44 lines
952 B
YAML
44 lines
952 B
YAML
|
- name: Template out ups.conf
|
||
|
ansible.builtin.template:
|
||
|
src: ups.conf.j2
|
||
|
dest: /etc/nut/ups.conf
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: '0644'
|
||
|
|
||
|
- name: Start and enable nut-enumerator
|
||
|
ansible.builtin.service:
|
||
|
name: nut-driver-enumerator
|
||
|
state: restarted
|
||
|
enabled: true
|
||
|
|
||
|
- name: Template out upsd.conf
|
||
|
ansible.builtin.template:
|
||
|
src: upsd.conf.j2
|
||
|
dest: /etc/nut/upsd.conf
|
||
|
owner: root
|
||
|
group: nut
|
||
|
mode: '0640'
|
||
|
|
||
|
- name: Template out upsd.users
|
||
|
ansible.builtin.template:
|
||
|
src: upsd.users.j2
|
||
|
dest: /etc/nut/upsd.users
|
||
|
owner: root
|
||
|
group: nut
|
||
|
mode: '0640'
|
||
|
|
||
|
- name: Open nut server firewall port
|
||
|
community.general.ufw:
|
||
|
rule: allow
|
||
|
to_ip: "{{ nut_server_listen_address }}"
|
||
|
to_port: "{{ nut_server_listen_port }}}}"
|
||
|
proto: tcp
|
||
|
comment: "NUT server"
|
||
|
|
||
|
- name: Start and enable nut-server
|
||
|
ansible.builtin.service:
|
||
|
name: nut-server
|
||
|
state: restarted
|
||
|
enabled: true
|