ansible-nas/roles/ansible-nas-docker/tasks/main.yml
David Stephens fa83a14cad Fix linting
2022-08-23 22:26:40 +01:00

45 lines
903 B
YAML

---
- name: Install python3-pip
apt:
name: python3-pip
state: present
register: result
until: result is succeeded
- name: Remove docker-py python module
pip:
name: docker-py
state: absent
register: result
until: result is succeeded
- name: Install docker python module
pip:
name: docker
state: present
register: result
until: result is succeeded
- name: Create Docker home directory
file:
path: "{{ docker_home }}"
mode: 0755
state: directory
- name: Add user account to Docker group
user:
name: "{{ ansible_nas_user }}"
groups: docker
append: yes
- name: Generate Docker daemon.json
copy:
dest: /etc/docker/daemon.json
content: "{{ docker_daemon_json | to_nice_json }}"
register: docker_config
- name: Restart Docker # noqa no-handler
service:
name: docker
state: restarted
when: docker_config.changed