ansible学习03

[root@localhost ansible]# vi /etc/ansible/hosts

[webservers]
192.168.10.127 http_port=80
192.168.10.128 http_port=8080

[root@localhost ansible]# ansible all -m shell -a "mkdir /tmp/{{http_port}}" -k
SSH password:
[WARNING]: Consider using the file module with state=directory rather than running 'mkdir'. If you need to use command because file is insufficient you can add 'warn: false' to this
command task or set 'command_warnings=False' in ansible.cfg to get rid of this message.
192.168.10.128 | CHANGED | rc=0 >>

192.168.10.127 | CHANGED | rc=0 >>

 

posted @ 2021-07-13 16:53  beawh  阅读(32)  评论(0编辑  收藏  举报