I have the following puppet code:
exec { 'set mysql root password':
user => root,
path => "/usr/bin:/usr/sbin:/bin",
command => "/usr/bin/mysqladmin -u root password \'${root_pwd}\'",
onlyif => 'grep /etc/mysql_root_password_setup.cf -nrw -e \'0\'',
}
exec { 'set mysql hostname password':
user => root,
path => "/usr/bin:/usr/sbin:/bin",
command => "/usr/bin/mysqladmin -u root -h ${::fqdn} password \'${root_pwd}\'",
onlyif => 'grep /etc/mysql_root_password_setup.cf -nrw -e \'0\'',
}
exec { 'Modify the Breadcrumb':
user => root,
path => "/usr/bin:/usr/sbin:/bin",
command => "echo 1 > /etc/mysql_root_password_setup.cf",
onlyif => 'grep /etc/mysql_root_password_setup.cf -nrw -e \'0\'',
}
As you can see, I am running three exec command. The first one sets the Mysql password, the second does the same, the third one though, write 1 into a breadcrumb file /etc/mysql_root_password_setup.cf
.
I want the the third exec to be executed only after the completion of first two exec.
How can I tell puppet to execute them in the order they are defined in the class file.