Provide a human-readable output on role executions

The output of Ansible is hard to read, so adding tasks names to
all tasks for better debugging.

Change-Id: I6e4dfa0fbcefca4521d0650d6dd46bcf753b38f8
This commit is contained in:
Ricardo Carrillo Cruz 2016-09-07 14:29:55 +02:00
parent 1b56aed513
commit fa645b641e
16 changed files with 82 additions and 41 deletions

View File

@ -1,6 +1,8 @@
---
- include: create_per_cloud_profiles_resources.yml
- name: "Processing profiles resources for cloud {{ item_cloud.name }}"
include: create_per_cloud_profiles_resources.yml
with_items: "{{ item_cloud.profiles|default([]) }}"
loop_control:
loop_var: item_profile
- include: create_per_cloud_resources.yml
- name: "Processing per cloud resources for cloud {{ item_cloud.name }}"
include: create_per_cloud_resources.yml

View File

@ -1,5 +1,6 @@
---
- os_keystone_domain:
- name: "Processing domain {{ item_domain.name }}"
os_keystone_domain:
cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item_domain.state|default(omit) }}"
name: "{{ item_domain.name }}"

View File

@ -1,5 +1,6 @@
---
- os_nova_flavor:
- name: "Processing flavor {{ item_flavor.name }}"
os_nova_flavor:
cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item_flavor.state|default(omit) }}"
name: "{{ item_flavor.name }}"

View File

@ -9,7 +9,8 @@
force: "{{ item_image.download_image_force|default(download_image_force) }}"
when: not openstack_image
when: item_image.download_image_url is defined
- os_image:
- name: "Processing image {{ item_image.name }}"
os_image:
cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item_image.state|default(omit) }}"
name: "{{ item_image.name }}"

View File

@ -1,5 +1,6 @@
---
- os_keypair:
- name: "Processing keypair {{ item_keypair.name }}"
os_keypair:
cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item_keypair.state|default(omit) }}"
name: "{{ item_keypair.name }}"

View File

@ -1,5 +1,6 @@
---
- os_network:
- name: "Processing network {{ item_network.name }}"
os_network:
cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item_network.state|default(omit) }}"
name: "{{ item_network.name }}"

View File

@ -1,5 +1,6 @@
---
- include: create_domain.yml
- name: "Processing domains resources for profile {{ item_profile }}"
include: create_domain.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='domains')|list }}"
loop_control:
loop_var: item_domain
@ -7,7 +8,8 @@
tags:
- domains
- include: create_project.yml
- name: "Processing projects resources for profile {{ item_profile }}"
include: create_project.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='projects')|list }}"
loop_control:
loop_var: item_project
@ -15,7 +17,8 @@
tags:
- projects
- include: create_user.yml
- name: "Processing users resources for profile {{ item_profile }}"
include: create_user.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='users')|list }}"
loop_control:
loop_var: item_user
@ -23,7 +26,8 @@
tags:
- users
- include: create_network.yml
- name: "Processing networks resources for profile {{ item_profile }}"
include: create_network.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='networks')|list }}"
loop_control:
loop_var: item_network
@ -31,7 +35,8 @@
tags:
- networks
- include: create_subnet.yml
- name: "Processing subnets resources for profile {{ item_profile }}"
include: create_subnet.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='subnets')|list }}"
loop_control:
loop_var: item_subnet
@ -39,7 +44,8 @@
tags:
- subnets
- include: create_router.yml
- name: "Processing routers resources for profile {{ item_profile }}"
include: create_router.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='routers')|list }}"
loop_control:
loop_var: item_router
@ -47,7 +53,8 @@
tags:
- routers
- include: create_flavor.yml
- name: "Processing flavors resources for profile {{ item_profile }}"
include: create_flavor.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='flavors')|list }}"
loop_control:
loop_var: item_flavor
@ -55,7 +62,8 @@
tags:
- flavors
- include: create_image.yml
- name: "Processing images resources for profile {{ item_profile }}"
include: create_image.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='images')|list }}"
loop_control:
loop_var: item_image
@ -63,7 +71,8 @@
tags:
- images
- include: create_security_group.yml
- name: "Processing security_groups resources for profile {{ item_profile }}"
include: create_security_group.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='security_groups')|list }}"
loop_control:
loop_var: item_security_group
@ -71,7 +80,8 @@
tags:
- security_groups
- include: create_security_group_rule.yml
- name: "Processing security_groups_rules resources for profile {{ item_profile }}"
include: create_security_group_rule.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='security_groups_rules')|list }}"
loop_control:
loop_var: item_security_group_rule
@ -79,7 +89,8 @@
tags:
- security_groups_rules
- include: create_keypair.yml
- name: "Processing keypairs resources for profile {{ item_profile }}"
include: create_keypair.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='keypairs')|list }}"
loop_control:
loop_var: item_keypair
@ -87,7 +98,8 @@
tags:
- keypairs
- include: create_volume.yml
- name: "Processing volumes resources for profile {{ item_profile }}"
include: create_volume.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='volumes')|list }}"
loop_control:
loop_var: item_volume
@ -95,7 +107,8 @@
tags:
- volumes
- include: create_server.yml
- name: "Processing servers resources for profile {{ item_profile }}"
include: create_server.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='servers')|list }}"
loop_control:
loop_var: item_server

