Commit 72e1b4d9 authored by Eric Pellegrini's avatar Eric Pellegrini

clearly separatation for input variables of the different tasks of os_users role

parent a1b713e2
......@@ -8,7 +8,7 @@
cloud: "{{ item.cloud | default(omit) }}"
role: "{{ item.role }}"
project: "{{ item.project }}"
loop: "{{ users['roles'] | default([]) }}"
loop: "{{ roles | default([]) }}"
environment:
OS_IDENTITY_API_VERSION: 3
......@@ -11,22 +11,27 @@
default_project: "{{ item.user_auth.default_project | default(omit) }}"
email: "{{ item.user_auth.email | default(omit) }}"
region_name: "{{ item.user_auth.region_name | default(omit) }}"
loop: "{{ users['users'] | default([]) }}"
loop: "{{ users | default([]) }}"
environment:
OS_IDENTITY_API_VERSION: 3
register: os_user_output
- set_fact:
users: "{{ users | combine({'users':temp}) }}"
vars:
temp: "{{ users['users'] | update_list_dict(os_user_output.results,['user','domain_id'],['user_auth','domain_id']) }}"
- block:
- name: update users dicts with domain_id
set_fact:
users: "{{ users | combine({'users':temp}) }}"
vars:
temp: "{{ users | update_list_dict(os_user_output.results,['user','domain_id'],['user_auth','domain_id']) }}"
- set_fact:
users: "{{ users | combine({'users':temp}) }}"
vars:
temp: "{{ users['users'] | update_list_dict(os_user_output.results,['user','default_project_id'],['user_auth','project_id']) }}"
- name: update users dicts with project_id
set_fact:
users: "{{ users | combine({'users':temp}) }}"
vars:
temp: "{{ users | update_list_dict(os_user_output.results,['user','default_project_id'],['user_auth','project_id']) }}"
- set_fact:
users: "{{ users | combine({'users':temp}) }}"
vars:
temp: "{{ users['users'] | update_list_dict(os_user_output.results,['user','id'],['user_auth','id']) }}"
- name: update users dicts with id
set_fact:
users: "{{ users | combine({'users':temp}) }}"
vars:
temp: "{{ users | update_list_dict(os_user_output.results,['user','id'],['user_auth','id']) }}"
when: (users | length > 0)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment