On Wed, 12 Feb 2020 18:02:20 -0800 (PST) Anand Solomon <[email protected]> wrote:
> What is the best way to loop the below KEY : VALUE ?
> [...]
> sqlvar.yml
> Key: Value
> Script1: select username from dba_users;
> Script2: select file_name from dba_data_files;
> Script3: select name from v$profile;
> Script4: select username from dba_profile;
Try this
- include_vars:
file: /home/ansible/sqlvar.yml
name: scripts
- debug:
msg: "{{ item.key }}: {{ item.value }}"
loop: "{{ scripts|dict2items }}"
HTH,
-vlado
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/20200213043800.23268a5d%40gmail.com.
pgpNbLMbpnhZq.pgp
Description: OpenPGP digital signature
