2023-10-05 22:10:13 +02:00
[![Ansible Galaxy ](https://ansible.l3d.space/svg/l3d.avahi_daemon.svg )](https://galaxy.ansible.com/ui/standalone/roles/l3d/avahi_daemon/)
[![MIT License ](https://ansible.l3d.space/svg/l3d.avahi_daemon_license.svg )](LICENSE)
[![Maintainance ](https://ansible.l3d.space/svg/l3d.avahi_daemon_maintainance.svg )](https://ansible.l3d.space/#l3d.avahi_daemon)
2021-09-02 00:24:53 +02:00
2021-09-02 01:08:52 +02:00
ansible role avahi_daemon
===========================
Ansible role to install the avahi_daemon and optionally announce some services.
2021-09-02 00:24:53 +02:00
2021-09-02 01:36:13 +02:00
Variables
-----------
2021-09-02 11:02:00 +02:00
In the ``avahi_daemon__services`` variable you can define the services you want to announce.
2021-09-02 01:36:13 +02:00
Here is a list with available parameters:
+ ``service``: Service Name *(HTTP/SSH/...)* ** *(required)***
+ ``port``: Service Port ** *(required)***
- ``name``: optional name to announce the Service
- ``protocol``: ``any``/``ipv6``/``ipv4``
- ``txt_records``: an array of txt records
2021-09-02 02:10:18 +02:00
- ``transport``: Transport Protokoll (``tcp``/``udp``)
2021-09-02 01:36:13 +02:00
Example:
```yaml
---
2021-09-02 11:02:00 +02:00
avahi_daemon__services:
2021-09-02 01:36:13 +02:00
- service: 'SSH'
port: 22
protocol: 'any'
2021-09-02 02:10:18 +02:00
transport: 'tcp'
2021-09-02 01:36:13 +02:00
- service: 'NFS'
name: 'Filesharing Host %h'
port: 2049
protocol: 'ipv6'
txt_records:
- 'path=/path/to/nfsexport'
- service: 'FTP'
port: '21'
protocol: 'ipv4'
txt_records:
- 'path=/ftppath'
- 'u=ftpuser'
- 'p=ftppass'
```
2021-09-02 01:08:52 +02:00
Netfilter rules
---------------
Avahi is using multicast to announce services.
2021-09-02 00:24:53 +02:00
Do not forget to add netfilter rules for multicast dns.
Configuration example for `ferm` :
```
# mdns
daddr 224.0.0.251 proto udp dport 5353 ACCEPT;
daddr ff02::fb proto udp dport 5353 ACCEPT;
```
2023-10-05 22:10:13 +02:00
Ansible Collection
--------------------
This role is part of the ``l3d.avahi`` Ansible Collection.
2023-10-05 22:16:18 +02:00
[![collection l3d.avahi ](https://ansible.l3d.space/svg/l3d.avahi_ansible-collection_collection.svg )](https://galaxy.ansible.com/ui/repo/published/l3d/avahi/)
2023-10-05 22:10:13 +02:00
[![Maintainance ](https://ansible.l3d.space/svg/l3d.avahi_maintainance_collection.svg )](https://ansible.l3d.space/#l3d.avahi)
[![License ](https://ansible.l3d.space/svg/l3d.avahi_license_collection.svg )](LICENSE)
Visit the [README.md ](https://github.com/roles-ansible/ansible_collection_avahi#readme ) of the l3d.avahi collection for information about downloading or integrating the collection to your ansible playbook.
### Role Usage Example:
```bash
2021-09-02 00:24:53 +02:00
Links
-----
* http://dns-sd.org/
* http://www.multicastdns.org/
2021-09-02 11:02:00 +02:00
* https://www.ietf.org/rfc/rfc6762.txt
* http://www.dns-sd.org/ServiceTypes.html
2021-09-02 00:24:53 +02:00
2021-09-02 11:02:00 +02:00
- https://www.avahi.org/
- https://github.com/lathiat/avahi
2021-09-02 01:08:52 +02:00
2021-09-02 11:02:00 +02:00
+ https://github.com/lathiat/avahi/blob/master/avahi-daemon/avahi-service.dtd
2021-09-02 00:24:53 +02:00
2021-09-02 11:02:00 +02:00
* https://github.com/lathiat/nss-mdns