Antoine
f70970f0e4
generate ansible inventory from terraform provisioned domain add make hazelcast to run and setup hazelcast onto domain
38 lines
1.0 KiB
Makefile
38 lines
1.0 KiB
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_remote.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:
|
|
@cd stack && terraform destroy --auto-approve -target=libvirt_domain.db1
|
|
|
|
destroy_all:
|
|
@cd stack && terraform destroy --auto-approve
|
|
|
|
create_all:
|
|
@cd stack && terraform apply --auto-approve
|
|
|
|
hazelcast:
|
|
cd applications/ && \
|
|
echo "create python venv workspace" && \
|
|
python3 -m venv workspace && \
|
|
source workspace/bin/activate && \
|
|
echo "install python venv and dependencies" && \
|
|
pip install --upgrade pip && \
|
|
pip install -r requirements.txt && \
|
|
echo "install ansible-galaxy dependencies" && \
|
|
ansible-galaxy install -r hazelcast/requirements.yml && \
|
|
echo "start playbook" && \
|
|
ansible-playbook -i stack_address.toml hazelcast/playbook.yml
|
|
|