Skip to content

Instantly share code, notes, and snippets.

@rmetzler
Forked from martinky/Makefile
Created August 18, 2017 12:36
Show Gist options
  • Select an option

  • Save rmetzler/d7c6938c989a16b654517627417cfe81 to your computer and use it in GitHub Desktop.

Select an option

Save rmetzler/d7c6938c989a16b654517627417cfe81 to your computer and use it in GitHub Desktop.
ansible-playbook-makefile
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