From 393cf4134900910f3ebea9335279d356ccf4187d Mon Sep 17 00:00:00 2001 From: Jannik Beyerstedt Date: Sat, 25 Sep 2021 23:39:19 +0200 Subject: [PATCH] Docker compose: Fix ansible module dependency --- README.md | 2 +- defaults/main.yml | 2 -- tasks/docker-Debian.yml | 34 ++-------------------------------- tasks/docker.yml | 2 +- 4 files changed, 4 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 10c9e19..104df96 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Mandatory variable: ### Docker Optional variable: -- `dockercompose_use_pip`: boolean to use pip instead of manual download (default: false) +- none ### DynDNS This task and it's configuration files might be quite specific for the [davd/docker-ddns](https://github.com/dprandzioch/docker-ddns) docker container. diff --git a/defaults/main.yml b/defaults/main.yml index a6767f3..f2a842a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -10,6 +10,4 @@ telegraf_docker_file: "telegraf-docker.conf" telegraf_unifi_file: "telegraf-UniFi.conf.j2" telegraf_airmax_file: "telegraf-AirMAX.conf.j2" -dockercompose_use_pip: false - exim_etc_mailname: "{{ inventory_hostname }}" diff --git a/tasks/docker-Debian.yml b/tasks/docker-Debian.yml index 3437c70..4db416c 100644 --- a/tasks/docker-Debian.yml +++ b/tasks/docker-Debian.yml @@ -1,7 +1,7 @@ --- # Server/Borgbackup: Install and Setup Borgbackup Backup Crobjob - Default Debian Version # Variables: -# - dockercompose_use_pip: boolean to use pip instead of manual download (default: false) +# - none # Detect some more host facts - name: docker - Detect architecture @@ -50,36 +50,7 @@ update_cache: yes cache_valid_time: "3600" -# Install latest release of docker-compose (using pip3) -# docker only provides pre-compiled binaries for x86_64, but not for armhf/ arm64! -# but ansible needs the python package anyway -- name: docker-compose - Discover if ARM is used - ansible.builtin.set_fact: - dockercompose_use_pip: true - when: ansible_architecture == "aarch64" or ansible_architecture == "armv7l" - -- name: docker-compose - Install x86_46 binary - block: - - name: docker-compose - Get version number of stable - ansible.builtin.shell: | - curl -s https://api.github.com/repos/docker/compose/releases/latest \ - | grep tag_name \ - | cut -d '"' -f 4 - args: - warn: false - register: latest_dc_version - - name: docker-compose - Download and install - become: yes - ansible.builtin.get_url: - url: "https://github.com/docker/compose/releases/download/{{ latest_dc_version.stdout }}/docker-compose-Linux-x86_64" - dest: /usr/local/bin/docker-compose - force: yes # otherwise updates will not be downloaded - - name: docker-compose - Make docker-compose executable - become: yes - ansible.builtin.file: - path: /usr/local/bin/docker-compose - mode: 0755 - when: dockercompose_use_pip == false and ansible_architecture == "x86_64" +# Just always use the python package, because the ansible module won't work otherwise - name: docker-compose - Install python package block: - name: docker-compose - Install requirements @@ -96,4 +67,3 @@ ansible.builtin.pip: name: docker-compose executable: pip3 - when: dockercompose_use_pip == true diff --git a/tasks/docker.yml b/tasks/docker.yml index 1e45cae..1791263 100644 --- a/tasks/docker.yml +++ b/tasks/docker.yml @@ -1,7 +1,7 @@ --- # Server/Docker: Install Docker and Docker-Compose # Variables: -# - dockercompose_use_pip: boolean to use pip instead of manual download (default: false) +# - none - name: docker - Install ansible.builtin.include_tasks: "{{ item }}"