chore: Cleaned up ansible and added control script
This commit is contained in:
@@ -10,50 +10,22 @@
|
||||
upgrade: dist
|
||||
cache_valid_time: 3600
|
||||
|
||||
- name: Install Docker prerequisites
|
||||
# Docker straight from Ubuntu's own repositories - no external apt repo, GPG
|
||||
# key or architecture juggling. docker.io is the engine, docker-compose-v2 is
|
||||
# the `docker compose` plugin. A little behind Docker's own channel, but far
|
||||
# simpler and plenty for these hosts.
|
||||
- name: Install Docker Engine and the Compose plugin
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- ca-certificates
|
||||
- curl
|
||||
- gnupg
|
||||
- docker.io
|
||||
- docker-compose-v2
|
||||
state: present
|
||||
|
||||
- name: Create apt keyrings directory
|
||||
ansible.builtin.file:
|
||||
path: /etc/apt/keyrings
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Download Docker's GPG key
|
||||
ansible.builtin.get_url:
|
||||
url: https://download.docker.com/linux/ubuntu/gpg
|
||||
dest: /etc/apt/keyrings/docker.asc
|
||||
mode: "0644"
|
||||
force: false
|
||||
|
||||
- name: Determine dpkg architecture
|
||||
ansible.builtin.command: dpkg --print-architecture
|
||||
register: _dpkg_arch
|
||||
changed_when: false
|
||||
|
||||
- name: Add Docker apt repository
|
||||
ansible.builtin.apt_repository:
|
||||
repo: >-
|
||||
deb [arch={{ _dpkg_arch.stdout }} signed-by=/etc/apt/keyrings/docker.asc]
|
||||
https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable
|
||||
filename: docker
|
||||
state: present
|
||||
|
||||
- name: Install Docker Engine and Compose plugin
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
name:
|
||||
- docker-ce
|
||||
- docker-ce-cli
|
||||
- containerd.io
|
||||
- docker-buildx-plugin
|
||||
- docker-compose-plugin
|
||||
state: present
|
||||
- name: Ensure Docker is enabled and running
|
||||
ansible.builtin.systemd:
|
||||
name: docker
|
||||
enabled: true
|
||||
state: started
|
||||
|
||||
- name: Create non-root sudo user, given the same key root was provisioned with
|
||||
ansible.builtin.user:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Generated by Ansible from dev_runner_count - do not hand-edit.
|
||||
# To change the number of runners, edit dev_runner_count in
|
||||
# ansible/group_vars/role_dev.yml and re-run playbooks/deploy.yml.
|
||||
# To change their shape, edit this template instead.
|
||||
# Generated by Ansible - do not hand-edit. Three Gitea Actions runners, always.
|
||||
# To change their shape (image, volumes, env), edit this template and re-run
|
||||
# playbooks/deploy.yml.
|
||||
#
|
||||
# GITEA_RUNNER_REGISTRATION_TOKEN is intentionally left as a compose variable
|
||||
# (not baked in here) - services/dev/spinup.sh generates a fresh token and
|
||||
@@ -10,8 +9,9 @@
|
||||
# /data is a disposable local cache (runner identity re-registers on every
|
||||
# spinup.sh run anyway), so it's a plain named volume - not part of the S3
|
||||
# backup/restore stack in services/dev/backup-docker-compose.yml.
|
||||
{% set runner_count = 3 %}
|
||||
services:
|
||||
{% for i in range(1, dev_runner_count + 1) %}
|
||||
{% for i in range(1, runner_count + 1) %}
|
||||
runner-{{ i }}:
|
||||
image: gitea/act_runner:latest
|
||||
container_name: gitea_runner_{{ i }}
|
||||
@@ -34,7 +34,7 @@ networks:
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
{% for i in range(1, dev_runner_count + 1) %}
|
||||
{% for i in range(1, runner_count + 1) %}
|
||||
gitea_runner_{{ i }}_data:
|
||||
name: gitea_runner_{{ i }}_data
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user