run compute on terraform with libvirt hypervisor
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.5KB

  1. .PHONY: console dhcp-lease ssh
  2. console:
  3. @virsh console --domain db1
  4. ssh:
  5. IP=$(shell virsh domifaddr --domain db1 | tail -2 | awk -F ' ' '{ print $$4 }' | sed 's|/.*||') && \
  6. ssh -o ProxyCommand="ssh -W %h:%p antoine@dx30_remote.localdomain" -i ~/.ssh/pri/id_rsa_bis antoine@"$$IP"
  7. dhcp-lease:
  8. @virsh net-dhcp-leases --network private
  9. get-ip:
  10. @virsh domifaddr --domain db1
  11. destroy_vm:
  12. @cd stack && terraform destroy --auto-approve -target=libvirt_domain.db1
  13. destroy_all:
  14. @cd stack && terraform destroy --auto-approve
  15. create_all:
  16. @cd stack && terraform apply --auto-approve
  17. hazelcast:
  18. cd applications/ && \
  19. echo "create python venv workspace" && \
  20. python3 -m venv workspace && \
  21. source workspace/bin/activate && \
  22. echo "install python venv and dependencies" && \
  23. pip install --upgrade pip && \
  24. pip install -r requirements.txt && \
  25. echo "install ansible-galaxy dependencies" && \
  26. ansible-galaxy install -r hazelcast/requirements.yml && \
  27. echo "start playbook" && \
  28. ansible-playbook -i stack_address.toml hazelcast/playbook.yml
  29. stack_init:
  30. cd stack && \
  31. terraform init \
  32. -backend-config="cacert_path=$$HOME/virtualization/kubernetes-the-hard-way/certs/ca.pem" \
  33. -backend-config="cert_path=$$HOME/virtualization/kubernetes-the-hard-way/certs/kubernetes.pem" \
  34. -backend-config="key_path=$$HOME/virtualization/kubernetes-the-hard-way/certs/kubernetes-key.pem"
  35. stack_test:
  36. cd applications/ && \
  37. ansible -m debug -i stack_address.toml all -a "msg=test"