From c1e20fe7a0db1bf866ee4fb5c1e05d3680d24827 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Thu, 19 Oct 2017 09:47:25 -0400 Subject: [PATCH] properly support authentication for ovirt4 ansible modules see: https://github.com/ansible/ansible-tower/issues/6522 see: https://github.com/ansible/ansible-tower/issues/6522#issuecomment-337909863 --- awx/main/models/credential.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/awx/main/models/credential.py b/awx/main/models/credential.py index 7db8db04e9..77ce9ca3b0 100644 --- a/awx/main/models/credential.py +++ b/awx/main/models/credential.py @@ -1041,6 +1041,10 @@ def ovirt4(cls): 'required': ['host', 'username', 'password'], }, injectors={ + # The duplication here is intentional; the ovirt4 inventory plugin + # writes a .ini file for authentication, while the ansible modules for + # ovirt4 use a separate authentication process that support + # environment variables; by injecting both, we support both 'file': { 'template': '\n'.join([ '[ovirt]', @@ -1050,7 +1054,10 @@ def ovirt4(cls): '{% if ca_file %}ovirt_ca_file={{ca_file}}{% endif %}']) }, 'env': { - 'OVIRT_INI_PATH': '{{tower.filename}}' + 'OVIRT_INI_PATH': '{{tower.filename}}', + 'OVIRT_URL': '{{host}}', + 'OVIRT_USERNAME': '{{username}}', + 'OVIRT_PASSWORD': '{{password}}' } }, )