
This patchset moves the vino-builder image build from the images repo into the vino repo. [0] removes it from the images repo. [0] https://review.opendev.org/c/airship/images/+/786714 Change-Id: I8299045cdfaaf285e0f088b330a84e00fcb8307c
53 lines
1.6 KiB
YAML
53 lines
1.6 KiB
YAML
- name: debug print loop
|
|
debug:
|
|
msg: "outer item={{ node }} inner item={{item}}"
|
|
loop: "{{ range(0,node.count)|list }}"
|
|
|
|
- name: debug print virsh xml domain
|
|
debug:
|
|
msg: "{{ flavorTemplates[node['bmhLabels']['airshipit.org/k8s-role']]['domainTemplate'] }}"
|
|
loop: "{{ range(0,node.count)|list }}"
|
|
|
|
- name: get state of existing volumes
|
|
shell: |
|
|
virsh vol-list vino-default
|
|
register: vol_list
|
|
|
|
- name: write out domain volume request xml
|
|
copy: content="{{ flavorTemplates[node['bmhLabels']['airshipit.org/k8s-role']]['volumeTemplate'] }}" dest=/tmp/vol-{{item}}.xml
|
|
loop: "{{ range(0,node.count)|list }}"
|
|
|
|
- name: create domain volume if it doesn't exist
|
|
shell: |
|
|
virsh vol-create vino-default /tmp/vol-{{item}}.xml
|
|
loop: "{{ range(0,node.count)|list }}"
|
|
when: "node.name + '-' + item|string not in vol_list.stdout"
|
|
|
|
- name: ensure vino instance state directory exists
|
|
file:
|
|
path: /var/lib/libvirt/vino-instances
|
|
state: directory
|
|
recurse: yes
|
|
owner: root
|
|
group: root
|
|
|
|
# the virt community plugin does not handle pushing out updates
|
|
# to domains, so we must shell out here instead
|
|
|
|
- name: write out domain volume request xml
|
|
copy: content="{{ flavorTemplates[node['bmhLabels']['airshipit.org/k8s-role']]['domainTemplate'] }}" dest=/tmp/domain-{{item}}.xml
|
|
loop: "{{ range(0,node.count)|list }}"
|
|
|
|
- name: virsh define domain
|
|
shell: |
|
|
virsh define /tmp/domain-{{item}}.xml
|
|
loop: "{{ range(0,node.count)|list }}"
|
|
|
|
#- name: set vm to running
|
|
# virt:
|
|
# name: "{{ node.name + '-' + item|string}}"
|
|
# state: running
|
|
# autostart: yes
|
|
# loop: "{{ range(0,node.count)|list }}"
|
|
# ignore_errors: true
|