-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (28 loc) · 2.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
.PHONY: container
container:
podman build -v $(shell pwd):/tpl -t localhost/packer-ansible packer-ansible-container
podman build -v $(shell pwd):/tpl -t localhost/terraform-ansible terraform-ansible-container
podman build -v $(shell pwd):/tpl -t localhost/hcloud-container hcloud-container
.PHONY: packershell
packershell:
podman run -i -t -w /tpl -v $(shell pwd):/tpl -v ~/.ssh/id_ed25519.pub:/root/.ssh/id_ed25519.pub:ro --entrypoint="/bin/sh" localhost/packer-ansible
.PHONY: packer
packer:
podman run -i -t -w /tpl -v $(shell pwd):/tpl -v ~/.ssh/id_ed25519.pub:/root/.ssh/id_ed25519.pub:ro localhost/packer-ansible build -var-file=secret.pkrvars.hcl universal-server-template.pkr.hcl
.PHONY: deletesnapshots
deletesnapshots:
podman run -i -w /tpl --env-file=secret.env --entrypoint=/usr/local/bin/delete.sh localhost/hcloud-container universal-server-template-bookworm-home
podman run -i -w /tpl --env-file=secret.env --entrypoint=/usr/local/bin/delete.sh localhost/hcloud-container universal-server-template-jammy-home
.PHONY: terraformshell
terraformshell:
podman run -i -t -w /tpl -v $(shell pwd):/tpl -v ~/.ssh/id_ed25519.pub:/root/.ssh/id_ed25519.pub:ro --entrypoint="/bin/sh" localhost/terraform-ansible
.PHONY: terraform
terraform:
podman run -i -t -w /tpl -v $(shell pwd):/tpl -v ~/.ssh/id_ed25519.pub:/root/.ssh/id_ed25519.pub:ro localhost/terraform-ansible plan
podman run -i -t -w /tpl -v $(shell pwd):/tpl -v ~/.ssh/id_ed25519.pub:/root/.ssh/id_ed25519.pub:ro localhost/terraform-ansible apply
.PHONY: ansibleinventory
ansibleinventory:
podman run -i -t -w /tpl -v $(shell pwd):/tpl -v ~/.ssh/id_ed25519.pub:/root/.ssh/id_ed25519.pub:ro --entrypoint="ansible-inventory" localhost/terraform-ansible -i inventory.yml --graph --vars
.PHONY: ansible
ansible:
podman run -i -t -w /tpl -v $(shell pwd):/tpl -v ~/.ssh/known_hosts:/root/.ssh/known_hosts:ro -v ~/.ssh/id_ed25519:/root/.ssh/id_ed25519:ro -v ~/.ssh/id_ed25519.pub:/root/.ssh/id_ed25519.pub:ro --entrypoint="ansible-playbook" localhost/terraform-ansible -i inventory.yml ansible-server.yml