What I ignore in Ansible projects

What I ignore in Ansible projects

Keep your repository neat and clean is a mandatory repository requirement, same as readable documentation and a good code, preferably useful. So, one of the first things I do in a new project is a .gitignore file.

Naturally, different languages and projects have quite a different project structure and file names, but I'm about to show you my list for the Ansible Tower projects.

  1. I always skip all backups and runtime leftovers.
  2. I ignore entire roles/ folder content for the Ansible Tower projects, except the list of requirements.
  3. All files that may contain plain-text passwords. Keep passwords in vaults, guys.
  4. Most common binaries. Git is not the best repo for that kind of content.
# Ansible Tower ignore list

# Ansible runtime and backups
*.original
*.tmp
*.bkp
*.retry
*.*~

# Tower runtime roles 
roles/**
!roles/requirements.yml

# Try tyo avoid any plain-text passwords 
*pwd*
*pass*
*password*
*.txt

# Exclude all binaries
*.bin
*.jar
*.tar
*.zip
*.gzip
*.tgz
Ansible Tower project .gitignore

Image source: https://www.flickr.com/photos/7729940@N06/6441399337