systemli / ansible-role-needrestart

Install and maintain needrestart on debian-like systems
GNU General Public License v3.0
10 stars 11 forks source link

Add option for custom restart scripts #55

Closed mabezi closed 7 months ago

mabezi commented 7 months ago

As the title says: It would be great to have the possibility to define your own restart scripts. There are quite a few possible uses for this.

And this form of implementation gives you maximum leeway, as you can either write them directly into the variable definition or read them from a file using lookup.

Examples:

needrestart_restartd:
  - name: unbound
    script: "echo "restart unbound!" && systemctl restart unbound.service"
needrestart_restartd:
  - name: unbound
    script: "{{ lookup('template', 'files/custom-restart', errors='strict') }}"
mabezi commented 7 months ago

fixed two typos

t2d commented 7 months ago

Cool, that looks useful. Can you please fix the linting issue?

mabezi commented 7 months ago

That should fix it now. ansible-lint and I somehow don't become friends 😄