Friday, July 3, 2020

how to use combine function in the ansible playbook ?

- name: Set kaushik output info
set_fact:
kaushik_info: "{{ kaushik_info | default({}) | combine({'KAUSHIKInfo': {'resourcegroup': rg, 'kaushik_kv_name': vaultname, 'secret_name': secret,'app_url': app_url
} }) }}"


- name: Create yaml file
copy:
content: "{{ kaushik_info | to_nice_yaml }}"
dest: "/tmp/kaushik-output.yaml"


expected output: ( which is in the yaml file )

KAUSHIKInfo: kaushik_kv_name: *************
resourcegroup: *****************
secret_name: ******************
app_url: ********************

No comments:

Post a Comment