1.配置ansible
1.1此处需要script模块,所以在所有设备上安装libselinux-python
[root@localhost /]# ansible webA -m yum -a "name=libselinux-python state=present"
192.168.9.15 | SUCCESS => {
"changed": false,
"msg": "",
"rc": 0,
"results": [
"libselinux-python-2.5-12.el7.x86_64 providing libselinux-python is already installed"
]
}
192.168.9.16 | SUCCESS => {
"changed": false,
"msg": "",
"rc": 0,
"results": [
"libselinux-python-2.5-12.el7.x86_64 providing libselinux-python is already installed"
]
}
192.168.9.14 | SUCCESS => {
"changed": false,
"msg": "",
"rc": 0,
"results": [
"libselinux-python-2.5-12.el7.x86_64 providing libselinux-python is already installed"
]
}
1.2