rex 检查脚本执行的返回结果

来源:互联网 发布:淘宝刷好评兼职工作 编辑:程序博客网 时间:2024/04/24 21:24
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 "--------------------------------\n";   say $?;   print "--------------------------------\n";   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.3ddad2313$VAR1 = {          'auto_die' => undef        };--------------------------------0--------------------------------QMNAME(test)                                              STATUS(Ended immediately)[2017-10-22 22:55:40] INFO - All tasks successful on all hosts