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:
parent
78421aac1f
commit
2ccf720db2
5 changed files with 61 additions and 17 deletions
33
README.md
33
README.md
|
@ -5,6 +5,39 @@
|
||||||
===========================
|
===========================
|
||||||
Ansible role to install the avahi_daemon and optionally announce some services.
|
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
|
Netfilter rules
|
||||||
---------------
|
---------------
|
||||||
Avahi is using multicast to announce services.
|
Avahi is using multicast to announce services.
|
||||||
|
|
|
@ -2,15 +2,20 @@
|
||||||
avahi_services:
|
avahi_services:
|
||||||
- service: 'SSH'
|
- service: 'SSH'
|
||||||
port: 22
|
port: 22
|
||||||
# - service: 'NFS'
|
protocol: 'any'
|
||||||
# port: 2049
|
# - service: 'NFS'
|
||||||
# extra: '<txt-record>path=/path/to/nfsexport</txt-record>'
|
# name: 'Filesharing Host %h'
|
||||||
# - service: 'FTP'
|
# port: 2049
|
||||||
# port: '21'
|
# protocol: 'ipv6'
|
||||||
# extra: |
|
# txt_records:
|
||||||
# <txt-record>path=/ftppath</txt-record>
|
# - 'path=/path/to/nfsexport'
|
||||||
# <txt-record>u=ftpuser</txt-record>
|
# - service: 'FTP'
|
||||||
# <txt-record>p=ftppass</txt-record>
|
# port: '21'
|
||||||
|
# protocol: 'ipv4'
|
||||||
|
# txt_records:
|
||||||
|
# - 'path=/ftppath'
|
||||||
|
# - 'u=ftpuser'
|
||||||
|
# - 'p=ftppass'
|
||||||
|
|
||||||
# should we do a version check? (recomended)
|
# should we do a version check? (recomended)
|
||||||
submodules_versioncheck: false
|
submodules_versioncheck: false
|
||||||
|
|
|
@ -16,6 +16,6 @@ galaxy_info:
|
||||||
galaxy_tags:
|
galaxy_tags:
|
||||||
- avahi
|
- avahi
|
||||||
- daemon
|
- daemon
|
||||||
- avahi_daemon
|
|
||||||
- mdns
|
- mdns
|
||||||
|
- bonjour
|
||||||
dependencies: []
|
dependencies: []
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
<?xml version="1.0" standalone='no'?>
|
<?xml version="1.0" standalone='no'?>
|
||||||
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
|
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
|
||||||
<service-group>
|
<service-group>
|
||||||
<name replace-wildcards="yes">{{ item.service | upper }} server at %h</name>
|
<name replace-wildcards="yes">
|
||||||
<service>
|
{%- 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>
|
<type>_{{ item.service | lower }}._tcp</type>
|
||||||
<port>{{ item.port | string }}</port>
|
<port>{{ item.port | int }}</port>
|
||||||
{% if item.extra is defined %}
|
{% for record in item.txt_records | default([]) %}
|
||||||
{{ item.extra }}
|
<txt-record>{{ record }}</txt-record>
|
||||||
{% endif %}
|
{% endfor %}
|
||||||
</service>
|
</service>
|
||||||
</service-group>
|
</service-group>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
---
|
---
|
||||||
# versionscheck
|
# versionscheck
|
||||||
playbook_version_number: 5
|
playbook_version_number: 6
|
||||||
playbook_version_path: 'do1jlr.avahi_daemon.version'
|
playbook_version_path: 'do1jlr.avahi_daemon.version'
|
||||||
|
|
Loading…
Reference in a new issue