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

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -