From 1bf00a8b80cf0467c9c3e29b026bc651dada8370 Mon Sep 17 00:00:00 2001 From: Antoine Date: Tue, 11 Aug 2020 01:43:24 +0200 Subject: [PATCH] add Makefile shortcut --- Makefile | 17 +++++++++++++++++ stack/libvirtd.tf | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..928d562 --- /dev/null +++ b/Makefile @@ -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 \ No newline at end of file diff --git a/stack/libvirtd.tf b/stack/libvirtd.tf index c4ec465..3145a24 100644 --- a/stack/libvirtd.tf +++ b/stack/libvirtd.tf @@ -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"