Remove delegate_to from service-ks-register tasks
This was actually not present in the original tasks, I'm not sure how it crept in. Using it could force delegating to a failed host. Also use a block in the service-ks-register role to avoid repeating the run_once and become arguments. Change-Id: Ie4e14b1cfb0167a2126685784b6a8f7262393f63
This commit is contained in:
parent
1982c9809f
commit
33b1b85d51
@ -5,7 +5,6 @@ service_ks_cacert: "{{ openstack_cacert }}"
|
|||||||
service_ks_register_interface: "{{ openstack_interface }}"
|
service_ks_register_interface: "{{ openstack_interface }}"
|
||||||
service_ks_register_endpoint_region: "{{ openstack_region_name }}"
|
service_ks_register_endpoint_region: "{{ openstack_region_name }}"
|
||||||
service_ks_register_domain: "default"
|
service_ks_register_domain: "default"
|
||||||
service_ks_register_delegate_host: "{{ groups['control'][0] }}"
|
|
||||||
# A list of services to register with Keystone. Each service definition should
|
# A list of services to register with Keystone. Each service definition should
|
||||||
# provide the following fields:
|
# provide the following fields:
|
||||||
# 'name'
|
# 'name'
|
||||||
|
@ -1,140 +1,126 @@
|
|||||||
---
|
---
|
||||||
- name: "{{ project_name }} | Creating services"
|
- block:
|
||||||
become: true
|
- name: "{{ project_name }} | Creating services"
|
||||||
kolla_toolbox:
|
kolla_toolbox:
|
||||||
module_name: "os_keystone_service"
|
module_name: "os_keystone_service"
|
||||||
module_args:
|
module_args:
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.name }}"
|
||||||
service_type: "{{ item.type }}"
|
service_type: "{{ item.type }}"
|
||||||
description: "{{ item.description }}"
|
description: "{{ item.description }}"
|
||||||
region_name: "{{ service_ks_register_region_name }}"
|
region_name: "{{ service_ks_register_region_name }}"
|
||||||
auth: "{{ service_ks_register_auth }}"
|
auth: "{{ service_ks_register_auth }}"
|
||||||
interface: "{{ service_ks_register_interface }}"
|
interface: "{{ service_ks_register_interface }}"
|
||||||
cacert: "{{ service_ks_cacert }}"
|
cacert: "{{ service_ks_cacert }}"
|
||||||
run_once: True
|
loop: "{{ service_ks_register_services }}"
|
||||||
loop: "{{ service_ks_register_services }}"
|
loop_control:
|
||||||
delegate_to: "{{ service_ks_register_delegate_host }}"
|
label:
|
||||||
loop_control:
|
name: "{{ item.name }}"
|
||||||
label:
|
service_type: "{{ item.type }}"
|
||||||
name: "{{ item.name }}"
|
register: service_ks_register_result
|
||||||
service_type: "{{ item.type }}"
|
until: service_ks_register_result is success
|
||||||
register: service_ks_register_result
|
retries: "{{ service_ks_register_retries }}"
|
||||||
until: service_ks_register_result is success
|
delay: "{{ service_ks_register_delay }}"
|
||||||
retries: "{{ service_ks_register_retries }}"
|
|
||||||
delay: "{{ service_ks_register_delay }}"
|
|
||||||
|
|
||||||
- name: "{{ project_name }} | Creating endpoints"
|
- name: "{{ project_name }} | Creating endpoints"
|
||||||
become: true
|
kolla_toolbox:
|
||||||
kolla_toolbox:
|
module_name: "os_keystone_endpoint"
|
||||||
module_name: "os_keystone_endpoint"
|
module_args:
|
||||||
module_args:
|
service: "{{ item.0.name }}"
|
||||||
service: "{{ item.0.name }}"
|
url: "{{ item.1.url }}"
|
||||||
url: "{{ item.1.url }}"
|
endpoint_interface: "{{ item.1.interface }}"
|
||||||
endpoint_interface: "{{ item.1.interface }}"
|
region: "{{ service_ks_register_endpoint_region }}"
|
||||||
region: "{{ service_ks_register_endpoint_region }}"
|
region_name: "{{ service_ks_register_region_name }}"
|
||||||
region_name: "{{ service_ks_register_region_name }}"
|
auth: "{{ service_ks_register_auth }}"
|
||||||
auth: "{{ service_ks_register_auth }}"
|
interface: "{{ service_ks_register_interface }}"
|
||||||
interface: "{{ service_ks_register_interface }}"
|
cacert: "{{ service_ks_cacert }}"
|
||||||
cacert: "{{ service_ks_cacert }}"
|
with_subelements:
|
||||||
run_once: True
|
- "{{ service_ks_register_services }}"
|
||||||
with_subelements:
|
- endpoints
|
||||||
- "{{ service_ks_register_services }}"
|
loop_control:
|
||||||
- endpoints
|
label:
|
||||||
delegate_to: "{{ service_ks_register_delegate_host }}"
|
service: "{{ item.0.name }}"
|
||||||
loop_control:
|
url: "{{ item.1.url }}"
|
||||||
label:
|
interface: "{{ item.1.interface }}"
|
||||||
service: "{{ item.0.name }}"
|
register: service_ks_register_result
|
||||||
url: "{{ item.1.url }}"
|
until: service_ks_register_result is success
|
||||||
interface: "{{ item.1.interface }}"
|
retries: "{{ service_ks_register_retries }}"
|
||||||
register: service_ks_register_result
|
delay: "{{ service_ks_register_delay }}"
|
||||||
until: service_ks_register_result is success
|
|
||||||
retries: "{{ service_ks_register_retries }}"
|
|
||||||
delay: "{{ service_ks_register_delay }}"
|
|
||||||
|
|
||||||
- name: "{{ project_name }} | Creating projects"
|
- name: "{{ project_name }} | Creating projects"
|
||||||
become: true
|
kolla_toolbox:
|
||||||
kolla_toolbox:
|
module_name: "os_project"
|
||||||
module_name: "os_project"
|
module_args:
|
||||||
module_args:
|
name: "{{ item }}"
|
||||||
name: "{{ item }}"
|
domain: "{{ service_ks_register_domain }}"
|
||||||
domain: "{{ service_ks_register_domain }}"
|
region_name: "{{ service_ks_register_region_name }}"
|
||||||
region_name: "{{ service_ks_register_region_name }}"
|
auth: "{{ service_ks_register_auth }}"
|
||||||
auth: "{{ service_ks_register_auth }}"
|
interface: "{{ service_ks_register_interface }}"
|
||||||
interface: "{{ service_ks_register_interface }}"
|
cacert: "{{ service_ks_cacert }}"
|
||||||
cacert: "{{ service_ks_cacert }}"
|
with_items: "{{ service_ks_register_users | map(attribute='project') | unique | list }}"
|
||||||
run_once: True
|
register: service_ks_register_result
|
||||||
with_items: "{{ service_ks_register_users | map(attribute='project') | unique | list }}"
|
until: service_ks_register_result is success
|
||||||
delegate_to: "{{ service_ks_register_delegate_host }}"
|
retries: "{{ service_ks_register_retries }}"
|
||||||
register: service_ks_register_result
|
delay: "{{ service_ks_register_delay }}"
|
||||||
until: service_ks_register_result is success
|
|
||||||
retries: "{{ service_ks_register_retries }}"
|
|
||||||
delay: "{{ service_ks_register_delay }}"
|
|
||||||
|
|
||||||
- name: "{{ project_name }} | Creating users"
|
- name: "{{ project_name }} | Creating users"
|
||||||
become: true
|
kolla_toolbox:
|
||||||
kolla_toolbox:
|
module_name: "os_user"
|
||||||
module_name: "os_user"
|
module_args:
|
||||||
module_args:
|
default_project: "{{ item.project }}"
|
||||||
default_project: "{{ item.project }}"
|
name: "{{ item.user }}"
|
||||||
name: "{{ item.user }}"
|
password: "{{ item.password }}"
|
||||||
password: "{{ item.password }}"
|
domain: "{{ service_ks_register_domain }}"
|
||||||
domain: "{{ service_ks_register_domain }}"
|
region_name: "{{ service_ks_register_region_name }}"
|
||||||
region_name: "{{ service_ks_register_region_name }}"
|
auth: "{{ service_ks_register_auth }}"
|
||||||
auth: "{{ service_ks_register_auth }}"
|
interface: "{{ service_ks_register_interface }}"
|
||||||
interface: "{{ service_ks_register_interface }}"
|
cacert: "{{ service_ks_cacert }}"
|
||||||
cacert: "{{ service_ks_cacert }}"
|
with_items: "{{ service_ks_register_users }}"
|
||||||
run_once: True
|
loop_control:
|
||||||
with_items: "{{ service_ks_register_users }}"
|
label:
|
||||||
delegate_to: "{{ service_ks_register_delegate_host }}"
|
user: "{{ item.user }}"
|
||||||
loop_control:
|
project: "{{ item.project }}"
|
||||||
label:
|
register: service_ks_register_result
|
||||||
user: "{{ item.user }}"
|
until: service_ks_register_result is success
|
||||||
project: "{{ item.project }}"
|
retries: "{{ service_ks_register_retries }}"
|
||||||
register: service_ks_register_result
|
delay: "{{ service_ks_register_delay }}"
|
||||||
until: service_ks_register_result is success
|
|
||||||
retries: "{{ service_ks_register_retries }}"
|
|
||||||
delay: "{{ service_ks_register_delay }}"
|
|
||||||
|
|
||||||
- name: "{{ project_name }} | Creating roles"
|
- name: "{{ project_name }} | Creating roles"
|
||||||
become: true
|
kolla_toolbox:
|
||||||
kolla_toolbox:
|
module_name: "os_keystone_role"
|
||||||
module_name: "os_keystone_role"
|
module_args:
|
||||||
module_args:
|
name: "{{ item }}"
|
||||||
name: "{{ item }}"
|
region_name: "{{ service_ks_register_region_name }}"
|
||||||
region_name: "{{ service_ks_register_region_name }}"
|
auth: "{{ service_ks_register_auth }}"
|
||||||
auth: "{{ service_ks_register_auth }}"
|
interface: "{{ service_ks_register_interface }}"
|
||||||
interface: "{{ service_ks_register_interface }}"
|
cacert: "{{ service_ks_cacert }}"
|
||||||
cacert: "{{ service_ks_cacert }}"
|
with_items: "{{ service_ks_register_users | map(attribute='role') | unique | list + service_ks_register_roles }}"
|
||||||
run_once: True
|
register: service_ks_register_result
|
||||||
with_items: "{{ service_ks_register_users | map(attribute='role') | unique | list + service_ks_register_roles }}"
|
until: service_ks_register_result is success
|
||||||
delegate_to: "{{ service_ks_register_delegate_host }}"
|
retries: "{{ service_ks_register_retries }}"
|
||||||
register: service_ks_register_result
|
delay: "{{ service_ks_register_delay }}"
|
||||||
until: service_ks_register_result is success
|
|
||||||
retries: "{{ service_ks_register_retries }}"
|
- name: "{{ project_name }} | Granting user roles"
|
||||||
delay: "{{ service_ks_register_delay }}"
|
kolla_toolbox:
|
||||||
|
module_name: "os_user_role"
|
||||||
|
module_args:
|
||||||
|
user: "{{ item.user }}"
|
||||||
|
role: "{{ item.role }}"
|
||||||
|
project: "{{ item.project }}"
|
||||||
|
domain: "{{ service_ks_register_domain }}"
|
||||||
|
region_name: "{{ service_ks_register_region_name }}"
|
||||||
|
auth: "{{ service_ks_register_auth }}"
|
||||||
|
interface: "{{ service_ks_register_interface }}"
|
||||||
|
cacert: "{{ service_ks_cacert }}"
|
||||||
|
with_items: "{{ service_ks_register_users + service_ks_register_user_roles }}"
|
||||||
|
loop_control:
|
||||||
|
label:
|
||||||
|
user: "{{ item.user }}"
|
||||||
|
role: "{{ item.role }}"
|
||||||
|
project: "{{ item.project }}"
|
||||||
|
register: service_ks_register_result
|
||||||
|
until: service_ks_register_result is success
|
||||||
|
retries: "{{ service_ks_register_retries }}"
|
||||||
|
delay: "{{ service_ks_register_delay }}"
|
||||||
|
|
||||||
- name: "{{ project_name }} | Granting user roles"
|
|
||||||
become: true
|
become: true
|
||||||
kolla_toolbox:
|
|
||||||
module_name: "os_user_role"
|
|
||||||
module_args:
|
|
||||||
user: "{{ item.user }}"
|
|
||||||
role: "{{ item.role }}"
|
|
||||||
project: "{{ item.project }}"
|
|
||||||
domain: "{{ service_ks_register_domain }}"
|
|
||||||
region_name: "{{ service_ks_register_region_name }}"
|
|
||||||
auth: "{{ service_ks_register_auth }}"
|
|
||||||
interface: "{{ service_ks_register_interface }}"
|
|
||||||
cacert: "{{ service_ks_cacert }}"
|
|
||||||
run_once: True
|
run_once: True
|
||||||
with_items: "{{ service_ks_register_users + service_ks_register_user_roles }}"
|
|
||||||
delegate_to: "{{ service_ks_register_delegate_host }}"
|
|
||||||
loop_control:
|
|
||||||
label:
|
|
||||||
user: "{{ item.user }}"
|
|
||||||
role: "{{ item.role }}"
|
|
||||||
project: "{{ item.project }}"
|
|
||||||
register: service_ks_register_result
|
|
||||||
until: service_ks_register_result is success
|
|
||||||
retries: "{{ service_ks_register_retries }}"
|
|
||||||
delay: "{{ service_ks_register_delay }}"
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user