ansible学习笔记

ansible web -m shell -a 'cat /etc/passwd |grep "keer"'

ansible web -m copy -a 'src=~/hello dest=/data/hello'

ansible web -m copy -a 'content="I am keer\n" dest=/data/name mode=666'

ansible web -m copy -a 'content="I am keerya\n" backup=yes dest=/data/name mode=666'

ansible web -m script -a '/tmp/df.sh'  --可以把本机的脚本模拟在被管理主机运行。

 

ansible bss-cz -m shell -a "nohup ps -ef|grep checkRealbill|grep -v grep|awk '{print \$2}'|xargs -i kill -9 {} &"

 

posted on 2022-03-28 11:37  hello_dg  阅读(23)  评论(0)    收藏  举报