View File

@ -1,89 +1,102 @@
---
- include: create_domain.yml
- name: "Processing per cloud domains"
include: create_domain.yml
with_items: "{{ item_cloud.domains|default([]) }}"
loop_control:
loop_var: item_domain
tags:
- domains
- include: create_project.yml
- name: "Processing per cloud projects"
include: create_project.yml
with_items: "{{ item_cloud.projects|default([]) }}"
loop_control:
loop_var: item_project
tags:
- projects
- include: create_user.yml
- name: "Processing per cloud users"
include: create_user.yml
with_items: "{{ item_cloud.users|default([]) }}"
loop_control:
loop_var: item_user
tags:
- users
- include: create_network.yml
- name: "Processing per cloud networks"
include: create_network.yml
with_items: "{{ item_cloud.networks|default([]) }}"
loop_control:
loop_var: item_network
tags:
- networks
- include: create_subnet.yml
- name: "Processing per cloud subnets"
include: create_subnet.yml
with_items: "{{ item_cloud.subnets|default([]) }}"
loop_control:
loop_var: item_subnet
tags:
- subnets
- include: create_router.yml
- name: "Processing per cloud routers"
include: create_router.yml
with_items: "{{ item_cloud.routers|default([]) }}"
loop_control:
loop_var: item_router
tags:
- routers
- include: create_flavor.yml
- name: "Processing per cloud flavors"
include: create_flavor.yml
with_items: "{{ item_cloud.flavors|default([]) }}"
loop_control:
loop_var: item_flavor
tags:
- flavors
- include: create_image.yml
- name: "Processing per cloud images"
include: create_image.yml
with_items: "{{ item_cloud.images|default([]) }}"
loop_control:
loop_var: item_image
tags:
- images
- include: create_security_group.yml
- name: "Processing per cloud security_groups"
include: create_security_group.yml
with_items: "{{ item_cloud.security_groups|default([]) }}"
loop_control:
loop_var: item_security_group
tags:
- security_groups
- include: create_security_group_rule.yml
- name: "Processing per cloud security_group_rules"
include: create_security_group_rule.yml
with_items: "{{ item_cloud.security_groups_rules|default([]) }}"
loop_control:
loop_var: item_security_group_rule
tags:
- security_groups_rules
- include: create_keypair.yml
- name: "Processing per cloud keypairs"
include: create_keypair.yml
with_items: "{{ item_cloud.keypairs|default([]) }}"
loop_control:
loop_var: item_keypair
tags:
- keypairs
- include: create_volume.yml
- name: "Processing per cloud volumes"
include: create_volume.yml
with_items: "{{ item_cloud.volumes|default([]) }}"
loop_control:
loop_var: item_volume
tags:
- volumes
- include: create_server.yml
- name: "Processing per cloud servers"
include: create_server.yml
with_items: "{{ item_cloud.servers|default([]) }}"
loop_control:
loop_var: item_server

View File

@ -1,5 +1,6 @@
---
- os_project:
- name: "Processing project {{ item_project.name }}"
os_project:
cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item_project.state|default(omit) }}"
name: "{{ item_project.name }}"

View File

@ -1,5 +1,6 @@
---
- os_router:
- name: "Processing router {{ item_router.name }}"
os_router:
cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item_router.state|default(omit) }}"
name: "{{ item_router.name }}"

View File

@ -1,5 +1,6 @@
---
- os_security_group_rule:
- name: "Processing security_group_rule"
os_security_group_rule:
cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item_security_group_rule.state|default(omit) }}"
security_group: "{{ item_security_group_rule.security_group }}"

View File

@ -2,7 +2,8 @@
- include: generate_keypair.yml
when: generate_keypair|bool
- os_server:
- name: "Processing server {{ item_server.name }}"
os_server:
cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item_server.state|default(omit) }}"
name: "{{ item_server.name.partition('.')[0] }}{{ '' if item_server.node_count is not defined else item }}{{ item_server.name.partition('.')[1] + item_server.name.partition('.')[2] }}"

View File

@ -1,5 +1,6 @@
---
- os_subnet:
- name: "Processing subnet {{ item_subnet.name }}"
os_subnet:
cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item_subnet.state|default(omit) }}"
name: "{{ item_subnet.name }}"

View File

@ -1,5 +1,6 @@
---
- os_user:
- name: "Processing user {{ item_user.name }}"
os_user:
cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item_user.state|default(omit) }}"
name: "{{ item_user.name }}"

View File

@ -1,5 +1,6 @@
---
- os_volume:
- name: "Processing volume {{ item_volume.name }}"
os_volume:
cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item_volume.state|default(omit) }}"
name: "{{ item_volume.name }}"

View File

@ -1,5 +1,6 @@
---
- include: create_clouds_resources.yml
- name: "Processing clouds resources"
include: create_clouds_resources.yml
with_items: "{{ clouds if cloud is not defined else clouds|selectattr('name', 'equalto', cloud)|list }}"
loop_control:
loop_var: item_cloud