Files
loci/playbooks/setup-gate.yaml
Andrii Ostapenko d910229ce9 Allow to specify eol release for project and fix gates
There's a need to keep building images from eol releases. This commit
introduces ability to specify eol release for project and clone to
{release}-eol instead of stable/{release}

Octavia moved to eol, using ocata-eol instead.

Also fixes gates providing ensure-pip role to executor.

Also pins openSUSE image to 15.1

Change-Id: I041033bb6c9cfe193c4bae9a0b6b4028f4602c5f
Signed-off-by: Andrii Ostapenko <andrii.ostapenko@att.com>
2020-07-03 10:36:44 -05:00

92 lines
2.5 KiB
YAML

- hosts: all
become: yes
roles:
- ensure-pip
tasks:
- include_vars: vars.yaml
- name: Setup swap
block:
- command: fallocate -l20g /swap
- file:
path: /swap
mode: 0600
- command: mkswap /swap
- command: swapon /swap
become: True
- name: Install Docker
block:
- file:
path: "{{ item }}"
state: directory
with_items:
- /etc/docker/
- /etc/systemd/system/docker.service.d/
- /var/lib/docker/
- mount:
path: /var/lib/docker/
src: tmpfs
fstype: tmpfs
opts: size=25g
state: mounted
- copy: "{{ item }}"
with_items:
- content: "{{ docker_daemon | to_json }}"
dest: /etc/docker/daemon.json
- src: files/docker-systemd.conf
dest: /etc/systemd/system/docker.service.d/
- apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
- apt_repository:
repo: deb http://{{ zuul_site_mirror_fqdn }}/deb-docker xenial stable
- apt:
name:
- docker-ce
allow_unauthenticated: True
- pip:
name: docker
version: 2.7.0
- docker_container:
name: registry
image: registry:2
state: started
published_ports:
- 172.17.0.1:5000:5000
# Allow all connections from containers to host so the
# containers can access the http server for git and wheels
- iptables:
action: insert
chain: INPUT
in_interface: docker0
jump: ACCEPT
become: True
- name: Setup http server for git repos
block:
- file:
path: "{{ item.path }}"
owner: "{{ item.owner }}"
state: directory
recurse: "{{ item.recurse | default(omit) }}"
with_items:
- path: /logs/apache/
owner: zuul
recurse: True
- path: /webroot/
owner: zuul
- path: /etc/systemd/system/apache2.service.d/
owner: root
- copy: "{{ item }}"
with_items:
- src: files/apache2-systemd.conf
dest: /etc/systemd/system/apache2.service.d/
- src: files/apache.conf
dest: /webroot/
- apt:
name:
- apache2
- gitweb
become: True