From 56374206bebe1a4a3f25e2099cbd839f47ff3a6f Mon Sep 17 00:00:00 2001
From: Eduardo Gonzalez <dabarren@gmail.com>
Date: Tue, 3 Oct 2017 14:48:55 +0200
Subject: [PATCH] Fix deployment with public TLS enabled

When deploying with tls enabled in public
endpoints, ansible modules fails due SSL certificates
are self-signed.

This change adds a new variable to allow customization
on which endpoints ansible should connect.
Defaults to admin because admin auth parameters defaults
to admin endpoint.

Change-Id: Ic3ed58cf9c9579cae08a11bbfe6fce983b5a9cbc
Closes-Bug: #1720995
---
 ansible/group_vars/all.yml                        | 4 ++++
 ansible/roles/aodh/tasks/register.yml             | 2 ++
 ansible/roles/barbican/tasks/register.yml         | 3 +++
 ansible/roles/ceilometer/tasks/register.yml       | 2 ++
 ansible/roles/ceph/tasks/start_rgw_keystone.yml   | 2 ++
 ansible/roles/cinder/tasks/check.yml              | 2 ++
 ansible/roles/cinder/tasks/register.yml           | 2 ++
 ansible/roles/cloudkitty/tasks/register.yml       | 3 +++
 ansible/roles/congress/tasks/register.yml         | 2 ++
 ansible/roles/designate/tasks/register.yml        | 2 ++
 ansible/roles/freezer/tasks/register.yml          | 2 ++
 ansible/roles/glance/tasks/check.yml              | 2 ++
 ansible/roles/glance/tasks/register.yml           | 2 ++
 ansible/roles/gnocchi/tasks/register.yml          | 2 ++
 ansible/roles/heat/tasks/register.yml             | 5 +++++
 ansible/roles/ironic/tasks/register.yml           | 4 ++++
 ansible/roles/karbor/tasks/register.yml           | 2 ++
 ansible/roles/keystone/tasks/check.yml            | 1 +
 ansible/roles/keystone/tasks/register.yml         | 1 +
 ansible/roles/keystone/tasks/update_endpoints.yml | 1 +
 ansible/roles/kuryr/tasks/register.yml            | 1 +
 ansible/roles/magnum/tasks/register.yml           | 5 +++++
 ansible/roles/manila/tasks/register.yml           | 2 ++
 ansible/roles/mistral/tasks/register.yml          | 2 ++
 ansible/roles/murano/tasks/register.yml           | 2 ++
 ansible/roles/neutron/tasks/register.yml          | 2 ++
 ansible/roles/nova/tasks/register.yml             | 3 +++
 ansible/roles/octavia/tasks/register.yml          | 3 +++
 ansible/roles/panko/tasks/register.yml            | 2 ++
 ansible/roles/sahara/tasks/register.yml           | 2 ++
 ansible/roles/searchlight/tasks/register.yml      | 2 ++
 ansible/roles/senlin/tasks/register.yml           | 2 ++
 ansible/roles/solum/tasks/register.yml            | 3 +++
 ansible/roles/swift/tasks/register.yml            | 3 +++
 ansible/roles/tacker/tasks/register.yml           | 2 ++
 ansible/roles/trove/tasks/register.yml            | 2 ++
 ansible/roles/watcher/tasks/register.yml          | 2 ++
 ansible/roles/zun/tasks/register.yml              | 2 ++
 38 files changed, 88 insertions(+)

diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index 508553aba..e35fda71d 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -319,6 +319,10 @@ openstack_auth:
     project_name: "admin"
     domain_name: "default"
 
+# Endpoint type used to connect with OpenStack services with ansible modules.
+# Valid options are [ public, internal, admin ]
+openstack_interface: "admin"
+
 # These roles are required for Kolla to be operation, however a savvy deployer
 # could disable some of these required roles and run their own services.
 enable_glance: "yes"
diff --git a/ansible/roles/aodh/tasks/register.yml b/ansible/roles/aodh/tasks/register.yml
index 2f722f106..8e7bab40d 100644
--- a/ansible/roles/aodh/tasks/register.yml
+++ b/ansible/roles/aodh/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_aodh_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_aodh_auth: "{{ openstack_aodh_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_aodh_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_aodh_auth: "{{ openstack_aodh_auth }}"
   run_once: True
