add docker-app with completion

This commit is contained in:
nouchka 2019-01-06 20:37:07 +01:00
parent 2c0b645e4d
commit 9a62b70c59
No known key found for this signature in database
GPG Key ID: CE33EAF5679B12A3
3 changed files with 52 additions and 1 deletions

View File

@ -11,10 +11,16 @@ docker_restart_handler_state: restarted
# Docker Compose options.
docker_install_compose: true
docker_compose_version: "1.22.0"
docker_compose_version: "1.23.2"
docker_compose_path: /usr/local/bin/docker-compose
docker_compose_completion_path: /etc/bash_completion.d/docker-compose
# Docker App options.
docker_install_app: true
docker_app_version: "v0.6.0"
docker_app_path: /usr/local/bin/docker-app
docker_app_completion_path: /etc/bash_completion.d/docker-app
# Used only for Debian/Ubuntu. Switch 'stable' to 'edge' if needed.
docker_apt_release_channel: stable
docker_apt_arch: amd64

42
tasks/docker-app.yml Normal file
View File

@ -0,0 +1,42 @@
---
- name: Check current docker-app version.
command: docker-app --version
register: docker_app_current_version
changed_when: false
failed_when: false
check_mode: false
- name: Delete existing docker-app version if it's different.
file:
path: "{{ docker_app_path }}"
state: absent
when: >
docker_app_current_version.stdout is defined
and docker_app_version not in docker_app_current_version.stdout
- name: Download Docker app (if configured).
unarchive:
src: https://github.com/docker/app/releases/download/{{ docker_app_version }}/docker-app-linux.tar.gz
dest: "/tmp"
remote_src: yes
when: >
docker_app_current_version.stdout is defined
and docker_app_version not in docker_app_current_version.stdout
or not docker_app_current_version.stdout is defined
- name: Install Docker app (if configured).
copy:
src: /tmp/docker-app-linux
dest: "{{ docker_app_path }}"
remote_src: yes
mode: 0755
when: >
docker_app_current_version.stdout is defined
and docker_app_version not in docker_app_current_version.stdout
or not docker_app_current_version.stdout is defined
- name: Install Docker app completion
shell: "docker-app completion >> {{ docker_app_completion_path }}"
args:
creates: "{{ docker_app_completion_path }}"

View File

@ -27,5 +27,8 @@
- include_tasks: docker-compose.yml
when: docker_install_compose
- include_tasks: docker-app.yml
when: docker_install_app
- include_tasks: docker-users.yml
when: docker_users