feat: docker-compose command-line completion

Added:

- docker-compose comman-line completion installation.

Updated:

- docker-compose updated from 1.26.0 to 1.29.2.
This commit is contained in:
Sergey Gripinskiy 2021-09-11 19:52:48 +03:00
parent 4f4c332aa1
commit f6335e4cbe
No known key found for this signature in database
GPG Key ID: 1E78FEB6C4E420D7
3 changed files with 18 additions and 4 deletions

View File

@ -28,7 +28,7 @@ You can control whether the package is installed, uninstalled, or at the latest
Variables to control the state of the `docker` service, and whether it should start on boot. If you're installing Docker inside a Docker container without systemd or sysvinit, you should set these to `stopped` and set the enabled variable to `no`.
docker_install_compose: true
docker_compose_version: "1.26.0"
docker_compose_version: "1.29.2"
docker_compose_path: /usr/local/bin/docker-compose
Docker Compose installation options.

View File

@ -11,9 +11,11 @@ docker_restart_handler_state: restarted
# Docker Compose options.
docker_install_compose: true
docker_compose_version: "1.26.0"
docker_compose_version: "1.29.2"
docker_compose_url: https://github.com/docker/compose/releases/download/{{ docker_compose_version }}/docker-compose-Linux-x86_64
docker_compose_path: /usr/local/bin/docker-compose
docker_compose_completion_url: https://raw.githubusercontent.com/docker/compose/{{ docker_compose_version }}/contrib/completion/bash/docker-compose
docker_compose_completion_path: /etc/bash_completion.d/docker-compose
# Docker repo URL.
docker_repo_url: https://download.docker.com/linux

View File

@ -5,10 +5,13 @@
changed_when: false
failed_when: false
- name: Delete existing docker-compose version if it's different.
- name: Delete existing docker-compose version with its command-line completion if it's different.
file:
path: "{{ docker_compose_path }}"
path: "{{ item }}"
state: absent
loop:
- "{{ docker_compose_path }}"
- "{{ docker_compose_completion_path }}"
when: >
docker_compose_current_version.stdout is defined
and docker_compose_version not in docker_compose_current_version.stdout
@ -21,3 +24,12 @@
when: >
docker_compose_current_version.stdout is not defined
or docker_compose_version not in docker_compose_current_version.stdout
- name: Install Docker Compose command-line completion (if configured)
get_url:
url: "{{ docker_compose_completion_url }}"
dest: "{{ docker_compose_completion_path }}"
mode: 0644
when: >
docker_compose_current_version.stdout is not defined
or docker_compose_version not in docker_compose_current_version.stdout