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

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

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

ansible学习03_ide_03