Skip to content

Commit

Permalink
Docker CE: Install Docker credential helpers.
Browse files Browse the repository at this point in the history
Installation is optional and can be turned off by setting variable
`docker_credential_helpers_release` to 0.
  • Loading branch information
riccardomurri committed Apr 17, 2020
1 parent 9d99b82 commit 776fbea
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/playbooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,13 @@ The following variables may be set to alter the role behavior:
set it to 0 or the empty string to skip installing ``docker-compose``.

.. __: https://github.com/docker/compose/releases
* - ``docker_credential_helpers_release``
- ``v0.6.3``
- What `release of *Docker credential helpers*`__ to install;
set it to 0 or the empty string to skip installing them. Note that
all release tags start with the letter ``v`` (as of April 2020).

.. __: https://github.com/docker/docker-credential-helpers/releases/
* - ``docker_group_members``
- ``[]``
- List of users that are authorized to call the ``docker``
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ docker_prune_frequency: 'daily'
# set it to `null` to skip installing `docker-compose`
docker_compose_release: '1.25.5'

# What release of the Docker credential helpers to install;
# set it to `null` to skip installing them
docker_credential_helpers_release: 'v0.6.3'
23 changes: 23 additions & 0 deletions elasticluster/share/playbooks/roles/docker-ce/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,29 @@
mode: 'u+rwx,g+rx'
when: 'docker_compose_release|bool'


- name: 'Install Docker credential helpers'
unarchive:
src: 'https://github.com/docker/docker-credential-helpers/releases/download/{{ docker_credential_helpers_release }}/docker-credential-{{ item }}-{{ docker_credential_helpers_release }}-amd64.tar.gz'
dest: '/usr/local/bin/'
remote_src: yes
group: 'docker'
mode: 'u+rwx,g+rx'
loop:
- pass
- secretservice
when: 'docker_credential_helpers_release|bool'


- name: 'Install dependencies of Docker credential helpers'
package:
name:
- 'pass'
- 'gnupg2'
state: '{{ pkg_install_state }}'
when: 'docker_credential_helpers_release|bool'


- name: 'Enable Docker service and ensure it (re)starts at boot'
service:
name: 'docker'
Expand Down

0 comments on commit 776fbea

Please sign in to comment.