summaryrefslogtreecommitdiff
path: root/playbooks/roles/pihole/tasks/main.yml
blob: a0094f4f64f013a6346ab46e089fdbde455ba815 (plain)
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
---

- name: Build pihole compose dirs
  ansible.builtin.file:
    state: directory
    dest: '{{ pihole_base }}/{{ item.path }}'
    owner: 1000
    group: 1000
    mode: 0755
  with_filetree: '../templates'
  when: item.state == 'directory'

- name: Build pihole compose files
  ansible.builtin.template:
    src: '{{ item.src }}'
    dest: '{{ pihole_base }}/{{ item.path }}'
    owner: 1000
    group: 1000
    mode: 0755
  with_filetree: '../templates'
  when: item.state == 'file'

- name: Deploy Pihole stack
  ansible.builtin.command:
    cmd: "docker stack deploy -c {{ pihole_base }}/stacks/docker-compose.yml pihole"