Port with_ loop variable syntax to Ansbile 2

Migrate to full variable syntax in with_ loop
instead of bare variables for:
- ceph
- ceilometer
- glance
- heat
- horizon
- keystone
- mariadb
- memcached
- neutron
- nova
- rabbitmq

Change-Id: Ib925b4ecea47ac758a77739c9c7e140f06933b08
Partial-Implements: blueprint ansible2
This commit is contained in:
Duong Ha-Quang 2016-08-08 22:37:30 +07:00
parent aa5864fc40
commit 34975e291e
13 changed files with 58 additions and 58 deletions

View File

@ -59,8 +59,8 @@
{ name: ceilometer_notification, group: ceilometer-notification },
{ name: ceilometer_collector, group: ceilometer-collector },
{ name: ceilometer_compute, group: ceilometer-compute }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"
- include: start.yml
when: remove_containers.changed
@ -80,5 +80,5 @@
{ name: ceilometer_notification, group: ceilometer-notification },
{ name: ceilometer_collector, group: ceilometer-collector },
{ name: ceilometer_compute, group: ceilometer-compute }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"

View File

@ -123,8 +123,8 @@
- item[2]['rc'] == 1
with_together:
- [{ name: ceph_mon, group: ceph-mon }]
- ceph_mon_container_envs.results
- ceph_mon_check_results.results
- "{{ ceph_mon_container_envs.results }}"
- "{{ ceph_mon_check_results.results }}"
- name: Remove the ceph_osd containers
kolla_docker:
@ -137,9 +137,9 @@
- item[2]['rc'] == 1
- osds
with_together:
- osd_ids.results
- ceph_osd_container_envs.results
- ceph_osd_check_results.results
- "{{ osd_ids.results }}"
- "{{ ceph_osd_container_envs.results }}"
- "{{ ceph_osd_check_results.results }}"
- name: Remove the ceph_rgw container
kolla_docker:
@ -153,8 +153,8 @@
- item[2]['rc'] == 1
with_together:
- [{ name: ceph_rgw, group: ceph-rgw }]
- ceph_rgw_container_envs.results
- ceph_rgw_check_results.results
- "{{ ceph_rgw_container_envs.results }}"
- "{{ ceph_rgw_check_results.results }}"
- include: start_mons.yml
when:
@ -181,8 +181,8 @@
- item[0]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- item[1]['rc'] == 1
with_together:
- ceph_mon_container_envs.results
- ceph_mon_check_results.results
- "{{ ceph_mon_container_envs.results }}"
- "{{ ceph_mon_check_results.results }}"
- name: Restart the ceph_osd container
kolla_docker:
@ -195,9 +195,9 @@
- item[2]['rc'] == 1
- osds
with_together:
- osd_ids.results
- ceph_osd_container_envs.results
- ceph_osd_check_results.results
- "{{ osd_ids.results }}"
- "{{ ceph_osd_container_envs.results }}"
- "{{ ceph_osd_check_results.results }}"
- name: Restart the ceph_rgw container
kolla_docker:
@ -210,5 +210,5 @@
- item[0]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- item[1]['rc'] == 1
with_together:
- ceph_rgw_container_envs.results
- ceph_rgw_check_results.results
- "{{ ceph_rgw_container_envs.results }}"
- "{{ ceph_rgw_check_results.results }}"

View File

@ -46,6 +46,6 @@
- "/var/lib/ceph/osd/{{ item.1['fs_uuid'] }}:/var/lib/ceph/osd/ceph-{{ item.0.stdout }}"
- "kolla_logs:/var/log/kolla/"
with_together:
- id.results
- osds
- "{{ id.results }}"
- "{{ osds }}"
when: osds

View File

@ -40,8 +40,8 @@
- item[2]['rc'] == 1
with_together:
- "{{ glance_service_groups }}"
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"
- include: bootstrap_service.yml
@ -59,5 +59,5 @@
- item[2]['rc'] == 1
with_together:
- "{{ glance_service_groups }}"
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"

View File

