setup: allow custom conductor host

This patch allows using a custom conductor host to do all the
deployment and setup steps when installing a brand new compute
node such as adding cell mappings, etc.

Change-Id: I61fc92d17d32e367ac133000d06bc83358735312
This commit is contained in:
Mohammed Naser 2019-01-05 16:05:10 -05:00
parent ab4764a079
commit 49259b937d
4 changed files with 9 additions and 8 deletions

View File

@ -32,6 +32,10 @@ debug: False
nova_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
nova_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((nova_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}"
# Set the host which will run compute initialization tasks such as checking
# for a compute node to be up and running cell discovery.
nova_conductor_setup_host: "{{ groups[nova_services['nova-conductor']['group']][0] }}"
# Set the package install state for distribution and pip packages
# Options are 'present' and 'latest'
nova_package_state: "latest"

View File

@ -197,12 +197,11 @@
# where we want to isolate the clouds.yaml configuration,
# rather than have it implemented on all compute nodes.
- import_tasks: nova_compute_wait.yml
delegate_to: "{{ first_conductor }}"
delegate_to: "{{ nova_conductor_setup_host }}"
when:
- "nova_services['nova-compute']['group'] in group_names"
- "nova_discover_hosts_in_cells_interval | int < 1"
vars:
first_conductor: "{{ groups[nova_services['nova-conductor']['group']][0] }}"
compute_host_to_wait_for: "{{ ansible_nodename }}"
tags:
- nova-config
@ -212,11 +211,9 @@
# the database connection string and therefore
# cannot run nova-manage.
- import_tasks: nova_db_post_setup.yml
delegate_to: "{{ first_conductor }}"
delegate_to: "{{ nova_conductor_setup_host }}"
run_once: true
when:
- "nova_services['nova-compute']['group'] in group_names"
vars:
first_conductor: "{{ groups[nova_services['nova-conductor']['group']][0] }}"
tags:
- nova-config

View File

@ -19,7 +19,7 @@
- name: Set the delegated task facts
set_fact:
_wait_nova_bin: "{{ hostvars[first_conductor]['nova_bin'] | default(nova_bin) }}"
_wait_nova_bin: "{{ hostvars[nova_conductor_setup_host]['nova_bin'] | default(nova_bin) }}"
- block:
- name: Wait for the nova-compute service to initialize

View File

@ -15,8 +15,8 @@
- name: Set the delegated task facts
set_fact:
_db_nova_bin: "{{ hostvars[first_conductor]['nova_bin'] | default(nova_bin) }}"
_db_nova_system_user_name: "{{ hostvars[first_conductor]['nova_system_user_name'] | default(nova_system_user_name) }}"
_db_nova_bin: "{{ hostvars[nova_conductor_setup_host]['nova_bin'] | default(nova_bin) }}"
_db_nova_system_user_name: "{{ hostvars[nova_conductor_setup_host]['nova_system_user_name'] | default(nova_system_user_name) }}"
# This needs to be done after Compute hosts are added.
- name: Perform a cell_v2 discover