我可以用Puppet运行shell内置命令吗?

我希望〜/ .bashrc在改变其内容时将成为源码.我用这样的东西创建了一个bashrc类:
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

有没有办法解决这个问题?

在Puppet中重新获取新的.bashrc是没有意义的,因为它将在子shell中运行,并且更改不会传播到您当前的shell(我认为,这是您尝试做的事情).你不能做你想做的事(我想).

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...