1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_avahi_daemon.git synced 2024-08-16 15:09:48 +02:00

configure avahi variables

This commit is contained in:
L3D 2021-09-02 01:36:13 +02:00
parent 78421aac1f
commit 2ccf720db2
Signed by: l3d
GPG key ID: CD08445BFF4313D1
5 changed files with 61 additions and 17 deletions

View file

@ -5,6 +5,39 @@
===========================
Ansible role to install the avahi_daemon and optionally announce some services.
Variables
-----------
In the ``avahi_services`` variable you can define the services you want to announce.
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
Example:
```yaml
---
avahi_services:
- service: 'SSH'
port: 22
protocol: 'any'
- 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'
```
Netfilter rules
---------------
Avahi is using multicast to announce services.

View file

@ -2,15 +2,20 @@
avahi_services:
- service: 'SSH'
port: 22
# - service: 'NFS'
# port: 2049
# extra: '<txt-record>path=/path/to/nfsexport</txt-record>'
# - service: 'FTP'
# port: '21'
# extra: |
# <txt-record>path=/ftppath</txt-record>
# <txt-record>u=ftpuser</txt-record>
# <txt-record>p=ftppass</txt-record>
protocol: 'any'
# - 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'
# should we do a version check? (recomended)
submodules_versioncheck: false

View file

@ -16,6 +16,6 @@ galaxy_info:
galaxy_tags:
- avahi
- daemon
- avahi_daemon
- mdns
- bonjour
dependencies: []

View file

@ -1,12 +1,18 @@
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">{{ item.service | upper }} server at %h</name>
<service>
<name replace-wildcards="yes">
{%- if item.name is defined -%}
{{- item.name -}}
{%- else -%}
{{ item.service | upper }} server at %h
{%- endif -%}
</name>
<service protocol="{{ item.protocol | default("any") }}">
<type>_{{ item.service | lower }}._tcp</type>
<port>{{ item.port | string }}</port>
{% if item.extra is defined %}
{{ item.extra }}
{% endif %}
<port>{{ item.port | int }}</port>
{% for record in item.txt_records | default([]) %}
<txt-record>{{ record }}</txt-record>
{% endfor %}
</service>
</service-group>

View file

@ -1,4 +1,4 @@
---
# versionscheck
playbook_version_number: 5
playbook_version_number: 6
playbook_version_path: 'do1jlr.avahi_daemon.version'