Browse Source

Adds option to skip overcloud nodes setup

When baremetal nodes are used, there is no
need to set up virt nodes. This commit will
skip setting up overcloud virt nodes if the
overcloud_nodes variable is empty.

The source of instackenv.json file is set as
a variable so a ready file can be imported.

Partial-Bug: 1571028

Change-Id: I41d315aa3eedbcea9f4841a5572b1c55f400d873
changes/15/309215/5
Ronelle Landy 6 years ago
committed by John Trowbridge
parent
commit
d62acadd4d
  1. 2
      playbooks/roles/libvirt/defaults/main.yml
  2. 6
      playbooks/roles/libvirt/setup/overcloud/tasks/main.yml

2
playbooks/roles/libvirt/defaults/main.yml

@ -18,3 +18,5 @@ libvirt_arch: x86_64
# how many times to try getting the undercloud ip
# address before giving up.
undercloud_ip_retries: 20
undercloud_instackenv_template: instackenv.json.j2

6
playbooks/roles/libvirt/setup/overcloud/tasks/main.yml

@ -3,6 +3,7 @@
nodes: "{{ overcloud_nodes }}"
networks: "{{ networks }}"
register: node_mac_map
when: overcloud_nodes
- name: Ensure volume pool directory exists
file:
@ -38,6 +39,7 @@
environment:
LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}"
with_items: "{{ overcloud_nodes }}"
when: overcloud_nodes
- name: Create overcloud vm storage
command: >
@ -48,6 +50,7 @@
LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}"
when: item|failed
with_items: "{{ overcloud_vol_check.results }}"
when: overcloud_nodes
- name: Define overcloud vms
virt:
@ -56,8 +59,9 @@
xml: "{{ lookup('template', 'baremetalvm.xml.j2') }}"
uri: "{{ libvirt_uri }}"
with_items: "{{ overcloud_nodes }}"
when: overcloud_nodes
- name: Write instackenv script
template:
src: instackenv.json.j2
src: "{{ undercloud_instackenv_template }}"
dest: "{{ working_dir }}/instackenv.json"

Loading…
Cancel
Save