Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ Vagrant.configure("2") do |config|
config.vm.provision "ansible" do |ansible|
ansible.compatibility_mode = "2.0"
ansible.verbose = "vv"
ansible.inventory_path = "playbooks/vagrant-inventory"
ansible.limit = "host, local"
ansible.playbook = "playbooks/vagrant-dev.yml"
end

config.vm.post_up_message = $post_msg
end
end
1 change: 1 addition & 0 deletions acid/features/zuul_manager/tests/static/host_key.pub
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
10.10.10.5 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPaUGUDik0UGU/YUqD+k9Y7ztMCALoVsDkz89ijaCKxN
10.100.0.150 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPaUGUDik0UGU/YUqD+k9Y7ztMCALoVsDkz89ijaCKxN
17 changes: 0 additions & 17 deletions playbooks/ansible.cfg

This file was deleted.

53 changes: 0 additions & 53 deletions playbooks/install-zuul.yml

This file was deleted.

12 changes: 11 additions & 1 deletion playbooks/inventory.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
---
all:
hosts:
gerrit-server:
ansible_host: 10.10.10.5
ansible_port: 22
ansible_user: vagrant
ansible_ssh_private_key_file: '/home/dariusz/.vagrant.d/insecure_private_key'
zuul-server:
ansible_host: 10.10.10.5
ansible_port: 22
ansible_user: vagrant
ansible_ssh_private_key_file: '/home/dariusz/.vagrant.d/insecure_private_key'
acid-server:
# Where to deploy ACID dashboard
ansible_host: 10.100.0.1
ansible_user: "ubuntu"
ansible_user: "ubuntu"
78 changes: 78 additions & 0 deletions playbooks/roles/install-docker/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
- name: "Create directory: /etc/docker"
become: yes
file:
path: "/etc/docker"
state: directory
mode: a+rwx

- name: Copy daemon.json file
become: yes
template:
src: "daemon.json.j2"
dest: "/etc/docker/daemon.json"

- name: Add dockers official GPG key
become: yes
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present

- name: Verify that key has a fingerprint
apt_key:
id: 0EBFCD88
state: present

- name: Set up repository
become: yes
apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
state: present
update_cache: yes

- name: Update packages
become: yes
apt:
update_cache: yes

- name: Install docker
become: yes
apt:
name: docker-ce
state: present
update_cache: yes

- name: Add user to docker group
become: yes
user:
name: "{{ ansible_user }}"
group: docker
append: yes

- name: Install docker-compose
become: yes
apt:
name: docker-compose
state: present
update-cache: yes

- name: Install pip2
become: yes
apt:
name: python-pip
state: present
update_cache: yes

- name: Install docker for docker module
become: yes
pip:
name: docker

- name: Verify docker installation
shell: |
set -e
set -x
docker --version
docker-compose --version
args:
executable: /bin/bash
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
---
- name: Run mariadb container
become: yes
shell: |
set -e
set -x
docker run -d \
-p 3306:3306 \
--restart always \
--name {{ zuul.history_db.name }} \
-e MYSQL_ROOT_PASSWORD={{ zuul.history_db.pass }} \
mariadb:10.3
args:
executable: /bin/bash
docker_container:
name: "{{ zuul.history_db.name }}"
published_ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: "{{ zuul.history_db.pass }}"
image: "mariadb:10.3"
restart_policy: always

- name: Wait until MariaDB comes up (naive)
pause:
Expand Down
11 changes: 11 additions & 0 deletions playbooks/roles/pre-zuul/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: "Create directory for zuul"
file:
path: "{{ zuul.home }}"
state: directory
mode: a+rwx
recurse: true

- include_tasks: history-db.yml
- include_tasks: zookeeper.yml
- include_tasks: gearman.yml
11 changes: 11 additions & 0 deletions playbooks/roles/pre-zuul/tasks/zookeeper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: Run mariadb container
become: yes
docker_container:
name: zuul_zoo
published_ports:
- 2181:2181
- 2888:2888
- 3888:3888
image: "zookeeper:3.4"
restart_policy: always
9 changes: 9 additions & 0 deletions playbooks/roles/pre-zuul/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
zuul:
home: "/home/{{ ansible_user }}/zuul"
history_db:
name: zuul_db
user: root
pass: root
# migrate example fixtures
# or start with empty database
migrate: true
107 changes: 0 additions & 107 deletions playbooks/roles/provision-dev/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,118 +1,11 @@
---
- name: Install distutils packages
become: yes
apt:
name: "{{ item }}"
state: present
update_cache: yes
with_items:
- apt-transport-https
- ca-certificates
- curl
- vim
- software-properties-common
- python3-pip
- python-pip
- python3.6
- libre2-dev
- ansible
- nodejs
- npm
- apache2
- bubblewrap

- name: "Create directory: {{ item }}"
file:
path: "{{ item }}"
state: directory
mode: a+rwx
recurse: true
with_items:
- "{{ zuul.home }}"
- "{{ gerrit.home }}"

- name: Create ssh key and add to authorized_key for vagrant user
shell: |
set -e
set -x
yes | ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub | tee --append ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa ~/.ssh/authorized_keys
args:
executable: /bin/bash

- name: "Create directory: /etc/docker"
become: yes
file:
path: "/etc/docker"
state: directory
mode: a+rwx

- name: Copy daemon.json file
become: yes
template:
src: "daemon.json.j2"
dest: "/etc/docker/daemon.json"

- name: Install docker-ce
shell: |
set -e
set -x
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install -y docker-ce
retry: 3
args:
executable: /bin/bash

- name: Install docker-compose
shell: |
set -e
set -x
sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
retry: 3
args:
executable: /bin/bash

- name: Add user to docker group
shell: |
set -e
set -x
sudo usermod -aG docker $USER
args:
executable: /bin/bash

- name: Verify docker installation
shell: |
set -e
set -x
docker --version
docker-compose --version
args:
executable: /bin/bash

- name: Disable ssh Strict Host Key Checking
become: yes
lineinfile:
path: /etc/ssh/ssh_config
regexp: "StrictHostKeyChecking"
line: " StrictHostKeyChecking no"

- name: Generate language locales to suppress Perl warnings
become: yes
shell: |
set -e
set -x
locale-gen en_US en_US.UTF-8 pl_PL.UTF-8

- name: Set VIM as default editor
become: yes
shell: update-alternatives --set editor /usr/bin/vim.basic

- name: Copy host public key
become: yes
copy:
Expand Down
Loading