aboutsummaryrefslogtreecommitdiffstats
path: root/roles/space_server/tasks
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@labitat.dk>2017-11-12 22:32:24 +0100
committerEmil Renner Berthing <esmil@labitat.dk>2017-11-12 22:32:24 +0100
commitdf3d5b95ef86195071240a96774a25f9bfb21ac2 (patch)
treefdc88f1a412fce37ab8b6dad4e2e583f843cc4ec /roles/space_server/tasks
parent0131eaf5c3a1fecee20daed94937a533363fe71b (diff)
downloadlabitat-ansible-df3d5b95ef86195071240a96774a25f9bfb21ac2.tar.gz
labitat-ansible-df3d5b95ef86195071240a96774a25f9bfb21ac2.tar.xz
labitat-ansible-df3d5b95ef86195071240a96774a25f9bfb21ac2.zip
space_server: run avahi
Diffstat (limited to 'roles/space_server/tasks')
-rw-r--r--roles/space_server/tasks/avahi.yml86
-rw-r--r--roles/space_server/tasks/main.yml2
2 files changed, 88 insertions, 0 deletions
diff --git a/roles/space_server/tasks/avahi.yml b/roles/space_server/tasks/avahi.yml
new file mode 100644
index 0000000..9520b08
--- /dev/null
+++ b/roles/space_server/tasks/avahi.yml
@@ -0,0 +1,86 @@
+---
+- name: Install avahi and tools
+ dnf:
+ name: avahi-tools # pulls in avahi package
+ state: latest
+ notify:
+ - restart avahi-daemon
+ tags:
+ - packages
+
+- name: Configure avahi-daemon
+ ini_file:
+ path: /etc/avahi/avahi-daemon.conf
+ no_extra_spaces: yes
+ section: '{{ item.section }}'
+ option: '{{ item.option }}'
+ value: '{{ item.value }}'
+ with_items:
+ - section: server
+ option: 'host-name'
+ value: '{{ hostname }}'
+ - section: server
+ option: 'domain-name'
+ value: 'local'
+ - section: server
+ option: 'browse-domains'
+ value: ''
+ - section: server
+ option: 'use-ipv4'
+ value: 'yes'
+ - section: server
+ option: 'use-ipv6'
+ value: 'yes'
+ - section: server
+ option: 'allow-interfaces'
+ value: 'lan11,lan12'
+ - section: server
+ option: 'enable-dbus'
+ value: 'yes'
+ - section: server
+ option: 'disallow-other-stacks'
+ value: 'yes'
+ - section: wide-area
+ option: 'enable-wide-area'
+ value: 'yes'
+ - section: publish
+ option: 'disable-publishing'
+ value: 'no'
+ - section: publish
+ option: 'disable-user-service-publishing'
+ value: 'no'
+ - section: publish
+ option: 'publish-addresses'
+ value: 'yes'
+ - section: publish
+ option: 'publish-hinfo'
+ value: 'yes'
+ - section: publish
+ option: 'publish-workstation'
+ value: 'no'
+ - section: publish
+ option: 'publish-domain'
+ value: 'yes'
+ - section: publish
+ option: 'publish-dns-servers'
+ value: '185.38.175.0,2a01:4260:1ab::'
+ - section: publish
+ option: 'publish-resolv-conf-dns-servers'
+ value: 'no'
+ notify:
+ - restart avahi-daemon
+
+- name: Enable avahi-daemon service
+ systemd:
+ name: avahi-daemon.service
+ enabled: yes
+ masked: no
+ state: started
+ when: "'container' not in ansible_env"
+- name: '- when in nspawn'
+ command: systemctl enable avahi-daemon.service
+ args:
+ creates: '/etc/systemd/system/multi-user.target.wants/avahi-daemon.service'
+ when: "'container' in ansible_env"
+
+# vim: set ts=2 sw=2 et:
diff --git a/roles/space_server/tasks/main.yml b/roles/space_server/tasks/main.yml
index 98a0764..6893cbb 100644
--- a/roles/space_server/tasks/main.yml
+++ b/roles/space_server/tasks/main.yml
@@ -37,5 +37,7 @@
when: radius_passwords is defined
- import_tasks: named.yml
tags: named
+- import_tasks: avahi.yml
+ tags: avahi
# vim: set ts=2 sw=2 et: