[sakura1] [sakura2] [sakura1:vars] ansible_ssh_port=22 ansible_ssh_user= ansible_ssh_pass= ansible_sudo_pass= [sakura2:vars] ansible_ssh_port=22 ansible_ssh_user= ansible_ssh_pass= ansible_sudo_pass=
[root@ ansible]# ansible all -i hosts -m ping
| FAILED! => {
“changed”: false,
“module_stderr”: “Shared connection to xxx.xx.xx.xx closed.\r\n”,
“module_stdout”: “/usr/bin/python: not found\r\n”,
“msg”: “MODULE FAILURE”,
“rc”: 127
}
xx.xxx.xxx.xx | FAILED! => {
“changed”: false,
“module_stderr”: “Shared connection to xx.xxx.xxx.xx closed.\r\n”,
“module_stdout”: “/usr/bin/python: not found\r\n”,
“msg”: “MODULE FAILURE”,
“rc”: 127
}
ん? python2.7が入っていない?
[root@localhost ~]# yum -y install centos-release-scl-rh
[root@localhost ~]# yum -y install python27
[root@ ansible]# scl enable python27 bash
[root@ ansible]# python –version
Python 2.7.13
ansible all -i hosts -m ping -e ‘ansible_python_interpreter=/opt/rh/python27/root/usr/bin/python2.7’
アアアアアアアアアアアアア、
remote hostにはいっていないとか。。