add Makefile shortcut

This commit is contained in:
Antoine 2020-08-11 01:43:24 +02:00
parent e2d7f0c7ab
commit 1bf00a8b80
Signed by: antoine
GPG Key ID: 098FB66FC0475E70
2 changed files with 18 additions and 1 deletions

17
Makefile Normal file
View File

@ -0,0 +1,17 @@
.PHONY: console dhcp-lease ssh
console:
@virsh console --domain db1
ssh:
@IP=$(shell virsh domifaddr --domain db1 | tail -2 | awk -F ' ' '{ print $$4 }' | sed 's|/.*||') && \
ssh -o ProxyCommand="ssh -W %h:%p antoine@dx30.localdomain" -i ~/.ssh/pri/id_rsa_bis antoine@"$$IP"
dhcp-lease:
@virsh net-dhcp-leases --network private
get-ip:
@virsh domifaddr --domain db1
destroy_vm:
@terraform destroy -auto-approve -target=libvirt_domain.db1

View File

@ -12,7 +12,7 @@ terraform {
backend "etcdv3" {
endpoints = ["https://100.64.0.19:2379"]
lock = true
prefix = "/terraform-state/stack"
prefix = "/terraform-state/stack/"
cacert_path = "/home/antoine/virtualization/kubernetes-the-hard-way/certs/ca.pem"
cert_path = "/home/antoine/virtualization/kubernetes-the-hard-way/certs/kubernetes.pem"
key_path = "/home/antoine/virtualization/kubernetes-the-hard-way/certs/kubernetes-key.pem"