59 lines
1.7 KiB
YAML
59 lines
1.7 KiB
YAML
- hosts: all
|
|
vars:
|
|
workspace: /tmp/quickstart-test
|
|
local: false
|
|
roles:
|
|
- name: install-docker
|
|
use_upstream_docker: false
|
|
tasks:
|
|
- name: Install pbrx software
|
|
command: python3 -m pip install src/git.openstack.org/openstack/pbrx
|
|
become: yes
|
|
- name: Build container images
|
|
command: 'pbrx --debug build-images --prefix=zuul'
|
|
args:
|
|
chdir: '{{ zuul.projects[item].src_dir }}'
|
|
loop:
|
|
- git.openstack.org/openstack-infra/nodepool
|
|
- git.openstack.org/openstack-infra/zuul
|
|
- name: Install docker-compose and git-review
|
|
package:
|
|
name:
|
|
- docker-compose
|
|
- git-review
|
|
state: present
|
|
become: true
|
|
- name: Create workspace directory
|
|
file:
|
|
state: directory
|
|
path: "{{ workspace }}"
|
|
- name: Generate example user ssh key
|
|
command: "ssh-keygen -f {{ workspace }}/id_rsa -N ''"
|
|
args:
|
|
creates: "{{ workspace }}/id_rsa.pub"
|
|
- name: Load example user SSH key
|
|
shell: "cat {{ workspace }}/id_rsa.pub"
|
|
register: ssh_key_cat
|
|
- name: Register example user SSH key
|
|
set_fact:
|
|
ssh_public_key: "{{ ssh_key_cat.stdout }}"
|
|
- name: Start ssh-agent
|
|
command: ssh-agent
|
|
register: ssh_agent
|
|
- name: Add key to ssh agent
|
|
shell:
|
|
executable: /bin/bash
|
|
cmd: |
|
|
{{ ssh_agent.stdout }}
|
|
ssh-add {{ workspace }}/id_rsa
|
|
- block:
|
|
- name: Run tasks in ssh agent
|
|
include_tasks: main.yaml
|
|
always:
|
|
- name: Stop ssh-agent
|
|
shell:
|
|
executable: /bin/bash
|
|
cmd: |
|
|
{{ ssh_agent.stdout }}
|
|
ssh-agent -k
|