diff --git a/ansible/roles/barbican/tasks/register.yml b/ansible/roles/barbican/tasks/register.yml
index 4fa214c42..82fc928a6 100644
--- a/ansible/roles/barbican/tasks/register.yml
+++ b/ansible/roles/barbican/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_barbican_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_barbican_auth: "{{ openstack_barbican_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_barbican_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_barbican_auth: "{{ openstack_barbican_auth }}"
   run_once: True
@@ -39,6 +41,7 @@
     module_args:
       name: "{{ item }}"
       auth: "{{ '{{ openstack_barbican_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_barbican_auth: "{{ openstack_barbican_auth }}"
   run_once: True
diff --git a/ansible/roles/ceilometer/tasks/register.yml b/ansible/roles/ceilometer/tasks/register.yml
index 2f81202f4..0904cbad2 100644
--- a/ansible/roles/ceilometer/tasks/register.yml
+++ b/ansible/roles/ceilometer/tasks/register.yml
@@ -9,6 +9,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_ceilometer_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
      openstack_ceilometer_auth: "{{ openstack_ceilometer_auth }}"
   run_once: True
@@ -22,6 +23,7 @@
       role: "ResellerAdmin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_ceilometer_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
      openstack_ceilometer_auth: "{{ openstack_ceilometer_auth }}"
   when: enable_swift | bool
diff --git a/ansible/roles/ceph/tasks/start_rgw_keystone.yml b/ansible/roles/ceph/tasks/start_rgw_keystone.yml
index b611a0fad..aac281a6f 100644
--- a/ansible/roles/ceph/tasks/start_rgw_keystone.yml
+++ b/ansible/roles/ceph/tasks/start_rgw_keystone.yml
@@ -16,6 +16,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_swift_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_swift_auth: "{{ openstack_swift_auth }}"
   run_once: True
@@ -34,6 +35,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_ceph_rgw_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_ceph_rgw_auth: "{{ openstack_swift_auth }}"
   run_once: True
diff --git a/ansible/roles/cinder/tasks/check.yml b/ansible/roles/cinder/tasks/check.yml
index 939ca6d34..0f3ca0df6 100644
--- a/ansible/roles/cinder/tasks/check.yml
+++ b/ansible/roles/cinder/tasks/check.yml
@@ -7,6 +7,7 @@
       state: present
       size: 1
       display_name: kolla_test_volume
+      endpoint_type: "{{ openstack_interface }}"
   run_once: True
   delegate_to: "{{ groups['cinder-api'][0] }}"
   when: kolla_enable_sanity_cinder | bool
@@ -18,6 +19,7 @@
       auth: "{{ openstack_cinder_auth }}"
       state: absent
       display_name: kolla_test_volume
+      endpoint_type: "{{ openstack_interface }}"
   run_once: True
   delegate_to: "{{ groups['cinder-api'][0] }}"
   when: kolla_enable_sanity_cinder | bool
diff --git a/ansible/roles/cinder/tasks/register.yml b/ansible/roles/cinder/tasks/register.yml
index bf0980109..abdccbdf0 100644
--- a/ansible/roles/cinder/tasks/register.yml
+++ b/ansible/roles/cinder/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_cinder_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_cinder_auth: "{{ openstack_cinder_auth }}"
   run_once: True
@@ -35,6 +36,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_cinder_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_cinder_auth: "{{ openstack_cinder_auth }}"
   run_once: True
diff --git a/ansible/roles/cloudkitty/tasks/register.yml b/ansible/roles/cloudkitty/tasks/register.yml
index 497a38838..9c11e0582 100644
--- a/ansible/roles/cloudkitty/tasks/register.yml
+++ b/ansible/roles/cloudkitty/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_cloudkitty_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_cloudkitty_auth: "{{ openstack_cloudkitty_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_cloudkitty_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_cloudkitty_auth: "{{ openstack_cloudkitty_auth }}"
   run_once: True
@@ -39,6 +41,7 @@
     module_args:
       name: "{{ cloudkitty_openstack_keystone_default_role }}"
       auth: "{{ '{{ openstack_cloudkitty_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_cloudkitty_auth: "{{ openstack_cloudkitty_auth }}"
   run_once: True
