使用ansible命令行时出现通配符错误

时间:2018-04-25 19:10:04

标签: ansible

[root@toure1~]# ansible -i ansi all -a  'df -Ph | grep -i overf'
slave62 | FAILED | rc=1 >>
df: `|': No such file or directory
df: `grep': No such file or directory
df: `overf': No such file or directory
df: no file systems processed

[root@toure1~]# ansible -i ansi all -a  "cat /etc/*release"
slave61 | FAILED | rc=1 >>
cat: /etc/*release: No such file or directory

可以采取哪些措施来解决错误。 有没有办法通过通配符

1 个答案:

答案 0 :(得分:0)

这样做:

ansible -i ansi all -m shell -a "cat /etc/*release"