Replying to myself as I have figured out the issue (but I still do not 
understand it though).

I had this hash in the group_vars/infrastructure.yml file:

telegraf_agent_output: - type: influxdb config: - urls = ["{{ 
hostvars[groups['influxdb'][0]]['influxdb_url'] }}"] - database = 
"telegraf" - precision = "us" - retention_policy = "" - timeout = "10s" - 
username = "telegraf" * - password = "{{ 
hostvars[groups['influxdb']|random]['influxdb_secrets']['telegraf'] }}" * - 
user_agent = "telegraf_{{ inventory_hostname }}"

Replacing the *|random *part by a list index fixed it:
* - password = "{{ 
hostvars[groups['influxdb'][0]['influxdb_secrets']['telegraf'] }}" *

I'll open an issue with a simple reproductible case later.

Cheers,

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d1af089a-0fe7-4598-ae48-8b114f0eb215%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to