Ansible crashes when running the openshift_facts playbook

Solution Verified - Updated -

Issue

  • OpenShift fails to gather facts due to the content of /etc/ansible/facts.d/openshift.fact
  • During the playbook execution, it crashes with following errors:
TASK [Gather Cluster facts and set is_containerized if needed] *******************************************************************************************************************************************************************************

[ SKIPED ]

fatal: [master.example.com]: FAILED! => {
    "changed": false, 
    "failed": true, 
    "module_stderr": "Shared connection to master.example.com closed.\r\n", 
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_bCPphJ/ansible_module_openshift_facts.py\", line 2470, in <module>\r\n    main()\r\n  File \"/tmp/ansible_bCPphJ/ansible_module_openshift_facts.py\", line 2457, in main\r\n    protected_facts_to_overwrite)\r\n  File \"/tmp/ansible_bCPphJ/ansible_module_openshift_facts.py\", line 1830, in __init__\r\n    protected_facts_to_overwrite)\r\n  File \"/tmp/ansible_bCPphJ/ansible_module_openshift_facts.py\", line 1879, in generate_facts\r\n    facts = set_selectors(facts)\r\n  File \"/tmp/ansible_bCPphJ/ansible_module_openshift_facts.py\", line 496, in set_selectors\r\n    facts['logging']['selector'] = None\r\nTypeError: 'unicode' object does not support item assignment\r\n", 
    "msg": "MODULE FAILURE", 
    "rc": 1
}


A few  tasks later:

TASK [initialize_facts set_fact on openshift_docker_hosted_registry_network] *****************************************************************************************************************************************************************
task path: /usr/share/ansible/openshift-ansible/playbooks/common/openshift-cluster/initialize_facts.yml:167
Thursday 21 December 2017  15:55:51 +0100 (0:00:00.184)       0:01:28.727 ***** 
fatal: [node1.example.com]: FAILED! => {
    "failed": true, 
    "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'dict object' has no attribute 'openshift'\n\nThe error appears to have been in '/usr/share/ansible/openshift-ansible
/playbooks/common/openshift-cluster/initialize_facts.yml': line 167, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n  - name: initialize_facts set_fact on opens
hift_docker_hosted_registry_network\n    ^ here\n"
}
[ FEW HOSTS SKIPPED ]
fatal: [node.example.com]: FAILED! => {
    "failed": true, 
    "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'dict object' has no attribute 'openshift'\n\nThe error appears to have been in '/usr/share/ansible/openshift-ansible
/playbooks/common/openshift-cluster/initialize_facts.yml': line 167, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n  - name: initialize_facts set_fact on openshift_docker_hosted_registry_network\n    ^ here\n"
}

Environment

  • OpenShift Container Platform 3.7
  • ansible-2.3.2.0-2.el7.noarch
  • openshift-ansible-3.7.9-1.git.7.eedd332.el7.noarch
  • openshift-ansible-playbooks-3.7.9-1.git.7.eedd332.el7.noarch

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content