PLAYBOOKS_YML = $(wildcard *.yml)
PLAYBOOKS = $(PLAYBOOKS_YML:%.yml=%)

info :
	@echo run make HOST_OR_GROUP_NAME

% : %.yml

$(PLAYBOOKS) : init-plugins
	ansible-playbook -v $@.yml $(TAGS=%=--tags %)

paradise : pontos anna antea arke pythia

init-plugins: _plugins_stamp/v3

_plugins_stamp/v3 :
	ansible-galaxy collection install community.general
	ansible-galaxy collection list | grep -q 'ansible\.posix' || ansible-galaxy collection install ansible.posix
	mkdir -p _plugins_stamp
	touch $@

.PHONY: $(PLAYBOOKS) paradise init-plugins
