ansible-consul icon indicating copy to clipboard operation
ansible-consul copied to clipboard

SELinux check fails

Open sgrimm-sg opened this issue 9 years ago • 3 comments

The ansible_selinux variable is a boolean (at least in Ansible 2.1.1.0) but it's being treated as an object:

fatal: [REDACTED]: FAILED! => {"failed": true, "msg": "The conditional check 'consul_is_ui and consul_install_nginx_config and ansible_selinux.status == "enabled"' failed. The error was: error while evaluating conditional (consul_is_ui and consul_install_nginx_config and ansible_selinux.status == "enabled"): 'bool object' has no attribute 'status'\n\nThe error appears to have been in '/[REDACTED]/ansible/roles/savagegus.ansible-consul/tasks/install-ui.yml': line 79, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: allow nginx to connect to consul (selinux)\n ^ here\n"}

Workaround is to add a role variable ansible_selinux: { "status": "disabled" } when including this role.

sgrimm-sg avatar Aug 30 '16 16:08 sgrimm-sg

I believe this is caused by d87b2f2edad6f49a06f432e9573b45e57620bdca , @trevorr

jeremyjh avatar Nov 13 '16 19:11 jeremyjh

It's not a boolean for me with Ansible 2.1.1.0:

$ ansible --version && ansible -i myhost, all -m setup | grep ansible_selinux -C 2
ansible 2.1.1.0
        },
        "ansible_python_version": "2.6.6",
        "ansible_selinux": {
            "status": "disabled"
        },

trevorr avatar Nov 16 '16 16:11 trevorr

Before installing python-selinux:

        "ansible_python_version": "2.7.6",
        "ansible_selinux": false,
        "ansible_service_mgr": "upstart",

After installing python-selinux:

        "ansible_python_version": "2.7.6",
        "ansible_selinux": {
            "status": "disabled"
        },

sgirones avatar Dec 11 '16 17:12 sgirones