Hi, Can I execute a command basis on some criteria in puppet. For example, I would want to execute the following command svn up; /usr/local/apache/bin/apachectl restart only if "revision number of file on host = revision number of file on svn" i.e. "/usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep Revision| cut -d: -f2| sed -e''s/ //g''" = "/usr/bin/svn info http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf| grep Revision| cut -d: -f2| sed -e''s/ //g''" Is it possible or instead can I do a md5sum of both the configurations i.e one available on svn and one on the host machine and if they differ execute the command else exit ?? Regards, -- 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, You could use something like this: exec { "svn up": command => "svn up", notify => Service["apache"], } service { "apache": enable => true, ensure => running, } Regards, Tom On 11 Aug 2011, at 10:51, Himanshu Raina wrote:> Hi, > > > Can I execute a command basis on some criteria in puppet. For example, I would want to execute the following command > > svn up; /usr/local/apache/bin/apachectl restart > > only if "revision number of file on host = revision number of file on svn" > > i.e. > > "/usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep Revision| cut -d: -f2| sed -e''s/ //g''" = "/usr/bin/svn info http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf | grep Revision| cut -d: -f2| sed -e''s/ //g''" > > Is it possible or instead can I do a md5sum of both the configurations i.e one available on svn and one on the host machine and if they differ execute the command else exit ?? > > Regards, > > -- > 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.
Why don''t you generate httpd.conf from a template in Puppet and restart apache if deemed necessary? On Thu, Aug 11, 2011 at 1:51 AM, Himanshu Raina <dopedoxygen@gmail.com>wrote:> Hi, > > > Can I execute a command basis on some criteria in puppet. For example, I > would want to execute the following command > > svn up; /usr/local/apache/bin/apachectl restart > > only if "revision number of file on host = revision number of file on svn" > > i.e. > > "/usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep > Revision| cut -d: -f2| sed -e''s/ //g''" = "/usr/bin/svn info > http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf| grep Revision| cut -d: -f2| sed -e''s/ //g''" > > Is it possible or instead can I do a md5sum of both the configurations i.e > one available on svn and one on the host machine and if they differ execute > the command else exit ?? > > Regards, > > -- > 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.
Hi Scott, For that I would need to have a puppet file server installed. The idea behind using puppet and svn is to keep track of revision history of changes made to configuration files. Also, if my understanding is wrong could you please guide me to do it using template as you have mentioned. Regards, On Thu, Aug 11, 2011 at 2:29 PM, Scott Smith <scott@ohlol.net> wrote:> Why don''t you generate httpd.conf from a template in Puppet and restart > apache if deemed necessary? > > On Thu, Aug 11, 2011 at 1:51 AM, Himanshu Raina <dopedoxygen@gmail.com>wrote: > >> Hi, >> >> >> Can I execute a command basis on some criteria in puppet. For example, I >> would want to execute the following command >> >> svn up; /usr/local/apache/bin/apachectl restart >> >> only if "revision number of file on host = revision number of file on svn" >> >> i.e. >> >> "/usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep >> Revision| cut -d: -f2| sed -e''s/ //g''" = "/usr/bin/svn info >> http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf| grep Revision| cut -d: -f2| sed -e''s/ //g''" >> >> Is it possible or instead can I do a md5sum of both the configurations i.e >> one available on svn and one on the host machine and if they differ execute >> the command else exit ?? >> >> Regards, >> >> -- >> 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. >-- 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.
Puppet''s file server is built in. You don''t have to do anything extra beyond creating the template and specifying it in your manifest. If your Puppet manifests are under version control (they should be), your Apache configuration is essentially versioned as well. On Thu, Aug 11, 2011 at 2:12 AM, Himanshu Raina <dopedoxygen@gmail.com>wrote:> Hi Scott, > > For that I would need to have a puppet file server installed. The idea > behind using puppet and svn is to keep track of revision history of changes > made to configuration files. Also, if my understanding is wrong could you > please guide me to do it using template as you have mentioned. > > Regards, > > > On Thu, Aug 11, 2011 at 2:29 PM, Scott Smith <scott@ohlol.net> wrote: > >> Why don''t you generate httpd.conf from a template in Puppet and restart >> apache if deemed necessary? >> >> On Thu, Aug 11, 2011 at 1:51 AM, Himanshu Raina <dopedoxygen@gmail.com>wrote: >> >>> Hi, >>> >>> >>> Can I execute a command basis on some criteria in puppet. For example, I >>> would want to execute the following command >>> >>> svn up; /usr/local/apache/bin/apachectl restart >>> >>> only if "revision number of file on host = revision number of file on >>> svn" >>> >>> i.e. >>> >>> "/usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep >>> Revision| cut -d: -f2| sed -e''s/ //g''" = "/usr/bin/svn info >>> http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf| grep Revision| cut -d: -f2| sed -e''s/ //g''" >>> >>> Is it possible or instead can I do a md5sum of both the configurations >>> i.e one available on svn and one on the host machine and if they differ >>> execute the command else exit ?? >>> >>> Regards, >>> >>> -- >>> 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. >> > > -- > 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.
What if I don''t want to use the templates and instead would want to do it otherwise (as mentioned earlier). Regards, On Thu, Aug 11, 2011 at 2:52 PM, Scott Smith <scott@ohlol.net> wrote:> Puppet''s file server is built in. You don''t have to do anything extra > beyond creating the template and specifying it in your manifest. > > If your Puppet manifests are under version control (they should be), your > Apache configuration is essentially versioned as well. > > > On Thu, Aug 11, 2011 at 2:12 AM, Himanshu Raina <dopedoxygen@gmail.com>wrote: > >> Hi Scott, >> >> For that I would need to have a puppet file server installed. The idea >> behind using puppet and svn is to keep track of revision history of changes >> made to configuration files. Also, if my understanding is wrong could you >> please guide me to do it using template as you have mentioned. >> >> Regards, >> >> >> On Thu, Aug 11, 2011 at 2:29 PM, Scott Smith <scott@ohlol.net> wrote: >> >>> Why don''t you generate httpd.conf from a template in Puppet and restart >>> apache if deemed necessary? >>> >>> On Thu, Aug 11, 2011 at 1:51 AM, Himanshu Raina <dopedoxygen@gmail.com>wrote: >>> >>>> Hi, >>>> >>>> >>>> Can I execute a command basis on some criteria in puppet. For example, I >>>> would want to execute the following command >>>> >>>> svn up; /usr/local/apache/bin/apachectl restart >>>> >>>> only if "revision number of file on host = revision number of file on >>>> svn" >>>> >>>> i.e. >>>> >>>> "/usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep >>>> Revision| cut -d: -f2| sed -e''s/ //g''" = "/usr/bin/svn info >>>> http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf| grep Revision| cut -d: -f2| sed -e''s/ //g''" >>>> >>>> Is it possible or instead can I do a md5sum of both the configurations >>>> i.e one available on svn and one on the host machine and if they differ >>>> execute the command else exit ?? >>>> >>>> Regards, >>>> >>>> -- >>>> 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. >>> >> >> -- >> 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. >-- 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.
Then you would be missing out on one of the best features of Puppet. On Thu, Aug 11, 2011 at 2:39 AM, Himanshu Raina <dopedoxygen@gmail.com>wrote:> What if I don''t want to use the templates and instead would want to do it > otherwise (as mentioned earlier). > > Regards, > > > On Thu, Aug 11, 2011 at 2:52 PM, Scott Smith <scott@ohlol.net> wrote: > >> Puppet''s file server is built in. You don''t have to do anything extra >> beyond creating the template and specifying it in your manifest. >> >> If your Puppet manifests are under version control (they should be), your >> Apache configuration is essentially versioned as well. >> >> >> On Thu, Aug 11, 2011 at 2:12 AM, Himanshu Raina <dopedoxygen@gmail.com>wrote: >> >>> Hi Scott, >>> >>> For that I would need to have a puppet file server installed. The idea >>> behind using puppet and svn is to keep track of revision history of changes >>> made to configuration files. Also, if my understanding is wrong could you >>> please guide me to do it using template as you have mentioned. >>> >>> Regards, >>> >>> >>> On Thu, Aug 11, 2011 at 2:29 PM, Scott Smith <scott@ohlol.net> wrote: >>> >>>> Why don''t you generate httpd.conf from a template in Puppet and restart >>>> apache if deemed necessary? >>>> >>>> On Thu, Aug 11, 2011 at 1:51 AM, Himanshu Raina <dopedoxygen@gmail.com>wrote: >>>> >>>>> Hi, >>>>> >>>>> >>>>> Can I execute a command basis on some criteria in puppet. For example, >>>>> I would want to execute the following command >>>>> >>>>> svn up; /usr/local/apache/bin/apachectl restart >>>>> >>>>> only if "revision number of file on host = revision number of file on >>>>> svn" >>>>> >>>>> i.e. >>>>> >>>>> "/usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep >>>>> Revision| cut -d: -f2| sed -e''s/ //g''" = "/usr/bin/svn info >>>>> http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf| grep Revision| cut -d: -f2| sed -e''s/ //g''" >>>>> >>>>> Is it possible or instead can I do a md5sum of both the configurations >>>>> i.e one available on svn and one on the host machine and if they differ >>>>> execute the command else exit ?? >>>>> >>>>> Regards, >>>>> >>>>> -- >>>>> 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. >>>> >>> >>> -- >>> 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. >> > > -- > 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.
So, can you guide me on how can this be done using templates. Regards, On Thu, Aug 11, 2011 at 3:19 PM, Scott Smith <scott@ohlol.net> wrote:> Then you would be missing out on one of the best features of Puppet. > > > On Thu, Aug 11, 2011 at 2:39 AM, Himanshu Raina <dopedoxygen@gmail.com>wrote: > >> What if I don''t want to use the templates and instead would want to do it >> otherwise (as mentioned earlier). >> >> Regards, >> >> >> On Thu, Aug 11, 2011 at 2:52 PM, Scott Smith <scott@ohlol.net> wrote: >> >>> Puppet''s file server is built in. You don''t have to do anything extra >>> beyond creating the template and specifying it in your manifest. >>> >>> If your Puppet manifests are under version control (they should be), your >>> Apache configuration is essentially versioned as well. >>> >>> >>> On Thu, Aug 11, 2011 at 2:12 AM, Himanshu Raina <dopedoxygen@gmail.com>wrote: >>> >>>> Hi Scott, >>>> >>>> For that I would need to have a puppet file server installed. The idea >>>> behind using puppet and svn is to keep track of revision history of changes >>>> made to configuration files. Also, if my understanding is wrong could you >>>> please guide me to do it using template as you have mentioned. >>>> >>>> Regards, >>>> >>>> >>>> On Thu, Aug 11, 2011 at 2:29 PM, Scott Smith <scott@ohlol.net> wrote: >>>> >>>>> Why don''t you generate httpd.conf from a template in Puppet and restart >>>>> apache if deemed necessary? >>>>> >>>>> On Thu, Aug 11, 2011 at 1:51 AM, Himanshu Raina <dopedoxygen@gmail.com >>>>> > wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> >>>>>> Can I execute a command basis on some criteria in puppet. For example, >>>>>> I would want to execute the following command >>>>>> >>>>>> svn up; /usr/local/apache/bin/apachectl restart >>>>>> >>>>>> only if "revision number of file on host = revision number of file on >>>>>> svn" >>>>>> >>>>>> i.e. >>>>>> >>>>>> "/usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep >>>>>> Revision| cut -d: -f2| sed -e''s/ //g''" = "/usr/bin/svn info >>>>>> http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf| grep Revision| cut -d: -f2| sed -e''s/ //g''" >>>>>> >>>>>> Is it possible or instead can I do a md5sum of both the configurations >>>>>> i.e one available on svn and one on the host machine and if they differ >>>>>> execute the command else exit ?? >>>>>> >>>>>> Regards, >>>>>> >>>>>> -- >>>>>> 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. >>>>> >>>> >>>> -- >>>> 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. >>> >> >> -- >> 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. >-- 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.
http://docs.puppetlabs.com/index.html explains it pretty well :) On Thu, Aug 11, 2011 at 2:55 AM, Himanshu Raina <dopedoxygen@gmail.com>wrote:> So, can you guide me on how can this be done using templates. > > Regards, > > On Thu, Aug 11, 2011 at 3:19 PM, Scott Smith <scott@ohlol.net> wrote: > >> Then you would be missing out on one of the best features of Puppet. >> >> >> On Thu, Aug 11, 2011 at 2:39 AM, Himanshu Raina <dopedoxygen@gmail.com>wrote: >> >>> What if I don''t want to use the templates and instead would want to do it >>> otherwise (as mentioned earlier). >>> >>> Regards, >>> >>> >>> On Thu, Aug 11, 2011 at 2:52 PM, Scott Smith <scott@ohlol.net> wrote: >>> >>>> Puppet''s file server is built in. You don''t have to do anything extra >>>> beyond creating the template and specifying it in your manifest. >>>> >>>> If your Puppet manifests are under version control (they should be), >>>> your Apache configuration is essentially versioned as well. >>>> >>>> >>>> On Thu, Aug 11, 2011 at 2:12 AM, Himanshu Raina <dopedoxygen@gmail.com>wrote: >>>> >>>>> Hi Scott, >>>>> >>>>> For that I would need to have a puppet file server installed. The idea >>>>> behind using puppet and svn is to keep track of revision history of changes >>>>> made to configuration files. Also, if my understanding is wrong could you >>>>> please guide me to do it using template as you have mentioned. >>>>> >>>>> Regards, >>>>> >>>>> >>>>> On Thu, Aug 11, 2011 at 2:29 PM, Scott Smith <scott@ohlol.net> wrote: >>>>> >>>>>> Why don''t you generate httpd.conf from a template in Puppet and >>>>>> restart apache if deemed necessary? >>>>>> >>>>>> On Thu, Aug 11, 2011 at 1:51 AM, Himanshu Raina < >>>>>> dopedoxygen@gmail.com> wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> >>>>>>> Can I execute a command basis on some criteria in puppet. For >>>>>>> example, I would want to execute the following command >>>>>>> >>>>>>> svn up; /usr/local/apache/bin/apachectl restart >>>>>>> >>>>>>> only if "revision number of file on host = revision number of file on >>>>>>> svn" >>>>>>> >>>>>>> i.e. >>>>>>> >>>>>>> "/usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | >>>>>>> grep Revision| cut -d: -f2| sed -e''s/ //g''" = "/usr/bin/svn info >>>>>>> http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf| grep Revision| cut -d: -f2| sed -e''s/ //g''" >>>>>>> >>>>>>> Is it possible or instead can I do a md5sum of both the >>>>>>> configurations i.e one available on svn and one on the host machine and if >>>>>>> they differ execute the command else exit ?? >>>>>>> >>>>>>> Regards, >>>>>>> >>>>>>> -- >>>>>>> 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. >>>>>> >>>>> >>>>> -- >>>>> 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. >>>> >>> >>> -- >>> 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. >> > > -- > 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.
Scott is right, but if you really wanted to do it the hard way, two choices: One, use an `exec` resource that just runs those commands on the client. Which pretty much sucks, FWIW, but not quite as much if you use the `unless` and `notify` metaparameters for `exec`. Two, you can use something like `generate` on the master to extract the version from SVN, and send that to the client as part of the catalog. That said, the *usual* way to get the benefits of SVN with Puppet is to put your manifests, templates, and files directly into SVN, then make `/etc/puppet` or your module path a checkout from SVN. Use a post-commit hook to update *that*, and Puppet to distribute it. Then you get the benefits of SVN, and of Puppet, and the bonus that you don''t need give all your machines access to the VCS repository that contains all your configuration data. Daniel On Thu, Aug 11, 2011 at 09:49, Scott Smith <scott@ohlol.net> wrote:> Then you would be missing out on one of the best features of Puppet. > > On Thu, Aug 11, 2011 at 2:39 AM, Himanshu Raina <dopedoxygen@gmail.com> > wrote: >> >> What if I don''t want to use the templates and instead would want to do it >> otherwise (as mentioned earlier). >> Regards, >> >> On Thu, Aug 11, 2011 at 2:52 PM, Scott Smith <scott@ohlol.net> wrote: >>> >>> Puppet''s file server is built in. You don''t have to do anything extra >>> beyond creating the template and specifying it in your manifest. >>> If your Puppet manifests are under version control (they should be), your >>> Apache configuration is essentially versioned as well. >>> >>> On Thu, Aug 11, 2011 at 2:12 AM, Himanshu Raina <dopedoxygen@gmail.com> >>> wrote: >>>> >>>> Hi Scott, >>>> For that I would need to have a puppet file server installed. The idea >>>> behind using puppet and svn is to keep track of revision history of changes >>>> made to configuration files. Also, if my understanding is wrong could you >>>> please guide me to do it using template as you have mentioned. >>>> Regards, >>>> >>>> On Thu, Aug 11, 2011 at 2:29 PM, Scott Smith <scott@ohlol.net> wrote: >>>>> >>>>> Why don''t you generate httpd.conf from a template in Puppet and restart >>>>> apache if deemed necessary? >>>>> >>>>> On Thu, Aug 11, 2011 at 1:51 AM, Himanshu Raina <dopedoxygen@gmail.com> >>>>> wrote: >>>>>> >>>>>> Hi, >>>>>> >>>>>> Can I execute a command basis on some criteria in puppet. For example, >>>>>> I would want to execute the following command >>>>>> svn up; /usr/local/apache/bin/apachectl restart >>>>>> only if "revision number of file on host = revision number of file on >>>>>> svn" >>>>>> i.e. >>>>>> "/usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep >>>>>> Revision| cut -d: -f2| sed -e''s/ //g''" = "/usr/bin/svn info >>>>>> http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf >>>>>> | grep Revision| cut -d: -f2| sed -e''s/ //g''" >>>>>> Is it possible or instead can I do a md5sum of both the configurations >>>>>> i.e one available on svn and one on the host machine and if they differ >>>>>> execute the command else exit ?? >>>>>> Regards, >>>>>> >>>>>> -- >>>>>> 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. >>>> >>>> -- >>>> 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. >> >> -- >> 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. >-- ⎋ Puppet Labs Developer – http://puppetlabs.com ♲ Made with 100 percent post-consumer electrons -- 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.