Zack Williams | e0d9eb9 | 2020-11-29 22:39:20 -0700 | [diff] [blame] | 1 | --- |
| 2 | # docker tasks/main.yml |
| 3 | # |
| 4 | # SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| 5 | # SPDX-License-Identifier: Apache-2.0 |
| 6 | |
| 7 | - name: include OS-specific vars |
| 8 | include_vars: "{{ ansible_os_family }}.yml" |
| 9 | |
Hyunsun Moon | c272be6 | 2021-12-02 13:54:40 -0800 | [diff] [blame] | 10 | - name: include OS-specific package repo updates |
| 11 | include_tasks: "{{ ansible_os_family }}-repo.yml" |
| 12 | when: docker_add_package_repo | bool |
| 13 | |
Zack Williams | e0d9eb9 | 2020-11-29 22:39:20 -0700 | [diff] [blame] | 14 | - name: include OS-specific tasks |
| 15 | include_tasks: "{{ ansible_os_family }}.yml" |
Hyunsun Moon | c272be6 | 2021-12-02 13:54:40 -0800 | [diff] [blame] | 16 | |
| 17 | - name: ensure /etc/docker/ directory exists |
| 18 | file: |
| 19 | path: /etc/docker |
| 20 | state: directory |
| 21 | mode: 0755 |
| 22 | when: docker_daemon_options.keys() | length > 0 |
| 23 | |
| 24 | - name: configure Docker daemon options |
| 25 | copy: |
| 26 | content: "{{ docker_daemon_options | to_nice_json }}" |
| 27 | dest: /etc/docker/daemon.json |
| 28 | mode: 0644 |
| 29 | when: docker_daemon_options.keys() | length > 0 |
| 30 | notify: restart docker |
| 31 | |
| 32 | - name: install docker compose (if configured). |
| 33 | get_url: |
| 34 | url: "{{ docker_compose_url }}" |
| 35 | checksum: "{{ docker_compose_checksum }}" |
| 36 | dest: "{{ docker_compose_path }}" |
| 37 | mode: 0755 |
| 38 | when: docker_install_compose | bool |