From 9eb810bb642f303e760ad5c47f12f81e83ed0074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Wed, 10 Jun 2015 15:39:46 +0200 Subject: [PATCH] experimental ppc64le playbook for copr builders --- .../files/provision/builderpb_ppc64le.yml | 30 +++++++++++++++++++ .../files/provision/filter_plugins/os_nova.py | 6 ++++ 2 files changed, 36 insertions(+) create mode 100644 roles/copr/backend/files/provision/builderpb_ppc64le.yml 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):