Files
loci/playbooks/setup-gate.yaml
Chris Hoge d0ef425ef6 Clean up comment style and identify bugs and workarounds
Cleans up the comment style to remove author names and clarify
the comment as it relates to the code. Using the NOTE (NAME):
format is redundant and takes away attention from the purpose
of documenting why an action is being taken.

Also updates status of TODO and FIXME items, including removing
code was a workaround fixed by a recent patch.

Change-Id: I2e087be1e204c618d1dbe499b3f69eae34ce656f
2018-10-25 11:33:25 -07:00

89 lines
2.5 KiB
YAML

- hosts: all
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
- python-pip
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