ansible/playbooks/pimp.yml

74 lines
2.0 KiB
YAML
Raw Normal View History

2021-02-28 19:48:42 -06:00
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
# Mass storage Pis
- hosts: pi-storage-1.desu.ltd
tasks:
- name: assure mount directory
file: path=/data state=directory
- name: assure mount
mount: path=/data src=LABEL=mass state=mounted
2021-02-28 19:48:42 -06:00
# Multipurpose Pis running unbound
- hosts: pi-mp-1.desu.ltd,pi-mp-2.desu.ltd
vars:
container_default_behavior: no_defaults
tasks:
- name: docker deploy unbound
docker_container:
name: unbound
image: rehashedsalt/unbound-desu-local:latest
restart_policy: unless-stopped
pull: yes
ports:
- "{{ ansible_facts.eth0.ipv4.address }}:53:5053/tcp"
- "{{ ansible_facts.eth0.ipv4.address }}:53:5053/udp"
tags: [ pis, mp, unbound ]
roles:
- role: motd
vars:
motd_watch_services_extra:
- docker
- isc-dhcp-server
tags: [ pis, mp, motd ]
# And also serving DHCP
- hosts: pi-mp-1.desu.ltd
vars_files:
- vars/desulocal-dhcp.yml
roles:
- role: netplan-static-ip
tags: [ pis, mp, dhcp, static-ip ]
- role: dhcp
vars:
dhcp_global_failover_peer: failover-group
dhcp_global_failover:
role: primary
address: 192.168.103.100
port: 647
peer_address: 192.168.103.101
peer_port: 647
max_response_delay: 15
max_unacked_updates: 10
load_balance_max_seconds: 5
split: 255
mclt: 3600
tags: [ pis, mp, dhcp ]
- hosts: pi-mp-2.desu.ltd
vars_files:
- vars/desulocal-dhcp.yml
roles:
- role: netplan-static-ip
tags: [ pis, mp, dhcp, static-ip ]
- role: dhcp
vars:
dhcp_global_failover_peer: failover-group
dhcp_global_failover:
role: secondary
address: 192.168.103.101
port: 647
peer_address: 192.168.103.100
peer_port: 647
max_response_delay: 15
max_unacked_updates: 10
load_balance_max_seconds: 5
tags: [ pis, mp, dhcp ]