jloh / nagios-nrpe-server

Nagios NRPE Server Role for Ansible
https://blog.jloh.co/nagios-nrpe-ansible-role/
MIT License
29 stars 38 forks source link

Custom variables overwritten #18

Closed XioNoX closed 5 years ago

XioNoX commented 8 years ago

Because of:

- name: Include OS-Specific variables
  include_vars: "{{ ansible_os_family }}.yml"

If I set for example:

nagios_nrpe_server_plugins_dir: /usr/lib/nagios/plugins/custom

In my vars files (not in the role's var file).

My custom value will be overwritten by the default one.

jloh commented 8 years ago

Interesting, I'd never thought of this! It should be possible to move this into the defaults section but I'll have to confirm. it isn't possible at this stage it seems.

jloh commented 8 years ago

I'm not sure how to fix this one. Ideally I'd be able to include the variables pragmatically like I do now but within the defaults dir. Sadly this isn't the case.

I could split them all our into separate variables on a per-OS level but this isn't as pretty as the current solution.

If I added another include step for custom variables overwrites after the main include would that work?