D.N. van der Meijden
2010-Sep-27 13:08 UTC
[Puppet Users] why does puppet shuffle its ‘phases’ and how can I stop this?
Hi all, class zabbix { file { "/etc/zabbix/": ensure => directory, recurse => true, purge => false, force => false, owner => "root", group => "root", mode => 0755, source => $operatingsystem ? { solaris => "puppet:///zabbix/solaris", default => "puppet:///zabbix/linux/$architecture" } } file { "zabbix_agentd.conf": path => "/etc/zabbix/zabbix_agentd.conf", purge => false, force => false, owner => root, group => root, mode => 644, source => "puppet:///zabbix/zabbix_agentd.conf", } exec {"Aanpassen van de zabbix_agentd.conf": command => "/bin/sed -i ''s/Hostname=/Hostname=$hostname/g'' /etc/ zabbix/zab bix_agentd.conf" } service { "zabbix_agent": name => "zabbix_agent", enable => true, ensure => running, hasstatus => true, subscribe => File["zabbix_agentd.conf"], } } The code above works (still learning the syntax though!), but what''s bothering me is that parts of this code (let me call them ''phases'') keep on running in different order: client:/etc/zabbix# rm -rf client:/etc/zabbix# puppetd -vt info: Caching catalog at /var/lib/puppet/state/localconfig.yaml notice: Starting catalog run notice: //Node[debiannode]/zabbix/File[/etc/zabbix]/checksum: checksum changed ''{mtime}Mon Sep 27 14:56:56 +0200 2010'' to ''{mtime}Mon Sep 27 15:05:57 +0200 2010'' 25c25 < Hostname=client ---> Hostnamenotice: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]/checksum:checksum changed ''{md5}9caf8f20d56d3d999e43c22f6be9d861'' to ''{md5} c861fef870a09b2300d92a3c9090fb11'' info: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]: Filebucketed to with sum c861fef870a09b2300d92a3c9090fb11 notice: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]/source: replacing from source puppet:///zabbix/zabbix_agentd.conf with contents {md5}9caf8f20d56d3d999e43c22f6be9d861 info: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]: Scheduling refresh of Service[zabbix_agent] info: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]: Scheduling refresh of Service[zabbix_agent] notice: //Node[debiannode]/zabbix/Service[zabbix_agent]/ensure: ensure changed ''stopped'' to ''running'' notice: //Node[debiannode]/zabbix/Service[zabbix_agent]: Triggering ''refresh'' from 2 dependencies notice: //Node[debiannode]/zabbix/Exec[Aanpassen van de zabbix_agentd.conf]/returns: executed successfully notice: Finished catalog run in 1.82 seconds client:/etc/zabbix# rm -rf client:/etc/zabbix# puppetd -vt info: Caching catalog at /var/lib/puppet/state/localconfig.yaml notice: Starting catalog run notice: //Node[debiannode]/zabbix/File[/etc/zabbix]/checksum: checksum changed ''{mtime}Mon Sep 27 15:05:57 +0200 2010'' to ''{mtime}Mon Sep 27 15:06:07 +0200 2010'' 25c25 < Hostname=client ---> Hostnamenotice: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]/checksum:checksum changed ''{md5}9caf8f20d56d3d999e43c22f6be9d861'' to ''{md5} c861fef870a09b2300d92a3c9090fb11'' info: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]: Filebucketed to with sum c861fef870a09b2300d92a3c9090fb11 notice: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]/source: replacing from source puppet:///zabbix/zabbix_agentd.conf with contents {md5}9caf8f20d56d3d999e43c22f6be9d861 info: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]: Scheduling refresh of Service[zabbix_agent] info: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]: Scheduling refresh of Service[zabbix_agent] notice: //Node[debiannode]/zabbix/Service[zabbix_agent]/ensure: ensure changed ''stopped'' to ''running'' notice: //Node[debiannode]/zabbix/Service[zabbix_agent]: Triggering ''refresh'' from 2 dependencies notice: //Node[debiannode]/zabbix/Exec[Aanpassen van de zabbix_agentd.conf]/returns: executed successfully notice: Finished catalog run in 1.88 seconds client:/etc/zabbix# rm -rf client:/etc/zabbix# puppetd -vt info: Caching catalog at /var/lib/puppet/state/localconfig.yaml notice: Starting catalog run notice: //Node[debiannode]/zabbix/File[/etc/zabbix]/checksum: checksum changed ''{mtime}Mon Sep 27 15:06:07 +0200 2010'' to ''{mtime}Mon Sep 27 15:06:13 +0200 2010'' 25c25 < Hostname=client ---> Hostnamenotice: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]/checksum:checksum changed ''{md5}9caf8f20d56d3d999e43c22f6be9d861'' to ''{md5} c861fef870a09b2300d92a3c9090fb11'' info: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]: Filebucketed to with sum c861fef870a09b2300d92a3c9090fb11 notice: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]/source: replacing from source puppet:///zabbix/zabbix_agentd.conf with contents {md5}9caf8f20d56d3d999e43c22f6be9d861 info: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]: Scheduling refresh of Service[zabbix_agent] info: //Node[debiannode]/zabbix/File[zabbix_agentd.conf]: Scheduling refresh of Service[zabbix_agent] notice: //Node[debiannode]/zabbix/Service[zabbix_agent]/ensure: ensure changed ''stopped'' to ''running'' notice: //Node[debiannode]/zabbix/Service[zabbix_agent]: Triggering ''refresh'' from 2 dependencies notice: //Node[debiannode]/zabbix/Exec[Aanpassen van de zabbix_agentd.conf]/returns: executed successfully notice: Finished catalog run in 1.84 seconds I’ve tried to use stages, but its syntax keeps on giving errors. I will dive into this later, but why does puppet shuffle its ‘phases’ (and how can I stop this? Only with stages?) ? Sorry for the lengthy e-mail, but I was hoping someone could perhaps shed a light on this issue :-) Best regards, Dennis -- 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.
Felix Frank
2010-Sep-27 15:14 UTC
Re: [Puppet Users] why does puppet shuffle its ‘phases’ and how can I stop this?
On 09/27/2010 03:08 PM, D.N. van der Meijden wrote:> Hi all, > > ... > Sorry for the lengthy e-mail, but I was hoping someone could perhaps > shed a light on this issue :-)Hi, it''s expected behaviour. If you want Puppet to do something before something else, use a "before" parameter in the former, or a require parameter in the latter. Cheers, Felix -- 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.
Richard Crowley
2010-Sep-27 15:26 UTC
Re: [Puppet Users] why does puppet shuffle its ‘phases’ and how can I stop this?
> The code above works (still learning the syntax though!), but what''s > bothering me is that parts of this code (let me call them ''phases'') > keep on running in different order:With very few exceptions (that are all made for time savings so you can ignore them safely) all resources (what you were calling phases) must explicitly declare their dependencies on other resources using before and require [1] [2]. [1] http://docs.puppetlabs.com/references/latest/metaparameter.html#before [2] http://docs.puppetlabs.com/references/latest/metaparameter.html#require -- 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.
Richard Crowley
2010-Sep-27 15:27 UTC
Re: [Puppet Users] why does puppet shuffle its ‘phases’ and how can I stop this?
> With very few exceptions (that are all made for time savings so you > can ignore them safely) all resources (what you were calling phases) > must explicitly declare their dependencies on other resources using > before and require [1] [2].s/before and require/before or require/ -- 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.
D.N. van der Meijden
2010-Sep-30 13:14 UTC
[Puppet Users] Re: why does puppet shuffle its ‘phases’ and how can I stop this?
Thanks for clearing this up! On 27 sep, 17:27, Richard Crowley <r...@rcrowley.org> wrote:> > With very few exceptions (that are all made for time savings so you > > can ignore them safely) all resources (what you were calling phases) > > must explicitly declare their dependencies on other resources using > > before and require [1] [2]. > > s/before and require/before or require/-- 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.