From 8155d74d8d530400d50754cf8673932224a02bf6 Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Fri, 30 Dec 2016 15:57:07 +0800 Subject: [PATCH] Refactor register.yml files Co-Authored-By: Mauricio Lima Change-Id: I9a4a6b6523dee4b388513386b7d85d421f2b7b89 --- ansible/group_vars/all.yml | 1 + ansible/library/kolla_toolbox.py | 26 ++++- ansible/roles/aodh/defaults/main.yml | 2 +- ansible/roles/aodh/tasks/register.yml | 50 ++++----- ansible/roles/barbican/defaults/main.yml | 2 +- ansible/roles/barbican/tasks/register.yml | 50 ++++----- ansible/roles/ceilometer/defaults/main.yml | 2 +- ansible/roles/ceilometer/tasks/register.yml | 50 ++++----- ansible/roles/cinder/defaults/main.yml | 2 +- ansible/roles/cinder/tasks/register.yml | 50 ++++----- ansible/roles/cloudkitty/defaults/main.yml | 3 +- ansible/roles/cloudkitty/tasks/register.yml | 65 +++++------ ansible/roles/congress/defaults/main.yml | 2 +- ansible/roles/congress/tasks/register.yml | 50 ++++----- ansible/roles/glance/defaults/main.yml | 2 +- ansible/roles/glance/tasks/register.yml | 50 ++++----- ansible/roles/gnocchi/defaults/main.yml | 2 +- ansible/roles/gnocchi/tasks/register.yml | 50 ++++----- ansible/roles/heat/defaults/main.yml | 2 +- ansible/roles/heat/tasks/register.yml | 80 +++++++------- ansible/roles/ironic/defaults/main.yml | 4 +- ansible/roles/ironic/tasks/register.yml | 100 ++++++++--------- ansible/roles/keystone/defaults/main.yml | 2 +- ansible/roles/keystone/tasks/register.yml | 15 +-- ansible/roles/kuryr/defaults/main.yml | 2 +- ansible/roles/kuryr/tasks/register.yml | 23 ++-- ansible/roles/magnum/defaults/main.yml | 2 +- ansible/roles/magnum/tasks/register.yml | 107 ++++++++++--------- ansible/roles/manila/defaults/main.yml | 2 +- ansible/roles/manila/tasks/register.yml | 50 ++++----- ansible/roles/mistral/defaults/main.yml | 2 +- ansible/roles/mistral/tasks/register.yml | 50 ++++----- ansible/roles/murano/defaults/main.yml | 2 +- ansible/roles/murano/tasks/register.yml | 50 ++++----- ansible/roles/neutron/defaults/main.yml | 2 +- ansible/roles/neutron/tasks/register.yml | 50 ++++----- ansible/roles/nova/defaults/main.yml | 2 +- ansible/roles/nova/tasks/register.yml | 50 ++++----- ansible/roles/octavia/defaults/main.yml | 2 +- ansible/roles/octavia/tasks/register.yml | 50 ++++----- ansible/roles/sahara/defaults/main.yml | 2 +- ansible/roles/sahara/tasks/register.yml | 50 ++++----- ansible/roles/searchlight/defaults/main.yml | 2 +- ansible/roles/searchlight/tasks/register.yml | 50 ++++----- ansible/roles/senlin/defaults/main.yml | 2 +- ansible/roles/senlin/tasks/register.yml | 50 ++++----- ansible/roles/solum/defaults/main.yml | 2 +- ansible/roles/solum/tasks/register.yml | 77 ++++++------- ansible/roles/swift/defaults/main.yml | 2 +- ansible/roles/swift/tasks/register.yml | 50 ++++----- ansible/roles/tacker/defaults/main.yml | 2 +- ansible/roles/tacker/tasks/register.yml | 50 ++++----- ansible/roles/trove/defaults/main.yml | 2 +- ansible/roles/trove/tasks/register.yml | 50 ++++----- ansible/roles/watcher/defaults/main.yml | 2 +- ansible/roles/watcher/tasks/register.yml | 50 ++++----- 56 files changed, 819 insertions(+), 732 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 1862cda728..b05541576c 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -255,6 +255,7 @@ openstack_auth: username: "admin" password: "{{ keystone_admin_password }}" project_name: "admin" + domain_name: "default" # 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. diff --git a/ansible/library/kolla_toolbox.py b/ansible/library/kolla_toolbox.py index b1ac5509d8..2aaef46a3f 100644 --- a/ansible/library/kolla_toolbox.py +++ b/ansible/library/kolla_toolbox.py @@ -33,6 +33,11 @@ options: - The module args use by the module required: False type: str or dict + module_extra_vars: + description: + - The extra variables used by the module + required: False + type: str or dict author: Jeffrey Zhang ''' @@ -51,6 +56,19 @@ EXAMPLES = ''' login_user: root login_password: admin name: testdb + - name: Creating default user role + kolla_toolbox: + module_name: os_keystone_role + module_args: + name: _member_ + auth: "{{ '{{ openstack_keystone_auth }}' }}" + module_extra_vars: + openstack_keystone_auth: + auth_url: http://127.0.0.1:5000 + username: admin + password: password + project_name: "admin" + domain_name: "default" ''' @@ -76,13 +94,19 @@ def gen_commandline(params): module_args = ' '.join("{}='{}'".format(key, value) for key, value in module_args.items()) command.extend(['-a', module_args]) + if params.get('module_extra_vars'): + extra_vars = params.get('module_extra_vars') + if isinstance(extra_vars, dict): + extra_vars = json.dumps(extra_vars) + command.extend(['--extra-vars', extra_vars]) return command def main(): specs = dict( module_name=dict(type='str'), - module_args=dict(type='str') + module_args=dict(type='str'), + module_extra_vars=dict(type='json') ) module = AnsibleModule(argument_spec=specs, bypass_checks=True) client = docker.Client() diff --git a/ansible/roles/aodh/defaults/main.yml b/ansible/roles/aodh/defaults/main.yml index 66e2b94590..f68eb1876c 100644 --- a/ansible/roles/aodh/defaults/main.yml +++ b/ansible/roles/aodh/defaults/main.yml @@ -40,4 +40,4 @@ aodh_logging_debug: "{{ openstack_logging_debug }}" aodh_keystone_user: "aodh" -openstack_aodh_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}','domain_name':'default'}" +openstack_aodh_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/aodh/tasks/register.yml b/ansible/roles/aodh/tasks/register.yml index 202a11fffc..bc58bf63a9 100644 --- a/ansible/roles/aodh/tasks/register.yml +++ b/ansible/roles/aodh/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the aodh service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=aodh - service_type=alarming - description='OpenStack Alarming Service' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_aodh_auth }}' }}" - -e "{'openstack_aodh_auth':{{ openstack_aodh_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "aodh" + service_type: "alarming" + description: "OpenStack Alarming Service" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_aodh_auth }}' }}" + module_extra_vars: + openstack_aodh_auth: "{{ openstack_aodh_auth }}" register: aodh_endpoint - changed_when: "{{ aodh_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (aodh_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: aodh_endpoint.stdout.split()[2] == 'SUCCESS' + until: aodh_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ aodh_public_endpoint }}'} - name: Creating the aodh project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=aodh - password={{ aodh_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_aodh_auth }}' }}" - -e "{'openstack_aodh_auth':{{ openstack_aodh_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "aodh" + password: "{{ aodh_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_aodh_auth }}' }}" + module_extra_vars: + openstack_aodh_auth: "{{ openstack_aodh_auth }}" register: aodh_user - changed_when: "{{ aodh_user.stdout.find('localhost | SUCCESS => ') != -1 and (aodh_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: aodh_user.stdout.split()[2] == 'SUCCESS' + until: aodh_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/barbican/defaults/main.yml b/ansible/roles/barbican/defaults/main.yml index 7fb8d628f9..93c83bfd42 100644 --- a/ansible/roles/barbican/defaults/main.yml +++ b/ansible/roles/barbican/defaults/main.yml @@ -37,4 +37,4 @@ barbican_logging_debug: "{{ openstack_logging_debug }}" barbican_keystone_user: "barbican" -openstack_barbican_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}','domain_name':'default'}" +openstack_barbican_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/barbican/tasks/register.yml b/ansible/roles/barbican/tasks/register.yml index 5bc6719c94..50d6272acd 100644 --- a/ansible/roles/barbican/tasks/register.yml +++ b/ansible/roles/barbican/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the barbican service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=barbican - service_type=key-manager - description='Barbican Key Management Service' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_barbican_auth }}' }}" - -e "{'openstack_barbican_auth':{{ openstack_barbican_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "barbican" + service_type: "key-manager" + description: "Barbican Key Management Service" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_barbican_auth }}' }}" + module_extra_vars: + openstack_barbican_auth: "{{ openstack_barbican_auth }}" register: barbican_endpoint - changed_when: "{{ barbican_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (barbican_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: barbican_endpoint.stdout.split()[2] == 'SUCCESS' + until: barbican_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ barbican_public_endpoint }}'} - name: Creating the barbican project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=barbican - password={{ barbican_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_barbican_auth }}' }}" - -e "{'openstack_barbican_auth':{{ openstack_barbican_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "barbican" + password: "{{ barbican_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_barbican_auth }}' }}" + module_extra_vars: + openstack_barbican_auth: "{{ openstack_barbican_auth }}" register: barbican_user - changed_when: "{{ barbican_user.stdout.find('localhost | SUCCESS => ') != -1 and (barbican_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: barbican_user.stdout.split()[2] == 'SUCCESS' + until: barbican_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/ceilometer/defaults/main.yml b/ansible/roles/ceilometer/defaults/main.yml index 60205fe3eb..c86e4232a4 100644 --- a/ansible/roles/ceilometer/defaults/main.yml +++ b/ansible/roles/ceilometer/defaults/main.yml @@ -48,4 +48,4 @@ ceilometer_logging_debug: "{{ openstack_logging_debug }}" ceilometer_keystone_user: "ceilometer" -openstack_ceilometer_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}','domain_name':'default'}" +openstack_ceilometer_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/ceilometer/tasks/register.yml b/ansible/roles/ceilometer/tasks/register.yml index c3cdd1a15b..a46bd55291 100644 --- a/ansible/roles/ceilometer/tasks/register.yml +++ b/ansible/roles/ceilometer/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Ceilometer service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=ceilometer - service_type=metering - description='Openstack Telemetry' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_ceilometer_auth }}' }}" - -e "{'openstack_ceilometer_auth':{{ openstack_ceilometer_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "ceilometer" + service_type: "metering" + description: "Openstack Telemetry" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_ceilometer_auth }}' }}" + module_extra_vars: + openstack_ceilometer_auth: "{{ openstack_ceilometer_auth }}" register: ceilometer_endpoint - changed_when: "{{ ceilometer_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (ceilometer_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: ceilometer_endpoint.stdout.split()[2] == 'SUCCESS' + until: ceilometer_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ ceilometer_public_endpoint }}'} - name: Creating the Ceilometer project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=ceilometer - password={{ ceilometer_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_ceilometer_auth }}' }}" - -e "{'openstack_ceilometer_auth':{{ openstack_ceilometer_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "ceilometer" + password: "{{ ceilometer_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_ceilometer_auth }}' }}" + module_extra_vars: + openstack_ceilometer_auth: "{{ openstack_ceilometer_auth }}" register: ceilometer_user - changed_when: "{{ ceilometer_user.stdout.find('localhost | SUCCESS => ') != -1 and (ceilometer_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: ceilometer_user.stdout.split()[2] == 'SUCCESS' + until: ceilometer_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/cinder/defaults/main.yml b/ansible/roles/cinder/defaults/main.yml index 7d3dddd644..843131eb42 100644 --- a/ansible/roles/cinder/defaults/main.yml +++ b/ansible/roles/cinder/defaults/main.yml @@ -61,7 +61,7 @@ cinder_logging_debug: "{{ openstack_logging_debug }}" cinder_keystone_user: "cinder" -openstack_cinder_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_cinder_auth: "{{ openstack_auth }}" #################### diff --git a/ansible/roles/cinder/tasks/register.yml b/ansible/roles/cinder/tasks/register.yml index 550077034c..60b613f82b 100644 --- a/ansible/roles/cinder/tasks/register.yml +++ b/ansible/roles/cinder/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Cinder service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name={{ item.service_name }} - service_type={{ item.service_type }} - description='Openstack Block Storage' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_cinder_auth }}' }}" - -e "{'openstack_cinder_auth':{{ openstack_cinder_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "{{ item.service_name }}" + service_type: "{{ item.service_type }}" + description: "Openstack Block Storage" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_cinder_auth }}' }}" + module_extra_vars: + openstack_cinder_auth: "{{ openstack_cinder_auth }}" register: cinder_endpoint - changed_when: "{{ cinder_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (cinder_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: cinder_endpoint.stdout.split()[2] == 'SUCCESS' + until: cinder_endpoint|success retries: 10 delay: 5 run_once: True @@ -26,18 +27,19 @@ - {'interface': 'public', 'url': '{{ cinder_v2_public_endpoint }}', 'service_name': 'cinderv2', 'service_type': 'volumev2'} - name: Creating the Cinder project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=cinder - password={{ cinder_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_cinder_auth }}' }}" - -e "{'openstack_cinder_auth':{{ openstack_cinder_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "cinder" + password: "{{ cinder_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_cinder_auth }}' }}" + module_extra_vars: + openstack_cinder_auth: "{{ openstack_cinder_auth }}" register: cinder_user - changed_when: "{{ cinder_user.stdout.find('localhost | SUCCESS => ') != -1 and (cinder_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: cinder_user.stdout.split()[2] == 'SUCCESS' + until: cinder_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/cloudkitty/defaults/main.yml b/ansible/roles/cloudkitty/defaults/main.yml index a344866f20..8f2b534e1b 100644 --- a/ansible/roles/cloudkitty/defaults/main.yml +++ b/ansible/roles/cloudkitty/defaults/main.yml @@ -31,7 +31,8 @@ cloudkitty_logging_debug: "{{ openstack_logging_debug }}" cloudkitty_keystone_user: "cloudkitty" -openstack_cloudkitty_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_cloudkitty_auth: "{{ openstack_auth }}" + #################### # Cloudkitty diff --git a/ansible/roles/cloudkitty/tasks/register.yml b/ansible/roles/cloudkitty/tasks/register.yml index aa608c9282..4d7b28a46e 100644 --- a/ansible/roles/cloudkitty/tasks/register.yml +++ b/ansible/roles/cloudkitty/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Cloudkitty service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=cloudkitty - service_type=rating - description='OpenStack Rating' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_cloudkitty_auth }}' }}" - -e "{'openstack_cloudkitty_auth':{{ openstack_cloudkitty_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "cloudkitty" + service_type: "rating" + description: "OpenStack Rating" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_cloudkitty_auth }}' }}" + module_extra_vars: + openstack_cloudkitty_auth: "{{ openstack_cloudkitty_auth }}" register: cloudkitty_endpoint - changed_when: "{{ cloudkitty_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (cloudkitty_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: cloudkitty_endpoint.stdout.split()[2] == 'SUCCESS' + until: cloudkitty_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,31 +24,33 @@ - {'interface': 'public', 'url': '{{ cloudkitty_public_endpoint }}'} - name: Creating the Cloudkitty project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=cloudkitty - password={{ cloudkitty_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_cloudkitty_auth }}' }}" - -e "{'openstack_cloudkitty_auth':{{ openstack_cloudkitty_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "cloudkitty" + password: "{{ cloudkitty_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_cloudkitty_auth }}' }}" + module_extra_vars: + openstack_cloudkitty_auth: {{ openstack_cloudkitty_auth }}" register: cloudkitty_user - changed_when: "{{ cloudkitty_user.stdout.find('localhost | SUCCESS => ') != -1 and (cloudkitty_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: cloudkitty_user.stdout.split()[2] == 'SUCCESS' + until: cloudkitty_user|success retries: 10 delay: 5 run_once: True - name: Creating the rating role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m os_keystone_role - -a "name={{ cloudkitty_openstack_keystone_default_role }} - auth={{ '{{ openstack_cloudkitty_auth }}' }}" - -e "{'openstack_cloudkitty_auth':{{ openstack_cloudkitty_auth }}}" + kolla_toolbox: + module_name: os_keystone_role + module_args: + name: "{{ cloudkitty_openstack_keystone_default_role }}" + auth: "{{ '{{ openstack_cloudkitty_auth }}' }}" + module_extra_vars: + openstack_cloudkitty_auth: "{{ openstack_cloudkitty_auth }}" register: cloudkitty_role - changed_when: "{{ cloudkitty_role.stdout.find('localhost | SUCCESS => ') != -1 and (cloudkitty_role.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: cloudkitty_role.stdout.split()[2] == 'SUCCESS' + until: cloudkitty_role|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/congress/defaults/main.yml b/ansible/roles/congress/defaults/main.yml index f54059c43b..33d92c520b 100644 --- a/ansible/roles/congress/defaults/main.yml +++ b/ansible/roles/congress/defaults/main.yml @@ -36,4 +36,4 @@ congress_logging_debug: "{{ openstack_logging_debug }}" congress_keystone_user: "congress" -openstack_congress_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_congress_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/congress/tasks/register.yml b/ansible/roles/congress/tasks/register.yml index e0a387acb3..8034e6044d 100644 --- a/ansible/roles/congress/tasks/register.yml +++ b/ansible/roles/congress/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the congress service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=congress - service_type=application_catalog - description='Openstack Application Catalog' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_congress_auth }}' }}" - -e "{'openstack_congress_auth':{{ openstack_congress_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "congress" + service_type: "application_catalog" + description: "Openstack Application Catalog" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_congress_auth }}' }}" + module_extra_vars: + openstack_congress_auth: "{{ openstack_congress_auth }}" register: congress_endpoint - changed_when: "{{ congress_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (congress_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: congress_endpoint.stdout.split()[2] == 'SUCCESS' + until: congress_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ congress_public_endpoint }}'} - name: Creating the congress project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=congress - password={{ congress_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_congress_auth }}' }}" - -e "{'openstack_congress_auth':{{ openstack_congress_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "congress" + password: "{{ congress_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_congress_auth }}' }}" + module_extra_vars: + openstack_congress_auth: "{{ openstack_congress_auth }}" register: congress_user - changed_when: "{{ congress_user.stdout.find('localhost | SUCCESS => ') != -1 and (congress_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: congress_user.stdout.split()[2] == 'SUCCESS' + until: congress_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/glance/defaults/main.yml b/ansible/roles/glance/defaults/main.yml index 0f6fede03b..ec1021a6fb 100644 --- a/ansible/roles/glance/defaults/main.yml +++ b/ansible/roles/glance/defaults/main.yml @@ -67,4 +67,4 @@ glance_logging_debug: "{{ openstack_logging_debug }}" glance_keystone_user: "glance" -openstack_glance_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}','domain_name':'default'}" +openstack_glance_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/glance/tasks/register.yml b/ansible/roles/glance/tasks/register.yml index d0cfaa7d98..a0f3a47f07 100644 --- a/ansible/roles/glance/tasks/register.yml +++ b/ansible/roles/glance/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Glance service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=glance - service_type=image - description='Openstack Image' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_glance_auth }}' }}" - -e "{'openstack_glance_auth':{{ openstack_glance_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "glance" + service_type: "image" + description: "Openstack Image" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_glance_auth }}' }}" + module_extra_vars: + openstack_glance_auth: "{{ openstack_glance_auth }}" register: glance_endpoint - changed_when: "{{ glance_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (glance_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: glance_endpoint.stdout.split()[2] == 'SUCCESS' + until: glance_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ glance_public_endpoint }}'} - name: Creating the Glance project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=glance - password={{ glance_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_glance_auth }}' }}" - -e "{'openstack_glance_auth':{{ openstack_glance_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "glance" + password: "{{ glance_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_glance_auth }}' }}" + module_extra_vars: + openstack_glance_auth: "{{ openstack_glance_auth }}" register: glance_user - changed_when: "{{ glance_user.stdout.find('localhost | SUCCESS => ') != -1 and (glance_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: glance_user.stdout.split()[2] == 'SUCCESS' + until: glance_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/gnocchi/defaults/main.yml b/ansible/roles/gnocchi/defaults/main.yml index cd80d1695d..4db96fd424 100644 --- a/ansible/roles/gnocchi/defaults/main.yml +++ b/ansible/roles/gnocchi/defaults/main.yml @@ -49,4 +49,4 @@ gnocchi_logging_debug: "{{ openstack_logging_debug }}" gnocchi_keystone_user: "gnocchi" -openstack_gnocchi_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}','domain_name':'default'}" +openstack_gnocchi_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/gnocchi/tasks/register.yml b/ansible/roles/gnocchi/tasks/register.yml index 5b60ff22f4..3a1a9b9fb4 100644 --- a/ansible/roles/gnocchi/tasks/register.yml +++ b/ansible/roles/gnocchi/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the gnocchi service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=gnocchi - service_type=metric - description='OpenStack Metric Service' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_gnocchi_auth }}' }}" - -e "{'openstack_gnocchi_auth':{{ openstack_gnocchi_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "gnocchi" + service_type: "metric" + description: "OpenStack Metric Service" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_gnocchi_auth }}' }}" + module_extra_vars: + openstack_gnocchi_auth: "{{ openstack_gnocchi_auth }}" register: gnocchi_endpoint - changed_when: "{{ gnocchi_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (gnocchi_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: gnocchi_endpoint.stdout.split()[2] == 'SUCCESS' + until: gnocchi_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ gnocchi_public_endpoint }}'} - name: Creating the gnocchi project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=gnocchi - password={{ gnocchi_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_gnocchi_auth }}' }}" - -e "{'openstack_gnocchi_auth':{{ openstack_gnocchi_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "gnocchi" + password: "{{ gnocchi_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_gnocchi_auth }}' }}" + module_extra_vars: + openstack_gnocchi_auth: "{{ openstack_gnocchi_auth }}" register: gnocchi_user - changed_when: "{{ gnocchi_user.stdout.find('localhost | SUCCESS => ') != -1 and (gnocchi_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: gnocchi_user.stdout.split()[2] == 'SUCCESS' + until: gnocchi_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/heat/defaults/main.yml b/ansible/roles/heat/defaults/main.yml index 9897cd2007..2a4f80e21a 100644 --- a/ansible/roles/heat/defaults/main.yml +++ b/ansible/roles/heat/defaults/main.yml @@ -69,4 +69,4 @@ heat_keystone_user: "heat" heat_stack_user_role: "heat_stack_user" heat_stack_owner_role: "heat_stack_owner" -openstack_heat_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_heat_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/heat/tasks/register.yml b/ansible/roles/heat/tasks/register.yml index 70ee29f981..a6e9f286f5 100644 --- a/ansible/roles/heat/tasks/register.yml +++ b/ansible/roles/heat/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Heat service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name={{ item.service_name }} - service_type={{ item.service_type }} - description='Openstack Orchestration' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_heat_auth }}' }}" - -e "{'openstack_heat_auth':{{ openstack_heat_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "{{ item.service_name }}" + service_type: "{{ item.service_type }}" + description: "Openstack Orchestration" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_heat_auth }}' }}" + module_extra_vars: + openstack_heat_auth: "{{ openstack_heat_auth }}" register: heat_endpoint - changed_when: "{{ heat_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (heat_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: heat_endpoint.stdout.split()[2] == 'SUCCESS' + until: heat_endpoint|success retries: 10 delay: 5 run_once: True @@ -26,44 +27,47 @@ - {'interface': 'public', 'url': '{{ heat_cfn_public_endpoint }}', 'service_name': 'heat-cfn', 'service_type': 'cloudformation'} - name: Creating the Heat project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=heat - password={{ heat_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_heat_auth }}' }}" - -e "{'openstack_heat_auth':{{ openstack_heat_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "heat" + password: "{{ heat_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_heat_auth }}' }}" + module_extra_vars: + openstack_heat_auth: "{{ openstack_heat_auth }}" register: heat_user - changed_when: "{{ heat_user.stdout.find('localhost | SUCCESS => ') != -1 and (heat_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: heat_user.stdout.split()[2] == 'SUCCESS' + until: heat_user|success retries: 10 delay: 5 run_once: True - name: Creating the heat_stack_user role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m os_keystone_role - -a "name={{ heat_stack_user_role }} - auth={{ '{{ openstack_heat_auth }}' }}" - -e "{'openstack_heat_auth':{{ openstack_heat_auth }}}" + kolla_toolbox: + module_name: os_keystone_role + module_args: + name: "{{ heat_stack_user_role }}" + auth: "{{ '{{ openstack_heat_auth }}' }}" + module_extra_vars: + openstack_heat_auth: "{{ openstack_heat_auth }}" register: heat_stack_user_role_result - changed_when: "{{ heat_stack_user_role_result.stdout.find('localhost | SUCCESS => ') != -1 and (heat_stack_user_role_result.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: heat_stack_user_role_result.stdout.split()[2] == 'SUCCESS' + until: heat_stack_user_role_result|success retries: 10 delay: 5 run_once: True - name: Creating the heat_stack_owner role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m os_keystone_role - -a "name={{ heat_stack_owner_role }} - auth={{ '{{ openstack_heat_auth }}' }}" - -e "{'openstack_heat_auth':{{ openstack_heat_auth }}}" + kolla_toolbox: + module_name: os_keystone_role + module_args: + name: "{{ heat_stack_owner_role }}" + auth: "{{ '{{ openstack_heat_auth }}' }}" + module_extra_vars: + openstack_heat_auth: "{{ openstack_heat_auth }}" register: heat_stack_owner_role_result - changed_when: "{{ heat_stack_owner_role_result.stdout.find('localhost | SUCCESS => ') != -1 and (heat_stack_owner_role_result.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: heat_stack_owner_role_result.stdout.split()[2] == 'SUCCESS' + until: heat_stack_owner_role_result|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/ironic/defaults/main.yml b/ansible/roles/ironic/defaults/main.yml index 6f201b17e9..6fe4db94b1 100644 --- a/ansible/roles/ironic/defaults/main.yml +++ b/ansible/roles/ironic/defaults/main.yml @@ -52,9 +52,9 @@ ironic_inspector_public_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn ironic_logging_debug: "{{ openstack_logging_debug }}" -openstack_ironic_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_ironic_auth: "{{ openstack_auth }}" -openstack_ironic_inspector_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_ironic_inspector_auth: "{{ openstack_auth }}" ######### diff --git a/ansible/roles/ironic/tasks/register.yml b/ansible/roles/ironic/tasks/register.yml index 71e25143d0..dee5577511 100644 --- a/ansible/roles/ironic/tasks/register.yml +++ b/ansible/roles/ironic/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Ironic service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=ironic - service_type=baremetal - description='Ironic bare metal provisioning service' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_ironic_auth }}' }}" - -e "{'openstack_ironic_auth':{{ openstack_ironic_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "ironic" + service_type: "baremetal" + description: "Ironic bare metal provisioning service" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_ironic_auth }}' }}" + module_extra_vars: + openstack_ironic_auth: "{{ openstack_ironic_auth }}" register: ironic_endpoint - changed_when: "{{ ironic_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (ironic_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: ironic_endpoint.stdout.split()[2] == 'SUCCESS' + until: ironic_endpoint|success retries: 10 delay: 5 run_once: True @@ -24,38 +25,40 @@ - {'interface': 'public', 'url': '{{ ironic_public_endpoint }}'} - name: Creating the Ironic project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user={{ ironic_keystone_user }} - password={{ ironic_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_ironic_auth }}' }}" - -e "{'openstack_ironic_auth':{{ openstack_ironic_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "{{ ironic_keystone_user }}" + password: "{{ ironic_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_ironic_auth }}' }}" + module_extra_vars: + openstack_ironic_auth: "{{ openstack_ironic_auth }}" register: ironic_user - changed_when: "{{ ironic_user.stdout.find('localhost | SUCCESS => ') != -1 and (ironic_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: ironic_user.stdout.split()[2] == 'SUCCESS' + until: ironic_user|success retries: 10 delay: 5 run_once: True when: inventory_hostname in groups['ironic-api'] - name: Creating the Ironic Inspector service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=ironic-inspector - service_type=baremetal-introspection - description='Ironic Inspector baremetal introspection service' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_ironic_inspector_auth }}' }}" - -e "{'openstack_ironic_inspector_auth':{{ openstack_ironic_inspector_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "ironic-inspector" + service_type: "baremetal-introspection" + description: "Ironic Inspector baremetal introspection service" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_ironic_inspector_auth }}' }}" + module_extra_vars: + openstack_ironic_inspector_auth: "{{ openstack_ironic_inspector_auth }}" register: ironic_inspector_endpoint - changed_when: "{{ ironic_inspector_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (ironic_inspector_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: ironic_inspector_endpoint.stdout.split()[2] == 'SUCCESS' + until: ironic_inspector_endpoint|success retries: 10 delay: 5 run_once: True @@ -66,18 +69,19 @@ - {'interface': 'public', 'url': '{{ ironic_inspector_public_endpoint }}'} - name: Creating the Ironic Inspector project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user={{ ironic_inspector_keystone_user }} - password={{ ironic_inspector_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_ironic_inspector_auth }}' }}" - -e "{'openstack_ironic_inspector_auth':{{ openstack_ironic_inspector_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "{{ ironic_inspector_keystone_user }}" + password: "{{ ironic_inspector_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_ironic_inspector_auth }}' }}" + module_extra_vars: + openstack_ironic_inspector_auth: "{{ openstack_ironic_inspector_auth }}" register: ironic_inspector_user - changed_when: "{{ ironic_inspector_user.stdout.find('localhost | SUCCESS => ') != -1 and (ironic_inspector_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: ironic_inspector_user.stdout.split()[2] == 'SUCCESS' + until: ironic_inspector_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/keystone/defaults/main.yml b/ansible/roles/keystone/defaults/main.yml index 703f9676fb..3fa3b593d4 100644 --- a/ansible/roles/keystone/defaults/main.yml +++ b/ansible/roles/keystone/defaults/main.yml @@ -70,4 +70,4 @@ keystone_ssh_image_full: "{{ keystone_ssh_image }}:{{ keystone_ssh_tag }}" #################### keystone_logging_debug: "{{ openstack_logging_debug }}" -openstack_keystone_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}','domain_name':'default'}" +openstack_keystone_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/keystone/tasks/register.yml b/ansible/roles/keystone/tasks/register.yml index 5c00f913a7..a322334adf 100644 --- a/ansible/roles/keystone/tasks/register.yml +++ b/ansible/roles/keystone/tasks/register.yml @@ -7,14 +7,15 @@ run_once: True - name: Creating default user role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m os_keystone_role - -a "name={{ keystone_default_user_role }} - auth={{ '{{ openstack_keystone_auth }}' }}" - -e "{'openstack_keystone_auth':{{ openstack_keystone_auth }}}" + kolla_toolbox: + module_name: "os_keystone_role" + module_args: + name: "{{ keystone_default_user_role }}" + auth: "{{ '{{ openstack_keystone_auth }}' }}" + module_extra_vars: + openstack_keystone_auth: "{{ openstack_keystone_auth }}" register: default_role - changed_when: "{{ default_role.stdout.find('localhost | SUCCESS => ') != -1 and (default_role.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: default_role.stdout.split()[2] == 'SUCCESS' + until: default_role|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/kuryr/defaults/main.yml b/ansible/roles/kuryr/defaults/main.yml index 1c755b1c44..5fd7dd1221 100644 --- a/ansible/roles/kuryr/defaults/main.yml +++ b/ansible/roles/kuryr/defaults/main.yml @@ -17,4 +17,4 @@ kuryr_logging_debug: "{{ openstack_logging_debug }}" kuryr_keystone_user: "kuryr" -openstack_kuryr_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}','domain_name':'default'}" +openstack_kuryr_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/kuryr/tasks/register.yml b/ansible/roles/kuryr/tasks/register.yml index b8b232354d..da5136ad6a 100644 --- a/ansible/roles/kuryr/tasks/register.yml +++ b/ansible/roles/kuryr/tasks/register.yml @@ -1,17 +1,18 @@ --- - name: Creating the Kuryr project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user={{ kuryr_keystone_user }} - password={{ kuryr_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_kuryr_auth }}' }}" - -e "{'openstack_kuryr_auth':{{ openstack_kuryr_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "{{ kuryr_keystone_user }}" + password: "{{ kuryr_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_kuryr_auth }}' }}" + module_extra_vars: + openstack_kuryr_auth: "{{ openstack_kuryr_auth }}" register: kuryr_user - changed_when: "{{ kuryr_user.stdout.find('localhost | SUCCESS => ') != -1 and (kuryr_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: kuryr_user.stdout.split()[2] == 'SUCCESS' + until: kuryr_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/magnum/defaults/main.yml b/ansible/roles/magnum/defaults/main.yml index c44c254eb8..3e6de1a9b1 100644 --- a/ansible/roles/magnum/defaults/main.yml +++ b/ansible/roles/magnum/defaults/main.yml @@ -33,4 +33,4 @@ 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 }}'}" +openstack_magnum_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/magnum/tasks/register.yml b/ansible/roles/magnum/tasks/register.yml index 31ac4a0851..3f9b2fc7f1 100644 --- a/ansible/roles/magnum/tasks/register.yml +++ b/ansible/roles/magnum/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Magnum service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=magnum - service_type=container-infra - description='Openstack Container Service' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_magnum_auth }}' }}" - -e "{'openstack_magnum_auth':{{ openstack_magnum_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "magnum" + service_type: "container-infra" + description: "Openstack Container Service" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_magnum_auth }}' }}" + module_extra_vars: + openstack_magnum_auth: "{{ openstack_magnum_auth }}" register: magnum_endpoint - changed_when: "{{ magnum_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (magnum_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: magnum_endpoint.stdout.split()[2] == 'SUCCESS' + until: magnum_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,66 +24,70 @@ - {'interface': 'public', 'url': '{{ magnum_public_endpoint }}'} - name: Creating the Magnum project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=magnum - password={{ magnum_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_magnum_auth }}' }}" - -e "{'openstack_magnum_auth':{{ openstack_magnum_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "magnum" + password: "{{ magnum_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_magnum_auth }}' }}" + module_extra_vars: + openstack_magnum_auth: "{{ openstack_magnum_auth }}" register: magnum_user - changed_when: "{{ magnum_user.stdout.find('localhost | SUCCESS => ') != -1 and (magnum_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: magnum_user.stdout.split()[2] == 'SUCCESS' + until: magnum_user|success retries: 10 delay: 5 run_once: True - name: Creating Magnum trustee domain - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m os_keystone_domain - -a "name={{ magnum_trustee_domain }} - description='Owns users and projects created by magnum' - auth={{ '{{ openstack_magnum_auth }}' }}" - -e "{'openstack_magnum_auth':{{ openstack_magnum_auth }}}" + kolla_toolbox: + module_name: "os_keystone_domain" + module_args: + name: "{{ magnum_trustee_domain }}" + description: "Owns users and projects created by magnum" + auth: "{{ '{{ openstack_magnum_auth }}' }}" + module_extra_vars: + openstack_magnum_auth: "{{ openstack_magnum_auth }}" register: trustee_domain - changed_when: "{{ trustee_domain.stdout.find('localhost | SUCCESS => ') != -1 and (trustee_domain.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: trustee_domain.stdout.split()[2] == 'SUCCESS' + until: trustee_domain|success retries: 10 delay: 5 run_once: True - name: Setting Magnum trustee domain value set_fact: - magnum_trustee_domain_id: "{{ (trustee_domain.stdout.split('localhost | SUCCESS => ')[1]|from_json).id }}" + magnum_trustee_domain_id: "{{ trustee_domain.id }}" - 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_trustee_domain }} - password={{ magnum_keystone_password }} - auth={{ '{{ openstack_magnum_auth }}' }}" - -e "{'openstack_magnum_auth':{{ openstack_magnum_auth }}}" + kolla_toolbox: + module_name: "os_user" + module_args: + name: "{{ magnum_trustee_domain_admin }}" + domain: "{{ magnum_trustee_domain }}" + password: "{{ magnum_keystone_password }}" + auth: "{{ '{{ openstack_magnum_auth }}' }}" + module_extra_vars: + openstack_magnum_auth: "{{ openstack_magnum_auth }}" register: trustee_user - changed_when: "{{ trustee_user.stdout.find('localhost | SUCCESS => ') != -1 and (trustee_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: trustee_user.stdout.split()[2] == 'SUCCESS' + until: trustee_user|success retries: 10 delay: 5 run_once: True - 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 }} - role=admin - auth={{ '{{ openstack_magnum_auth }}' }}" - -e "{'openstack_magnum_auth':{{ openstack_magnum_auth }}}" + kolla_toolbox: + module_name: "os_user_role" + module_args: + domain: "{{ magnum_trustee_domain_id }}" + user: "{{ magnum_trustee_domain_admin }}" + role: "admin" + auth: "{{ '{{ openstack_magnum_auth }}' }}" + module_extra_vars: + openstack_magnum_auth: "{{ openstack_magnum_auth }}" register: magnum_user_role_result - changed_when: "{{ magnum_user_role_result.stdout.find('localhost | SUCCESS => ') != -1 and (magnum_user_role_result.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: magnum_user_role_result.stdout.split()[2] == 'SUCCESS' + until: magnum_user_role_result|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/manila/defaults/main.yml b/ansible/roles/manila/defaults/main.yml index 2ba9665953..95b303ac05 100644 --- a/ansible/roles/manila/defaults/main.yml +++ b/ansible/roles/manila/defaults/main.yml @@ -44,7 +44,7 @@ manila_keystone_user: "manila" manila_service_instance_user: "manila" manila_service_instance_password: "manila" -openstack_manila_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_manila_auth: "{{ openstack_auth }}" #################### # Manila diff --git a/ansible/roles/manila/tasks/register.yml b/ansible/roles/manila/tasks/register.yml index a804b32158..9e75ec41bd 100644 --- a/ansible/roles/manila/tasks/register.yml +++ b/ansible/roles/manila/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Manila service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name={{ item.service_name }} - service_type={{ item.service_type }} - description='Openstack Shared Filesystems' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_manila_auth }}' }}" - -e "{'openstack_manila_auth':{{ openstack_manila_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "{{ item.service_name }}" + service_type: "{{ item.service_type }}" + description: "Openstack Shared Filesystems" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_manila_auth }}' }}" + module_extra_vars: + openstack_manila_auth: "{{ openstack_manila_auth }}" register: manila_endpoint - changed_when: "{{ manila_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (manila_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: manila_endpoint.stdout.split()[2] == 'SUCCESS' + until: manila_endpoint|success retries: 10 delay: 5 run_once: True @@ -26,18 +27,19 @@ - {'interface': 'public', 'url': '{{ manila_v2_public_endpoint }}', 'service_name': 'manilav2', 'service_type': 'sharev2'} - name: Creating the Manila project, user and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=manila - password={{ manila_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_manila_auth }}' }}" - -e "{'openstack_manila_auth':{{ openstack_manila_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "manila" + password: "{{ manila_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_manila_auth }}' }}" + module_extra_vars: + openstack_manila_auth: "{{ openstack_manila_auth }}" register: manila_user - changed_when: "{{ manila_user.stdout.find('localhost | SUCCESS => ') != -1 and (manila_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: manila_user.stdout.split()[2] == 'SUCCESS' + until: manila_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/mistral/defaults/main.yml b/ansible/roles/mistral/defaults/main.yml index cca068623d..1dba85ee7d 100644 --- a/ansible/roles/mistral/defaults/main.yml +++ b/ansible/roles/mistral/defaults/main.yml @@ -36,4 +36,4 @@ mistral_logging_debug: "{{ openstack_logging_debug }}" mistral_keystone_user: "mistral" -openstack_mistral_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_mistral_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/mistral/tasks/register.yml b/ansible/roles/mistral/tasks/register.yml index 0ac4906fe6..8af6faaffe 100644 --- a/ansible/roles/mistral/tasks/register.yml +++ b/ansible/roles/mistral/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Mistral service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=mistral - service_type=workflowv2 - description='Openstack Workflow' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_mistral_auth }}' }}" - -e "{'openstack_mistral_auth':{{ openstack_mistral_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "mistral" + service_type: "workflowv2" + description: "Openstack Workflow" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_mistral_auth }}' }}" + module_extra_vars: + openstack_mistral_auth: "{{ openstack_mistral_auth }}" register: mistral_endpoint - changed_when: "{{ mistral_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (mistral_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: mistral_endpoint.stdout.split()[2] == 'SUCCESS' + until: mistral_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ mistral_public_endpoint }}'} - name: Creating the Mistral project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=mistral - password={{ mistral_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_mistral_auth }}' }}" - -e "{'openstack_mistral_auth':{{ openstack_mistral_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "mistral" + password: "{{ mistral_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_mistral_auth }}' }}" + module_extra_vars: + openstack_mistral_auth: "{{ openstack_mistral_auth }}" register: mistral_user - changed_when: "{{ mistral_user.stdout.find('localhost | SUCCESS => ') != -1 and (mistral_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: mistral_user.stdout.split()[2] == 'SUCCESS' + until: mistral_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/murano/defaults/main.yml b/ansible/roles/murano/defaults/main.yml index 50ccef01fa..94bb0bdeea 100644 --- a/ansible/roles/murano/defaults/main.yml +++ b/ansible/roles/murano/defaults/main.yml @@ -32,4 +32,4 @@ murano_logging_debug: "{{ openstack_logging_debug }}" murano_keystone_user: "murano" -openstack_murano_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_murano_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/murano/tasks/register.yml b/ansible/roles/murano/tasks/register.yml index 308afc5b09..79b08c46af 100644 --- a/ansible/roles/murano/tasks/register.yml +++ b/ansible/roles/murano/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Murano service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=murano - service_type=application-catalog - description='Openstack Application Catalogue' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_murano_auth }}' }}" - -e "{'openstack_murano_auth':{{ openstack_murano_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "murano" + service_type: "application-catalog" + description: "Openstack Application Catalogue" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_murano_auth }}' }}" + module_extra_vars: + openstack_murano_auth: "{{ openstack_murano_auth }}" register: murano_endpoint - changed_when: "{{ murano_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (murano_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: murano_endpoint.stdout.split()[2] == 'SUCCESS' + until: murano_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ murano_public_endpoint }}'} - name: Creating the Murano project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=murano - password={{ murano_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_murano_auth }}' }}" - -e "{'openstack_murano_auth':{{ openstack_murano_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "murano" + password: "{{ murano_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_murano_auth }}' }}" + module_extra_vars: + openstack_murano_auth: "{{ openstack_murano_auth }}" register: murano_user - changed_when: "{{ murano_user.stdout.find('localhost | SUCCESS => ') != -1 and (murano_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: murano_user.stdout.split()[2] == 'SUCCESS' + until: murano_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/neutron/defaults/main.yml b/ansible/roles/neutron/defaults/main.yml index 699c6b688c..ad8a3a43e2 100644 --- a/ansible/roles/neutron/defaults/main.yml +++ b/ansible/roles/neutron/defaults/main.yml @@ -72,4 +72,4 @@ neutron_logging_debug: "{{ openstack_logging_debug }}" neutron_bridge_name: "br-ex" -openstack_neutron_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_neutron_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/neutron/tasks/register.yml b/ansible/roles/neutron/tasks/register.yml index fee70230ec..810e48ad42 100644 --- a/ansible/roles/neutron/tasks/register.yml +++ b/ansible/roles/neutron/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Neutron service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=neutron - service_type=network - description='Openstack Networking' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_neutron_auth }}' }}" - -e "{'openstack_neutron_auth':{{ openstack_neutron_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "neutron" + service_type: "network" + description: "Openstack Networking" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_neutron_auth }}' }}" + module_extra_vars: + openstack_neutron_auth: "{{ openstack_neutron_auth }}" register: neutron_endpoint - changed_when: "{{ neutron_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (neutron_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: neutron_endpoint.stdout.split()[2] == 'SUCCESS' + until: neutron_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ neutron_public_endpoint }}'} - name: Creating the Neutron project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=neutron - password={{ neutron_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_neutron_auth }}' }}" - -e "{'openstack_neutron_auth':{{ openstack_neutron_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "neutron" + password: "{{ neutron_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_neutron_auth }}' }}" + module_extra_vars: + openstack_neutron_auth: "{{ openstack_neutron_auth }}" register: neutron_user - changed_when: "{{ neutron_user.stdout.find('localhost | SUCCESS => ') != -1 and (neutron_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: neutron_user.stdout.split()[2] == 'SUCCESS' + until: neutron_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/nova/defaults/main.yml b/ansible/roles/nova/defaults/main.yml index bf24c02f78..da44a0c197 100644 --- a/ansible/roles/nova/defaults/main.yml +++ b/ansible/roles/nova/defaults/main.yml @@ -85,6 +85,6 @@ nova_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ nova nova_logging_debug: "{{ openstack_logging_debug }}" -openstack_nova_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_nova_auth: "{{ openstack_auth }}" nova_ssh_port: "8022" diff --git a/ansible/roles/nova/tasks/register.yml b/ansible/roles/nova/tasks/register.yml index a1b87e5c1d..68f2275b5c 100644 --- a/ansible/roles/nova/tasks/register.yml +++ b/ansible/roles/nova/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Nova service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name={{ item.name }} - service_type={{ item.service_type }} - description='{{ item.description }}' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_nova_auth }}' }}" - -e "{'openstack_nova_auth':{{ openstack_nova_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "{{ item.name }}" + service_type: "{{ item.service_type }}" + description: "{{ item.description }}" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_nova_auth }}' }}" + module_extra_vars: + openstack_nova_auth: "{{ openstack_nova_auth }}" register: nova_endpoint - changed_when: "{{ nova_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (nova_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: nova_endpoint.stdout.split()[2] == 'SUCCESS' + until: nova_endpoint|success retries: 10 delay: 5 run_once: True @@ -26,18 +27,19 @@ - {'name': 'nova', 'service_type': 'compute', 'interface': 'public', 'url': '{{ nova_public_endpoint }}', 'description': 'OpenStack Compute Service'} - name: Creating the Nova project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=nova - password={{ nova_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_nova_auth }}' }}" - -e "{'openstack_nova_auth':{{ openstack_nova_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "nova" + password: "{{ nova_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_nova_auth }}' }}" + module_extra_vars: + openstack_nova_auth: "{{ openstack_nova_auth }}" register: nova_user - changed_when: "{{ nova_user.stdout.find('localhost | SUCCESS => ') != -1 and (nova_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: nova_user.stdout.split()[2] == 'SUCCESS' + until: nova_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/octavia/defaults/main.yml b/ansible/roles/octavia/defaults/main.yml index 6a2bc36873..0460fa7add 100644 --- a/ansible/roles/octavia/defaults/main.yml +++ b/ansible/roles/octavia/defaults/main.yml @@ -40,4 +40,4 @@ octavia_logging_debug: "{{ openstack_logging_debug }}" octavia_keystone_user: "octavia" -openstack_octavia_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_octavia_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/octavia/tasks/register.yml b/ansible/roles/octavia/tasks/register.yml index 96c0e790b8..860ae7805c 100644 --- a/ansible/roles/octavia/tasks/register.yml +++ b/ansible/roles/octavia/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Octavia service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=octavia - service_type=application-catalog - description='Openstack Application Catalogue' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_octavia_auth }}' }}" - -e "{'openstack_octavia_auth':{{ openstack_octavia_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "octavia" + service_type: "application-catalog" + description: "Openstack Application Catalogue" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_octavia_auth }}' }}" + module_extra_vars: + openstack_octavia_auth: "{{ openstack_octavia_auth }}" register: octavia_endpoint - changed_when: "{{ octavia_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (octavia_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: octavia_endpoint.stdout.split()[2] == 'SUCCESS' + until: octavia_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ octavia_public_endpoint }}'} - name: Creating the Octavia project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=octavia - password={{ octavia_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_octavia_auth }}' }}" - -e "{'openstack_octavia_auth':{{ openstack_octavia_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "octavia" + password: "{{ octavia_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_octavia_auth }}' }}" + module_extra_vars: + openstack_octavia_auth: "{{ openstack_octavia_auth }}" register: octavia_user - changed_when: "{{ octavia_user.stdout.find('localhost | SUCCESS => ') != -1 and (octavia_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: octavia_user.stdout.split()[2] == 'SUCCESS' + until: octavia_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/sahara/defaults/main.yml b/ansible/roles/sahara/defaults/main.yml index d545f68346..984b0fa1cd 100644 --- a/ansible/roles/sahara/defaults/main.yml +++ b/ansible/roles/sahara/defaults/main.yml @@ -33,4 +33,4 @@ sahara_logging_debug: "{{ openstack_logging_debug }}" sahara_keystone_user: "sahara" -openstack_sahara_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}','domain_name':'default'}" +openstack_sahara_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/sahara/tasks/register.yml b/ansible/roles/sahara/tasks/register.yml index 7c031e0932..43b86a9129 100644 --- a/ansible/roles/sahara/tasks/register.yml +++ b/ansible/roles/sahara/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Sahara service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=sahara - service_type=data_processing - description='Sahara Data Processing' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_sahara_auth }}' }}" - -e "{'openstack_sahara_auth':{{ openstack_sahara_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "sahara" + service_type: "data_processing" + description: "Sahara Data Processing" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_sahara_auth }}' }}" + module_extra_vars: + openstack_sahara_auth: "{{ openstack_sahara_auth }}" register: sahara_endpoint - changed_when: "{{ sahara_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (sahara_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: sahara_endpoint.stdout.split()[2] == 'SUCCESS' + until: sahara_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ sahara_public_endpoint }}'} - name: Creating the Sahara project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=sahara - password={{ sahara_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_sahara_auth }}' }}" - -e "{'openstack_sahara_auth':{{ openstack_sahara_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "sahara" + password: "{{ sahara_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_sahara_auth }}' }}" + module_extra_vars: + openstack_sahara_auth: "{{ openstack_sahara_auth }}" register: sahara_user - changed_when: "{{ sahara_user.stdout.find('localhost | SUCCESS => ') != -1 and (sahara_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: sahara_user.stdout.split()[2] == 'SUCCESS' + until: sahara_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/searchlight/defaults/main.yml b/ansible/roles/searchlight/defaults/main.yml index a742489e86..a23b189800 100644 --- a/ansible/roles/searchlight/defaults/main.yml +++ b/ansible/roles/searchlight/defaults/main.yml @@ -49,4 +49,4 @@ searchlight_logging_debug: "{{ openstack_logging_debug }}" searchlight_keystone_user: "searchlight" -openstack_searchlight_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_searchlight_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/searchlight/tasks/register.yml b/ansible/roles/searchlight/tasks/register.yml index 4724e7b96d..8279c7ab40 100644 --- a/ansible/roles/searchlight/tasks/register.yml +++ b/ansible/roles/searchlight/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Searchlight service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=searchlight - service_type=search - description='Openstack Index Service' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_searchlight_auth }}' }}" - -e "{'openstack_searchlight_auth':{{ openstack_searchlight_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "searchlight" + service_type: "search" + description: "Openstack Index Service" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_searchlight_auth }}' }}" + module_extra_vars: + openstack_searchlight_auth: "{{ openstack_searchlight_auth }}" register: searchlight_endpoint - changed_when: "{{ searchlight_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (searchlight_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: searchlight_endpoint.stdout.split()[2] == 'SUCCESS' + until: searchlight_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ searchlight_public_endpoint }}'} - name: Creating the Searchlight project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=searchlight - password={{ searchlight_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_searchlight_auth }}' }}" - -e "{'openstack_searchlight_auth':{{ openstack_searchlight_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "searchlight" + password: "{{ searchlight_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_searchlight_auth }}' }}" + module_extra_vars: + openstack_searchlight_auth: "{{ openstack_searchlight_auth }}" register: searchlight_user - changed_when: "{{ searchlight_user.stdout.find('localhost | SUCCESS => ') != -1 and (searchlight_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: searchlight_user.stdout.split()[2] == 'SUCCESS' + until: searchlight_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/senlin/defaults/main.yml b/ansible/roles/senlin/defaults/main.yml index a2a48b6a01..84e1642cec 100644 --- a/ansible/roles/senlin/defaults/main.yml +++ b/ansible/roles/senlin/defaults/main.yml @@ -52,4 +52,4 @@ senlin_logging_debug: "{{ openstack_logging_debug }}" senlin_keystone_user: "senlin" -openstack_senlin_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_senlin_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/senlin/tasks/register.yml b/ansible/roles/senlin/tasks/register.yml index c9d0185f4f..cdfb5152f6 100644 --- a/ansible/roles/senlin/tasks/register.yml +++ b/ansible/roles/senlin/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Senlin service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=senlin - service_type=clustering - description='Senlin Clustering Service' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_senlin_auth }}' }}" - -e "{'openstack_senlin_auth':{{ openstack_senlin_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "senlin" + service_type: "clustering" + description: "Senlin Clustering Service" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_senlin_auth }}' }}" + module_extra_vars: + openstack_senlin_auth: "{{ openstack_senlin_auth }}" register: senlin_endpoint - changed_when: "{{ senlin_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (senlin_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: senlin_endpoint.stdout.split()[2] == 'SUCCESS' + until: senlin_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ senlin_public_endpoint }}'} - name: Creating the Senlin project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=senlin - password={{ senlin_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_senlin_auth }}' }}" - -e "{'openstack_senlin_auth':{{ openstack_senlin_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "senlin" + password: "{{ senlin_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_senlin_auth }}' }}" + module_extra_vars: + openstack_senlin_auth: "{{ openstack_senlin_auth }}" register: senlin_user - changed_when: "{{ senlin_user.stdout.find('localhost | SUCCESS => ') != -1 and (senlin_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: senlin_user.stdout.split()[2] == 'SUCCESS' + until: senlin_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/solum/defaults/main.yml b/ansible/roles/solum/defaults/main.yml index dd78cdc593..d5ebfcdfa6 100644 --- a/ansible/roles/solum/defaults/main.yml +++ b/ansible/roles/solum/defaults/main.yml @@ -44,4 +44,4 @@ solum_logging_debug: "{{ openstack_logging_debug }}" solum_keystone_user: "solum" -openstack_solum_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_solum_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/solum/tasks/register.yml b/ansible/roles/solum/tasks/register.yml index 118d85f17b..7f12cc0a0b 100644 --- a/ansible/roles/solum/tasks/register.yml +++ b/ansible/roles/solum/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Solum image builder service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=solum_image_builder - service_type=image_builder - description='Openstack Solum Image Builder' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_solum_auth }}' }}" - -e "{'openstack_solum_auth':{{ openstack_solum_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "solum_image_builder" + service_type: "image_builder" + description: "Openstack Solum Image Builder" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_solum_auth }}' }}" + module_extra_vars: + openstack_solum_auth: "{{ openstack_solum_auth }}" register: solum_image_builder_endpoint - changed_when: "{{ solum_image_builder_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (solum_image_builder_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: solum_image_builder_endpoint.stdout.split()[2] == 'SUCCESS' + until: solum_image_builder_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,20 +24,21 @@ - {'interface': 'public', 'url': '{{ solum_image_builder_public_endpoint }}'} - name: Creating the Solum application deployment service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=solum_application_deployment - service_type=application_deployment - description='Openstack Solum Application Deployment' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_solum_auth }}' }}" - -e "{'openstack_solum_auth':{{ openstack_solum_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "solum_application_deployment" + service_type: "application_deployment" + description: "Openstack Solum Application Deployment" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_solum_auth }}' }}" + module_extra_vars: + openstack_solum_auth: "{{ openstack_solum_auth }}" register: solum_application_deployment_endpoint - changed_when: "{{ solum_application_deployment_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (solum_application_deployment_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: solum_application_deployment_endpoint.stdout.split()[2] == 'SUCCESS' + until: solum_application_deployment_endpoint|success retries: 10 delay: 5 run_once: True @@ -46,18 +48,19 @@ - {'interface': 'public', 'url': '{{ solum_application_deployment_public_endpoint }}'} - name: Creating the Solum project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=solum - password={{ solum_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_solum_auth }}' }}" - -e "{'openstack_solum_auth':{{ openstack_solum_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "solum" + password: "{{ solum_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_solum_auth }}' }}" + module_extra_vars: + openstack_solum_auth: "{{ openstack_solum_auth }}" register: solum_user - changed_when: "{{ solum_user.stdout.find('localhost | SUCCESS => ') != -1 and (solum_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: solum_user.stdout.split()[2] == 'SUCCESS' + until: solum_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/swift/defaults/main.yml b/ansible/roles/swift/defaults/main.yml index e10f8cda99..8ac6fc11a5 100644 --- a/ansible/roles/swift/defaults/main.yml +++ b/ansible/roles/swift/defaults/main.yml @@ -44,4 +44,4 @@ swift_devices_mount_point: "/srv/node" swift_devices_match_mode: "strict" swift_devices_name: "KOLLA_SWIFT_DATA" -openstack_swift_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_swift_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/swift/tasks/register.yml b/ansible/roles/swift/tasks/register.yml index 628e8aea6f..ad1edc8be7 100644 --- a/ansible/roles/swift/tasks/register.yml +++ b/ansible/roles/swift/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Swift service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=swift - service_type=object-store - description='Openstack Object Storage' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_swift_auth }}' }}" - -e "{'openstack_swift_auth':{{ openstack_swift_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "swift" + service_type: "object-store" + description: "Openstack Object Storage" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_swift_auth }}' }}" + module_extra_vars: + openstack_swift_auth: "{{ openstack_swift_auth }}" register: swift_endpoint - changed_when: "{{ swift_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (swift_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: swift_endpoint.stdout.split()[2] == 'SUCCESS' + until: swift_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ swift_public_endpoint }}'} - name: Creating the Swift project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user={{ swift_keystone_user }} - password={{ swift_keystone_password }} - role={{ swift_admin_tenant_name }} - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_swift_auth }}' }}" - -e "{'openstack_swift_auth':{{ openstack_swift_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "{{ swift_keystone_user }}" + password: "{{ swift_keystone_password }}" + role: "{{ swift_admin_tenant_name }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_swift_auth }}' }}" + module_extra_vars: + openstack_swift_auth: "{{ openstack_swift_auth }}" register: swift_user - changed_when: "{{ swift_user.stdout.find('localhost | SUCCESS => ') != -1 and (swift_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: swift_user.stdout.split()[2] == 'SUCCESS' + until: swift_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/tacker/defaults/main.yml b/ansible/roles/tacker/defaults/main.yml index 6c1fc6c0e3..a3a91f8ab4 100644 --- a/ansible/roles/tacker/defaults/main.yml +++ b/ansible/roles/tacker/defaults/main.yml @@ -26,4 +26,4 @@ tacker_logging_debug: "{{ openstack_logging_debug }}" tacker_keystone_user: "tacker" -openstack_tacker_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_tacker_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/tacker/tasks/register.yml b/ansible/roles/tacker/tasks/register.yml index c039e9afb1..7b1fb3a0ce 100644 --- a/ansible/roles/tacker/tasks/register.yml +++ b/ansible/roles/tacker/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Tacker service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=tacker - service_type=nfv-orchestration - description='Tacker Service' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_tacker_auth }}' }}" - -e "{'openstack_tacker_auth':{{ openstack_tacker_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "tacker" + service_type: "nfv-orchestration" + description: "Tacker Service" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_tacker_auth }}' }}" + module_extra_vars: + openstack_tacker_auth: "{{ openstack_tacker_auth }}" register: tacker_endpoint - changed_when: "{{ tacker_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (tacker_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: tacker_endpoint.stdout.split()[2] == 'SUCCESS' + until: tacker_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ tacker_public_endpoint }}'} - name: Creating the Tacker project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=tacker - password={{ tacker_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_tacker_auth }}' }}" - -e "{'openstack_tacker_auth':{{ openstack_tacker_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "tacker" + password: "{{ tacker_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_tacker_auth }}' }}" + module_extra_vars: + openstack_tacker_auth: "{{ openstack_tacker_auth }}" register: tacker_user - changed_when: "{{ tacker_user.stdout.find('localhost | SUCCESS => ') != -1 and (tacker_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: tacker_user.stdout.split()[2] == 'SUCCESS' + until: tacker_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/trove/defaults/main.yml b/ansible/roles/trove/defaults/main.yml index 79ed9b3299..8d96aed43f 100644 --- a/ansible/roles/trove/defaults/main.yml +++ b/ansible/roles/trove/defaults/main.yml @@ -36,4 +36,4 @@ trove_logging_debug: "{{ openstack_logging_debug }}" trove_keystone_user: "trove" -openstack_trove_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}','domain_name':'default'}" +openstack_trove_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/trove/tasks/register.yml b/ansible/roles/trove/tasks/register.yml index f2d5928867..21c93d8d1f 100644 --- a/ansible/roles/trove/tasks/register.yml +++ b/ansible/roles/trove/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Trove service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=trove - service_type=database - description='Trove Database Service' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_trove_auth }}' }}" - -e "{'openstack_trove_auth':{{ openstack_trove_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "trove" + service_type: "database" + description: "Trove Database Service" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_trove_auth }}' }}" + module_extra_vars: + openstack_trove_auth: "{{ openstack_trove_auth }}" register: trove_endpoint - changed_when: "{{ trove_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (trove_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: trove_endpoint.stdout.split()[2] == 'SUCCESS' + until: trove_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ trove_public_endpoint }}'} - name: Creating the Trove project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=trove - password={{ trove_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_trove_auth }}' }}" - -e "{'openstack_trove_auth':{{ openstack_trove_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "trove" + password: "{{ trove_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_trove_auth }}' }}" + module_extra_vars: + openstack_trove_auth: "{{ openstack_trove_auth }}" register: trove_user - changed_when: "{{ trove_user.stdout.find('localhost | SUCCESS => ') != -1 and (trove_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: trove_user.stdout.split()[2] == 'SUCCESS' + until: trove_user|success retries: 10 delay: 5 run_once: True diff --git a/ansible/roles/watcher/defaults/main.yml b/ansible/roles/watcher/defaults/main.yml index 28f300bcba..1fbf7de3d8 100644 --- a/ansible/roles/watcher/defaults/main.yml +++ b/ansible/roles/watcher/defaults/main.yml @@ -35,4 +35,4 @@ watcher_logging_debug: "{{ openstack_logging_debug }}" watcher_keystone_user: "watcher" -openstack_watcher_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +openstack_watcher_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/watcher/tasks/register.yml b/ansible/roles/watcher/tasks/register.yml index 59a2e21823..a60a6add50 100644 --- a/ansible/roles/watcher/tasks/register.yml +++ b/ansible/roles/watcher/tasks/register.yml @@ -1,19 +1,20 @@ --- - name: Creating the Watcher service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name=watcher - service_type=infra-optim - description='Infrastructure Optimization service' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_watcher_auth }}' }}" - -e "{'openstack_watcher_auth':{{ openstack_watcher_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "watcher" + service_type: "infra-optim" + description: "Infrastructure Optimization service" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_watcher_auth }}' }}" + module_extra_vars: + openstack_watcher_auth: "{{ openstack_watcher_auth }}" register: watcher_endpoint - changed_when: "{{ watcher_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (watcher_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: watcher_endpoint.stdout.split()[2] == 'SUCCESS' + until: watcher_endpoint|success retries: 10 delay: 5 run_once: True @@ -23,18 +24,19 @@ - {'interface': 'public', 'url': '{{ watcher_public_endpoint }}'} - name: Creating the Watcher project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=watcher - password={{ watcher_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_watcher_auth }}' }}" - -e "{'openstack_watcher_auth':{{ openstack_watcher_auth }}}" + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "watcher" + password: "{{ watcher_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ '{{ openstack_watcher_auth }}' }}" + module_extra_vars: + openstack_watcher_auth: "{{ openstack_watcher_auth }}" register: watcher_user - changed_when: "{{ watcher_user.stdout.find('localhost | SUCCESS => ') != -1 and (watcher_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: watcher_user.stdout.split()[2] == 'SUCCESS' + until: watcher_user|success retries: 10 delay: 5 run_once: True