@ -51,8 +51,8 @@
- [{ name: heat_api, group: heat-api },
{ name: heat_api_cfn, group: heat-api-cfn },
{ name: heat_engine, group: heat-engine }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"
- include: start.yml
when: remove_containers.changed
@ -70,5 +70,5 @@
- [{ name: heat_api, group: heat-api },
{ name: heat_api_cfn, group: heat-api-cfn },
{ name: heat_engine, group: heat-engine }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"

View File

@ -43,8 +43,8 @@
- inventory_hostname in groups[item[0]['group']]
with_together:
- [{ name: horizon, group: horizon }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"
- include: start.yml
when: remove_containers.changed
@ -60,5 +60,5 @@
- inventory_hostname in groups[item[0]['group']]
with_together:
- [{ name: horizon, group: horizon }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"

View File

@ -43,8 +43,8 @@
- inventory_hostname in groups[item[0]['group']]
with_together:
- [{ name: keystone, group: keystone }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"
- include: start.yml
when: remove_containers.changed
@ -60,5 +60,5 @@
- inventory_hostname in groups[item[0]['group']]
with_together:
- [{ name: keystone, group: keystone }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"

View File

@ -43,8 +43,8 @@
- inventory_hostname in groups[item[0]['group']]
with_together:
- [{ name: mariadb, group: mariadb }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"
- include: start.yml
when: remove_containers.changed
@ -60,7 +60,7 @@
- inventory_hostname in groups[item[0]['group']]
with_together:
- [{ name: mariadb, group: mariadb }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"
- include: check.yml

View File

@ -43,8 +43,8 @@
- inventory_hostname in groups[item[0]['group']]
with_together:
- [{ name: memcached, group: memcached }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"
- include: start.yml
when: remove_containers.changed
@ -60,5 +60,5 @@
- inventory_hostname in groups[item[0]['group']]
with_together:
- [{ name: memcached, group: memcached }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"

View File

@ -182,8 +182,8 @@
{ name: neutron_l3_agent, group: neutron-l3-agent },
{ name: neutron_lbaas_agent, group: neutron-lbaas-agent, enabled: "{{ enable_neutron_lbaas | bool }}" },
{ name: neutron_metadata_agent, group: neutron-metadata-agent }]
- neutron_container_envs.results
- neutron_check_results.results
- "{{ neutron_container_envs.results }}"
- "{{ neutron_check_results.results }}"
- name: Remove the neutron_openvswitch_agent container
kolla_docker:
@ -248,8 +248,8 @@
{ name: neutron_l3_agent, group: neutron-l3-agent },
{ name: neutron_lbaas_agent, group: neutron-lbaas-agent, enabled: "{{ enable_neutron_lbaas | bool }}" },
{ name: neutron_metadata_agent, group: neutron-metadata-agent }]
- neutron_container_envs.results
- neutron_check_results.results
- "{{ neutron_container_envs.results }}"
- "{{ neutron_check_results.results }}"
- name: Restart the neutron_openvswitch_agent container
kolla_docker:

View File

@ -175,8 +175,8 @@
{ name: nova_api, group: nova-api },
{ name: nova_consoleauth, group: nova-consoleauth },
{ name: nova_scheduler, group: nova-scheduler }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"
- name: Remove nova_compute container
kolla_docker:
@ -266,8 +266,8 @@
{ name: nova_api, group: nova-api },
{ name: nova_consoleauth, group: nova-consoleauth },
{ name: nova_scheduler, group: nova-scheduler }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"
- name: Restart the nova_compute container
kolla_docker:

View File

@ -3,10 +3,10 @@
command: "getent ahostsv4 {{ hostvars[item]['ansible_hostname'] }}"
changed_when: false
register: rabbitmq_hostnames
with_items: groups['rabbitmq']
with_items: "{{ groups['rabbitmq'] }}"
- fail: msg="Hostname has to resolve to IP address of api_interface"
with_items: rabbitmq_hostnames.results
with_items: "{{ rabbitmq_hostnames.results }}"
when: "'{{ hostvars[item['item']]['ansible_' + hostvars[item['item']]['api_interface']]['ipv4']['address'] }}' not in '{{ item.stdout }}'"
- name: Creating rabbitmq volume

View File

@ -43,8 +43,8 @@
- inventory_hostname in groups[item[0]['group']]
with_together:
- [{ name: rabbitmq, group: rabbitmq }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"
- include: start.yml
when: remove_containers.changed
@ -60,5 +60,5 @@
- inventory_hostname in groups[item[0]['group']]
with_together:
- [{ name: rabbitmq, group: rabbitmq }]
- container_envs.results
- check_results.results
- "{{ container_envs.results }}"
- "{{ check_results.results }}"