61 lines
1.5 KiB
Makefile
61 lines
1.5 KiB
Makefile
|
SERVER ?= "192.168.2.41"
|
||
|
SSH_USER = iamthefij
|
||
|
SSH_KEY = ~/.ssh/id_ed25519
|
||
|
|
||
|
.PHONY: rm-nomad
|
||
|
rm-nomad:
|
||
|
hashi-up nomad uninstall \
|
||
|
--ssh-target-addr $(SERVER) \
|
||
|
--ssh-target-key $(SSH_KEY) \
|
||
|
--ssh-target-user $(SSH_USER) \
|
||
|
--ssh-target-sudo-pass $(SSH_TARGET_SUDO_PASS)
|
||
|
|
||
|
.PHONY: nomad
|
||
|
nomad:
|
||
|
hashi-up nomad install \
|
||
|
--ssh-target-addr $(SERVER) \
|
||
|
--ssh-target-key $(SSH_KEY) \
|
||
|
--ssh-target-user $(SSH_USER) \
|
||
|
--ssh-target-sudo-pass $(SSH_TARGET_SUDO_PASS) \
|
||
|
--server --client
|
||
|
|
||
|
.PHONY: rm-consul
|
||
|
rm-consul:
|
||
|
hashi-up consul uninstall \
|
||
|
--ssh-target-addr $(SERVER) \
|
||
|
--ssh-target-key $(SSH_KEY) \
|
||
|
--ssh-target-user $(SSH_USER) \
|
||
|
--ssh-target-sudo-pass $(SSH_TARGET_SUDO_PASS)
|
||
|
|
||
|
.PHONY: consul
|
||
|
consul:
|
||
|
hashi-up consul install \
|
||
|
--ssh-target-addr $(SERVER) \
|
||
|
--advertise-addr $(SERVER) \
|
||
|
--client-addr 0.0.0.0 \
|
||
|
--http-addr 0.0.0.0 \
|
||
|
--ssh-target-key $(SSH_KEY) \
|
||
|
--ssh-target-user $(SSH_USER) \
|
||
|
--ssh-target-sudo-pass $(SSH_TARGET_SUDO_PASS) \
|
||
|
--connect \
|
||
|
--server
|
||
|
|
||
|
.PHONY: cluster
|
||
|
cluster:
|
||
|
ansible-galaxy install -p roles -r roles/requirements.yml
|
||
|
ansible-playbook -K -vv -i ansible_hosts -M roles/ ./setup-cluster.yml
|
||
|
|
||
|
.PHONY: plan
|
||
|
plan:
|
||
|
terraform plan
|
||
|
|
||
|
.PHONY: apply
|
||
|
apply:
|
||
|
terraform apply
|
||
|
|
||
|
# Install CNI on hosts?
|
||
|
# curl -L -o cni-plugins.tgz "https://github.com/containernetworking/plugins/releases/download/v1.0.0/cni-plugins-linux-$( [ $(uname -m) = aarch64 ] && echo arm64 || echo amd64)"-v1.0.0.tgz
|
||
|
# sudo mkdir -p /opt/cni/bin
|
||
|
# sudo tar -C /opt/cni/bin -xzf cni-plugins.tgz
|
||
|
|