yavdr-ansible/roles/yavdr-network/tasks/main.yml
2017-08-31 13:05:31 +02:00

62 lines
1.5 KiB
YAML

---
# this playbook sets up network services for a yaVDR installation
- name: apt |install packages for network services
apt:
name: '{{ item }}'
state: present
install_recommends: no
with_items:
- avahi-daemon
- avahi-utils
#- biosdevname # caution: may change device names after a minimal installation!
- ethtool
- nfs-common
- vdr-addon-avahi-linker
- wakeonlan
# Does this really work? We need a way to check if an interface supports WOL - Python Skript?
# - name: check WOL capabilities of network interfaces
# shell: 'ethtool {{ item }} | grep -Po "(?<=Supports\sWake-on:\s).*$"'
# register: wol
# with_items: '{% for interface in ansible_interfaces if interface != 'lo' and interface != 'bond0' %}'
- name: restart autofs if running
systemd:
name: autofs
state: restarted
enabled: yes
masked: no
- name: ensure autofs is running
systemd:
name: autofs
state: started
enabled: yes
masked: no
- name: restart avahi-linker if running
systemd:
name: avahi-linker
state: restarted
enabled: yes
masked: no
- name: start avahi-linker
systemd:
name: avahi-linker
state: started
enabled: yes
masked: no
- name: enable and start additional services for avahi-linker
systemd:
name: '{{ item }}'
state: started
enabled: yes
masked: no
with_items:
- vdr-net-monitor
- vdr-update-monitor
- prevent-umount-on-pause