diff --git a/ansible/roles/congress/tasks/register.yml b/ansible/roles/congress/tasks/register.yml
index 1ea06e661..b1a08b779 100644
--- a/ansible/roles/congress/tasks/register.yml
+++ b/ansible/roles/congress/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_congress_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_congress_auth: "{{ openstack_congress_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_congress_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_congress_auth: "{{ openstack_congress_auth }}"
   run_once: True
diff --git a/ansible/roles/designate/tasks/register.yml b/ansible/roles/designate/tasks/register.yml
index 2d5b310d7..0265692c5 100644
--- a/ansible/roles/designate/tasks/register.yml
+++ b/ansible/roles/designate/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_designate_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_designate_auth: "{{ openstack_designate_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_designate_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_designate_auth: "{{ openstack_designate_auth }}"
   run_once: True
diff --git a/ansible/roles/freezer/tasks/register.yml b/ansible/roles/freezer/tasks/register.yml
index 8cb204ec1..8dc101f6f 100644
--- a/ansible/roles/freezer/tasks/register.yml
+++ b/ansible/roles/freezer/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_freezer_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_freezer_auth: "{{ openstack_freezer_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: admin
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_freezer_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_freezer_auth: "{{ openstack_freezer_auth }}"
   run_once: True
diff --git a/ansible/roles/glance/tasks/check.yml b/ansible/roles/glance/tasks/check.yml
index d6651b2ad..af408d41d 100644
--- a/ansible/roles/glance/tasks/check.yml
+++ b/ansible/roles/glance/tasks/check.yml
@@ -6,6 +6,7 @@
       auth: "{{ openstack_glance_auth }}"
       name: "glance_sanity_check"
       filename: "/etc/hostname"
+      endpoint_type: "{{ openstack_interface }}"
   delegate_to: "{{ groups['glance-api'][0] }}"
   run_once: True
   when: kolla_enable_sanity_glance | bool
@@ -17,6 +18,7 @@
       auth: "{{ openstack_glance_auth }}"
       name: "glance_sanity_check"
       state: absent
+      endpoint_type: "{{ openstack_interface }}"
   delegate_to: "{{ groups['glance-api'][0] }}"
   run_once: True
   when: kolla_enable_sanity_glance | bool
diff --git a/ansible/roles/glance/tasks/register.yml b/ansible/roles/glance/tasks/register.yml
index 54db8f90d..62be22309 100644
--- a/ansible/roles/glance/tasks/register.yml
+++ b/ansible/roles/glance/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_glance_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_glance_auth: "{{ openstack_glance_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_glance_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_glance_auth: "{{ openstack_glance_auth }}"
   run_once: True
diff --git a/ansible/roles/gnocchi/tasks/register.yml b/ansible/roles/gnocchi/tasks/register.yml
index 8b092e662..829809586 100644
--- a/ansible/roles/gnocchi/tasks/register.yml
+++ b/ansible/roles/gnocchi/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_gnocchi_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_gnocchi_auth: "{{ openstack_gnocchi_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_gnocchi_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_gnocchi_auth: "{{ openstack_gnocchi_auth }}"
   run_once: True
diff --git a/ansible/roles/heat/tasks/register.yml b/ansible/roles/heat/tasks/register.yml
index 5b1c4cacd..08fd009bd 100644
--- a/ansible/roles/heat/tasks/register.yml
+++ b/ansible/roles/heat/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_heat_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_heat_auth: "{{ openstack_heat_auth }}"
   run_once: True
@@ -32,6 +33,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_heat_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_heat_auth: "{{ openstack_heat_auth }}"
   run_once: True
@@ -42,6 +44,7 @@
     module_args:
       name: "{{ heat_stack_user_role }}"
       auth: "{{ '{{ openstack_heat_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_heat_auth: "{{ openstack_heat_auth }}"
   run_once: True
@@ -52,6 +55,7 @@
     module_args:
       name: "{{ heat_stack_owner_role }}"
       auth: "{{ '{{ openstack_heat_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_heat_auth: "{{ openstack_heat_auth }}"
   run_once: True
@@ -65,6 +69,7 @@
       role: "{{ heat_stack_owner_role }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_heat_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_heat_auth: "{{ openstack_heat_auth }}"
   run_once: True
diff --git a/ansible/roles/ironic/tasks/register.yml b/ansible/roles/ironic/tasks/register.yml
index 34506f323..e215f748a 100644
--- a/ansible/roles/ironic/tasks/register.yml
+++ b/ansible/roles/ironic/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_ironic_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_ironic_auth: "{{ openstack_ironic_auth }}"
   run_once: True
@@ -30,6 +31,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_ironic_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_ironic_auth: "{{ openstack_ironic_auth }}"
   run_once: True
@@ -47,6 +49,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_ironic_inspector_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_ironic_inspector_auth: "{{ openstack_ironic_inspector_auth }}"
   run_once: True
@@ -66,6 +69,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_ironic_inspector_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_ironic_inspector_auth: "{{ openstack_ironic_inspector_auth }}"
   run_once: True
diff --git a/ansible/roles/karbor/tasks/register.yml b/ansible/roles/karbor/tasks/register.yml
index e5057f8aa..68e55e18b 100644
--- a/ansible/roles/karbor/tasks/register.yml
+++ b/ansible/roles/karbor/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_karbor_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_karbor_auth: "{{ openstack_karbor_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_karbor_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_karbor_auth: "{{ openstack_karbor_auth }}"
   run_once: True
diff --git a/ansible/roles/keystone/tasks/check.yml b/ansible/roles/keystone/tasks/check.yml
index 4a49db818..84531d888 100644
--- a/ansible/roles/keystone/tasks/check.yml
+++ b/ansible/roles/keystone/tasks/check.yml
@@ -4,6 +4,7 @@
     module_name: os_auth
     module_args:
       auth: "{{ openstack_keystone_auth }}"
+      endpoint_type: "{{ openstack_interface }}"
   run_once: True
   delegate_to: "{{ groups['keystone'][0] }}"
   when: kolla_enable_sanity_keystone | bool
diff --git a/ansible/roles/keystone/tasks/register.yml b/ansible/roles/keystone/tasks/register.yml
index 611897a38..42aae4027 100644
--- a/ansible/roles/keystone/tasks/register.yml
+++ b/ansible/roles/keystone/tasks/register.yml
@@ -13,6 +13,7 @@
     module_args:
       name: "{{ keystone_default_user_role }}"
       auth: "{{ '{{ openstack_keystone_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_keystone_auth: "{{ openstack_keystone_auth }}"
   register: default_role
diff --git a/ansible/roles/keystone/tasks/update_endpoints.yml b/ansible/roles/keystone/tasks/update_endpoints.yml
index 7cf9466ae..bfa9155b4 100644
--- a/ansible/roles/keystone/tasks/update_endpoints.yml
+++ b/ansible/roles/keystone/tasks/update_endpoints.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_keystone_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_keystone_auth: "{{ openstack_keystone_auth }}"
   run_once: True
diff --git a/ansible/roles/kuryr/tasks/register.yml b/ansible/roles/kuryr/tasks/register.yml
index 1d6a271c8..4232ae4a9 100644
--- a/ansible/roles/kuryr/tasks/register.yml
+++ b/ansible/roles/kuryr/tasks/register.yml
@@ -9,6 +9,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_kuryr_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_kuryr_auth: "{{ openstack_kuryr_auth }}"
   run_once: True
diff --git a/ansible/roles/magnum/tasks/register.yml b/ansible/roles/magnum/tasks/register.yml
index c153922b3..6414143ef 100644
--- a/ansible/roles/magnum/tasks/register.yml
+++ b/ansible/roles/magnum/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_magnum_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_magnum_auth: "{{ openstack_magnum_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_magnum_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_magnum_auth: "{{ openstack_magnum_auth }}"
   run_once: True
@@ -40,6 +42,7 @@
       name: "{{ magnum_trustee_domain }}"
       description: "Owns users and projects created by magnum"
       auth: "{{ '{{ openstack_magnum_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_magnum_auth: "{{ openstack_magnum_auth }}"
   register: trustee_domain
