Compare commits

..

2 Commits

Author SHA1 Message Date
ee03f86b3a Merge pull request '[INFO] Créer le rôle' (#1) from alpha into master
Reviewed-on: #1
2023-05-24 09:48:51 +00:00
008003d83a [INFO] Créer le rôle 2023-05-17 15:35:42 +02:00
6 changed files with 76 additions and 3 deletions

View File

@ -1,3 +1,3 @@
# role_modele # role_stubby
Modèle Rôle de déploiement de stubby.

20
defaults/main.yml Normal file
View File

@ -0,0 +1,20 @@
---
# defaults file for dnsmasq
stubby_listen_addresses:
- 127.0.0.1
- 0::1
stubby_upstream_recursive_servers:
- address_data: 2a0f:fc80::0
tls_port: 853
tls_auth_name: "dns0.eu"
- address_data: 2a0f:fc81::0
tls_port: 853
tls_auth_name: "dns0.eu"
- address_data: 193.110.81.0
tls_port: 853
tls_auth_name: "dns0.eu"
- address_data: 185.253.5.0
tls_port: 853
tls_auth_name: "dns0.eu"

8
handlers/main.yml Normal file
View File

@ -0,0 +1,8 @@
---
# handlers file for stubby
- name: Redémarrer stubby.service
ansible.builtin.systemd:
state: restarted
name: stubby.service
become: true

View File

@ -1,7 +1,7 @@
galaxy_info: galaxy_info:
namespace: ykn namespace: ykn
author: pulsar89.5 author: pulsar89.5
description: Rôle modèle description: Rôle de déploiement de stubby
license: GPL-3.0-or-later license: GPL-3.0-or-later

14
tasks/main.yml Normal file
View File

@ -0,0 +1,14 @@
---
# tasks file for stubby
- name: Installer stubby
ansible.builtin.apt:
name: stubby
become: true
- name: configurer stubby
ansible.builtin.template:
src: stubby.yml.j2
dest: /etc/stubby/stubby.yml
become: true
notify: Redémarrer stubby.service

31
templates/stubby.yml.j2 Normal file
View File

@ -0,0 +1,31 @@
# {{ ansible_managed }}
resolution_type: GETDNS_RESOLUTION_STUB
dns_transport_list:
- GETDNS_TRANSPORT_TLS
tls_authentication: GETDNS_AUTHENTICATION_REQUIRED
tls_query_padding_blocksize: 128
edns_client_subnet_private: 1
round_robin_upstreams: 1
idle_timeout: 10000
listen_addresses:
{% for address in stubby_listen_addresses %}
- {{ address }}
{% endfor %}
upstream_recursive_servers:
{% for server in stubby_upstream_recursive_servers %}
- address_data: {{ server.address_data }}
{% if server.tls_port is defined %}
tls_port: {{ server.tls_port }}
{% endif %}
tls_auth_name: "{{ server.tls_auth_name }}"
{% if server.tls_pubkey_pinset is defined %}
tls_pubkey_pinset:
{% for pubkey in server.tls_pubkey_pinset %}
- digest: "{{ pubkey.digest }}"
value: {{ pubkey.value }}
{% endfor %}
{% endif %}
{% endfor %}