57 lines
2.0 KiB
YAML
57 lines
2.0 KiB
YAML
|
---
|
||
|
- name: Configure a Buildbot worker for Zcash CI
|
||
|
hosts: zcash-ci-worker-unix
|
||
|
become: true
|
||
|
gather_facts: False
|
||
|
|
||
|
pre_tasks:
|
||
|
- set_fact:
|
||
|
python_raw: "test -e /usr/bin/python || test -e /usr/bin/python2 || test -e /usr/bin/python2.7 || test -e /usr/local/bin/python2.7 || (test -e /usr/bin/apt && apt -qqy update && apt install -qqy python) || (test -e /usr/bin/dnf && dnf install -qqy python2) || (test -e /usr/sbin/pkg && pkg install -qqy python2)"
|
||
|
- name: Install Python 2 for Ansible and Buildbot [bash]
|
||
|
raw: bash -c "'{{ python_raw }}'"
|
||
|
ignore_errors: true
|
||
|
register: output
|
||
|
changed_when:
|
||
|
- output.stdout != ""
|
||
|
- output.stdout != "\r\n"
|
||
|
- name: Install Python 2 for Ansible and Buildbot [tcsh]
|
||
|
raw: tcsh -c "{{ python_raw }}"
|
||
|
ignore_errors: true
|
||
|
register: output
|
||
|
changed_when:
|
||
|
- output.stdout != ""
|
||
|
- output.stdout != "\r\n"
|
||
|
- name: Gathering Facts
|
||
|
setup:
|
||
|
|
||
|
tasks:
|
||
|
- name: Get default dependencies
|
||
|
include_vars: "vars/default.yml"
|
||
|
|
||
|
- name: Get dependencies for distribution
|
||
|
include_vars: "{{ item }}"
|
||
|
with_first_found:
|
||
|
- files:
|
||
|
- "vars/{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
|
||
|
- "vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version | int }}.yml"
|
||
|
- "vars/{{ ansible_distribution }}.yml"
|
||
|
- "vars/{{ ansible_os_family }}.yml"
|
||
|
skip: true
|
||
|
|
||
|
- name: Collate dependencies
|
||
|
set_fact:
|
||
|
package_deps: "{{ buildbot_deps + fetch_deps + conf_deps + build_deps + link_deps + dist_deps }}"
|
||
|
python_modules: "{{ buildbot_modules + rpc_test_modules }}"
|
||
|
|
||
|
- name: Install required packages
|
||
|
package:
|
||
|
name: "{{ item }}"
|
||
|
state: present
|
||
|
with_items: "{{ package_deps }}"
|
||
|
|
||
|
- name: Install required Python modules
|
||
|
pip:
|
||
|
name: "{{ item }}"
|
||
|
state: latest
|
||
|
with_items: "{{ python_modules }}"
|