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
This commit is contained in:
Ronelle Landy 2016-04-21 19:38:13 -04:00 committed by John Trowbridge
parent c4f451c440
commit d62acadd4d
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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"