24 lines
637 B
Makefile
24 lines
637 B
Makefile
SHELL := /bin/bash
|
|
.ONESHELL:
|
|
.SHELLFLAGS := -eu -o pipefail -c
|
|
|
|
MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
|
ANSIBLE_DIR := $(abspath $(MAKEFILE_DIR)/../ansible)
|
|
TERRAFORM_DIR := $(abspath $(MAKEFILE_DIR)/../terraform/stacks/proxmox/vm)
|
|
|
|
.PHONY: all \
|
|
enable_snippets create_vms
|
|
|
|
all: create_vms
|
|
|
|
enable_snippets:
|
|
cd "$(ANSIBLE_DIR)"
|
|
ansible-playbook "playbooks/proxmox/enable_snippets.yml" -i "inventory.ini"
|
|
|
|
create_vms: enable_snippets
|
|
cd "$(TERRAFORM_DIR)"
|
|
terraform init
|
|
terraform plan -var-file="terraform.tfvars"
|
|
terraform apply -auto-approve -var-file="terraform.tfvars"
|
|
|
|
# make -f 02_create_vms.mk
|