This should do the trick.

https://docs.ansible.com/ansible/latest/user_guide/playbooks_vault.html#single-encrypted-variable



On Monday, October 29, 2018 at 9:40:49 AM UTC-5, Bairava Surya wrote:
>
> Hi All,
>
> ---
>
> - name: Weblogic Server control
>   hosts: "servername"
>
>
>   tasks:
>   - name: Ansible Id
>     shell: 
>       cmd: |
>         echo "{{ ansible_password }}" | /usr/local/bin/sudo -S su - 
> sudousername
>         echo "{{ ansible_password }}" | /usr/local/bin/sudo -S su - 
> sudousername << EOF
>         id
>         EOF
>     register: shell_out
>     
>
>   - debug:
>       var: shell_out
>     
> When i execute above playbook ansible it prints password in debug 
> output.Can anyone tell me any other approach to avoid printing passwords 
> other than no_logs option.
>

-- 
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/383acbb4-1e28-4f76-ac54-679755142647%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to