infra/roles/hass-ser2net/tasks/hass-ser2net.yml

38 lines
616 B
YAML

---
- name: install ser2net
apt:
name:
- ser2net
state: present
register: install_ser2net
tags:
- packages
- name: ser2net config file
template:
src: ser2net.yaml.j2
dest: /etc/ser2net.yaml
owner: root
group: root
mode: "0644"
notify: restart ser2net
- name: start and enable ser2net
service:
name: ser2net
state: started
enabled: true
when: not hass_ser2net_disabled|default(false) == true
- name: stop and disable ser2net
service:
name: ser2net
state: stopped
enabled: false
when: hass_ser2net_disabled|default(false) == true