Re: [ansible-project] variable misunderstanding

2024-02-06 Thread 'Rowe, Walter P. (Fed)' via Ansible Project
Furthering Todd's message about needing more colons: % cat foo.yml --- - name: list to dict hosts: localhost become: false gather_facts: false vars: backups: mongodb: postgresql: - sonarqube - other /opt: /etc: tasks: -

Re: [ansible-project] variable misunderstanding

2024-02-06 Thread 'Rowe, Walter P. (Fed)' via Ansible Project
It is important to understand the structure of the data. Your backups variable defines a list, not a dictionary. % cat foo.yml --- - name: list to dict hosts: localhost become: false gather_facts: false vars: backups: - mongodb - postgresql: -

Re: [ansible-project] variable misunderstanding

2024-02-06 Thread Todd Lewis
Needs more colons: backups: mongodb: postgresql: - sonarqube - other "/opt": "/etc": On 2/6/24 9:57 AM, Brian Coca wrote: backups.postgresql does not exist, it is backups[1] To get what you want the data would have to look

Re: [ansible-project] variable misunderstanding

2024-02-06 Thread Brian Coca
backups.postgresql does not exist, it is backups[1] To get what you want the data would have to look like this: backups: mongodb postgresql: - sonarqube - other "/opt" "/etc" -- -- Brian Coca (he/him/yo) -- You

[ansible-project] variable misunderstanding

2024-02-06 Thread gregory....@gmail.com
i have this: backups: - mongodb - postgresql: - sonarqube - other - /opt - /etc later i use it in template task: - name: template backup script out template: src: backup-script.sh.j2 dest: /root/backup.sh mode: 755 my