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
---
> Hostname=
notice: //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
---
> Hostname=
notice: //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
---
> Hostname=
notice: //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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.