Closed sinc59 closed 6 years ago
@sinc59 did you take a look at http://docs.ansible.com/ansible/latest/intro_configuration.html#hash-behaviour ?
you can try hash_behaviour = merge
, but be care to not merge other settings.
Same issue.
I think you could use filename
directive to generate different file names:
group_vars/postgres_database:
telegraf_plugins_extra:
- plugin: postgresql
filename: postgresql
config:
- address = "postgres://user:password@localhost/postgres"
group_vars/rabbitmq
telegraf_plugins_extra:
- plugin: rabbitmq
filename: rabbitmq
config:
- url = "http://localhost:15672"
This was solved in 0.9.0. See https://github.com/dj-wasabi/ansible-telegraf/pull/46.
You will need to change your config to a hash instead of a list, and need hash_behaviour=merge in your ansible.cfg.
telegraf_plugins_extra:
postgresql:
config:
- address = "postgres://user:password@localhost/postgres"
telegraf_plugins_extra:
rabbitmq:
config:
- url = "http://localhost:15672"
Closing issue as fix is applied in a PR.
Hello, i use this role with multiple groups (postgres_database, rabbitmq) For this, i use groups_vars files to specify extra_plugins (group_vars/postgres_database, group_vars/rabbitmq) These files contains:
If a server is one two roles (database and rabbitmq), the file /etc/telegraf/telegraf.d/extra-plugins.conf contain only the rabbitmq.
Do you know how i can aggregate this two have the postgresql and rabbitmq in this server ?
Best regards