Skip to content

Instantly share code, notes, and snippets.

@chadgeary
Last active March 5, 2021 17:21
Show Gist options
  • Select an option

  • Save chadgeary/6d5e45114b248c5d25faed2837e7e739 to your computer and use it in GitHub Desktop.

Select an option

Save chadgeary/6d5e45114b248c5d25faed2837e7e739 to your computer and use it in GitHub Desktop.
wireguard2.yml
- name: wireguard2 container
docker_container:
name: wireguard2
capabilities:
- NET_ADMIN
- SYS_MODULE
env:
PUID: "1000"
PGID: "1000"
TZ: "Etc/UTC"
SERVERURL: "auto"
SERVERPORT: "51821"
ALLOWEDIPS: "{% if vpn_traffic is not defined %}{{ docker_pihole }}/32,{{ docker_webproxy }}/32{% elif vpn_traffic == 'dns' %}{{ docker_pihole }}/32,{{ docker_webproxy }}/32{% elif vpn_traffic == 'peers' %}{{ docker_pihole }}/32,{{ docker_webproxy }}/32,{{ wireguard_network2 }}/24{% elif vpn_traffic == 'all' %}0.0.0.0/0{% else %}{{ docker_pihole }}/32,{{ docker_webproxy }}/32{% endif %}"
PEERS: "{{ wireguard_peers }}"
PEERDNS: "{{ docker_pihole }}"
INTERNAL_SUBNET: "{{ wireguard_network2 }}"
image: linuxserver/wireguard:latest
networks:
- name: cloudblock
ipv4_address: "{{ docker_wireguard2 }}"
ports:
- "51821:51821/udp"
sysctls:
net.ipv4.conf.all.src_valid_mark: 1
volumes:
- /opt/wireguard2:/config:rw
pull: yes
restart_policy: "always"
purge_networks: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment