aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/docker/tasks/main.yml
blob: f4ba814e0c8502016c97c2d4154f49e60877bf83 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
- name: Install Docker
  become: true
  ansible.builtin.apt:
    name:
      - docker.io
      - docker-compose
    state: present
    policy_rc_d: 101
  notify: docker_restart

- name: Configure Docker logging driver
  when: docker_logging_driver is defined and docker_logging_driver
  ansible.builtin.include_tasks: logging.yml

- name: Restart systemd service if necessary
  ansible.builtin.meta: flush_handlers

- name: Clean up Docker data
  become: true
  community.docker.docker_prune:
    builder_cache: true
    containers: true
    images: true
    images_filters:
      dangling: false
    networks: true
    volumes: true