解决ansible 执行出现“discovered_interpreter_python“: “/usr/bin/python“

这种就是模块或者服务不存在 本列是 nginx的用户存在 所以创建不成功

[root@ansible ~]# ansible all -m user -a 'name=nginx shell=/sbin/nologin system=yes home=/var/nginx groups=root,bin uid=80 comment="nginx server"'                                                                 10.0.0.49 | FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "msg": "usermod: user nginx is currently used by process 18199\n",
    "name": "nginx",
    "rc": 8
}
10.0.0.48 | FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "msg": "usermod: user nginx is currently used by process 27810\n",
    "name": "nginx",
    "rc": 8
}
10.0.0.44 | FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "msg": "usermod: user nginx is currently used by process 3193\n",
    "name": "nginx",
    "rc": 8
}

这个是没有vsftpd 我换了 nginx就成功了

[root@ansible ~]# ansible all -m service -a 'name=memcached state=started enabled=                                                                                                                                 yes'
10.0.0.44 | FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "msg": "Could not find the requested service memcached: host"
}
10.0.0.48 | FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "msg": "Could not find the requested service memcached: host"
}
10.0.0.49 | FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "msg": "Could not find the requested service memcached: host"
}
[root@ansible ~]# ansible all -m yum -a 'name=nginx state=installed'     

你可能感兴趣的:(ansible)