windmill/tests/playbooks/pre.yaml

68 lines
2.0 KiB
YAML

---
- hosts: all
tasks:
- name: Disable extra wheels mirror
become: true
lineinfile:
dest: /etc/pip.conf
regexp: ^extra-index-url
state: absent
- name: Remove exclude from dnf.conf
become: true
lineinfile:
dest: /etc/dnf/dnf.conf
regexp: ^exclude
state: absent
when: ansible_os_family == 'RedHat'
- name: Install ansible configuration file
template:
dest: ~/.ansible.cfg
src: "{{ zuul.executor.work_root }}/{{ zuul.projects['opendev.org/windmill/windmill-config'].src_dir }}/ansible/ansible.cfg"
- name: Create config directory
file:
dest: ~/.config
state: directory
- name: Symlink ansible configuration file
file:
dest: ~/.config/windmill
src: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/windmill/windmill-config'].src_dir }}"
state: link
- name: Set ARA fact for Debian
set_fact:
ara_path: /opt/venv/ansible/lib/python3.6/site-packages/ara/plugins/callbacks
when: ansible_os_family == 'Debian'
- name: Set ARA fact for RedHat
set_fact:
ara_path: /opt/venv/ansible/lib/python3.7/site-packages/ara/plugins/callbacks
when: ansible_os_family == 'RedHat'
- name: Enable ARA callback plugin
ini_file:
path: ~/.ansible.cfg
section: defaults
option: callback_plugins
value: "{{ ara_path }}"
- name: Bootstrap tox environment
args:
chdir: "{{ item }}"
shell: tox -evenv --notest
with_items:
- ~/src/opendev.org/windmill/windmill-ops
- ~/src/opendev.org/windmill/windmill
- name: Install ansible roles via galaxy
args:
chdir: "{{ item }}"
executable: /bin/bash
shell: source .tox/venv/bin/activate; ./tools/install_roles.sh --force
with_items:
- ~/src/opendev.org/windmill/windmill-ops
- ~/src/opendev.org/windmill/windmill