ansible学习03

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

[webservers]
192.168.10.127 http_port=80
192.168.10.128 http_port=8080
ansible学习03

[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 >>

ansible学习03

ansible学习03

 

上一篇:剑指 Offer 35. 复杂链表的复制


下一篇:with_items 迭代