Hi,
the function is executed on the puppet master at the time of compiling
the catalog.
The catalog is then transferred to the agent where all resources are
applied.
Depending on your setup this might not only be two different stages in
the process, but also two different machines!
This is explained in more depth here:
http://docs.puppetlabs.com/learning/manifests.html
Best Regards, David
On 23.10.2012 11:09, Apple Wang wrote:
Hi, all
I'm confused about the execution sequence in puppet.
*The background:*
** I want to get mysql package version after installing it with the
Package resource. And I'll configure /etc/my.cnf according the version
of mysql package. The code is as following.
-----------------------------------------------
class mysql{
package { "mysql":
ensure => latest,
}
$mysql_version = get_pkg_version("mysql")
file { '/etc/my.cnf':
ensure => present,
content => template('mysql/mysql.cnf'),
require => Package["mysql"],
}
}
-----------------------------
Note: get_pkg_version is a user defined function written by me. It
can get mysql rpm version when mysql is installed.
*Issue:*
First time I executed /*puppet agent -t*, /the variable
*/mysql_version/* didn't get the value of mysql rpm version.
But the second time, after mysql is installed.
*/mysql_version/* can get the value of mysql rpm version.
Can anyone help me with the problem?
--
You received this message because you are subscribed to the Google
Groups "Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/4uL89crPzDsJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.