Switch connection/become settings for nova

Typically nova_compute is on localhost, so in
https://review.openstack.org/582957 we made the
change to set connection/become accordingly, but
as it turns out ironic does not deploy compute
on to localhost so that patch broke the ironic
tests.

So, given this is much the same requirement as
cinder's, we implement the same hack as done in
https://review.openstack.org/582579

Change-Id: Icf50423576cd95a891da743f2b8b7c01e81ceb38
This commit is contained in:
Jesse Pretorius 2018-07-18 03:09:11 +01:00
parent 208a625d8c
commit 710b195bf0
1 changed files with 16 additions and 6 deletions

View File

@ -18,6 +18,14 @@
- name: Prepare for nova services
hosts: nova_all
remote_user: root
# Some services run on localhost. For that to work,
# we need to sudo. Ideally it should rather be broken
# out into its own playbook and use 'connection: local'
# but to do that we'd have to know which service it is
# and every role's inventory is different. So instead,
# we use this rather horrible hack.
become: "{{ inventory_hostname == 'localhost' }}"
connection: "{{ (inventory_hostname == 'localhost') | ternary('local', 'ssh') }}"
gather_facts: true
any_errors_fatal: true
vars:
@ -88,12 +96,14 @@
- name: Deploy nova compute
hosts: "nova_compute"
# This set of tasks runs against localhost
# and requires root access, but tests run as
# the user running the playbook (zuul). As
# such, we use a local connection and become.
connection: local
become: yes
# Some services run on localhost. For that to work,
# we need to sudo. Ideally it should rather be broken
# out into its own playbook and use 'connection: local'
# but to do that we'd have to know which service it is
# and every role's inventory is different. So instead,
# we use this rather horrible hack.
become: "{{ inventory_hostname == 'localhost' }}"
connection: "{{ (inventory_hostname == 'localhost') | ternary('local', 'ssh') }}"
gather_facts: true
any_errors_fatal: true
roles: