task "prepare01", "192.168.137.3", sub {
file "/home/mqm/xbin/test.sh",
source => "/root/Rex/test.sh",
mode => 755,
owner => "mqm",
group => "mqm";
my $output = run "/home/mqm/xbin/test.sh";
print "--------------------------------
";
say $?;
print "--------------------------------
";
say $output;
$VAR1 = {
'auto_die' => undef
};
/home/mqm/xbin/test.sh: Command not found.error--------------------------------
127
--------------------------------
127 失败
正常情况:
[root@node01 Rex]# rex prepare01
[2017-10-22 22:55:38] WARN - Please use only the following characters for task names:
[2017-10-22 22:55:38] WARN - A-Z, a-z, 0-9 and _
[2017-10-22 22:55:38] WARN - Also the task should start with A-Z or a-z
[2017-10-22 22:55:38] WARN - You can disable this warning by setting feature flag: disable_taskname_warning
[2017-10-22 22:55:38] INFO - Running task prepare01 on 192.168.137.3
ddad2313
$VAR1 = {
'auto_die' => undef
};
--------------------------------
0
--------------------------------
QMNAME(test) STATUS(Ended immediately)
[2017-10-22 22:55:40] INFO - All tasks successful on all hosts