Created
November 12, 2020 17:42
-
-
Save hakuno/57b41fa2dbea0da941dda1bc5dbb500f to your computer and use it in GitHub Desktop.
Run Ansible Playbook in .makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I found at https://dreisbach.us/articles/simple-ansible-makefile/ | |
# Replace this | |
# ansible-playbook -i hosts --vault-password-file=.vault-password.txt site.yml | |
# For this | |
tags = $(subst roles/,,$(wildcard roles/*)) | |
.PHONY: all $(tags) | |
all: | |
ansible-playbook -i hosts --vault-password-file=.vault-password.txt site.yml | |
$(tags): | |
ansible-playbook -i hosts -t $@ --vault-password-file=.vault-password.txt site.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment