From a065fd4bc88079276cfb0453accabbff0a451e8c Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Fri, 19 Jun 2020 23:41:16 +0200 Subject: [PATCH] drone: install runner onto bob --- hosts | 1 + roles/docker/tasks/main.yml | 17 +++++++++++++++++ roles/drone-runner/meta/main.yml | 4 ++++ roles/drone-runner/tasks/main.yml | 20 ++++++++++++++++++++ site.yml | 7 ++++++- 5 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 roles/docker/tasks/main.yml create mode 100644 roles/drone-runner/meta/main.yml create mode 100644 roles/drone-runner/tasks/main.yml diff --git a/hosts b/hosts index 2e5e611..d896e45 100644 --- a/hosts +++ b/hosts @@ -5,6 +5,7 @@ aveta.binary.kitchen ansible_host=172.23.2.4 sulis.binary.kitchen ansible_host=172.23.2.5 nabia.binary.kitchen ansible_host=172.23.2.6 pizza.binary.kitchen ansible_host=172.23.2.33 +bob.binary.kitchen ansible_host=172.23.2.37 bowle.binary.kitchen ansible_host=172.23.2.62 ansible_python_interpreter=/usr/local/bin/python2.7 cerunnos.binary.kitchen ansible_host=172.23.8.23 salat.binary.kitchen ansible_host=172.23.9.61 diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml new file mode 100644 index 0000000..66afcc7 --- /dev/null +++ b/roles/docker/tasks/main.yml @@ -0,0 +1,17 @@ +--- + +- name: Enable docker apt-key + apt_key: url='https://download.docker.com/linux/debian/gpg' + +- name: Enable docker repository + apt_repository: + repo: 'deb https://download.docker.com/linux/debian buster stable' + filename: docker + +- name: Install docker + apt: + name: + - docker-ce + - docker-ce-cli + - containerd.io + - python-docker diff --git a/roles/drone-runner/meta/main.yml b/roles/drone-runner/meta/main.yml new file mode 100644 index 0000000..093840b --- /dev/null +++ b/roles/drone-runner/meta/main.yml @@ -0,0 +1,4 @@ +--- + +dependencies: +- { role: docker } diff --git a/roles/drone-runner/tasks/main.yml b/roles/drone-runner/tasks/main.yml new file mode 100644 index 0000000..6876649 --- /dev/null +++ b/roles/drone-runner/tasks/main.yml @@ -0,0 +1,20 @@ +--- + +- name: Run runner container + docker_container: + name: runner + image: drone/drone-runner-docker:1 + env: + - DRONE_RPC_PROTO: "https" + - DRONE_RPC_HOST: "{{ drone_domain }}" + - DRONE_RPC_SECRET: "{{ drone_secret }}" + - DRONE_RUNNER_CAPACITY: 2 + - DRONE_RUNNER_NAME: "{{ ansible_fqdn }}" + - DRONE_UI_USERNAME: "admin" + - DRONE_UI_PASSWORD: "{{ drone_uipass }}" + ports: + - "3000:3000" + restart_policy: unless-stopped + state: started + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" diff --git a/site.yml b/site.yml index 853f41e..f86cc0e 100644 --- a/site.yml +++ b/site.yml @@ -8,7 +8,7 @@ - root-keys - name: Setup unattended updates - hosts: [sulis.binary.kitchen, nabia.binary.kitchen, beryllium.binary-kitchen.net, boron.binary-kitchen.net, carbon.binary-kitchen.net, nitrogen.binary-kitchen.net, oxygen.binary-kitchen.net, fluorine.binary-kitchen.net, krypton.binary-kitchen.net, sodium.binary-kitchen.net, yttrium.binary-kitchen.net, zirconium.binary-kitchen.net] + hosts: [sulis.binary.kitchen, nabia.binary.kitchen, bob.binary.kitchen, beryllium.binary-kitchen.net, boron.binary-kitchen.net, carbon.binary-kitchen.net, nitrogen.binary-kitchen.net, oxygen.binary-kitchen.net, fluorine.binary-kitchen.net, krypton.binary-kitchen.net, sodium.binary-kitchen.net, yttrium.binary-kitchen.net, zirconium.binary-kitchen.net] roles: - uau @@ -37,6 +37,11 @@ - librenms - prometheus +- name: Setup drone runner + hosts: bob.binary.kitchen + roles: + - drone-runner + - name: Setup ldap server hosts: helium.binary-kitchen.net roles: