1
0
IaC/ansible/playbooks/infra/nut.yaml

33 lines
728 B
YAML
Raw Permalink Normal View History

2024-01-09 08:05:03 -05:00
- name: Install NUT
hosts:
- nut_servers
- nut_clients
become: true
gather_facts: true
2024-01-09 08:05:03 -05:00
tasks:
- name: Install NUT package on Archlinux
2024-01-09 08:05:03 -05:00
when: ansible_facts['os_family'] == "Archlinux"
community.general.pacman:
name: nut
2024-01-09 08:05:03 -05:00
state: latest
update_cache: true
- name: Setup NUT servers
gather_facts: false
2024-01-09 08:05:03 -05:00
hosts: nut_servers
become: true
roles:
- role: acme_certificate
2024-01-11 00:15:16 -05:00
acme_certificate_subject: "{{ ansible_host }}"
acme_certificate_zone: balsillie.house
acme_certificate_restart_services: ['nut-server.service']
- role: nut_server
2024-01-09 08:05:03 -05:00
- name: Setup NUT clients
gather_facts: false
2024-01-09 08:05:03 -05:00
hosts: nut_clients
become: true
roles:
- nut_client