Merge "Add retries to keystone resource registration tasks"

This commit is contained in:
Zuul 2019-09-20 17:20:53 +00:00 committed by Gerrit Code Review
commit 6211aab111
2 changed files with 28 additions and 0 deletions

View File

@ -12,3 +12,7 @@ service_ks_register_delegate_host: "{{ groups['control'][0] }}"
service_ks_register_services: []
# A list of users and associated roles for this service to register with Keystone
service_ks_register_users: []
# Number of retries for each task.
service_ks_register_retries: 5
# Delay between task retries.
service_ks_register_delay: 10

View File

@ -14,6 +14,10 @@
run_once: True
loop: "{{ service_ks_register_services }}"
delegate_to: "{{ service_ks_register_delegate_host }}"
register: service_ks_register_result
until: service_ks_register_result is success
retries: "{{ service_ks_register_retries }}"
delay: "{{ service_ks_register_delay }}"
- name: Creating the {{ project_name }} endpoints
become: true
@ -33,6 +37,10 @@
- "{{ service_ks_register_services }}"
- endpoints
delegate_to: "{{ service_ks_register_delegate_host }}"
register: service_ks_register_result
until: service_ks_register_result is success
retries: "{{ service_ks_register_retries }}"
delay: "{{ service_ks_register_delay }}"
- name: Creating the {{ project_name }} service project
become: true
@ -48,6 +56,10 @@
run_once: True
with_items: "{{ service_ks_register_users | map(attribute='project') | unique | list }}"
delegate_to: "{{ service_ks_register_delegate_host }}"
register: service_ks_register_result
until: service_ks_register_result is success
retries: "{{ service_ks_register_retries }}"
delay: "{{ service_ks_register_delay }}"
- name: Creating the {{ project_name }} service users
become: true
@ -69,6 +81,10 @@
label:
user: "{{ item.user }}"
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: Creating the {{ project_name }} service roles
become: true
@ -83,6 +99,10 @@
run_once: True
with_items: "{{ service_ks_register_users | map(attribute='role') | unique | list }}"
delegate_to: "{{ service_ks_register_delegate_host }}"
register: service_ks_register_result
until: service_ks_register_result is success
retries: "{{ service_ks_register_retries }}"
delay: "{{ service_ks_register_delay }}"
- name: Granting the {{ project_name }} service user roles
become: true
@ -105,3 +125,7 @@
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 }}"