diff --git a/README.md b/README.md index 3edfbf7..2928611 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# role_modele +# role_stubby -Modèle \ No newline at end of file +Rôle de déploiement de stubby. diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..aed0150 --- /dev/null +++ b/defaults/main.yml @@ -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" diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..493d3fe --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,8 @@ +--- +# handlers file for stubby + +- name: Redémarrer stubby.service + ansible.builtin.systemd: + state: restarted + name: stubby.service + become: true diff --git a/meta/main.yml b/meta/main.yml index c58bebf..04dc1af 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,7 +1,7 @@ galaxy_info: namespace: ykn author: pulsar89.5 - description: Rôle modèle + description: Rôle de déploiement de stubby license: GPL-3.0-or-later diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..b70b2d5 --- /dev/null +++ b/tasks/main.yml @@ -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 diff --git a/templates/stubby.yml.j2 b/templates/stubby.yml.j2 new file mode 100644 index 0000000..2dd7879 --- /dev/null +++ b/templates/stubby.yml.j2 @@ -0,0 +1,18 @@ +# {{ 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 item in stubby_listen_addresses %} + - {{ item }} +{% endfor %} + +upstream_recursive_servers: + {{ stubby_upstream_recursive_servers | to_nice_yaml(indent=8) }}