Basic Ansible automation playbook provides a method for accessing Cisco IOS devices and executing “show commands”. The “secrets.yml” file contains the username and password in plain-text. ansible-vault can be utilized to encrypt the “secrets.yml” file.
Encrypt a file using ansible-vault:
ansible-vault encrypt secrets.yml
View the contents of an encrypted file:
ansible-vault view secrets.yml
Decrypt a file using ansible-vault:
ansible-vault decrypt secrets.yml