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] }}" delegate_to: "{{ groups[neutron_services['neutron-server']['group']][0] }}"
when: when:
- "ansible_local['openstack_ansible']['neutron']['need_db_contract'] | bool" - "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" listen: "Restart neutron services"
- name: Start services - name: Start services

View File

@ -86,15 +86,22 @@
- neutron-config - neutron-config
- include: neutron_db_setup.yml - include: neutron_db_setup.yml
static: no
when:
- "neutron_services['neutron-server']['group'] in group_names"
tags: tags:
- neutron-config - neutron-config
- include: neutron_service_setup.yml - 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: tags:
- neutron-config - neutron-config
- include: neutron_l3_ha.yml - include: neutron_l3_ha.yml
static: no
when: when:
- "neutron_services['neutron-l3-agent']['group'] in group_names" - "neutron_services['neutron-l3-agent']['group'] in group_names"
tags: tags:

View File

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

View File

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