2020-04-01 14:12:57 -05:00
|
|
|
- import_playbook: ../install-ansible.yaml
|
2018-08-22 09:46:07 -07:00
|
|
|
vars:
|
2020-07-14 13:13:13 +10:00
|
|
|
root_rsa_key: "{{ lookup('file', zuul.executor.work_root + '/' + zuul.build + '_id_rsa', rstrip=False) }}"
|
2019-07-16 14:56:04 +10:00
|
|
|
ansible_cron_disable_job: true
|
|
|
|
cloud_launcher_disable_job: true
|
2018-08-22 09:46:07 -07:00
|
|
|
|
|
|
|
- hosts: bridge.openstack.org
|
|
|
|
become: true
|
|
|
|
tasks:
|
|
|
|
- name: Write inventory on bridge
|
|
|
|
include_role:
|
|
|
|
name: write-inventory
|
|
|
|
vars:
|
2020-05-26 15:46:41 -05:00
|
|
|
write_inventory_dest: /home/zuul/src/opendev.org/opendev/system-config/inventory/base/gate-hosts.yaml
|
2018-08-22 09:46:07 -07:00
|
|
|
write_inventory_exclude_hostvars:
|
|
|
|
- ansible_user
|
2019-07-10 10:05:18 -07:00
|
|
|
- ansible_python_interpreter
|
2020-05-08 14:15:01 -07:00
|
|
|
write_inventory_additional_hostvars:
|
2020-06-03 14:20:36 -07:00
|
|
|
public_v4: nodepool.private_ipv4
|
2020-05-08 14:15:01 -07:00
|
|
|
public_v6: nodepool.public_ipv6
|
2018-09-12 11:32:42 -06:00
|
|
|
- name: Add groups config for test nodes
|
|
|
|
template:
|
|
|
|
src: "templates/gate-groups.yaml.j2"
|
|
|
|
dest: "/etc/ansible/hosts/gate-groups.yaml"
|
2018-08-29 11:04:07 -07:00
|
|
|
- name: Update ansible.cfg to use job inventory
|
|
|
|
ini_file:
|
|
|
|
path: /etc/ansible/ansible.cfg
|
|
|
|
section: defaults
|
|
|
|
option: inventory
|
2020-05-26 15:46:41 -05:00
|
|
|
value: /home/zuul/src/opendev.org/opendev/system-config/inventory/base/gate-hosts.yaml,/home/zuul/src/opendev.org/opendev/system-config/inventory/service/groups.yaml,/etc/ansible/hosts/gate-groups.yaml
|
2018-08-22 09:46:07 -07:00
|
|
|
- name: Make host_vars directory
|
|
|
|
file:
|
|
|
|
path: "/etc/ansible/hosts/host_vars"
|
|
|
|
state: directory
|
|
|
|
- name: Make group_vars directory
|
|
|
|
file:
|
|
|
|
path: "/etc/ansible/hosts/group_vars"
|
|
|
|
state: directory
|
|
|
|
- name: Write hostvars files
|
|
|
|
vars:
|
|
|
|
bastion_ipv4: "{{ nodepool['public_ipv4'] }}"
|
|
|
|
bastion_ipv6: "{{ nodepool['public_ipv6'] }}"
|
|
|
|
bastion_public_key: "{{ lookup('file', zuul.executor.work_root + '/' + zuul.build + '_id_rsa.pub') }}"
|
2020-12-15 15:22:26 +11:00
|
|
|
iptables_test_public_tcp_ports:
|
|
|
|
# Zuul web console
|
|
|
|
- 19885
|
|
|
|
# selenium
|
|
|
|
- 4444
|
2018-08-22 09:46:07 -07:00
|
|
|
template:
|
|
|
|
src: "templates/{{ item }}.j2"
|
|
|
|
dest: "/etc/ansible/hosts/{{ item }}"
|
|
|
|
loop:
|
|
|
|
- group_vars/all.yaml
|
2018-10-31 16:13:33 -07:00
|
|
|
- group_vars/adns.yaml
|
2020-04-19 12:34:06 -05:00
|
|
|
- group_vars/eavesdrop.yaml
|
2018-08-30 12:17:31 -07:00
|
|
|
- group_vars/nodepool.yaml
|
2018-11-01 13:24:41 -07:00
|
|
|
- group_vars/ns.yaml
|
2019-01-31 09:59:26 -08:00
|
|
|
- group_vars/registry.yaml
|
2019-02-15 15:18:15 -08:00
|
|
|
- group_vars/gitea.yaml
|
2019-02-19 14:41:54 -08:00
|
|
|
- group_vars/gitea-lb.yaml
|
2021-03-05 16:10:01 +11:00
|
|
|
- group_vars/kerberos-kdc.yaml
|
2019-02-14 08:10:51 +11:00
|
|
|
- group_vars/letsencrypt.yaml
|
2020-04-20 09:05:51 -07:00
|
|
|
- group_vars/meetpad.yaml
|
2020-05-18 12:28:51 -07:00
|
|
|
- group_vars/jvb.yaml
|
2020-04-16 10:18:51 -05:00
|
|
|
- group_vars/nodepool-launcher.yaml
|
2021-03-19 14:55:02 +11:00
|
|
|
- group_vars/refstack.yaml
|
2019-04-17 14:39:32 -07:00
|
|
|
- group_vars/registry.yaml
|
2019-01-31 09:26:38 -08:00
|
|
|
- group_vars/review.yaml
|
2019-02-28 12:10:49 +00:00
|
|
|
- group_vars/control-plane-clouds.yaml
|
2019-12-10 13:11:14 +11:00
|
|
|
- group_vars/afs-client.yaml
|
2020-04-05 09:25:28 -05:00
|
|
|
- group_vars/zuul.yaml
|
2020-04-24 17:40:32 -05:00
|
|
|
- group_vars/zuul-executor.yaml
|
2020-04-05 09:25:28 -05:00
|
|
|
- group_vars/zuul-merger.yaml
|
|
|
|
- group_vars/zuul-scheduler.yaml
|
|
|
|
- group_vars/zuul-web.yaml
|
2018-08-30 12:17:31 -07:00
|
|
|
- host_vars/bridge.openstack.org.yaml
|
2020-11-17 17:13:46 +11:00
|
|
|
- host_vars/codesearch01.opendev.org.yaml
|
2020-03-31 16:33:26 -05:00
|
|
|
- host_vars/etherpad01.opendev.org.yaml
|
2019-02-14 08:10:51 +11:00
|
|
|
- host_vars/letsencrypt01.opendev.org.yaml
|
|
|
|
- host_vars/letsencrypt02.opendev.org.yaml
|
2020-04-29 08:24:50 -07:00
|
|
|
- host_vars/lists.openstack.org.yaml
|
2019-11-13 16:33:35 -08:00
|
|
|
- host_vars/gitea99.opendev.org.yaml
|
2020-06-23 11:41:27 +10:00
|
|
|
- host_vars/grafana01.opendev.org.yaml
|
2019-06-17 11:15:38 +10:00
|
|
|
- host_vars/mirror01.openafs.provider.opendev.org.yaml
|
2020-05-12 08:53:25 +10:00
|
|
|
- host_vars/mirror02.openafs.provider.opendev.org.yaml
|
2019-06-27 14:20:02 +10:00
|
|
|
- host_vars/mirror-update01.opendev.org.yaml
|
2020-01-31 09:27:34 -08:00
|
|
|
- host_vars/refstack01.openstack.org.yaml
|
2018-08-29 11:04:07 -07:00
|
|
|
- name: Display group membership
|
|
|
|
command: ansible localhost -m debug -a 'var=groups'
|
2018-08-22 09:46:07 -07:00
|
|
|
- name: Run base.yaml
|
2020-04-29 08:02:11 -05:00
|
|
|
command: ansible-playbook -f 50 -v /home/zuul/src/opendev.org/opendev/system-config/playbooks/base.yaml
|
2019-05-02 15:07:32 -06:00
|
|
|
- name: Run bridge service playbook
|
|
|
|
command: ansible-playbook -v /home/zuul/src/opendev.org/opendev/system-config/playbooks/service-bridge.yaml
|
2021-02-10 16:32:51 -08:00
|
|
|
- name: Run dstat logger playbook
|
|
|
|
command: ansible-playbook -v /home/zuul/src/opendev.org/opendev/system-config/playbooks/service-dstatlogger.yaml
|
2019-05-02 15:07:32 -06:00
|
|
|
- name: Run playbook
|
|
|
|
when: run_playbooks is defined
|
|
|
|
loop: "{{ run_playbooks }}"
|
2020-04-29 08:02:11 -05:00
|
|
|
command: "ansible-playbook -f 50 -v /home/zuul/src/opendev.org/opendev/system-config/{{ item }}"
|
2019-03-05 15:24:24 -08:00
|
|
|
- name: Run test playbook
|
2019-05-02 15:07:32 -06:00
|
|
|
when: run_test_playbook is defined
|
|
|
|
shell: "ANSIBLE_ROLES_PATH=/home/zuul/src/opendev.org/opendev/system-config/playbooks/roles ansible-playbook -v /home/zuul/src/opendev.org/opendev/system-config/{{ run_test_playbook }}"
|
2020-05-20 09:06:40 +10:00
|
|
|
|
|
|
|
- name: Generate testinfra extra data fixture
|
|
|
|
set_fact:
|
|
|
|
testinfra_extra_data:
|
|
|
|
zuul_job: '{{ zuul.job }}'
|
|
|
|
zuul: '{{ zuul }}'
|
|
|
|
|
|
|
|
- name: Write out testinfra extra data fixture
|
|
|
|
copy:
|
2020-06-03 13:58:18 -07:00
|
|
|
content: '{{ testinfra_extra_data | to_nice_yaml(indent=2) }}'
|
2020-05-20 09:06:40 +10:00
|
|
|
dest: '/home/zuul/testinfra_extra_data_fixture.yaml'
|
|
|
|
|
2020-12-15 15:22:26 +11:00
|
|
|
- name: Make screenshots directory
|
|
|
|
file:
|
|
|
|
path: '/var/log/screenshots'
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: Return screenshots artifact
|
|
|
|
zuul_return:
|
|
|
|
data:
|
|
|
|
zuul:
|
|
|
|
artifacts:
|
|
|
|
- name: Screenshots
|
|
|
|
url: "bridge.openstack.org/screenshots"
|
|
|
|
|
2020-07-13 14:27:58 +10:00
|
|
|
- name: Run and collect testinfra
|
|
|
|
block:
|
|
|
|
- name: Run testinfra to validate configuration
|
|
|
|
include_role:
|
|
|
|
name: tox
|
|
|
|
vars:
|
|
|
|
tox_envlist: testinfra
|
|
|
|
# This allows us to run from external projects (like testinfra
|
|
|
|
# itself)
|
|
|
|
tox_environment:
|
|
|
|
TESTINFRA_EXTRA_DATA: '/home/zuul/testinfra_extra_data_fixture.yaml'
|
|
|
|
zuul_work_dir: src/opendev.org/opendev/system-config
|
|
|
|
always:
|
|
|
|
- name: Return testinfra report artifact
|
|
|
|
zuul_return:
|
|
|
|
data:
|
|
|
|
zuul:
|
|
|
|
artifacts:
|
|
|
|
- name: testinfra results
|
|
|
|
url: "bridge.openstack.org/test-results.html"
|