Skip to content
Merged
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: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.1.9] - 2026-11-04
### Fixed
- `github_runner_mount_docker_socket: false` now removes the socket from an existing runner. The docker module ignored removed volumes, so the mount stayed until the container was next replaced for another reason. Existing runners with stale mounts are replaced on their next deploy.

## [0.1.8] - 2026-11-04
### Added
- `github_runner_tmpfs` (default `[]`): in-memory mounts for the runner container, to keep rebuildable job data off slow disks.
Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: "Installs github self hosted repo or org runners within a docker co
can be a vanilla runner, or one with java / android installed."
license_file: LICENSE
readme: README.md
version: 0.1.8
version: 0.1.9
repository: https://github.com/compscidr/ansible-github-runner
tags:
- github
Expand Down
38 changes: 37 additions & 1 deletion molecule/no-docker-socket/verify.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Verify runner without docker socket
hosts: all
gather_facts: false
gather_facts: true
become: true
tasks:
- name: Check if GitHub runner container is running
Expand Down Expand Up @@ -35,3 +35,39 @@
- runner_container.container.HostConfig.Binds | default([], true) | select('search', '/var/run/docker.sock') | list | length == 0
fail_msg: "Docker socket should not be mounted with github_runner_mount_docker_socket: false"
success_msg: "Docker socket correctly not mounted"

# A runner that already has the socket has to lose it on the next deploy, and
# the docker module doesn't do that unless the role compares volumes strictly.
- name: Deploy with the docker socket
ansible.builtin.include_role:
name: github_runner
vars:
github_runner_mount_docker_socket: true
github_runner_drain_before_replace: false

- name: Read the runner with the docker socket
community.docker.docker_container_info:
name: "{{ github_runner_name }}"
register: socket_container

- name: Verify docker socket is mounted
ansible.builtin.assert:
that:
- socket_container.container.HostConfig.Binds | default([], true) | select('search', '/var/run/docker.sock') | list | length == 1

- name: Deploy again without the docker socket
ansible.builtin.include_role:
name: github_runner
vars:
github_runner_mount_docker_socket: false
github_runner_drain_before_replace: false

- name: Read the redeployed runner
community.docker.docker_container_info:
name: "{{ github_runner_name }}"
register: redeployed_container

- name: Verify docker socket was removed from the existing runner
ansible.builtin.assert:
that:
- redeployed_container.container.HostConfig.Binds | default([], true) | select('search', '/var/run/docker.sock') | list | length == 0
2 changes: 2 additions & 0 deletions roles/github_runner/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
# Without strict, removing an entry leaves the mount on the container.
comparisons:
tmpfs: strict
volumes: strict
restart_policy: unless-stopped
stop_timeout: "{{ github_runner_stop_timeout }}"
timeout: "{{ github_runner_docker_timeout }}"
Expand Down Expand Up @@ -182,6 +183,7 @@
# Without strict, removing an entry leaves the mount on the container.
comparisons:
tmpfs: strict
volumes: strict
restart_policy: unless-stopped
# Replacing an existing container (image bump) stops and removes it first.
# A crash-looping or wedged runner can take well over the Docker SDK's
Expand Down
Loading