Ansible vault passwords appears in log if task fails

542 Views Asked by At

I am using ansible vault to store my passwords , Its working wonderfully. Issue I have is when any task fails it shows those passwords in logs. How Can I hide these passwords in all the situations?

This is my sample task

- name: Run python script for generating Projects report
  command: python GetProjects.py -o { org1 } -p { pat1 }
  register: result
- debug: msg="{{result.stdout}}"

If task fails It shows my pat and org in logs

1

There are 1 best solutions below

0
On BEST ANSWER

If you want to hide the output, you can use the no_log option:

- name: Run python script for generating Projects report
  command: python GetProjects.py -o { org1 } -p { pat1 }
  register: result
  no_log: true