2017-08-28 15:31:54 +00:00
|
|
|
---
|
2021-01-12 12:56:03 +00:00
|
|
|
- name: Install python3-pip
|
2019-01-05 04:05:41 +00:00
|
|
|
apt:
|
|
|
|
name: python3-pip
|
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2017-08-28 15:31:54 +00:00
|
|
|
|
2021-01-12 12:56:03 +00:00
|
|
|
- name: Remove docker-py python module
|
2020-01-22 22:59:16 +00:00
|
|
|
pip:
|
|
|
|
name: docker-py
|
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
|
|
|
|
2021-01-12 12:56:03 +00:00
|
|
|
- name: Install docker python module
|
2017-08-28 15:31:54 +00:00
|
|
|
pip:
|
2020-01-20 21:49:46 +00:00
|
|
|
name: docker
|
2017-08-28 15:31:54 +00:00
|
|
|
state: present
|
2018-12-23 16:50:20 +00:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2017-08-28 15:31:54 +00:00
|
|
|
|
2021-01-12 12:56:03 +00:00
|
|
|
- name: Create Docker home directory
|
2017-08-28 15:31:54 +00:00
|
|
|
file:
|
|
|
|
path: "{{ docker_home }}"
|
|
|
|
mode: 0755
|
|
|
|
state: directory
|
|
|
|
|
2021-01-12 12:56:03 +00:00
|
|
|
- name: Add user account to Docker group
|
2017-08-28 15:31:54 +00:00
|
|
|
user:
|
|
|
|
name: "{{ ansible_nas_user }}"
|
2019-12-08 22:16:24 +00:00
|
|
|
groups: docker
|
2017-08-28 15:31:54 +00:00
|
|
|
append: yes
|
|
|
|
|
2021-01-12 12:56:03 +00:00
|
|
|
- name: Update Docker home from install default
|
2017-08-28 15:31:54 +00:00
|
|
|
template:
|
2021-01-12 12:56:03 +00:00
|
|
|
src: daemon.json
|
2017-08-28 15:31:54 +00:00
|
|
|
dest: /etc/docker/daemon.json
|
|
|
|
register: docker_config
|
|
|
|
|
2021-01-12 12:56:03 +00:00
|
|
|
- name: Restart Docker
|
2017-08-28 15:31:54 +00:00
|
|
|
service:
|
2021-02-21 19:50:07 +00:00
|
|
|
name: docker
|
|
|
|
state: restarted
|
2018-12-08 22:44:51 +00:00
|
|
|
when: docker_config.changed
|
|
|
|
tags:
|
2020-01-20 21:49:46 +00:00
|
|
|
- skip_ansible_lint
|