- using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml- using inventory:
127.0.0.1 ansible_connection=local| #!/usr/bin/env bash | |
| set -e | |
| # Formats any *.tf files according to the hashicorp convention | |
| files=$(git diff --cached --name-only) | |
| for f in $files | |
| do | |
| if [ -e "$f" ] && [[ $f == *.tf ]]; then | |
| #terraform validate `dirname $f` | |
| terraform fmt $f |
ansible-playbook --connection=local 127.0.0.1 playbook.yml127.0.0.1 ansible_connection=local