@@ -53,6 +56,7 @@
       domain: "{{ magnum_trustee_domain }}"
       password: "{{ magnum_keystone_password }}"
       auth: "{{ '{{ openstack_magnum_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_magnum_auth: "{{ openstack_magnum_auth }}"
   run_once: True
@@ -65,6 +69,7 @@
       user: "{{ magnum_trustee_domain_admin }}"
       role: "admin"
       auth: "{{ '{{ openstack_magnum_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_magnum_auth: "{{ openstack_magnum_auth }}"
   run_once: True
diff --git a/ansible/roles/manila/tasks/register.yml b/ansible/roles/manila/tasks/register.yml
index 00446b52a..1ee68414e 100644
--- a/ansible/roles/manila/tasks/register.yml
+++ b/ansible/roles/manila/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_manila_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_manila_auth: "{{ openstack_manila_auth }}"
   run_once: True
@@ -32,6 +33,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_manila_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_manila_auth: "{{ openstack_manila_auth }}"
   run_once: True
diff --git a/ansible/roles/mistral/tasks/register.yml b/ansible/roles/mistral/tasks/register.yml
index eb8b4b36f..e8a063aa6 100644
--- a/ansible/roles/mistral/tasks/register.yml
+++ b/ansible/roles/mistral/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_mistral_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_mistral_auth: "{{ openstack_mistral_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_mistral_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_mistral_auth: "{{ openstack_mistral_auth }}"
   run_once: True
diff --git a/ansible/roles/murano/tasks/register.yml b/ansible/roles/murano/tasks/register.yml
index 484012935..b1d7beb93 100644
--- a/ansible/roles/murano/tasks/register.yml
+++ b/ansible/roles/murano/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_murano_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_murano_auth: "{{ openstack_murano_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_murano_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_murano_auth: "{{ openstack_murano_auth }}"
   run_once: True
diff --git a/ansible/roles/neutron/tasks/register.yml b/ansible/roles/neutron/tasks/register.yml
index 3cefe75e1..521a30b95 100644
--- a/ansible/roles/neutron/tasks/register.yml
+++ b/ansible/roles/neutron/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_neutron_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_neutron_auth: "{{ openstack_neutron_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_neutron_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_neutron_auth: "{{ openstack_neutron_auth }}"
   run_once: True
diff --git a/ansible/roles/nova/tasks/register.yml b/ansible/roles/nova/tasks/register.yml
index 847fbf018..1156bb877 100644
--- a/ansible/roles/nova/tasks/register.yml
+++ b/ansible/roles/nova/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_nova_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_nova_auth: "{{ openstack_nova_auth }}"
   run_once: True
@@ -36,6 +37,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_nova_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_nova_auth: "{{ openstack_nova_auth }}"
   run_once: True
@@ -50,6 +52,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_placement_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_placement_auth: "{{ openstack_placement_auth }}"
   register: placement_user
diff --git a/ansible/roles/octavia/tasks/register.yml b/ansible/roles/octavia/tasks/register.yml
index 41fcc30a0..ef7520328 100644
--- a/ansible/roles/octavia/tasks/register.yml
+++ b/ansible/roles/octavia/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_octavia_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_octavia_auth: "{{ openstack_octavia_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_octavia_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_octavia_auth: "{{ openstack_octavia_auth }}"
   run_once: True
@@ -41,6 +43,7 @@
       role: admin
       project: admin
       auth: "{{ '{{ openstack_octavia_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_octavia_auth: "{{ openstack_octavia_auth }}"
   run_once: True
diff --git a/ansible/roles/panko/tasks/register.yml b/ansible/roles/panko/tasks/register.yml
index 498de7056..d832ab857 100644
--- a/ansible/roles/panko/tasks/register.yml
+++ b/ansible/roles/panko/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_panko_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_panko_auth: "{{ openstack_panko_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_panko_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_panko_auth: "{{ openstack_panko_auth }}"
   run_once: True
diff --git a/ansible/roles/sahara/tasks/register.yml b/ansible/roles/sahara/tasks/register.yml
index eea8a0168..0c69b91e3 100644
--- a/ansible/roles/sahara/tasks/register.yml
+++ b/ansible/roles/sahara/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_sahara_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_sahara_auth: "{{ openstack_sahara_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_sahara_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_sahara_auth: "{{ openstack_sahara_auth }}"
   run_once: True
