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.

Reply via email to