2024-02-24 15:12:58 +00:00
|
|
|
---
|
|
|
|
# tasks file for ansible-role-nut
|
|
|
|
#
|
|
|
|
- name: Install Nut
|
|
|
|
ansible.builtin.package:
|
2024-02-24 15:58:38 +00:00
|
|
|
name:
|
|
|
|
- "{{ nut_package_name }}"
|
2024-02-24 15:12:58 +00:00
|
|
|
state: present
|
|
|
|
|
|
|
|
|
|
|
|
- name: Template ups.conf
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: ups.conf.j2
|
|
|
|
dest: /etc/nut/ups.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 644
|
|
|
|
|
|
|
|
- name: Template upsd.conf
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: upsd.conf.j2
|
|
|
|
dest: /etc/nut/upsd.conf
|
|
|
|
owner: root
|
|
|
|
group: nut
|
|
|
|
mode: 640
|
|
|
|
|
|
|
|
- name: Template upsmon.conf
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: upsmon.conf.j2
|
|
|
|
dest: /etc/nut/upsmon.conf
|
|
|
|
owner: root
|
|
|
|
group: nut
|
|
|
|
mode: 640
|
|
|
|
|
2024-02-24 15:58:38 +00:00
|
|
|
- name: Create udev rules
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: udev/50-ups.rules.j2
|
|
|
|
dest: /etc/udev/rules.d/50-ups.rules
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 640
|
|
|
|
|
|
|
|
|
|
|
|
- name: start and enable nut-driver-enumerator
|
|
|
|
ansible.builtin.service:
|
|
|
|
name: nut-driver-enumerator.service
|
|
|
|
state: started
|
|
|
|
enabled: true
|
|
|
|
|
2024-02-24 15:12:58 +00:00
|
|
|
- name: start and enable nut
|
|
|
|
ansible.builtin.service:
|
|
|
|
name: nut.target
|
|
|
|
state: started
|
|
|
|
enabled: true
|
|
|
|
|