From ac5a6463b4d3ba002e8923f0cd1fd27dbd770da6 Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 2 Sep 2021 03:22:44 +0200 Subject: [PATCH] Change from mdns4 to mdns --- .github/galaxy.svg | 120 ++++++++++++++++++++++++------------- README.md | 10 ++++ defaults/main.yml | 4 ++ templates/nsswitch.conf.j2 | 14 ++--- vars/Archlinux.yml | 2 - vars/Debian.yml | 2 - vars/main.yml | 2 +- vars/os_fallback.yml | 2 - 8 files changed, 101 insertions(+), 55 deletions(-) diff --git a/.github/galaxy.svg b/.github/galaxy.svg index 7f868c1..41bf605 100644 --- a/.github/galaxy.svg +++ b/.github/galaxy.svg @@ -1,59 +1,97 @@ - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - do1jlr.role_name - do1jlr.role_name diff --git a/README.md b/README.md index 9b5145b..3675de6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +[![Galaxy](https://github.com/roles-ansible/ansible_role_avahi_client/raw/main/.github/galaxy.svg)](https://galaxy.ansible.com/do1jlr/avahi_client) +[![License](https://github.com/roles-ansible/ansible_role_avahi_client/raw/main/.github/license.svg)](https://github.com/roles-ansible/ansible_role_avahi_client/blob/main/LICENSE) + ansible role avahi_client =========================== @@ -8,7 +11,14 @@ You can opt-out from deploying a new ``/etc/nsswitch.conf`` config by setting `` You can opt-in in a simple versionscheck that can prevent you from running a older version of this role by setting ``submodules_versioncheck`` to ``true``. +If you want only IPv4 or IPv6 names resolved, change ``mdns`` to ``mdns4`` or ``mdns6`` in these variables: +```yaml +avahi__mdns_name: 'mdns' +avahi__mdns_minimal_name: 'mdns_minimal' +``` + Learn more ------------ + [/etc/nsswitch.conf](https://man7.org/linux/man-pages/man5/nsswitch.conf.5.html) + Avahi [wiki.archlinux.org](https://wiki.archlinux.org/title/Avahi) ++ nss-mdns [0pointer.de](https://0pointer.de/lennart/projects/nss-mdns/#documentation) diff --git a/defaults/main.yml b/defaults/main.yml index 6e81ee2..630d7a2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,5 +2,9 @@ # deploy custom /etc/nsswitch.conf config avahi__configure_nsswitch: true +# mdns resolver name +avahi__mdns_name: 'mdns' +avahi__mdns_minimal_name: 'mdns_minimal' + # should we do a version check? (recomended) submodules_versioncheck: false diff --git a/templates/nsswitch.conf.j2 b/templates/nsswitch.conf.j2 index dbbc48d..f56eb20 100644 --- a/templates/nsswitch.conf.j2 +++ b/templates/nsswitch.conf.j2 @@ -12,12 +12,12 @@ gshadow: files publickey: files -hosts: files mymachines myhostname {{ avahi__mdns_name }} [NOTFOUND=return] resolve [!UNAVAIL=return] dns -networks: nis [NOTFOUND=return] files +hosts: files mymachines myhostname {{ avahi__mdns_minnimal_name }} [NOTFOUND=return] resolve [!UNAVAIL=return] dns {{ avahi__mdns_name }} +networks: files -protocols: nis [NOTFOUND=return] db [NOTFOUND=return] files -services: nis [NOTFOUND=return] db [NOTFOUND=return] files -ethers: nis [NOTFOUND=return] db [NOTFOUND=return] files -rpc: nis [NOTFOUND=return] db [NOTFOUND=return] files +protocols: db [NOTFOUND=return] files +services: db [NOTFOUND=return] files +ethers: db [NOTFOUND=return] files +rpc: db [NOTFOUND=return] files -netgroup: nis [NOTFOUND=return] files +netgroup: files diff --git a/vars/Archlinux.yml b/vars/Archlinux.yml index b9d4225..a884c8e 100644 --- a/vars/Archlinux.yml +++ b/vars/Archlinux.yml @@ -3,5 +3,3 @@ avahi_packages: - avahi - mdns-scan - nss-mdns - -avahi__mdns_name: 'mdns_minimal' diff --git a/vars/Debian.yml b/vars/Debian.yml index a32df45..791e317 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -3,5 +3,3 @@ avahi_packages: - 'avahi-discover' - 'avahi-utils' - 'mdns-scan' - -avahi__mdns_name: 'mdns4_minimal' diff --git a/vars/main.yml b/vars/main.yml index e0a70b8..15c4f74 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,4 +1,4 @@ --- # versionscheck -playbook_version_number: 5 +playbook_version_number: 6 playbook_version_path: 'do1jlr.avahi_client.version' diff --git a/vars/os_fallback.yml b/vars/os_fallback.yml index 5102265..4b6d3e0 100644 --- a/vars/os_fallback.yml +++ b/vars/os_fallback.yml @@ -1,5 +1,3 @@ --- avahi_packages: - mdns-scan - -avahi__mdns_name: 'mdns4_minimal'