2022-12-19 03:26:06 +05:30
|
|
|
env: ## Init environment
|
|
|
|
terraform init
|
|
|
|
ansible-galaxy install -r ./ansible/requirements.yml
|
|
|
|
virtualenv vent
|
|
|
|
. ./venv/bin/activate && pip install -r requirements.txt
|
|
|
|
|
2022-12-19 02:33:15 +05:30
|
|
|
default:
|
|
|
|
terraform plan --out=plan
|
|
|
|
terraform apply plan
|
|
|
|
|
|
|
|
inventory: ## Deploy server
|
|
|
|
terraform plan --out=plan
|
|
|
|
terraform apply plan
|
|
|
|
|
|
|
|
configure: ## Configure server
|
|
|
|
ansible-playbook -i ./ansible/inventory/hosts.ini -f 10 ./ansible/playbook.yml
|
2022-12-30 05:18:52 +05:30
|
|
|
ansible-playbook -i ./ansible/inventory/hosts.ini -f 10 ./ansible/install-librepages.yml
|
|
|
|
ansible-playbook -i ./ansible/inventory/hosts.ini -f 10 ./ansible/install-librepages-forms.yml
|
|
|
|
ansible-playbook -i ./ansible/inventory/hosts.ini -f 10 ./ansible/install-librepages-conductor.yml
|
|
|
|
# ansible-playbook -i ./ansible/inventory/hosts.ini -f 10 ./ansible/linux-baseline.yml
|
2022-12-19 02:33:15 +05:30
|
|
|
|
|
|
|
ansible-check: ## Check Ansible playbooks
|
|
|
|
ansible-playbook --check ./ansible/playbook.yml
|
|
|
|
|
|
|
|
lint: ## Lint source code
|
|
|
|
terraform fmt
|
|
|
|
ansible-lint --write ./ansible/playbook.yml
|
|
|
|
ansible-lint --write ./ansible/shutdown.yml
|
|
|
|
. ./venv/bin/activate && black tests/
|
|
|
|
|
|
|
|
on: ## Power on VMs
|
|
|
|
./scripts/on.sh
|
|
|
|
virsh list
|
|
|
|
|
|
|
|
shutdown: ## Shut down vms
|
|
|
|
ansible-playbook -i ./ansible/inventory/hosts.ini -f 10 ./ansible/shutdown.yml
|
|
|
|
|
|
|
|
test: ## Test VM configuration
|
|
|
|
. ./venv/bin/activate && \
|
|
|
|
cd tests/ && \
|
|
|
|
py.test --hosts='ansible://all' \
|
|
|
|
-n 10 \
|
|
|
|
--verbose \
|
|
|
|
--ansible-inventory='../ansible/inventory/hosts.ini'
|
|
|
|
|
|
|
|
|
|
|
|
help: ## Prints help for targets with comments
|
|
|
|
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|