diff --git a/roles/copr/backend/files/provision/builderpb_ppc64le.yml b/roles/copr/backend/files/provision/builderpb_ppc64le.yml new file mode 100644 index 0000000000..9013d22c28 --- /dev/null +++ b/roles/copr/backend/files/provision/builderpb_ppc64le.yml @@ -0,0 +1,30 @@ +- name: check/create instance + hosts: rh-power2.fit.vutbr.cz + gather_facts: False + + tasks: + - name: spin up VM + command: /home/msuchy/bin/get-one-vm.sh + register: get_one + + - debug: msg="{{ get_one.stdout }}" + + - set_fact: builder_ip="{{ get_one.stdout|extract_ip_from_stdout() }}" + + - name: wait for he host to be hot + local_action: wait_for host={{ builder_ip }} port=22 delay=1 timeout=600 + + - name: add builder ip to the special group + local_action: add_host hostname={{ builder_ip }} groupname=builder_temp_group + +- name: provision builder + hosts: builder_temp_group + gather_facts: False + user: root + + vars: + # pass this options if you need to create new base image from snapshot + #prepare_base_image: True + + tasks: + - include: "provision_builder_tasks.yml" diff --git a/roles/copr/backend/files/provision/filter_plugins/os_nova.py b/roles/copr/backend/files/provision/filter_plugins/os_nova.py index c2a8ca692d..9b7386d856 100644 --- a/roles/copr/backend/files/provision/filter_plugins/os_nova.py +++ b/roles/copr/backend/files/provision/filter_plugins/os_nova.py @@ -1,4 +1,10 @@ from novaclient.v1_1.client import Client +import re + +def extract_ip_from_stdout(output): + match = re.search(r'IP=([^\{\}"]+)', result, re.MULTILINE) + if match: + return match.group(1) def nova_result_to_builder_ip(nova_result, network_name):