我是傀儡新手。我想在RHEL linux puppet主服务器上运行位于 RelativeLayout layout = (RelativeLayout) findViewById(R.id.toplinear);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.CENTER_HORIZONTAL);
params.addRule(RelativeLayout.CENTER_VERTICAL);
myImage.setLayoutParams(params);
layout.addView(myImage, params);
下的shell脚本调用crfs.sh
。
如何在客户端或目标服务器上执行此脚本?
答案 0 :(得分:3)
class mymodule::myclass {
file { 'my_bash_script':
ensure => 'file',
source => 'puppet:///modules/mymodule/my_bash_script.sh',
path => '/usr/local/bin/my_bash_script.sh',
owner => 'root'
group => 'root'
mode => '0744', # Use 0700 if it is sensitive
notify => Exec['run_my_script'],
}
exec { 'run_my_script':
command => '/usr/local/bin/my_bash_script.sh',
refreshonly => true,
}
}