Files
loci/playbooks/setup-gate.yaml
Mohammed Naser 409c784dc5 gate: fix repository url
The repository was changed by the OpenDev infrastructure in order to
properly mirror systems, this change reflects that modification.

Change-Id: I93ea021810568a7998c99958c622aacb3d39e908
2020-09-22 17:49:51 -04:00

92 lines
2.6 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/{{ ansible_distribution_release }} {{ ansible_distribution_release }} 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