How can i pipe the results of my shell command as a ansible variable to the entire block?
Code:
- name: A
shell:
cmd: |
/opt/git/bin/cli get service/info/{{ source }}/{{ destination }} | jq -r .secret’
/opt/git/bin/user-create ‘{{ source }}’ ‘{{ password_from_above }}’
/opt/git/bin/cli set ‘{{ source }}’ ‘{{ user }}’ ‘{{ user }}’ ‘{{ password_from_above }}’
vars:
password_from_above: ??? [Is this needed?]
no_log: true
'/opt/git/bin/cli get service/info/{{ source }}/{{ destination }} | jq -r .secret'
Will output a json where i simply cut out the required password. How can i apply that same password to the next two commands in my shell block?
Does it need to be declared as a variable?
Passing it as a variable fails