2023-12-21 16:13:32 +00:00
|
|
|
- name: Create network
|
|
|
|
docker_network:
|
|
|
|
name: coredns
|
|
|
|
internal: true
|
|
|
|
become: true
|
|
|
|
|
2023-12-14 21:04:26 +00:00
|
|
|
- name: Create install directory
|
|
|
|
file:
|
|
|
|
path: /opt/coredns
|
|
|
|
state: directory
|
|
|
|
owner: "{{ docker_user.name }}"
|
|
|
|
mode: "{{ docker_compose_directory_mask }}"
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Install compose file
|
|
|
|
template:
|
|
|
|
src: files/docker-compose.yml
|
|
|
|
dest: /opt/coredns/docker-compose.yml
|
|
|
|
mode: "{{ docker_compose_file_mask }}"
|
|
|
|
owner: "{{ docker_user.name }}"
|
|
|
|
validate: docker-compose -f %s config
|
|
|
|
notify: restart coredns
|
|
|
|
become: true
|