Use modern versions of docker-compose on Debian
All checks were successful
/ terraform (push) Successful in 36s
/ ansible (push) Successful in 1m25s

Install the plugin and use switch, rather than downloading an arbitrary binary. This way, it keeps getting updated.
This commit is contained in:
Jake Howard 2024-07-14 23:12:44 +01:00
parent 393a947cb7
commit 3d281fffc2
Signed by: jake
GPG key ID: 57AFB45680EDD477
4 changed files with 19 additions and 6 deletions

View file

@ -8,7 +8,7 @@ collections:
roles: roles:
- src: geerlingguy.docker - src: geerlingguy.docker
version: 6.2.0 version: 7.3.0
- src: geerlingguy.ntp - src: geerlingguy.ntp
version: 2.5.0 version: 2.5.0
- src: realorangeone.reflector - src: realorangeone.reflector

View file

@ -2,7 +2,17 @@ docker_user:
id: 3000 id: 3000
name: dockeruser name: dockeruser
docker_users:
- "{{ me.user }}"
docker_compose_file_mask: "664" docker_compose_file_mask: "664"
docker_compose_directory_mask: "775" docker_compose_directory_mask: "775"
# HACK: Use compose-switch as the install for compose, so the commands still work.
# Run this task manually, as version comparisons usually fail
docker_compose_url: https://github.com/docker/compose-switch/releases/latest/download/docker-compose-linux-{{ docker_apt_arch }}
docker_install_compose: false
docker_install_compose_plugin: "{{ ansible_os_family == 'Debian' }}"
docker_update_command: docker-compose pull && docker-compose down --remove-orphans && docker-compose rm && docker-compose up -d docker_update_command: docker-compose pull && docker-compose down --remove-orphans && docker-compose rm && docker-compose up -d

View file

@ -40,11 +40,6 @@
roles: roles:
- role: geerlingguy.docker - role: geerlingguy.docker
become: true become: true
vars:
docker_install_compose_plugin: "{{ ansible_os_family == 'Debian' }}"
docker_install_compose: "{{ ansible_os_family == 'Debian' }}"
docker_users:
- "{{ me.user }}"
- docker_cleanup - docker_cleanup
- hosts: - hosts:

View file

@ -4,6 +4,14 @@
become: true become: true
when: ansible_os_family != 'Debian' when: ansible_os_family != 'Debian'
- name: Install compose-switch
get_url:
url: "{{ docker_compose_url }}"
dest: "{{ docker_compose_path }}"
mode: "0755"
become: true
when: ansible_os_family == 'Debian'
- name: Create docker group - name: Create docker group
group: group:
name: "{{ docker_user.name }}" name: "{{ docker_user.name }}"