lxc with drone-runner on proxmox via opentofu and ansible

This commit is contained in:
2026-02-23 23:55:29 +01:00
commit b29c73c404
10 changed files with 254 additions and 0 deletions

55
ansible/drone-runner.yml Normal file
View File

@@ -0,0 +1,55 @@
- name: Configure Drone Runner LXC
hosts: drone-runner
tasks:
- name: Install dependencies
apt:
name:
- ca-certificates
- curl
- gnupg
state: present
update_cache: true
- name: Add Docker GPG key
get_url:
url: https://download.docker.com/linux/debian/gpg
dest: /etc/apt/keyrings/docker.asc
mode: "0644"
- name: Add Docker repository
apt_repository:
repo: "deb [signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable"
filename: docker
state: present
- name: Install Docker
apt:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
state: present
update_cache: true
- name: Enable and start Docker service
systemd:
name: docker
enabled: true
state: started
- name: Start Drone Runner
community.docker.docker_container:
name: drone-runner
image: drone/drone-runner-docker:1
state: started
restart_policy: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
env:
DRONE_RPC_HOST: "drone.gilmour109.de"
DRONE_RPC_PROTO: "https"
DRONE_RPC_SECRET: "dronegitea"
DRONE_RUNNER_CAPACITY: "4"
DRONE_RUNNER_NAME: "proxmox-runner"