You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.0 KiB

- hosts: attitude-adjuster
become: yes
tasks:
- name: install dependencies
package:
name: "{{ item }}"
state: present
with_items:
- git
- vim
- import_playbook: security.yml
- import_playbook: docker.yml
- import_playbook: ddclient.yml
- import_playbook: home-assistant.yml
- import_playbook: pihole.yml
- import_playbook: traefik.yml
- hosts: attitude-adjuster
vars_files:
- vars.yml.private
tasks:
- name: docker compose
docker_compose:
project_name: attitude-adjuster
definition:
version: '2'
services:
ddclient:
image: kejadlen/ddclient
container_name: ddclient
environment:
TZ: America/Los_Angeles
volumes:
- /etc/ddclient:/etc/ddclient
networks:
- bridge
restart: always
home_assistant:
container_name: home-assistant
image: homeassistant/raspberrypi3-homeassistant
environment:
TZ: America/Los_Angeles
volumes:
- /etc/homeassistant:/config
network_mode: host
restart: always
pihole:
container_name: pihole
image: pihole/pihole:latest
ports:
- 53:53/tcp
- 53:53/udp
environment:
ServerIP: 192.168.1.101
TZ: America/Los_Angeles
VIRTUAL_HOST: "{{ pihole.host }}"
WEBPASSWORD: "{{ pihole.password }}"
volumes:
- /etc/pihole:/etc/pihole
- /etc/dnsmasq.d:/etc/dnsmasq.d
dns:
- 127.0.0.1
- 1.1.1.1
cap_add:
- NET_ADMIN
networks:
- bridge
restart: always
labels:
- traefik.enable=true
- traefik.frontend.rule=Host:{{ pihole.host }}
- traefik.basic.port=80
- traefik.basic.protocol=http
traefik:
container_name: traefik
image: traefik
command: --api --docker
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/traefik/traefik.toml:/traefik.toml
- /opt/traefik/acme.json:/acme.json
networks:
- bridge
restart: always
labels:
- traefik.enable=true
- traefik.frontend.rule=Host:{{ traefik.host }}
- traefik.frontend.auth.basic.users=alpha:{{ traefik.password | password_hash('md5') | replace('$', '$$') }}
- traefik.basic.port=8080
- traefik.basic.protocol=http
networks:
bridge:
state: present
pull: yes