无法运行带有collect_facts true的Ansible剧本

时间:2019-01-16 06:14:58

标签: ansible

如果我将collect_facts设置为true,则我的ansible剧本将失败。 即使我执行ansible-cmdb,我也会遇到同样的问题。

完整的回溯是:

WARNING: The below traceback may *not* be related to the actual failure.
  File "/tmp/ansible_setup_payload_ccUPIO/ansible_setup_payload.zip/ansible/module_utils/basic.py", line 2848, in run_command
    cmd = subprocess.Popen(args, **kwargs)
  File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.6/subprocess.py", line 1238, in _execute_child
    raise child_exception

QA_SILVER_MANUAL_LARGE(19.01GA_repo)_IDM | FAILED! => {
    "changed": false, 
    "cmd": "/usr/bin/facter --puppet --json", 
    "invocation": {
        "module_args": {
            "fact_path": "/etc/ansible/facts.d", 
            "filter": "*", 
            "gather_subset": [
                "all"
            ], 
            "gather_timeout": 10
        }
    }, 
    "msg": "[Errno 13] Permission denied", 
    "rc": 13
}

这是我的匿名版本信息:

bash-4.2# ansible --version
ansible 2.7.5
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/usr/lib/python2.7/site-packages/ara/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug 31 2018, 05:35:17) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36.0.1)]

能帮我吗?

1 个答案:

答案 0 :(得分:0)

您可能需要仔细检查安装。警告说:

  

文件“ /usr/lib64/python2.6/subprocess.py”

但是 ansible --version 报告:

  

python版本= 2.7.5