<commit_before>pipenv := env PIPENV_VENV_IN_PROJECT=1 pipenv

default:

check: ansible-lint

.venv:
	${pipenv} install

play: .venv
	${pipenv} run ansible-playbook -vv ansible.yml

facts: .venv
	${pipenv} run ansible -m setup sakura


encrypt_all: .venv
	-find vault/ -type f | xargs -n 1 ${pipenv} run ansible-vault encrypt


decrypt_all: .venv
	-find vault/ -type f | xargs -n 1 ${pipenv} run ansible-vault decrypt


ansible-lint: .venv
	${pipenv} run ansible-lint ansible.yml --nocolor -p<commit_msg>Add help message for Makefile<commit_after>pipenv := env PIPENV_VENV_IN_PROJECT=1 pipenv

default: help

help:
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
		awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

check: ansible-lint  # Run check

.venv:
	${pipenv} install

play: .venv  ## Invoke ansible-playbook
	${pipenv} run ansible-playbook -vv ansible.yml

facts: .venv  ## Show fact
	${pipenv} run ansible -m setup sakura


encrypt_all: .venv  ## Encrypt all files in vault/
	-find vault/ -type f | xargs -n 1 ${pipenv} run ansible-vault encrypt


decrypt_all: .venv  ## Decrypt all files in vault/
	-find vault/ -type f | xargs -n 1 ${pipenv} run ansible-vault decrypt


ansible-lint: .venv  ## Run ansible-lint
	${pipenv} run ansible-lint ansible.yml --nocolor -p
{'fraction_non_alphanumeric': 0.14961832061068703, 'fraction_numerical': 0.01450381679389313, 'mean_word_length': 3.6, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, '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': '3549271', 'n_tokens_mistral': 575, 'n_tokens_neox': 528, 'n_words': 153}