diff --git a/ansible/roles/searchlight/tasks/register.yml b/ansible/roles/searchlight/tasks/register.yml
index c331ed50b..2755c137f 100644
--- a/ansible/roles/searchlight/tasks/register.yml
+++ b/ansible/roles/searchlight/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_searchlight_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_searchlight_auth: "{{ openstack_searchlight_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_searchlight_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_searchlight_auth: "{{ openstack_searchlight_auth }}"
   run_once: True
diff --git a/ansible/roles/senlin/tasks/register.yml b/ansible/roles/senlin/tasks/register.yml
index 2ad0cfd4b..6113882dd 100644
--- a/ansible/roles/senlin/tasks/register.yml
+++ b/ansible/roles/senlin/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_senlin_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_senlin_auth: "{{ openstack_senlin_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_senlin_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_senlin_auth: "{{ openstack_senlin_auth }}"
   run_once: True
diff --git a/ansible/roles/solum/tasks/register.yml b/ansible/roles/solum/tasks/register.yml
index eda3b906d..8a8db355f 100644
--- a/ansible/roles/solum/tasks/register.yml
+++ b/ansible/roles/solum/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_solum_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_solum_auth: "{{ openstack_solum_auth }}"
   run_once: True
@@ -31,6 +32,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_solum_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_solum_auth: "{{ openstack_solum_auth }}"
   run_once: True
@@ -49,6 +51,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_solum_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_solum_auth: "{{ openstack_solum_auth }}"
   run_once: True
diff --git a/ansible/roles/swift/tasks/register.yml b/ansible/roles/swift/tasks/register.yml
index 714ba9965..bd623f42b 100644
--- a/ansible/roles/swift/tasks/register.yml
+++ b/ansible/roles/swift/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_swift_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_swift_auth: "{{ openstack_swift_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "{{ swift_admin_tenant_name }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_swift_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_swift_auth: "{{ openstack_swift_auth }}"
   run_once: True
@@ -40,6 +42,7 @@
       name: "ResellerAdmin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_swift_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_swift_auth: "{{ openstack_swift_auth }}"
   run_once: True
diff --git a/ansible/roles/tacker/tasks/register.yml b/ansible/roles/tacker/tasks/register.yml
index 8da2eb169..acece3259 100644
--- a/ansible/roles/tacker/tasks/register.yml
+++ b/ansible/roles/tacker/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_tacker_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_tacker_auth: "{{ openstack_tacker_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_tacker_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_tacker_auth: "{{ openstack_tacker_auth }}"
   run_once: True
diff --git a/ansible/roles/trove/tasks/register.yml b/ansible/roles/trove/tasks/register.yml
index e48bbffe5..dab38f905 100644
--- a/ansible/roles/trove/tasks/register.yml
+++ b/ansible/roles/trove/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_trove_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_trove_auth: "{{ openstack_trove_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_trove_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_trove_auth: "{{ openstack_trove_auth }}"
   run_once: True
diff --git a/ansible/roles/watcher/tasks/register.yml b/ansible/roles/watcher/tasks/register.yml
index e59dcf0a8..b5e6689ef 100644
--- a/ansible/roles/watcher/tasks/register.yml
+++ b/ansible/roles/watcher/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_watcher_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_watcher_auth: "{{ openstack_watcher_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_watcher_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_watcher_auth: "{{ openstack_watcher_auth }}"
   run_once: True
diff --git a/ansible/roles/zun/tasks/register.yml b/ansible/roles/zun/tasks/register.yml
index 40b6609e5..78f41255e 100644
--- a/ansible/roles/zun/tasks/register.yml
+++ b/ansible/roles/zun/tasks/register.yml
@@ -11,6 +11,7 @@
       interface: "{{ item.interface }}"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_zun_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_zun_auth: "{{ openstack_zun_auth }}"
   run_once: True
@@ -29,6 +30,7 @@
       role: "admin"
       region_name: "{{ openstack_region_name }}"
       auth: "{{ '{{ openstack_zun_auth }}' }}"
+      endpoint_type: "{{ openstack_interface }}"
     module_extra_vars:
       openstack_zun_auth: "{{ openstack_zun_auth }}"
   run_once: True
-- 
GitLab