切换目录并且创建文件
1、使用shell模块操作
[root@master ~]# ansible k8s -m shell -a "chdir=/rubbish touch test.conf"
2、使用command操作
[root@master ~]# ansible k8s -m command -a "chdir=/rubbish touch test.conf"
ansible切换目录
原文:https://www.cnblogs.com/effortsing/p/10289796.html