{"id":18382406,"url":"https://github.com/ntd/ansible-role-nut","last_synced_at":"2025-07-26T21:36:31.489Z","repository":{"id":43726741,"uuid":"68741587","full_name":"ntd/ansible-role-nut","owner":"ntd","description":"Ansible role to install and configure Nework UPS tools on Debian","archived":false,"fork":false,"pushed_at":"2024-10-31T05:32:30.000Z","size":23,"stargazers_count":11,"open_issues_count":2,"forks_count":18,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T09:02:13.370Z","etag":null,"topics":["ansible","ansible-role","debian","nut"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ntd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-20T18:31:23.000Z","updated_at":"2024-10-31T05:32:33.000Z","dependencies_parsed_at":"2024-10-31T06:18:31.512Z","dependency_job_id":"effbe93c-279a-441a-9f83-428da03d8c5e","html_url":"https://github.com/ntd/ansible-role-nut","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntd%2Fansible-role-nut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntd%2Fansible-role-nut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntd%2Fansible-role-nut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntd%2Fansible-role-nut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ntd","download_url":"https://codeload.github.com/ntd/ansible-role-nut/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247569123,"owners_count":20959758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-role","debian","nut"],"created_at":"2024-11-06T01:05:18.597Z","updated_at":"2025-07-26T21:36:31.472Z","avatar_url":"https://github.com/ntd.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"Ansible Role: NUT\n=================\n[![Build Status](https://travis-ci.org/ntd/ansible-role-nut.svg?branch=master)](https://travis-ci.org/ntd/ansible-role-nut)\n\nInstalls and configures [NUT](http://networkupstools.org/) (Nework UPS\ntools) on Debian based systems.\n\nRole Variables\n--------------\n\nAvailable variables are listed below, along with default values (see\n`defaults/main.yml`):\n\n### Generic Configuration\n\n| Variable | Default Value | Description |\n|----------|---------------|-------------|\n| `nut_managed_config` | `true` | If this is set to false, none of the following options will have any effect, that is any and all changes under `/etc/nut/` will be your responsibility. This can be desirable if you have complex configurations. |\n| `nut_enable_service` | `true` | Whether to start the NUT service after configuration |\n| `nut_mode` | `standalone` | NUT mode setting (see `man 5 nut.conf` MODE directive) |\n| `nut_services` | `[nut-driver, nut-monitor, nut-server]` | List of NUT services to enable |\n| `nut_users` | See example below | List of users for NUT configuration (replaces legacy user variables). See below for detailed schema. |\n| `nut_ups` | See example below | List of UPS configurations with name, driver, device, description |\n| `nut_ups_extra` | `maxretry = 3` | Additional configuration options directly placed in `ups.conf` |\n| `nut_upsd_extra` | Multi-line config | Additional upsd daemon configuration directly placed in `upsd.conf` |\n| `nut_maxretry` | `3` | **DEPRECATED** - Use `nut_ups_extra` instead |\n\n### UPSMON Configuration\n\nThis settings are primarily used for the **local** `upsmon.conf` configuration.\n\n| Variable | Default Value | Description |\n|----------|---------------|-------------|\n| `nut_host` | `localhost` | Hostname of the NUT server to monitor |\n| `nut_powervalue` | `1` | Power value for MONITOR directive (see `man 5 upsmon.conf`) |\n| `nut_user` | `undefined` | **DEPRECATED** - Legacy user configuration, migrate to `nut_users` |\n| `nut_password` | `undefined` | **DEPRECATED** - Legacy password configuration, migrate to `nut_users` |\n| `nut_role` | `undefined` | **DEPRECATED** - Legacy role configuration, migrate to `nut_users` |\n| `nut_upsmon_user` | Auto-derived | Use this variable to override how the upsmon **username** is derived. If you override, make sure to create the required user yourself. |\n| `nut_upsmon_password` | Auto-derived | Use this variable to override how the upsmon users **password** is derived. If you override, make sure to create the required user yourself. |\n| `nut_upsmon_role` | Auto-derived | Use this variable to override how the upsmon users **role** is derived. If you override, make sure to create the required user yourself. |\n| `nut_upsmon_extra` | Multi-line config | Additional upsmon configuratio directly placed in `upsmon.conf` |\n| `nut_upsmon_notifycmd` | `undefined` | Path for NOTIFYCMD configuration |\n| `nut_upsmon_notifycmd_content` | `undefined` | Content to copy to the notifycmd path |\n\nRefer to the Users Definition section below for details on how to configure users.\n\n### UPS Definition\n\n```yaml\nnut_ups:\n  - name: UPS\n    driver: riello_ups\n    device: /dev/ttyUSB0\n    description: Some descriptive information\n    extra: |\n      maxretry = 10\n      retrydelay = 1\n```\n\n`name` is an arbitrary string that must identify univocally the UPS.\n\n`driver` depends on your hardware and must be one of the [available NUT\ndriver](http://networkupstools.org/stable-hcl.html). Be sure the NUT\nversion installed on your server has that specific driver available.\n\n`device` is device where the UPS is listening (typically an USB port or\na serial device).\n\n`description` is optional and is an arbitrary string used for debugging\nand reporting purposes.\n\n`extra` is an optional multiline text to be inserted verbatim in the\nglobal section of the relevant configuration file.\n\nOther less used variables, all of them optionals:\n\n    nut_mode: standalone # `man 5 nut.conf`     MODE directive\n    nut_powervalue: 1    # `man 5 upsmon.conf`  MONITOR directive, powervalue field\n    nut_role: master     # `man 5 upsmon.conf`  MONITOR directive, type field\n    nut_services:        # Name of the services to enable\n      - nut-driver\n      - nut-monitor\n      - nut-server\n\n### Users Definition\n\nThe NUT users are configured using the `nut_users` variable, see nested scheme below.\nYou can optionally specify extra configuration snippets that\nare added to each user.\n\nThe legacy variables `nut_user`, `nut_password` and `nut_role` are now **deprecated**.\nFor now, the behaviour is as follows:\n\n- If `nut_user` is defined, the legacy variables will be added to `upsd.users` and will be used in `upsmon.conf`\n- If `nut_user` is not defined, the first entry of `nut_users` will be used in `upsmon.conf`\n\nThis default behaviour can be overriden by explicitely setting \nthe `nut_upsmon_*` variables. Note that you are responsible to\ncreate this user in `upsd.users` (for example by adding them to\n`nut_users`), the role does not do that automatically.\n\n```yaml\nnut_users:\n  - name: nutuser1\n    password: password1\n    role: user\n  - name: nutuser2\n    password: password2\n    role: admin\n    extra: |\n      sdtype = 2\n```\n\nFor a detailed description on user attributes that can be set,\nplease refer to the [`upsd.users` documentation](https://networkupstools.org/docs/man/upsd.users.html).\n\nExample Playbook\n----------------\n\n    - hosts: all\n      roles:\n      - role: ntd.nut\n        nut_ups:\n          - name: riello\n            driver: riello_usb\n            device: /dev/ups\n            description: iPlug 800\n\nFor more examples, please see `tests/test.yml`.\n\nLicense\n-------\n\nMIT\n\nAuthor Information\n------------------\n\nThis role was created in 2016 by Nicola Fontana (ntd@entidi.it).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntd%2Fansible-role-nut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fntd%2Fansible-role-nut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntd%2Fansible-role-nut/lists"}