file { "/root/.bashrc": ensure => present,owner => root,group => root,mode => 0644,source => "puppet:///bashrc/root/.bashrc" } exec { "root_bashrc": command => "source /root/.bashrc",subscribe => File["/root/.bashrc"],}
但是如你所知,source是一个shell内置命令,运行代理时出现以下错误:
# puppet agent --no-daemonize --verbose notice: Starting Puppet client version 2.7.1 info: Caching catalog for svr051-4170 info: Applying configuration version '1311563901' err: /Stage[main]/Bashrc/Exec[root_bashrc]/returns: change from notrun to 0 Failed: Could not find command 'source' notice: Finished catalog run in 2.28 seconds notice: Caught INT; calling stop
有没有办法解决这个问题?