Skip to content

Commit 68cb5f5

Browse files
committed
run.yaml: hardcode debian bookworm repo, start daemons directly
- pod has no ansible_facts: drop fact templates, hardcode debian/bookworm/amd64 for the Docker CE apt repo and GPG URL - pod has no systemd as PID 1: drop systemd/service modules, launch containerd and dockerd as nohup'd background processes and wait for the sockets before verifying with docker info - gather_facts: false (facts unavailable/unnecessary in the pod)
1 parent e350bd1 commit 68cb5f5

1 file changed

Lines changed: 30 additions & 19 deletions

File tree

‎playbooks_k8s/run.yaml‎

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88
# Docker is needed because cloudmon's graphite/statsd/postgres
99
# provisioning playbooks deploy containerized components via
1010
# ansible-runner.
11+
#
12+
# NOTE: the pod has no systemd as PID 1, so the docker/containerd
13+
# daemons are started directly (background processes), not via the
14+
# service or systemd modules.
1115
- hosts: all
1216
become: true
13-
gather_facts: true
17+
gather_facts: false
1418
vars:
1519
docker_ce_packages:
1620
- docker-ce
@@ -41,9 +45,11 @@
4145
state: directory
4246
mode: '0755'
4347

48+
# Pod environment: known zuul-debian pod (Debian bookworm, amd64).
49+
# No ansible_facts available — hardcode values.
4450
- name: Download Docker official GPG key
4551
ansible.builtin.get_url:
46-
url: "https://download.docker.com/linux/{{ ansible_facts['os_release']['ID'] }}/gpg"
52+
url: "https://download.docker.com/linux/debian/gpg"
4753
dest: /etc/apt/keyrings/docker.asc
4854
mode: '0644'
4955

@@ -52,10 +58,10 @@
5258
dest: /etc/apt/sources.list.d/docker-ce.list
5359
mode: '0644'
5460
content: >-
55-
deb [arch={{ ansible_facts['architecture'] }}
61+
deb [arch=amd64
5662
signed-by=/etc/apt/keyrings/docker.asc]
57-
https://download.docker.com/linux/{{ ansible_facts['os_release']['ID'] }}
58-
{{ ansible_facts['os_release']['VERSION_CODENAME'] }} stable
63+
https://download.docker.com/linux/debian
64+
bookworm stable
5965
6066
# Remove conflicting Docker packages that may be in the distro image
6167
- name: Remove conflicting Docker packages
@@ -88,21 +94,26 @@
8894
- /var/run/docker.pid
8995
failed_when: false
9096

91-
# Start and enable containerd and docker
92-
- name: Start and enable containerd
93-
ansible.builtin.systemd:
94-
name: containerd
95-
state: started
96-
enabled: true
97+
# Start daemons directly — the pod has no init system to do it.
98+
- name: Start containerd daemon
99+
ansible.builtin.shell:
100+
cmd: nohup /usr/bin/containerd > /var/log/containerd.log 2>&1 &
101+
changed_when: true
97102

98-
- name: Start and enable Docker
99-
ansible.builtin.systemd:
100-
name: "{{ item }}"
101-
state: started
102-
enabled: true
103-
loop:
104-
- docker.socket
105-
- docker.service
103+
- name: Wait for containerd socket (up to 30s)
104+
ansible.builtin.wait_for:
105+
path: /run/containerd/containerd.sock
106+
timeout: 30
107+
108+
- name: Start dockerd daemon
109+
ansible.builtin.shell:
110+
cmd: nohup /usr/bin/dockerd > /var/log/dockerd.log 2>&1 &
111+
changed_when: true
112+
113+
- name: Wait for Docker socket to appear (up to 60s)
114+
ansible.builtin.wait_for:
115+
path: /var/run/docker.sock
116+
timeout: 60
106117

107118
- name: Verify Docker daemon is running
108119
ansible.builtin.command:

0 commit comments

Comments
 (0)