Makefile used to run complete Ansible playbooks in parallel on individual hosts using make -jN with added timeout constraint.
This file contains 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
HOSTS=host_a host_b | |
INVENTORY=../data/inventory.inv | |
PLAYBOOK=../playbooks/test.yml | |
TIMEOUT=600 | |
deploy: all_hosts | |
all_hosts: $(HOSTS) | |
$(HOSTS): | |
timeout -s KILL $(TIMEOUT) ansible-playbook -i $(INVENTORY) $(PLAYBOOK) -l $@ | |
touch $@ | |
clean: | |
rm -f $(HOSTS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not sure when I gonna need this, but I bet I will. Thank you very much!