base64 - how to use ansible b64encode -


i need base64 encoding of like: "https://myurl.com". because there colon in string, need enclose in quotes. have like:

- name: encode   shell: 'echo "https://myurl.com" | /usr/bin/base64'   register: bvalue 

but blank when use:

{{ bvalue.stdout }} 

so want use ansible construct, don't know how , documentation not clear. it's like:

- name: encode   shell: '{{ "https://myurl.com" | b64encode }}' 

but know wrong. , can't find examples. help!

i think how it. define variable in playbook:

myvar: "https://myurl.com" 

then in role, do:

- name: encode   shell: echo {{ myvar | b64encode }} > /tmp/output 

Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -