tenks/playbooks/tenks-deploy-teardown/pre.yml
Will Szumski 871d3cfd88 Use zuul checkout for stackhpc-libvirt roles
This allows us to use the Depends-On: syntax in future commits.

Depends-On: https://review.opendev.org/#/c/618511/
Depends-On: https://github.com/stackhpc/ansible-role-libvirt-vm/pull/29
Change-Id: I4007edf0939d21115b0e2699857a4593cae30b74
2019-05-07 16:17:24 +00:00

58 lines
1.8 KiB
YAML

---
- hosts: all
pre_tasks:
- name: Include common variables
include_vars: common.yml
roles:
- role: tenks-diagnostics
tenks_diagnostics_phase: "pre"
tenks_diagnostics_log_dir: "{{ logs_dir }}"
- role: tenks-ci-prep
tasks:
- name: Ensure config directory exists
file:
path: "{{ config_dir }}"
state: "directory"
- name: Template tenks overrides
template:
src: tenks-overrides.yml.j2
dest: "{{ tenks_overrides_path }}"
- name: Create virtualenv for tenks
pip:
requirements: "{{ tenks_src_dir }}/requirements.txt"
virtualenv: "{{ tenks_venv }}"
- name: Template requirements overrides
template:
src: requirements-overrides.yml.j2
dest: "{{ tenks_requirements_overrides_path }}"
- name: Install Ansible Galaxy dependencies
vars:
ansible_galaxy_bin: "{{ tenks_venv }}/bin/ansible-galaxy"
command:
cmd: >-
{{ ansible_galaxy_bin }} install -r {{ tenks_src_dir }}/requirements.yml
-p {{ tenks_src_dir }}/ansible/roles
chdir: "{{ tenks_src_dir }}"
- name: Override Galaxy dependencies with equivalent modules from the zuul checkout
# We override so that as we add more dependenices we won't have to keep two files in
# sync
vars:
ansible_galaxy_bin: "{{ tenks_venv }}/bin/ansible-galaxy"
command:
cmd: >-
{{ ansible_galaxy_bin }} install -f -r "{{ tenks_requirements_overrides_path }}"
-p {{ tenks_src_dir }}/ansible/roles
chdir: "{{ tenks_src_dir }}"
- name: Ensure network bridge for physnet1 exists
command: "{{ item }}"
become: true
with_items:
- "ip l add breth1 type bridge"
- "ip l set breth1 up"