【发布时间】:2020-01-09 02:47:18
【问题描述】:
现在在远程主机中,有一个file:/root/.c,它定义了以下别名命令:
alias d="mysql -hxxxx -P3306 -uroot --default-character-set=utf8 db2"
然后在我的本地主机中,我执行:
ansible 10.10.130.30 -m shell -a "source /root/.c && d -e 'show databases;'"
10.10.130.30 | FAILED | rc=127 >>
/bin/sh: d: command not foundnon-zero return code
ansible如何执行d命令?
【问题讨论】: