softplayer-ansible/playbooks/providers/hetzner/Makefile

42 lines
1.2 KiB
Makefile

venv: venv-create venv-install-deps venv-install-reqs
run: venv venv-run
check: venv venv-check
venv-create:
python3 -m venv venv
venv-install-deps:
source venv/bin/activate &&\
python3 -m pip install hcloud ansible ansible-lint
venv-install-reqs:
source venv/bin/activate &&\
python3 -m ansible galaxy role install -r ./requirements.yml -p ./.ansible/roles
venv-install-reqs-force:
source venv/bin/activate &&\
python3 -m ansible galaxy role install -r ./requirements.yml --force -p ./.ansible/roles
venv-check:
source venv/bin/activate &&\
export COLLECTIONS_PATHS=./.ansible/collections &&\
export ROLES_PATH=./.ansible/roles &&\
python3 -m ansible playbook playbook.yml --check -i ./inventory.yaml
venv-run:
source venv/bin/activate &&\
export COLLECTIONS_PATHS=./.ansible/collections &&\
export ANSIBLE_ROLES_PATH=$(PWD)/.ansible/roles &&\
python3 -m ansible playbook playbook.yml -i ./inventory.yaml
venv-run-cleanup:
source venv/bin/activate &&\
export SP_STATE=absent && \
export COLLECTIONS_PATHS=./.ansible/collections &&\
export ANSIBLE_ROLES_PATH=$(PWD)/.ansible/roles &&\
python3 -m ansible playbook playbook.yml -i ./inventory.yaml
venv-lint:
venv/bin/ansible-lint playbook.yml