forked from simoncaron/ansible-role-nut
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Salvoxia/feat/installFromSource
Feature: Install NUT from source
- Loading branch information
Showing
48 changed files
with
1,529 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ skip_list: | |
- 'risky-shell-pipe' | ||
- 'role-name' | ||
- 'no-changed-when' | ||
- 'var-naming[no-reserved]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
name: Ansible Lint | ||
'on': | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the codebase. | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install test dependencies. | ||
run: pip3 install yamllint ansible-lint ansible | ||
|
||
- name: Run yamllint. | ||
run: yamllint . | ||
|
||
- name: Run ansible-lint. | ||
run: ansible-lint | ||
|
||
molecule: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the codebase. | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3. | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install test dependencies. | ||
run: pip3 install ansible molecule molecule-plugins[docker] | ||
|
||
- name: Install role dependencies. | ||
run: ansible-galaxy install -r requirements.yml | ||
|
||
- name: Run Molecule tests. | ||
run: molecule test --all | ||
env: | ||
PY_COLORS: '1' | ||
ANSIBLE_FORCE_COLOR: '1' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
--- | ||
- name: Restart nut | ||
ansible.builtin.service: | ||
name: "{{ item }}" | ||
state: restarted | ||
with_items: "{{ nut_services }}" | ||
ansible.builtin.include_tasks: "../tasks/restart.yml" | ||
when: nut_enable_service | ||
|
||
- name: Systemctl daemon-reload | ||
ansible.builtin.systemd: | ||
daemon_reload: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
ambient.humidity: 0.00 | ||
ambient.temperature: 0.0 | ||
battery.charge: 100.00 | ||
battery.charge.low: 20 | ||
battery.runtime: 11520.00 | ||
battery.runtime.low: 180.00 | ||
battery.voltage: 198.00 | ||
device.mfr: Eaton | ||
device.model: Eaton 9PX | ||
device.serial: XXXXXXXXXX | ||
device.type: ups | ||
driver.name: snmp-ups | ||
driver.parameter.pollinterval: 2 | ||
driver.parameter.port: XX.XX.XX.XX | ||
driver.parameter.synchronous: no | ||
driver.version: 2.7.4 | ||
driver.version.data: mge MIB 0.5 | ||
driver.version.internal: 0.97 | ||
input.phases: 1.00 | ||
input.transfer.reason: | ||
outlet.desc: Main Outlet | ||
outlet.id: 0 | ||
output.current: 1.00 | ||
output.frequency: 49.00 | ||
output.phases: 1.00 | ||
output.voltage: 230.00 | ||
ups.beeper.status: enabled | ||
ups.delay.shutdown: 20 | ||
ups.delay.start: 30 | ||
ups.firmware: 02.14.0034 | ||
ups.firmware.aux: JI | ||
ups.load: 7.00 | ||
ups.mfr: Eaton | ||
ups.model: Eaton 9PX | ||
ups.serial: XXXXXXXXXX | ||
ups.start.auto: yes | ||
ups.status: OL | ||
ups.test.result: aborted | ||
ups.timer.reboot: -1.00 | ||
ups.timer.shutdown: -1.00 | ||
ups.timer.start: -1.00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
ambient.humidity: 0.00 | ||
ambient.temperature: 0.0 | ||
battery.charge: 100.00 | ||
battery.charge.low: 20 | ||
battery.runtime: 11520.00 | ||
battery.runtime.low: 180.00 | ||
battery.voltage: 198.00 | ||
device.mfr: Eaton | ||
device.model: Eaton 9PX | ||
device.serial: XXXXXXXXXX | ||
device.type: ups | ||
driver.name: snmp-ups | ||
driver.parameter.pollinterval: 2 | ||
driver.parameter.port: XX.XX.XX.XX | ||
driver.parameter.synchronous: no | ||
driver.version: 2.7.4 | ||
driver.version.data: mge MIB 0.5 | ||
driver.version.internal: 0.97 | ||
input.phases: 1.00 | ||
input.transfer.reason: | ||
outlet.desc: Main Outlet | ||
outlet.id: 0 | ||
output.current: 1.00 | ||
output.frequency: 49.00 | ||
output.phases: 1.00 | ||
output.voltage: 230.00 | ||
ups.beeper.status: enabled | ||
ups.delay.shutdown: 20 | ||
ups.delay.start: 30 | ||
ups.firmware: 02.14.0034 | ||
ups.firmware.aux: JI | ||
ups.load: 7.00 | ||
ups.mfr: Eaton | ||
ups.model: Eaton 9PX | ||
ups.serial: XXXXXXXXXX | ||
ups.start.auto: yes | ||
ups.status: OL | ||
ups.test.result: aborted | ||
ups.timer.reboot: -1.00 | ||
ups.timer.shutdown: -1.00 | ||
ups.timer.start: -1.00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
gather_facts: true | ||
pre_tasks: | ||
- name: Create NUT configuration folder. | ||
ansible.builtin.file: | ||
path: "/etc/nut" | ||
state: directory | ||
mode: '0755' | ||
- name: Copy dummy-ups.dev file | ||
ansible.builtin.copy: | ||
src: "../dummy-ups.dev" | ||
dest: "/etc/nut/dummy-ups.dev" | ||
mode: '0755' | ||
- name: Copy dummy-ups2.dev file | ||
ansible.builtin.copy: | ||
src: "../dummy-ups2.dev" | ||
dest: "/etc/nut/dummy-ups2.dev" | ||
mode: '0755' | ||
roles: | ||
- role: salvoxia.nut | ||
nut_users: | ||
- name: monitor | ||
password: changeme | ||
role: secondary | ||
- name: second_user | ||
password: insecure_password | ||
role: primary | ||
nut_ups: | ||
- name: dummy_ups | ||
monitoruser: monitor | ||
driver: dummy-ups | ||
device: /etc/nut/dummy-ups.dev | ||
description: "Dummy UPS for testing" | ||
- name: dummy_ups2 | ||
monitoruser: second_user | ||
driver: dummy-ups | ||
device: /etc/nut/dummy-ups2.dev | ||
description: "Dummy UPS 2 for testing" |
Oops, something went wrong.