ansible-consul
ansible-consul copied to clipboard
SELinux check fails
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.
I believe this is caused by d87b2f2edad6f49a06f432e9573b45e57620bdca , @trevorr
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"
},
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"
},