diff --git a/ansible/roles/magnum/defaults/main.yml b/ansible/roles/magnum/defaults/main.yml index f48fff44f3..c44c254eb8 100644 --- a/ansible/roles/magnum/defaults/main.yml +++ b/ansible/roles/magnum/defaults/main.yml @@ -30,5 +30,7 @@ magnum_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ ma magnum_logging_debug: "{{ openstack_logging_debug }}" magnum_keystone_user: "magnum" +magnum_trustee_domain_admin: "magnum_trustee_domain_admin" +magnum_trustee_domain: "magnum" openstack_magnum_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" diff --git a/ansible/roles/magnum/tasks/register.yml b/ansible/roles/magnum/tasks/register.yml index 042f0b9771..31ac4a0851 100644 --- a/ansible/roles/magnum/tasks/register.yml +++ b/ansible/roles/magnum/tasks/register.yml @@ -42,7 +42,7 @@ - name: Creating Magnum trustee domain command: docker exec -t kolla_toolbox /usr/bin/ansible localhost -m os_keystone_domain - -a "name=magnum + -a "name={{ magnum_trustee_domain }} description='Owns users and projects created by magnum' auth={{ '{{ openstack_magnum_auth }}' }}" -e "{'openstack_magnum_auth':{{ openstack_magnum_auth }}}" @@ -60,8 +60,8 @@ - name: Creating Magnum trustee user command: docker exec -t kolla_toolbox /usr/bin/ansible localhost -m os_user - -a "name=magnum_trustee_domain_admin - domain=magnum + -a "name={{ magnum_trustee_domain_admin }} + domain={{ magnum_trustee_domain }} password={{ magnum_keystone_password }} auth={{ '{{ openstack_magnum_auth }}' }}" -e "{'openstack_magnum_auth':{{ openstack_magnum_auth }}}" @@ -72,15 +72,11 @@ delay: 5 run_once: True -- name: Setting Magnum trustee user value - set_fact: - magnum_trustee_domain_admin_id: "{{ (trustee_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).user.id }}" - - name: Creating Magnum trustee user role command: docker exec -t kolla_toolbox /usr/bin/ansible localhost -m os_user_role -a "domain={{ magnum_trustee_domain_id }} - user={{ magnum_trustee_domain_admin_id }} + user={{ magnum_trustee_domain_admin }} role=admin auth={{ '{{ openstack_magnum_auth }}' }}" -e "{'openstack_magnum_auth':{{ openstack_magnum_auth }}}" diff --git a/ansible/roles/magnum/templates/magnum.conf.j2 b/ansible/roles/magnum/templates/magnum.conf.j2 index 86049e2b3c..7deb2b1e4b 100644 --- a/ansible/roles/magnum/templates/magnum.conf.j2 +++ b/ansible/roles/magnum/templates/magnum.conf.j2 @@ -53,8 +53,8 @@ memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['ansi [trust] trustee_domain_admin_password = {{ magnum_keystone_password }} -trustee_domain_admin_id = {{ magnum_trustee_domain_admin_id }} -trustee_domain_id = {{ magnum_trustee_domain_id}} +trustee_domain_admin_name = {{ magnum_trustee_domain_admin }} +trustee_domain_name = {{ magnum_trustee_domain }} [oslo_concurrency] lock_path = /var/lib/magnum/tmp