Hi guys,
Here is why im triying to do:
im generating passwords and registering the output in a variable like this
- name: Generate Server Password
raw: Secret=$(az keyvault secret show --name AdminPassword
--vault-name "{{ keyvault }}" --query value --output tsv);if [ -z $Secret
];then echo $(</dev/urandom tr -dc 'A-Za-z0-9#()*+=>?~' | head -c 32 );else
echo "$Secret" ;fi
register: AdminPassword
after i have that AdminPassword variable inside a template of
azure_rm_deployment
AdminPassword:
value: "{{ LogRWebAdminPassword.stdout_lines[0] }}"
If the passwords generates it works ok. but if the password doesnt generate
(cos sometimes we dont want to generate) it fails cos its waiting a value.
I tried to use the operator default like this but it doues not work
AdminPassword:
value: "{{ LogRWebAdminPassword.stdout_lines[0] |
default(string) }}"
Anyone has some idea how can i give the AdminPassword value options if the
1st one fails?
Thanks a lot!
--
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/1351e6d5-af9b-410e-9930-01e4459ef9c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.