39 lines
1.1 KiB
Makefile
39 lines
1.1 KiB
Makefile
venv: venv-create venv-install-deps
|
|
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 ansible ansible-lint
|
|
|
|
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 SP_CUSTOMER=allanger && \
|
|
export SP_ENV=default && \
|
|
export SP_STATE=present && \
|
|
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_CUSTOMER=allanger && \
|
|
export SP_ENV=default && \
|
|
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
|
|
|