Search code examples
ansibleansible-vault

Ansible vault passwords appears in log if task fails


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


Solution

  • 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