Merge "Switch from run_once back to inventory scoping"

This commit is contained in:
Jenkins 2017-07-06 21:20:21 +00:00 committed by Gerrit Code Review
commit dc70e20412
4 changed files with 13 additions and 10 deletions

View File

@ -70,7 +70,8 @@
delegate_to: "{{ groups[neutron_services['neutron-server']['group']][0] }}"
when:
- "ansible_local['openstack_ansible']['neutron']['need_db_contract'] | bool"
run_once: yes
- "neutron_services['neutron-server']['group'] in group_names"
- "inventory_hostname == ansible_play_hosts[0]"
listen: "Restart neutron services"
- name: Start services

View File

@ -86,15 +86,22 @@
- neutron-config
- include: neutron_db_setup.yml
static: no
when:
- "neutron_services['neutron-server']['group'] in group_names"
tags:
- neutron-config
- include: neutron_service_setup.yml
run_once: yes
static: no
when:
- "neutron_services['neutron-server']['group'] in group_names"
- "inventory_hostname == ansible_play_hosts[0]"
tags:
- neutron-config
- include: neutron_l3_ha.yml
static: no
when:
- "neutron_services['neutron-l3-agent']['group'] in group_names"
tags:

View File

@ -17,10 +17,9 @@
command: "{{ neutron_bin }}/neutron-db-manage upgrade --expand"
become: yes
become_user: "{{ neutron_system_user_name }}"
delegate_to: "{{ groups[neutron_services['neutron-server']['group']][0] }}"
when:
- "ansible_local['openstack_ansible']['neutron']['need_db_expand'] | bool"
run_once: yes
- "inventory_hostname == ansible_play_hosts[0]"
- name: Disable the db expand fact
ini_file:
@ -33,13 +32,13 @@
command: "{{ neutron_bin }}/neutron-db-manage has_offline_migrations"
become: yes
become_user: "{{ neutron_system_user_name }}"
delegate_to: "{{ groups[neutron_services['neutron-server']['group']][0] }}"
when:
- "inventory_hostname == ansible_play_hosts[0]"
changed_when: false
register: _offline_migrations_check
failed_when:
- "_offline_migrations_check.rc == 1"
- "'Need to apply migrations from neutron contract branch' not in _offline_migrations_check.stdout"
run_once: yes
- name: Set the fact for the required offline migrations
ini_file:

View File

@ -29,7 +29,6 @@
until: add_service|success
retries: 5
delay: 2
run_once: yes
# Create an admin user
- name: Ensure neutron user
@ -48,7 +47,6 @@
until: add_service|success
retries: 5
delay: 10
run_once: yes
# Add a role to the user
- name: Ensure neutron user to admin role
@ -67,7 +65,6 @@
until: add_service|success
retries: 5
delay: 10
run_once: yes
# Create an endpoint
- name: Ensure neutron endpoint
@ -92,4 +89,3 @@
until: add_service|success
retries: 5
delay: 10
run_once: yes