
We want to replace the current executors with focal executors. Make sure zuul-executor can run there. Kubic is apparently the new source for libcontainers stuff: https://podman.io/getting-started/installation.html Use only timesyncd on focal ntp and timesyncd have a hard conflict with each other. Our test images install ntp. Remove it and just stay with timesyncd. Change-Id: I0126f7c77d92deb91711f38a19384a9319955cf5
165 lines
3.9 KiB
YAML
165 lines
3.9 KiB
YAML
- name: Include OS-specific variables
|
|
include_vars: "{{ lookup('first_found', params) }}"
|
|
vars:
|
|
params:
|
|
files: "{{ distro_lookup_path }}"
|
|
paths:
|
|
- 'vars'
|
|
|
|
- name: Install PPAs
|
|
apt_repository:
|
|
repo: '{{ item }}'
|
|
become: yes
|
|
loop: '{{ zuul_executor_ppas }}'
|
|
|
|
- name: Atomic for focal
|
|
when: ansible_distribution_version is version('20.04', '>=')
|
|
block:
|
|
|
|
- name: Add Kubic libcontainers OBS repo key
|
|
become: yes
|
|
apt_key:
|
|
data: "{{ libcontainers_apt_key }}"
|
|
keyring: /etc/apt/trusted.gpg.d/projectatomic.gpg
|
|
|
|
- name: Add kubic project libcontainers apt repo
|
|
become: yes
|
|
template:
|
|
dest: /etc/apt/sources.list.d/projectatomic.list
|
|
group: root
|
|
mode: 0644
|
|
owner: root
|
|
src: sources.list.j2
|
|
register: projectatomic_repo
|
|
|
|
- name: Run the equivalent of "apt-get update" as a separate step
|
|
apt:
|
|
update_cache: yes
|
|
when: projectatomic_repo is changed
|
|
|
|
- name: Install bindep
|
|
pip:
|
|
name: bindep
|
|
state: present
|
|
executable: pip3
|
|
become: yes
|
|
|
|
- name: Install extra packages
|
|
package:
|
|
name: '{{ item }}'
|
|
state: present
|
|
loop:
|
|
- bubblewrap
|
|
- skopeo
|
|
- socat
|
|
|
|
- name: Install distro-specific executor extra packages
|
|
package:
|
|
name: '{{ item }}'
|
|
state: present
|
|
loop: '{{ zuul_executor_extra_packages }}'
|
|
|
|
- name: Clone zuul repo
|
|
git:
|
|
repo: https://opendev.org/zuul/zuul
|
|
dest: /opt/zuul
|
|
force: yes
|
|
register: zuul_repo
|
|
|
|
- name: Install zuul bindep packages
|
|
shell:
|
|
cmd: apt-get install -y $(bindep -b compile)
|
|
chdir: /opt/zuul
|
|
when: zuul_repo is changed
|
|
|
|
- name: Install zuul
|
|
shell:
|
|
cmd: pip3 install .
|
|
chdir: /opt/zuul
|
|
when: zuul_repo is changed
|
|
|
|
- name: Run zuul-manage-ansible
|
|
shell:
|
|
cmd: zuul-manage-ansible
|
|
environment:
|
|
ANSIBLE_EXTRA_PACKAGES: gear
|
|
when: zuul_repo is changed
|
|
|
|
- name: Install kubectl
|
|
include_role:
|
|
name: install-kubectl
|
|
|
|
# This checks the current installed ara version with pip list and the
|
|
# latest version of ara on pypi with pip search and if they are different
|
|
# then we know we need to upgrade to reconcile the local version with
|
|
# the upstream version.
|
|
#
|
|
# We do this using this check here rather than a pip package resource so
|
|
# that ara's deps don't inadverdently update zuuls deps (specifically
|
|
# ansible).
|
|
- name: Install ARA safely
|
|
shell: |
|
|
if test $(pip3 list --format columns | sed -ne 's/^ara\s\+\([.0-9]\+\)\s\+$/\1/p') != $(pip3 search 'ara$' | sed -ne 's/^ara (\(.*\)).*$/\1/p') ; then
|
|
pip3 install --upgrade --upgrade-strategy=only-if-needed "ara<1.0.0"
|
|
fi
|
|
|
|
- name: Write key for talking to nodepool nodes
|
|
copy:
|
|
content: '{{ nodepool_test_node_ssh_private_key_contents }}'
|
|
dest: /var/lib/zuul/ssh/nodepool_id_rsa
|
|
mode: 0400
|
|
owner: zuul
|
|
group: zuul
|
|
|
|
- name: Create Zuul Executor directories
|
|
file:
|
|
state: directory
|
|
path: '{{ item }}'
|
|
owner: zuul
|
|
group: zuul
|
|
loop:
|
|
- /var/lib/zuul/builds
|
|
- /var/lib/zuul/git
|
|
|
|
- name: Set up cron job to pack git refs
|
|
cron:
|
|
name: pack-git-refs
|
|
state: present
|
|
job: 'find /var/lib/zuul/git/ -maxdepth 3 -type d -name ".git" -exec git --git-dir="{}" pack-refs --all \;'
|
|
minute: '7'
|
|
hour: '4'
|
|
|
|
- name: Install logging config
|
|
copy:
|
|
src: logging.conf
|
|
dest: /etc/zuul/executor-logging.conf
|
|
|
|
- name: Rotate executor logs
|
|
include_role:
|
|
name: logrotate
|
|
vars:
|
|
logrotate_file_name: /var/log/zuul/executor.log
|
|
|
|
- name: Rotate executor debug logs
|
|
include_role:
|
|
name: logrotate
|
|
vars:
|
|
logrotate_file_name: /var/log/zuul/executor-debug.log
|
|
|
|
- name: Install defaults file
|
|
template:
|
|
src: zuul-executor.defaults.j2
|
|
dest: /etc/default/zuul-executor
|
|
|
|
- name: Install init script
|
|
copy:
|
|
src: zuul-executor.init
|
|
dest: /etc/init.d/zuul-executor
|
|
mode: 0555
|
|
register: install_init_script
|
|
|
|
- name: Register script with systemd
|
|
shell:
|
|
cmd: /bin/systemctl daemon-reload
|
|
when: install_init_script is changed
|