40 lines
1.7 KiB
Makefile
40 lines
1.7 KiB
Makefile
CUSTOMER ?= softplayer
|
|
ENV ?= default
|
|
|
|
venv-create:
|
|
python3 -m venv venv
|
|
source venv/bin/activate && \
|
|
export ANSIBLE_COLLECTIONS_PATH=./.ansible/collections && \
|
|
export ANSIBLE_ROLES_PATH=./.ansible/roles && \
|
|
python3 -m pip install -r ./requirements.txt && \
|
|
python3 -m ansible galaxy install -r ./requirements.yml --force
|
|
|
|
bootstrap:
|
|
source venv/bin/activate && \
|
|
export ANSIBLE_HOST_KEY_CHECKING=false && \
|
|
export ANSIBLE_COLLECTIONS_PATH=./.ansible/collections && \
|
|
export ANSIBLE_ROLES_PATH=./.ansible/roles && \
|
|
export SP_CUSTOMER=softplayer && \
|
|
export SP_ENV=dev && \
|
|
export SP_STATE=present && \
|
|
python3 -m ansible playbook ./playbooks/other/ssh-key-gen/playbook.yml && \
|
|
python3 -m ansible playbook ./playbooks/providers/hetzner/playbook.yml && \
|
|
python3 -m ansible playbook ./playbooks/other/cloudflare/playbook.yml && \
|
|
export ANSIBLE_INVENTORY=/tmp/outputs/inventory.yaml && \
|
|
export ANSIBE_PRIVATE_KEY_FILE=/tmp/outputs/ssh_key && \
|
|
sleep 8 && \
|
|
python3 -m ansible playbook ./playbooks/systems/system-bootstrap/playbook.yml && \
|
|
python3 -m ansible playbook ./playbooks/systems/k3s-bootstrap/playbook.yml && \
|
|
python3 -m ansible playbook ./playbooks/other/k8s-create-user/playbook.yml
|
|
|
|
cleanup:
|
|
source venv/bin/activate && \
|
|
export ANSIBLE_HOST_KEY_CHECKING=false && \
|
|
export COLLECTIONS_PATHS=./.ansible/collections && \
|
|
export ANSIBLE_ROLES_PATH=./.ansible/roles && \
|
|
export SP_CUSTOMER=softplayer && \
|
|
export SP_ENV=dev && \
|
|
export SP_STATE=absent && \
|
|
python3 -m ansible playbook ./playbooks/providers/hetzner/playbook.yml || true && \
|
|
python3 -m ansible playbook ./playbooks/other/cloudflare/playbook.yml
|