Skip to content

Commit

Permalink
fix: don't override Docker systemd unit file for Flatcar (#896)
Browse files Browse the repository at this point in the history
Don't revert Docker and Containerd systemd unit files when running KIB for a second time after downloading a new version of Docker.
  • Loading branch information
dkoshkin authored Aug 31, 2023
1 parent ec5e993 commit 7bf6011
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions ansible/roles/containerd/tasks/install-flatcar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,7 @@
- ansible_facts['distribution_version'] is version('3033.3.0', '>=', version_type='semver')
- ansible_facts['distribution_version'] is version('3033.4.0', '<', version_type='semver')

- name: Create systemd unit file for containerd
template:
dest: /etc/systemd/system/containerd.service
src: etc/systemd/system/containerd-flatcar.service
mode: 0600
when: dockerUpgradeRequired is not defined

- name: Download, Update and Restart docker for 3033.3.x flatcar LTS
when: dockerUpgradeRequired is true
- when: dockerUpgradeRequired is true
block:
- name: Download docker for 3033.3.x flatcar LTS to /opt/docker.tgz
get_url:
Expand All @@ -48,6 +40,20 @@
- docker
- containerd

- name: Check if /opt/bin/dockerd binary exists
changed_when: false
stat:
path: "/opt/bin/dockerd"
register: dockerd_binary_exists

# Only run this task if not using the downloaded Docker binary
- name: Create systemd unit file for containerd
template:
dest: /etc/systemd/system/containerd.service
src: etc/systemd/system/containerd-flatcar.service
mode: 0600
when: not dockerd_binary_exists.stat.exists

- name: Create containerd memory pressure drop in file
template:
dest: /etc/systemd/system/containerd.service.d/memory-pressure.conf
Expand Down

0 comments on commit 7bf6011

Please sign in to comment.