Hi, I need to use puppet for updating app config files. I have the master/client setup installed. What I wish to do is as follows. 1> Make changes to config file say httpd.conf and commit the changes to svn 2> Run puppet so that these changes are pushed to all nodes specified in my site.pp The site.pp is as follows mport "CM/Backup/manifest/*" node "182.168.2.2" { include configmanifest } node "default" { exec { "hostname_echo": cwd => "/tmp", path => "/usr/bin:/usr/sbin:/bin:/sbin", command => "hostname", } } The manifest.pp which is inside CM/Backup/manifest is as follows class apache { file { "httpd.conf": mode => 644, owner => root, group => admin, } exec { path => "/usr/bin:/usr/sbin:/bin", command => "svn up /usr/local/apache/conf/", command => "/usr/local/apache/bin/apachectl graceful",} } } -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi Himanshu, There are many ways you could do this: Create a ERB template of the httpd.conf file and set something like notify => [ Service["httpd"] ], once the httpd.conf template file changes. This would be the easiest solution. Regards, Kevin On Aug 2, 10:08 am, Himanshu Raina <dopedoxy...@gmail.com> wrote:> Hi, > > I need to use puppet for updating app config files. I have the master/client > setup installed. What I wish to do is as follows. > > 1> Make changes to config file say httpd.conf and commit the changes to svn > 2> Run puppet so that these changes are pushed to all nodes specified in my > site.pp > > The site.pp is as follows > > mport "CM/Backup/manifest/*" > > node "182.168.2.2" { > > include configmanifest > > } > > node "default" { > exec { "hostname_echo": > cwd => "/tmp", > path => "/usr/bin:/usr/sbin:/bin:/sbin", > command => "hostname", > > } > } > > The manifest.pp which is inside CM/Backup/manifest is as follows > > class apache { > > file { > "httpd.conf": > mode => 644, > owner => root, > group => admin,} > > exec { > path => "/usr/bin:/usr/sbin:/bin", > command => "svn up /usr/local/apache/conf/", > command => "/usr/local/apache/bin/apachectl graceful",} > > > > > > > > } > }-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi, another possibility would be to put your puppet configuration files into version control and use the config file within in file resource. You can then connect file resources with exec resources. e.g. (untested!) file { ''/usr/local/apache/etc/'': owner => root, group => root, source => ''puppet:///files/usr/local/apache/etc/'', recurse => true, } exec { ''/usr/local/apache/bin/apachectl graceful'': refreshonly => true, subscribe => File[''/usr/local/apache/etc/''], } Regards, Martin On 02.08.2011, at 11:20, linuxbsdfreak wrote:> Hi Himanshu, > > There are many ways you could do this: > > Create a ERB template of the httpd.conf file and set something like > notify => [ Service["httpd"] ], once the httpd.conf template file > changes. This would be the easiest solution. > > Regards, > Kevin > > On Aug 2, 10:08 am, Himanshu Raina <dopedoxy...@gmail.com> wrote: >> Hi, >> >> I need to use puppet for updating app config files. I have the master/client >> setup installed. What I wish to do is as follows. >> >> 1> Make changes to config file say httpd.conf and commit the changes to svn >> 2> Run puppet so that these changes are pushed to all nodes specified in my >> site.pp >> >> The site.pp is as follows >> >> mport "CM/Backup/manifest/*" >> >> node "182.168.2.2" { >> >> include configmanifest >> >> } >> >> node "default" { >> exec { "hostname_echo": >> cwd => "/tmp", >> path => "/usr/bin:/usr/sbin:/bin:/sbin", >> command => "hostname", >> >> } >> } >> >> The manifest.pp which is inside CM/Backup/manifest is as follows >> >> class apache { >> >> file { >> "httpd.conf": >> mode => 644, >> owner => root, >> group => admin,} >> >> exec { >> path => "/usr/bin:/usr/sbin:/bin", >> command => "svn up /usr/local/apache/conf/", >> command => "/usr/local/apache/bin/apachectl graceful",} >> >> >> >> >> >> >> >> } >> } > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.