ansible/roles/copr/backend/files/provision/builderpb_nova.yml
Pavel Raiskup 249069afa5 copr: builders: cut the image name definition to group_vars
This will allow us to temporarily affect staging instance only,
and test that the images are actually OK.  We should though put
the timestamp to the image name.
2020-04-24 21:34:08 +02:00

49 lines
1.2 KiB
YAML

- name: check/create instance
hosts: 127.0.0.1
gather_facts: False
vars_files:
- vars.yml
- nova_cloud_vars.yml
vars:
keypair: buildsys
max_spawn_time: 1100
spawning_vm_user: "fedora"
image_name: "{{ builder_images.x86_64 }}"
tasks:
- name: generate builder name
local_action: set_fact vm_name="Copr_builder_{{ 999999999 | random }}"
- debug: msg="vm_name={{ vm_name }}"
- include: "spinup_nova_task.yml"
- debug: msg="VM_IP={{ builder_ip }}"
- name: wait for he host to be hot
local_action: wait_for host={{ builder_ip }} port=22 delay=1 timeout=1100
- name: wait until ssh is available
local_action: shell false; until [ "$?" -eq "0" ]; do sleep 2; ssh -o PasswordAuthentication=no {{ spawning_vm_user|default('fedora') }}@{{ builder_ip }} 'echo foobar' 2>/dev/null; done
async: 600
poll: 2
- name: provision builder
hosts: builder_temp_group
gather_facts: True
sudo: True
user: fedora
vars_files:
- vars.yml
- nova_cloud_vars.yml
vars:
ansible_python_interpreter: /usr/bin/python3
tasks:
- include: "provision_builder_tasks.yml"
- include: "offloading_hack.yml"