Skip to content

Pihole Sync

Auto Documentation

Documentation Generated with Python on 2021-04-03

Default Variables

Tasks

main.yml

- name: Generate an OpenSSH keypair with the default values (4096 bits, rsa)
  become: true
  become_user: "{{ main_username }}"
  community.crypto.openssh_keypair:
    path: "~/.ssh/id_rsa"
  register: response

- name: Save Public Key
  copy:
    content: "{{ response.public_key }}"
    dest: "./pub_keys/pihole_sync.pub"
  delegate_to: localhost

- name: Pihole Sync
  docker_container:
    name: pihole_sync
    image: shirom/pihole-sync
    restart_policy: always
    volumes:
      - '~/.ssh:/root/.ssh/:ro'
      - '/etc/pihole/:/mnt/pihole'
    env:
      CLIENTDIR: "pihole@{{ vm_ubnt_secondary_docker_ip }}:/home/pi/pihole/pihole"