feat: Add techtinium dns nodes
This commit is contained in:
@@ -419,3 +419,13 @@ graylog_password_secret: !vault |
|
|||||||
34663031333031396239386361323539613837383230366165653664396135633563633265376333
|
34663031333031396239386361323539613837383230366165653664396135633563633265376333
|
||||||
64346366386136383233613533386437376263653736333437373466353465333339373365376663
|
64346366386136383233613533386437376263653736333437373466353465333339373365376663
|
||||||
336434663137336232636133623132653237
|
336434663137336232636133623132653237
|
||||||
|
|
||||||
|
technitium_web_admin: !vault |
|
||||||
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
|
65313430343864303431623031393535376535666130306139626162336439383464333739623463
|
||||||
|
3839323438323532636631643635653566643037643365610a313237633637613131376338356666
|
||||||
|
35323230303636663265656664333632306365623733623232336631333032656638346538636431
|
||||||
|
3931383564353136640a353634363338646437616565623766653330353662663263663138646531
|
||||||
|
35613361306332616464336232323562643463366139313431336436653536393062663761356337
|
||||||
|
66306532353138663762653338646339613038363035303064666433336333633531626666393239
|
||||||
|
653738616662366532653061326632663333
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
ansible_user: root
|
||||||
|
ansible_host: 10.0.2.49
|
||||||
|
ansible_ssh_pass: "{{ proxmox_api_password }}"
|
||||||
|
vmid: 649
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
ansible_user: root
|
||||||
|
ansible_host: 10.0.2.50
|
||||||
|
ansible_ssh_pass: "{{ proxmox_api_password }}"
|
||||||
|
vmid: 650
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
ansible_user: root
|
||||||
|
ansible_host: 10.0.2.51
|
||||||
|
ansible_ssh_pass: "{{ proxmox_api_password }}"
|
||||||
|
vmid: 651
|
||||||
@@ -18,17 +18,20 @@ paperless
|
|||||||
minio
|
minio
|
||||||
outline
|
outline
|
||||||
#nginx-proxy-manager
|
#nginx-proxy-manager
|
||||||
upsnap
|
#upsnap
|
||||||
#geoguessr
|
#geoguessr
|
||||||
ghostfolio
|
ghostfolio
|
||||||
graylog
|
#graylog
|
||||||
jellyfin
|
#jellyfin
|
||||||
convertx
|
convertx
|
||||||
nocodb
|
#nocodb
|
||||||
super-productivity
|
super-productivity
|
||||||
droposs
|
droposs
|
||||||
ghost
|
ghost
|
||||||
dawarich
|
dawarich
|
||||||
|
technitium-dns
|
||||||
|
technitium-dns-2
|
||||||
|
technitium-dns-3
|
||||||
|
|
||||||
[baremetal]
|
[baremetal]
|
||||||
mipha
|
mipha
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
become: yes
|
||||||
|
roles:
|
||||||
|
- role: 49-technitium-dns/provision/delete
|
||||||
|
vars:
|
||||||
|
vmid: 649
|
||||||
|
- role: 49-technitium-dns/provision/create
|
||||||
|
vars:
|
||||||
|
vmid: 649
|
||||||
|
- role: 49-technitium-dns/provision/start
|
||||||
|
vars:
|
||||||
|
vmid: 649
|
||||||
|
|
||||||
|
- hosts: mipha
|
||||||
|
become: yes
|
||||||
|
roles:
|
||||||
|
- role: 49-technitium-dns/enable-ssh
|
||||||
|
vars:
|
||||||
|
vmid: 649
|
||||||
|
|
||||||
|
- hosts: technitium-dns
|
||||||
|
become: yes
|
||||||
|
roles:
|
||||||
|
- role: 49-technitium-dns/update
|
||||||
|
- role: 49-technitium-dns/install-docker
|
||||||
|
- role: 49-technitium-dns/install-app
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
become: yes
|
||||||
|
roles:
|
||||||
|
- role: 50-technitium-dns-2/provision/delete
|
||||||
|
vars:
|
||||||
|
vmid: 650
|
||||||
|
- role: 50-technitium-dns-2/provision/create
|
||||||
|
vars:
|
||||||
|
vmid: 650
|
||||||
|
- role: 50-technitium-dns-2/provision/start
|
||||||
|
vars:
|
||||||
|
vmid: 650
|
||||||
|
|
||||||
|
- hosts: purah
|
||||||
|
become: yes
|
||||||
|
roles:
|
||||||
|
- role: 50-technitium-dns-2/enable-ssh
|
||||||
|
vars:
|
||||||
|
vmid: 650
|
||||||
|
|
||||||
|
- hosts: technitium-dns-2
|
||||||
|
become: yes
|
||||||
|
roles:
|
||||||
|
- role: 50-technitium-dns-2/update
|
||||||
|
- role: 50-technitium-dns-2/install-docker
|
||||||
|
- role: 50-technitium-dns-2/install-app
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
become: yes
|
||||||
|
roles:
|
||||||
|
- role: 51-technitium-dns-3/provision/delete
|
||||||
|
vars:
|
||||||
|
vmid: 651
|
||||||
|
- role: 51-technitium-dns-3/provision/create
|
||||||
|
vars:
|
||||||
|
vmid: 651
|
||||||
|
- role: 51-technitium-dns-3/provision/start
|
||||||
|
vars:
|
||||||
|
vmid: 651
|
||||||
|
|
||||||
|
- hosts: sidon
|
||||||
|
become: yes
|
||||||
|
roles:
|
||||||
|
- role: 51-technitium-dns-3/enable-ssh
|
||||||
|
vars:
|
||||||
|
vmid: 651
|
||||||
|
|
||||||
|
- hosts: technitium-dns-3
|
||||||
|
become: yes
|
||||||
|
roles:
|
||||||
|
- role: 51-technitium-dns-3/update
|
||||||
|
- role: 51-technitium-dns-3/install-docker
|
||||||
|
- role: 51-technitium-dns-3/install-app
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
# Unable to use ansible.builtin.lineinfile, because we need to run this through the proxmox host (because SSH is not enabled duh)
|
||||||
|
|
||||||
|
- name: Pause for 10 seconds to wait for SSH server
|
||||||
|
ansible.builtin.pause:
|
||||||
|
seconds: 10
|
||||||
|
|
||||||
|
- name: Allow SSH into LXC
|
||||||
|
ansible.builtin.command: lxc-attach -n 649 -- sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
|
||||||
|
|
||||||
|
- name: Restart SSH Service
|
||||||
|
ansible.builtin.command: lxc-attach -n 649 service ssh restart
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
- name: Create directory for docker-compose
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /root/docker/
|
||||||
|
state: directory
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: Copy docker-compose file
|
||||||
|
template:
|
||||||
|
src: "docker-compose.yml"
|
||||||
|
dest: /root/docker/docker-compose.yml
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Run docker-compose
|
||||||
|
ansible.builtin.shell:
|
||||||
|
args:
|
||||||
|
cmd: docker compose up -d
|
||||||
|
chdir: /root/docker/
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
services:
|
||||||
|
dns-server:
|
||||||
|
container_name: dns-server
|
||||||
|
hostname: dns-server
|
||||||
|
image: technitium/dns-server:latest
|
||||||
|
# For DHCP deployments, use "host" network mode and remove all the port mappings, including the ports array by commenting them
|
||||||
|
# network_mode: "host"
|
||||||
|
ports:
|
||||||
|
- "5380:5380/tcp" #DNS web console (HTTP)
|
||||||
|
- "53443:53443/tcp" #DNS web console (HTTPS)
|
||||||
|
- "53:53/udp" #DNS service
|
||||||
|
- "53:53/tcp" #DNS service
|
||||||
|
# - "853:853/udp" #DNS-over-QUIC service
|
||||||
|
# - "853:853/tcp" #DNS-over-TLS service
|
||||||
|
# - "443:443/udp" #DNS-over-HTTPS service (HTTP/3)
|
||||||
|
# - "443:443/tcp" #DNS-over-HTTPS service (HTTP/1.1, HTTP/2)
|
||||||
|
# - "80:80/tcp" #DNS-over-HTTP service (use with reverse proxy or certbot certificate renewal)
|
||||||
|
# - "8053:8053/tcp" #DNS-over-HTTP service (use with reverse proxy)
|
||||||
|
# - "67:67/udp" #DHCP service
|
||||||
|
environment:
|
||||||
|
- DNS_SERVER_DOMAIN=mipha-dns #The primary domain name used by this DNS Server to identify itself.
|
||||||
|
# - DNS_SERVER_ADMIN_PASSWORD="{{ technitium_web_admin }}" #DNS web console admin user password.
|
||||||
|
# - DNS_SERVER_ADMIN_PASSWORD_FILE=password.txt #The path to a file that contains a plain text password for the DNS web console admin user.
|
||||||
|
# - DNS_SERVER_PREFER_IPV6=false #DNS Server will use IPv6 for querying whenever possible with this option enabled.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_LOCAL_ADDRESSES=172.17.0.1,127.0.0.1 #Comma separated list of network interface IP addresses that you want the web service to listen on for requests. The "172.17.0.1" address is the built-in Docker bridge. The "[::]" is the default value if not specified. Note! This must be used only with "host" network mode.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_HTTP_PORT=5380 #The TCP port number for the DNS web console over HTTP protocol.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_HTTPS_PORT=53443 #The TCP port number for the DNS web console over HTTPS protocol.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_ENABLE_HTTPS=false #Enables HTTPS for the DNS web console.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_USE_SELF_SIGNED_CERT=false #Enables self signed TLS certificate for the DNS web console.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_TLS_CERTIFICATE_PATH=/etc/dns/tls/cert.pfx #The file path to the TLS certificate for the DNS web console.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_TLS_CERTIFICATE_PASSWORD=password #The password for the TLS certificate for the DNS web console.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_HTTP_TO_TLS_REDIRECT=false #Enables HTTP to HTTPS redirection for the DNS web console.
|
||||||
|
# - DNS_SERVER_OPTIONAL_PROTOCOL_DNS_OVER_HTTP=false #Enables DNS server optional protocol DNS-over-HTTP on TCP port 8053 to be used with a TLS terminating reverse proxy like nginx.
|
||||||
|
# - DNS_SERVER_RECURSION=AllowOnlyForPrivateNetworks #Recursion options: Allow, Deny, AllowOnlyForPrivateNetworks, UseSpecifiedNetworkACL.
|
||||||
|
# - DNS_SERVER_RECURSION_NETWORK_ACL=192.168.10.0/24, !192.168.10.2 #Comma separated list of IP addresses or network addresses to allow access. Add ! character at the start to deny access, e.g. !192.168.10.0/24 will deny entire subnet. The ACL is processed in the same order its listed. If no networks match, the default policy is to deny all except loopback. Valid only for `UseSpecifiedNetworkACL` recursion option.
|
||||||
|
# - DNS_SERVER_RECURSION_DENIED_NETWORKS=1.1.1.0/24 #Comma separated list of IP addresses or network addresses to deny recursion. Valid only for `UseSpecifiedNetworkACL` recursion option. This option is obsolete and DNS_SERVER_RECURSION_NETWORK_ACL should be used instead.
|
||||||
|
# - DNS_SERVER_RECURSION_ALLOWED_NETWORKS=127.0.0.1, 192.168.1.0/24 #Comma separated list of IP addresses or network addresses to allow recursion. Valid only for `UseSpecifiedNetworkACL` recursion option. This option is obsolete and DNS_SERVER_RECURSION_NETWORK_ACL should be used instead.
|
||||||
|
# - DNS_SERVER_ENABLE_BLOCKING=false #Sets the DNS server to block domain names using Blocked Zone and Block List Zone.
|
||||||
|
# - DNS_SERVER_ALLOW_TXT_BLOCKING_REPORT=false #Specifies if the DNS Server should respond with TXT records containing a blocked domain report for TXT type requests.
|
||||||
|
# - DNS_SERVER_BLOCK_LIST_URLS= #A comma separated list of block list URLs.
|
||||||
|
# - DNS_SERVER_FORWARDERS=1.1.1.1, 8.8.8.8 #Comma separated list of forwarder addresses.
|
||||||
|
# - DNS_SERVER_FORWARDER_PROTOCOL=Tcp #Forwarder protocol options: Udp, Tcp, Tls, Https, HttpsJson.
|
||||||
|
# - DNS_SERVER_LOG_USING_LOCAL_TIME=true #Enable this option to use local time instead of UTC for logging.
|
||||||
|
volumes:
|
||||||
|
- /data:/etc/dns
|
||||||
|
restart: unless-stopped
|
||||||
|
sysctls:
|
||||||
|
- net.ipv4.ip_local_port_range=1024 65535
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
config:
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
- name: Get convenience script
|
||||||
|
uri:
|
||||||
|
url: "https://get.docker.com"
|
||||||
|
method: GET
|
||||||
|
dest: /tmp/get-docker.sh
|
||||||
|
mode: a+x
|
||||||
|
creates: /tmp/get-docker.sh
|
||||||
|
|
||||||
|
- name: Execute script
|
||||||
|
ansible.builtin.shell: /tmp/get-docker.sh
|
||||||
|
|
||||||
|
- name: Ensure group "docker" exists
|
||||||
|
ansible.builtin.group:
|
||||||
|
name: docker
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Add root user to docker group
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: root
|
||||||
|
groups: docker
|
||||||
|
append: yes
|
||||||
|
|
||||||
|
- name: Enable docker on startup
|
||||||
|
ansible.builtin.shell: |
|
||||||
|
systemctl enable docker.service
|
||||||
|
systemctl enable containerd.service
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
- name: Create container
|
||||||
|
community.general.proxmox:
|
||||||
|
vmid: 649
|
||||||
|
node: mipha
|
||||||
|
api_user: root@pam
|
||||||
|
api_password: "{{ proxmox_api_password }}"
|
||||||
|
api_host: 10.0.2.2
|
||||||
|
password: "{{ lxc_password }}"
|
||||||
|
hostname: technitium-dns
|
||||||
|
ostemplate: "local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst"
|
||||||
|
netif: "{'net0':'name=eth0,\
|
||||||
|
gw=10.0.0.1,\
|
||||||
|
ip=10.0.2.49/21,\
|
||||||
|
hwaddr=cc:c6:cf:de:20:49,\
|
||||||
|
bridge=vmbr0'}"
|
||||||
|
cores: 2
|
||||||
|
memory: 4196
|
||||||
|
unprivileged: no
|
||||||
|
swap: 0
|
||||||
|
searchdomain: "home"
|
||||||
|
onboot: 1
|
||||||
|
features:
|
||||||
|
- nesting=1
|
||||||
|
- keyctl=1
|
||||||
|
disk: local-lvm:20
|
||||||
|
mounts: '{
|
||||||
|
"mp0":"local-lvm:10,mp=/data,backup=1"
|
||||||
|
}'
|
||||||
|
force: yes
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
- name: Stop container
|
||||||
|
community.general.proxmox:
|
||||||
|
vmid: "{{ vmid }}"
|
||||||
|
api_user: root@pam
|
||||||
|
api_password: "{{ proxmox_api_password }}"
|
||||||
|
api_host: 10.0.2.2
|
||||||
|
state: stopped
|
||||||
|
ignore_errors: true
|
||||||
|
timeout: 90
|
||||||
|
|
||||||
|
- name: Remove containers
|
||||||
|
community.general.proxmox:
|
||||||
|
vmid: "{{ vmid }}"
|
||||||
|
api_user: root@pam
|
||||||
|
api_password: "{{ proxmox_api_password }}"
|
||||||
|
api_host: 10.0.2.2
|
||||||
|
state: absent
|
||||||
|
ignore_errors: true
|
||||||
|
timeout: 90
|
||||||
|
|
||||||
|
- name: Remove .ssh/known_hosts lines
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: /Users/lino.silva/.ssh/known_hosts
|
||||||
|
state: absent
|
||||||
|
regexp: "^10.0.2.49"
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- name: Start deployments
|
||||||
|
community.general.proxmox:
|
||||||
|
vmid: "{{ vmid }}"
|
||||||
|
api_user: root@pam
|
||||||
|
api_password: "{{ proxmox_api_password }}"
|
||||||
|
api_host: 10.0.2.2
|
||||||
|
state: started
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: Update all packages to their latest version
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt:
|
||||||
|
update_cache: yes
|
||||||
|
upgrade: full
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
# Unable to use ansible.builtin.lineinfile, because we need to run this through the proxmox host (because SSH is not enabled duh)
|
||||||
|
|
||||||
|
- name: Pause for 10 seconds to wait for SSH server
|
||||||
|
ansible.builtin.pause:
|
||||||
|
seconds: 10
|
||||||
|
|
||||||
|
- name: Allow SSH into LXC
|
||||||
|
ansible.builtin.command: lxc-attach -n 650 -- sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
|
||||||
|
|
||||||
|
- name: Restart SSH Service
|
||||||
|
ansible.builtin.command: lxc-attach -n 650 service ssh restart
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
- name: Create directory for docker-compose
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /root/docker/
|
||||||
|
state: directory
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: Copy docker-compose file
|
||||||
|
template:
|
||||||
|
src: "docker-compose.yml"
|
||||||
|
dest: /root/docker/docker-compose.yml
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Run docker-compose
|
||||||
|
ansible.builtin.shell:
|
||||||
|
args:
|
||||||
|
cmd: docker compose up -d
|
||||||
|
chdir: /root/docker/
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
services:
|
||||||
|
dns-server:
|
||||||
|
container_name: dns-server
|
||||||
|
hostname: dns-server
|
||||||
|
image: technitium/dns-server:latest
|
||||||
|
# For DHCP deployments, use "host" network mode and remove all the port mappings, including the ports array by commenting them
|
||||||
|
# network_mode: "host"
|
||||||
|
ports:
|
||||||
|
- "5380:5380/tcp" #DNS web console (HTTP)
|
||||||
|
- "53443:53443/tcp" #DNS web console (HTTPS)
|
||||||
|
- "53:53/udp" #DNS service
|
||||||
|
- "53:53/tcp" #DNS service
|
||||||
|
# - "853:853/udp" #DNS-over-QUIC service
|
||||||
|
# - "853:853/tcp" #DNS-over-TLS service
|
||||||
|
# - "443:443/udp" #DNS-over-HTTPS service (HTTP/3)
|
||||||
|
# - "443:443/tcp" #DNS-over-HTTPS service (HTTP/1.1, HTTP/2)
|
||||||
|
# - "80:80/tcp" #DNS-over-HTTP service (use with reverse proxy or certbot certificate renewal)
|
||||||
|
# - "8053:8053/tcp" #DNS-over-HTTP service (use with reverse proxy)
|
||||||
|
# - "67:67/udp" #DHCP service
|
||||||
|
environment:
|
||||||
|
- DNS_SERVER_DOMAIN=purah-dns #The primary domain name used by this DNS Server to identify itself.
|
||||||
|
# - DNS_SERVER_ADMIN_PASSWORD="{{ technitium_web_admin }}" #DNS web console admin user password.
|
||||||
|
# - DNS_SERVER_ADMIN_PASSWORD_FILE=password.txt #The path to a file that contains a plain text password for the DNS web console admin user.
|
||||||
|
# - DNS_SERVER_PREFER_IPV6=false #DNS Server will use IPv6 for querying whenever possible with this option enabled.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_LOCAL_ADDRESSES=172.17.0.1,127.0.0.1 #Comma separated list of network interface IP addresses that you want the web service to listen on for requests. The "172.17.0.1" address is the built-in Docker bridge. The "[::]" is the default value if not specified. Note! This must be used only with "host" network mode.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_HTTP_PORT=5380 #The TCP port number for the DNS web console over HTTP protocol.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_HTTPS_PORT=53443 #The TCP port number for the DNS web console over HTTPS protocol.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_ENABLE_HTTPS=false #Enables HTTPS for the DNS web console.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_USE_SELF_SIGNED_CERT=false #Enables self signed TLS certificate for the DNS web console.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_TLS_CERTIFICATE_PATH=/etc/dns/tls/cert.pfx #The file path to the TLS certificate for the DNS web console.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_TLS_CERTIFICATE_PASSWORD=password #The password for the TLS certificate for the DNS web console.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_HTTP_TO_TLS_REDIRECT=false #Enables HTTP to HTTPS redirection for the DNS web console.
|
||||||
|
# - DNS_SERVER_OPTIONAL_PROTOCOL_DNS_OVER_HTTP=false #Enables DNS server optional protocol DNS-over-HTTP on TCP port 8053 to be used with a TLS terminating reverse proxy like nginx.
|
||||||
|
# - DNS_SERVER_RECURSION=AllowOnlyForPrivateNetworks #Recursion options: Allow, Deny, AllowOnlyForPrivateNetworks, UseSpecifiedNetworkACL.
|
||||||
|
# - DNS_SERVER_RECURSION_NETWORK_ACL=192.168.10.0/24, !192.168.10.2 #Comma separated list of IP addresses or network addresses to allow access. Add ! character at the start to deny access, e.g. !192.168.10.0/24 will deny entire subnet. The ACL is processed in the same order its listed. If no networks match, the default policy is to deny all except loopback. Valid only for `UseSpecifiedNetworkACL` recursion option.
|
||||||
|
# - DNS_SERVER_RECURSION_DENIED_NETWORKS=1.1.1.0/24 #Comma separated list of IP addresses or network addresses to deny recursion. Valid only for `UseSpecifiedNetworkACL` recursion option. This option is obsolete and DNS_SERVER_RECURSION_NETWORK_ACL should be used instead.
|
||||||
|
# - DNS_SERVER_RECURSION_ALLOWED_NETWORKS=127.0.0.1, 192.168.1.0/24 #Comma separated list of IP addresses or network addresses to allow recursion. Valid only for `UseSpecifiedNetworkACL` recursion option. This option is obsolete and DNS_SERVER_RECURSION_NETWORK_ACL should be used instead.
|
||||||
|
# - DNS_SERVER_ENABLE_BLOCKING=false #Sets the DNS server to block domain names using Blocked Zone and Block List Zone.
|
||||||
|
# - DNS_SERVER_ALLOW_TXT_BLOCKING_REPORT=false #Specifies if the DNS Server should respond with TXT records containing a blocked domain report for TXT type requests.
|
||||||
|
# - DNS_SERVER_BLOCK_LIST_URLS= #A comma separated list of block list URLs.
|
||||||
|
# - DNS_SERVER_FORWARDERS=1.1.1.1, 8.8.8.8 #Comma separated list of forwarder addresses.
|
||||||
|
# - DNS_SERVER_FORWARDER_PROTOCOL=Tcp #Forwarder protocol options: Udp, Tcp, Tls, Https, HttpsJson.
|
||||||
|
# - DNS_SERVER_LOG_USING_LOCAL_TIME=true #Enable this option to use local time instead of UTC for logging.
|
||||||
|
volumes:
|
||||||
|
- /data:/etc/dns
|
||||||
|
restart: unless-stopped
|
||||||
|
sysctls:
|
||||||
|
- net.ipv4.ip_local_port_range=1024 65535
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
config:
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
- name: Get convenience script
|
||||||
|
uri:
|
||||||
|
url: "https://get.docker.com"
|
||||||
|
method: GET
|
||||||
|
dest: /tmp/get-docker.sh
|
||||||
|
mode: a+x
|
||||||
|
creates: /tmp/get-docker.sh
|
||||||
|
|
||||||
|
- name: Execute script
|
||||||
|
ansible.builtin.shell: /tmp/get-docker.sh
|
||||||
|
|
||||||
|
- name: Ensure group "docker" exists
|
||||||
|
ansible.builtin.group:
|
||||||
|
name: docker
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Add root user to docker group
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: root
|
||||||
|
groups: docker
|
||||||
|
append: yes
|
||||||
|
|
||||||
|
- name: Enable docker on startup
|
||||||
|
ansible.builtin.shell: |
|
||||||
|
systemctl enable docker.service
|
||||||
|
systemctl enable containerd.service
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
- name: Create container
|
||||||
|
community.general.proxmox:
|
||||||
|
vmid: 650
|
||||||
|
node: purah
|
||||||
|
api_user: root@pam
|
||||||
|
api_password: "{{ proxmox_api_password }}"
|
||||||
|
api_host: 10.0.2.2
|
||||||
|
password: "{{ lxc_password }}"
|
||||||
|
hostname: technitium-dns-2
|
||||||
|
ostemplate: "local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst"
|
||||||
|
netif: "{'net0':'name=eth0,\
|
||||||
|
gw=10.0.0.1,\
|
||||||
|
ip=10.0.2.50/21,\
|
||||||
|
hwaddr=cc:c6:cf:de:20:50,\
|
||||||
|
bridge=vmbr0'}"
|
||||||
|
cores: 2
|
||||||
|
memory: 4196
|
||||||
|
unprivileged: no
|
||||||
|
swap: 0
|
||||||
|
searchdomain: "home"
|
||||||
|
onboot: 1
|
||||||
|
features:
|
||||||
|
- nesting=1
|
||||||
|
- keyctl=1
|
||||||
|
disk: purah-mirror-860gb:20
|
||||||
|
mounts: '{
|
||||||
|
"mp0":"purah-mirror-860gb:10,mp=/data,backup=1"
|
||||||
|
}'
|
||||||
|
force: yes
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
- name: Stop container
|
||||||
|
community.general.proxmox:
|
||||||
|
vmid: "{{ vmid }}"
|
||||||
|
api_user: root@pam
|
||||||
|
api_password: "{{ proxmox_api_password }}"
|
||||||
|
api_host: 10.0.2.2
|
||||||
|
state: stopped
|
||||||
|
ignore_errors: true
|
||||||
|
timeout: 90
|
||||||
|
|
||||||
|
- name: Remove containers
|
||||||
|
community.general.proxmox:
|
||||||
|
vmid: "{{ vmid }}"
|
||||||
|
api_user: root@pam
|
||||||
|
api_password: "{{ proxmox_api_password }}"
|
||||||
|
api_host: 10.0.2.2
|
||||||
|
state: absent
|
||||||
|
ignore_errors: true
|
||||||
|
timeout: 90
|
||||||
|
|
||||||
|
- name: Remove .ssh/known_hosts lines
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: /Users/lino.silva/.ssh/known_hosts
|
||||||
|
state: absent
|
||||||
|
regexp: "^10.0.2.50"
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- name: Start deployments
|
||||||
|
community.general.proxmox:
|
||||||
|
vmid: "{{ vmid }}"
|
||||||
|
api_user: root@pam
|
||||||
|
api_password: "{{ proxmox_api_password }}"
|
||||||
|
api_host: 10.0.2.2
|
||||||
|
state: started
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: Update all packages to their latest version
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt:
|
||||||
|
update_cache: yes
|
||||||
|
upgrade: full
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
# Unable to use ansible.builtin.lineinfile, because we need to run this through the proxmox host (because SSH is not enabled duh)
|
||||||
|
|
||||||
|
- name: Pause for 10 seconds to wait for SSH server
|
||||||
|
ansible.builtin.pause:
|
||||||
|
seconds: 10
|
||||||
|
|
||||||
|
- name: Allow SSH into LXC
|
||||||
|
ansible.builtin.command: lxc-attach -n 651 -- sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
|
||||||
|
|
||||||
|
- name: Restart SSH Service
|
||||||
|
ansible.builtin.command: lxc-attach -n 651 service ssh restart
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
- name: Create directory for docker-compose
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /root/docker/
|
||||||
|
state: directory
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: Copy docker-compose file
|
||||||
|
template:
|
||||||
|
src: "docker-compose.yml"
|
||||||
|
dest: /root/docker/docker-compose.yml
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Run docker-compose
|
||||||
|
ansible.builtin.shell:
|
||||||
|
args:
|
||||||
|
cmd: docker compose up -d
|
||||||
|
chdir: /root/docker/
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
services:
|
||||||
|
dns-server:
|
||||||
|
container_name: dns-server
|
||||||
|
hostname: dns-server
|
||||||
|
image: technitium/dns-server:latest
|
||||||
|
# For DHCP deployments, use "host" network mode and remove all the port mappings, including the ports array by commenting them
|
||||||
|
# network_mode: "host"
|
||||||
|
ports:
|
||||||
|
- "5380:5380/tcp" #DNS web console (HTTP)
|
||||||
|
- "53443:53443/tcp" #DNS web console (HTTPS)
|
||||||
|
- "53:53/udp" #DNS service
|
||||||
|
- "53:53/tcp" #DNS service
|
||||||
|
# - "853:853/udp" #DNS-over-QUIC service
|
||||||
|
# - "853:853/tcp" #DNS-over-TLS service
|
||||||
|
# - "443:443/udp" #DNS-over-HTTPS service (HTTP/3)
|
||||||
|
# - "443:443/tcp" #DNS-over-HTTPS service (HTTP/1.1, HTTP/2)
|
||||||
|
# - "80:80/tcp" #DNS-over-HTTP service (use with reverse proxy or certbot certificate renewal)
|
||||||
|
# - "8053:8053/tcp" #DNS-over-HTTP service (use with reverse proxy)
|
||||||
|
# - "67:67/udp" #DHCP service
|
||||||
|
environment:
|
||||||
|
- DNS_SERVER_DOMAIN=sidon-dns #The primary domain name used by this DNS Server to identify itself.
|
||||||
|
# - DNS_SERVER_ADMIN_PASSWORD="{{ technitium_web_admin }}" #DNS web console admin user password.
|
||||||
|
# - DNS_SERVER_ADMIN_PASSWORD_FILE=password.txt #The path to a file that contains a plain text password for the DNS web console admin user.
|
||||||
|
# - DNS_SERVER_PREFER_IPV6=false #DNS Server will use IPv6 for querying whenever possible with this option enabled.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_LOCAL_ADDRESSES=172.17.0.1,127.0.0.1 #Comma separated list of network interface IP addresses that you want the web service to listen on for requests. The "172.17.0.1" address is the built-in Docker bridge. The "[::]" is the default value if not specified. Note! This must be used only with "host" network mode.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_HTTP_PORT=5380 #The TCP port number for the DNS web console over HTTP protocol.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_HTTPS_PORT=53443 #The TCP port number for the DNS web console over HTTPS protocol.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_ENABLE_HTTPS=false #Enables HTTPS for the DNS web console.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_USE_SELF_SIGNED_CERT=false #Enables self signed TLS certificate for the DNS web console.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_TLS_CERTIFICATE_PATH=/etc/dns/tls/cert.pfx #The file path to the TLS certificate for the DNS web console.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_TLS_CERTIFICATE_PASSWORD=password #The password for the TLS certificate for the DNS web console.
|
||||||
|
# - DNS_SERVER_WEB_SERVICE_HTTP_TO_TLS_REDIRECT=false #Enables HTTP to HTTPS redirection for the DNS web console.
|
||||||
|
# - DNS_SERVER_OPTIONAL_PROTOCOL_DNS_OVER_HTTP=false #Enables DNS server optional protocol DNS-over-HTTP on TCP port 8053 to be used with a TLS terminating reverse proxy like nginx.
|
||||||
|
# - DNS_SERVER_RECURSION=AllowOnlyForPrivateNetworks #Recursion options: Allow, Deny, AllowOnlyForPrivateNetworks, UseSpecifiedNetworkACL.
|
||||||
|
# - DNS_SERVER_RECURSION_NETWORK_ACL=192.168.10.0/24, !192.168.10.2 #Comma separated list of IP addresses or network addresses to allow access. Add ! character at the start to deny access, e.g. !192.168.10.0/24 will deny entire subnet. The ACL is processed in the same order its listed. If no networks match, the default policy is to deny all except loopback. Valid only for `UseSpecifiedNetworkACL` recursion option.
|
||||||
|
# - DNS_SERVER_RECURSION_DENIED_NETWORKS=1.1.1.0/24 #Comma separated list of IP addresses or network addresses to deny recursion. Valid only for `UseSpecifiedNetworkACL` recursion option. This option is obsolete and DNS_SERVER_RECURSION_NETWORK_ACL should be used instead.
|
||||||
|
# - DNS_SERVER_RECURSION_ALLOWED_NETWORKS=127.0.0.1, 192.168.1.0/24 #Comma separated list of IP addresses or network addresses to allow recursion. Valid only for `UseSpecifiedNetworkACL` recursion option. This option is obsolete and DNS_SERVER_RECURSION_NETWORK_ACL should be used instead.
|
||||||
|
# - DNS_SERVER_ENABLE_BLOCKING=false #Sets the DNS server to block domain names using Blocked Zone and Block List Zone.
|
||||||
|
# - DNS_SERVER_ALLOW_TXT_BLOCKING_REPORT=false #Specifies if the DNS Server should respond with TXT records containing a blocked domain report for TXT type requests.
|
||||||
|
# - DNS_SERVER_BLOCK_LIST_URLS= #A comma separated list of block list URLs.
|
||||||
|
# - DNS_SERVER_FORWARDERS=1.1.1.1, 8.8.8.8 #Comma separated list of forwarder addresses.
|
||||||
|
# - DNS_SERVER_FORWARDER_PROTOCOL=Tcp #Forwarder protocol options: Udp, Tcp, Tls, Https, HttpsJson.
|
||||||
|
# - DNS_SERVER_LOG_USING_LOCAL_TIME=true #Enable this option to use local time instead of UTC for logging.
|
||||||
|
volumes:
|
||||||
|
- /data:/etc/dns
|
||||||
|
restart: unless-stopped
|
||||||
|
sysctls:
|
||||||
|
- net.ipv4.ip_local_port_range=1024 65535
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
config:
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
- name: Get convenience script
|
||||||
|
uri:
|
||||||
|
url: "https://get.docker.com"
|
||||||
|
method: GET
|
||||||
|
dest: /tmp/get-docker.sh
|
||||||
|
mode: a+x
|
||||||
|
creates: /tmp/get-docker.sh
|
||||||
|
|
||||||
|
- name: Execute script
|
||||||
|
ansible.builtin.shell: /tmp/get-docker.sh
|
||||||
|
|
||||||
|
- name: Ensure group "docker" exists
|
||||||
|
ansible.builtin.group:
|
||||||
|
name: docker
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Add root user to docker group
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: root
|
||||||
|
groups: docker
|
||||||
|
append: yes
|
||||||
|
|
||||||
|
- name: Enable docker on startup
|
||||||
|
ansible.builtin.shell: |
|
||||||
|
systemctl enable docker.service
|
||||||
|
systemctl enable containerd.service
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
- name: Create container
|
||||||
|
community.general.proxmox:
|
||||||
|
vmid: 651
|
||||||
|
node: sidon
|
||||||
|
api_user: root@pam
|
||||||
|
api_password: "{{ proxmox_api_password }}"
|
||||||
|
api_host: 10.0.2.2
|
||||||
|
password: "{{ lxc_password }}"
|
||||||
|
hostname: technitium-dns-3
|
||||||
|
ostemplate: "local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst"
|
||||||
|
netif: "{'net0':'name=eth0,\
|
||||||
|
gw=10.0.0.1,\
|
||||||
|
ip=10.0.2.51/21,\
|
||||||
|
hwaddr=cc:c6:cf:de:20:51,\
|
||||||
|
bridge=vmbr0'}"
|
||||||
|
cores: 2
|
||||||
|
memory: 4196
|
||||||
|
unprivileged: no
|
||||||
|
swap: 0
|
||||||
|
searchdomain: "home"
|
||||||
|
onboot: 1
|
||||||
|
features:
|
||||||
|
- nesting=1
|
||||||
|
- keyctl=1
|
||||||
|
disk: rest:20
|
||||||
|
mounts: '{
|
||||||
|
"mp0":"rest:10,mp=/data,backup=1"
|
||||||
|
}'
|
||||||
|
force: yes
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
- name: Stop container
|
||||||
|
community.general.proxmox:
|
||||||
|
vmid: "{{ vmid }}"
|
||||||
|
api_user: root@pam
|
||||||
|
api_password: "{{ proxmox_api_password }}"
|
||||||
|
api_host: 10.0.2.2
|
||||||
|
state: stopped
|
||||||
|
ignore_errors: true
|
||||||
|
timeout: 90
|
||||||
|
|
||||||
|
- name: Remove containers
|
||||||
|
community.general.proxmox:
|
||||||
|
vmid: "{{ vmid }}"
|
||||||
|
api_user: root@pam
|
||||||
|
api_password: "{{ proxmox_api_password }}"
|
||||||
|
api_host: 10.0.2.2
|
||||||
|
state: absent
|
||||||
|
ignore_errors: true
|
||||||
|
timeout: 90
|
||||||
|
|
||||||
|
- name: Remove .ssh/known_hosts lines
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: /Users/lino.silva/.ssh/known_hosts
|
||||||
|
state: absent
|
||||||
|
regexp: "^10.0.2.51"
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- name: Start deployments
|
||||||
|
community.general.proxmox:
|
||||||
|
vmid: "{{ vmid }}"
|
||||||
|
api_user: root@pam
|
||||||
|
api_password: "{{ proxmox_api_password }}"
|
||||||
|
api_host: 10.0.2.2
|
||||||
|
state: started
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: Update all packages to their latest version
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt:
|
||||||
|
update_cache: yes
|
||||||
|
upgrade: full
|
||||||
Reference in New Issue
Block a user