containers: clean-up build code
The containers code use a code path for installing things which can all be done using existing CI tooling, let's use that rather than build our stuff from scratch. Change-Id: I1bcf5dfaac62666f48f7cce70d53244814b0b7db
This commit is contained in:
parent
a9bf7fb236
commit
b6ad606bd2
@ -1,37 +1,25 @@
|
|||||||
|
---
|
||||||
- hosts: all
|
- hosts: all
|
||||||
|
roles:
|
||||||
|
- configure-swap
|
||||||
|
- install-docker
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Create logging folders
|
||||||
- name: setup swap
|
|
||||||
block:
|
|
||||||
- command: fallocate -l20g /swap
|
|
||||||
- file:
|
|
||||||
path: /swap
|
|
||||||
mode: 0600
|
|
||||||
- command: mkswap /swap
|
|
||||||
- command: swapon /swap
|
|
||||||
become: True
|
|
||||||
|
|
||||||
- name: setup logging
|
|
||||||
shell:
|
|
||||||
cmd: |
|
|
||||||
mkdir logs
|
|
||||||
ln -s $(pwd)/logs /tmp/logs
|
|
||||||
mkdir -p /tmp/logs/{ansible,build}
|
|
||||||
executable: /bin/bash
|
|
||||||
chdir: "{{ zuul.project.src_dir }}"
|
|
||||||
|
|
||||||
- name: copy setup script
|
|
||||||
copy:
|
|
||||||
src: "{{ zuul.executor.work_root }}/{{ zuul.project.src_dir }}/tools/install_docker_UBUNTU.sh"
|
|
||||||
dest: /tmp/setup.sh
|
|
||||||
mode: 0755
|
|
||||||
|
|
||||||
- name: run node setup script
|
|
||||||
shell: /tmp/setup.sh
|
|
||||||
become: true
|
|
||||||
|
|
||||||
- name: changing permission of Docker socket to 666
|
|
||||||
file:
|
file:
|
||||||
path: /run/docker.sock
|
path: "/tmp/logs/{{ item }}"
|
||||||
mode: 666
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- ansible
|
||||||
|
- build
|
||||||
|
|
||||||
|
- name: Link logs output folder
|
||||||
|
file:
|
||||||
|
src: /tmp/logs
|
||||||
|
dest: "{{ zuul.project.src_dir }}/logs"
|
||||||
|
state: link
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
become: true
|
become: true
|
||||||
|
pip:
|
||||||
|
name: docker
|
||||||
|
state: present
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -o xtrace
|
|
||||||
set -o errexit
|
|
||||||
|
|
||||||
# Setup Docker repo and add signing key
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y \
|
|
||||||
apt-transport-https \
|
|
||||||
ca-certificates \
|
|
||||||
curl \
|
|
||||||
software-properties-common
|
|
||||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
|
||||||
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get -y install --no-install-recommends docker-ce
|
|
||||||
|
|
||||||
sudo systemctl start docker --now
|
|
||||||
|
|
||||||
sudo docker info
|
|
||||||
|
|
||||||
sudo apt-get install python-pip
|
|
||||||
|
|
||||||
sudo pip install docker
|
|
||||||
|
|
||||||
echo "Completed $0."
|
|
Loading…
Reference in New Issue
Block a user