Skip to content

Instantly share code, notes, and snippets.

@martinky

martinky/Makefile

Last active Oct 2, 2019
Embed
What would you like to do?
Makefile used to run complete Ansible playbooks in parallel on individual hosts using make -jN with added timeout constraint.
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)
@rmetzler

This comment has been minimized.

Copy link

@rmetzler rmetzler commented Aug 18, 2017

I'm not sure when I gonna need this, but I bet I will. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment