ntd / ansible-role-nut

Ansible role to install and configure Nework UPS tools on Debian
MIT License
11 stars 16 forks source link

Add support for NOTIFYCMD and fix Jinja2 syntax. #2

Closed tobias-richter closed 4 years ago

tobias-richter commented 4 years ago

Hi @ntd!

Thanks for the role! I had some problems using the latest changes from your dev branch with Ansible 2.7. I fixed the issues on my fork and perhaps you want to integrate this into your role.

  1. Jinja2 syntax.

Ansible complained for example about {% nut_ups_extra %} and it did not work. It is the first time I stumpbled this kind of syntax for rendering a value in a template. Is this working on your side? I changed the syntax to {{ VARIABLE }}.

  1. Add support for NOTIFYCMD

You can either only specify a path to an existing script (nut_upsmon_notifycmd), or use nut_upsmon_notifycmd_content to place a script in the path specified by the nut_upsmon_notifycmd property.

  1. Use list based package installation

In the more recent versions of Ansible it is possible (and recommended) to use the list based installation feature of packages. Package installation using with_items takes more time and produces more log output.

Feedback is appreciated :)

ntd commented 4 years ago

I just released ntd/ansible-role-nut 1.1.0 with your changes. Thank you again.

tobias-richter commented 4 years ago

Thanks!