56 lines
1.0 KiB
YAML
56 lines
1.0 KiB
YAML
---
|
|
# tasks file for ansible-role-nut
|
|
#
|
|
- name: Install Nut
|
|
ansible.builtin.package:
|
|
name:
|
|
- "{{ nut_package_name }}"
|
|
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
|
|
|
|
- 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
|
|
|
|
- name: start and enable nut
|
|
ansible.builtin.service:
|
|
name: nut.target
|
|
state: started
|
|
enabled: true
|
|
|