<commit_before>#
# Basic usage:
#   Run `playbook.yml` in env `<env>`:
#     $ make <env>`
#
# Advanced usage:
#   Run `<PLAYBOOK>.yml` with `--tags=<TAGS>` and `--limit=<LIMIT>` in env `<env>`:
#     $ make TAGS=<tag[,tag ...]> LIMIT=<host_or_group[,host_or_group ...]> PLAYBOOK=<basename> <env>

ifneq ($(strip $(TAGS)),)
TAGS_ARG="--tags=$(TAGS)"
endif
ifneq ($(strip $(LIMIT)),)
LIMIT_ARG="--limit=$(LIMIT)"
endif
PLAYBOOK := playbook

# this is for openstack cli commands in the usegalaxy-node-image target, which relies on clouds.yaml.
OS_CLOUD=js2


galaxy tacc jsiu jstacc js2:
	ansible-playbook -i env/$@/inventory env/$@/$(PLAYBOOK).yml --diff $(TAGS_ARG) $(LIMIT_ARG)

usegalaxy-node-image:
	ansible-playbook -i env/js2/inventory env/js2/image.yml --limit=usegalaxy-node
	openstack server stop usegalaxy-node
	openstack image set --name usegalaxy-node-$(shell openstack image show usegalaxy-node -f value -c created_at | cut -d'T' -f 1) usegalaxy-node
	while [ "$$(openstack server show -f value -c status usegalaxy-node)" != "SHUTOFF" ]; do echo "Waiting for instance shutdown"; sleep 3; done
	openstack server image create --name usegalaxy-node --wait usegalaxy-node
	openstack server delete usegalaxy-node
<commit_msg>Drop Makefile command that were integrated into the playbook<commit_after>#
# Basic usage:
#   Run `playbook.yml` in env `<env>`:
#     $ make <env>`
#
# Advanced usage:
#   Run `<PLAYBOOK>.yml` with `--tags=<TAGS>` and `--limit=<LIMIT>` in env `<env>`:
#     $ make TAGS=<tag[,tag ...]> LIMIT=<host_or_group[,host_or_group ...]> PLAYBOOK=<basename> <env>

ifneq ($(strip $(TAGS)),)
TAGS_ARG="--tags=$(TAGS)"
endif
ifneq ($(strip $(LIMIT)),)
LIMIT_ARG="--limit=$(LIMIT)"
endif
PLAYBOOK := playbook


galaxy tacc jsiu jstacc js2:
	ansible-playbook -i env/$@/inventory env/$@/$(PLAYBOOK).yml --diff $(TAGS_ARG) $(LIMIT_ARG)

usegalaxy-node-image:
	ansible-playbook -i env/js2/inventory env/js2/image.yml --limit=usegalaxy-node

{'fraction_non_alphanumeric': 0.1773122125702606, 'fraction_numerical': 0.004598875830352581, 'mean_word_length': 4.454038997214485, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6995006', 'n_tokens_mistral': 766, 'n_tokens_neox': 739, 'n_words': 188}