Ask Your Question
0

Notify and tidy

asked 2013-10-09 10:27:21 -0600

Simon gravatar image

I'm trying to migrate clients to a new puppet master and wanted to do something like this:

  file { "/etc/puppet/puppet.conf":
    ensure  => present,
    owner   => 'root',
    group   => 'root',
    mode    => 0644,
    content => template("migrate_master/puppet.conf.erb"),
    notify  => Tidy["/var/puppet/ssl"]
  }

  tidy { "/var/puppet/ssl":
    recurse => true,
    matches => "*.pem"
  }

The idea being that the puppet.conf would be updated with a new "server =" entry pointing to the new master, then the clients certs would then get removed. On the next Puppet invocation it would talk to the new puppet master (where autosign is temporarily enabled), get it's new ... (more)

edit retag flag offensive close merge delete

Comments

I don't think it should matter, but does the ordering work correctly if you add "before => Tidy["/var/puppet/ssl"]" to your file resource? Also, please post a link ...(more)

GregLarkin gravatar imageGregLarkin ( 2013-10-09 12:57:39 -0600 )edit

Never mind - I see that you tried "->".

GregLarkin gravatar imageGregLarkin ( 2013-10-09 14:43:24 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-10-09 14:45:17 -0600

GregLarkin gravatar image

Based on the documentation here ( http://docs.puppetlabs.com/learning/ordering.html#notify-and-subscribe ), I don't think the tidy resource can be notified.

It's not as "tidy" (sorry :)), but you can switch to an exec resource which does support notification and remove your .pem files that way.

edit flag offensive delete link more

Comments

1

http://www.youtube.com/watch?v=oShTJ90fC34

Ancillas gravatar imageAncillas ( 2013-10-09 14:49:31 -0600 )edit

Haha - should have included that in my comment!

GregLarkin gravatar imageGregLarkin ( 2013-10-09 14:57:25 -0600 )edit

Many thanks for your help on this. I went for the "exec" option and all is now working as expected. Bit of a shame really as I was trying to ...(more)

Simon gravatar imageSimon ( 2013-10-10 03:45:39 -0600 )edit

Use cases like this are always good feedback for the developers. If enough people are using a similar Exec, then it might be a candidate for native functionality in Puppet.

Ancillas gravatar imageAncillas ( 2013-10-10 09:40:19 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-10-09 10:27:21 -0600

Seen: 450 times

Last updated: Oct 09 '13