Merge "Define condition for the first play host one time"

This commit is contained in:
Zuul 2020-10-14 08:50:44 +00:00 committed by Gerrit Code Review
commit d2409627d1
2 changed files with 6 additions and 8 deletions

View File

@ -71,8 +71,7 @@
- import_tasks: db_setup.yml
when:
- "nova_services['nova-conductor']['group'] in group_names"
- "inventory_hostname == ((groups[nova_services['nova-conductor']['group']] | intersect(ansible_play_hosts)) | list)[0]"
- _nova_is_first_play_host
vars:
_oslodb_setup_host: "{{ nova_db_setup_host }}"
_oslodb_ansible_python_interpreter: "{{ nova_db_setup_python_interpreter }}"
@ -97,8 +96,7 @@
- import_tasks: mq_setup.yml
when:
- "nova_services['nova-conductor']['group'] in group_names"
- "inventory_hostname == ((groups[nova_services['nova-conductor']['group']] | intersect(ansible_play_hosts)) | list)[0]"
- _nova_is_first_play_host
vars:
_oslomsg_rpc_setup_host: "{{ nova_oslomsg_rpc_setup_host }}"
_oslomsg_rpc_userid: "{{ nova_oslomsg_rpc_userid }}"
@ -172,15 +170,13 @@
type: "{{ nova_service_type }}"
description: "{{ nova_service_description }}"
when:
- "nova_services['nova-conductor']['group'] in group_names"
- "inventory_hostname == ((groups['nova_conductor'] | intersect(ansible_play_hosts)) | list)[0]"
- _nova_is_first_play_host
tags:
- nova-config
- import_tasks: nova_db_setup.yml
when:
- "nova_services['nova-conductor']['group'] in group_names"
- "inventory_hostname == ((groups['nova_conductor'] | intersect(ansible_play_hosts)) | list)[0]"
- _nova_is_first_play_host
tags:
- nova-config

View File

@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
_nova_is_first_play_host: "{{ (nova_services['nova-conductor']['group'] in group_names and inventory_hostname == (groups[nova_services['nova-conductor']['group']] | intersect(ansible_play_hosts)) | first) | bool }}"
nova_venv_packages: |-
{%- set pkg_list = nova_pip_packages | union(nova_user_pip_packages) %}
{%- if nova_oslomsg_amqp1_enabled | bool %}