terraform-libvirt/Makefile
2020-08-11 01:45:39 +02:00

17 lines
449 B
Makefile

.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