add config metadata
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
bf00263bc5
commit
2e0a14320a
2 changed files with 5 additions and 1 deletions
4
agent.sh
4
agent.sh
|
|
@ -11,6 +11,7 @@
|
||||||
. ./lib/subnet.sh
|
. ./lib/subnet.sh
|
||||||
. ./lib/colors.sh
|
. ./lib/colors.sh
|
||||||
. ./lib/qemu.sh
|
. ./lib/qemu.sh
|
||||||
|
. ./lib/metadata.sh
|
||||||
|
|
||||||
DRY_RUN="1"
|
DRY_RUN="1"
|
||||||
SIMULATION="1"
|
SIMULATION="1"
|
||||||
|
|
@ -117,6 +118,9 @@ function main {
|
||||||
"DeleteVolume")
|
"DeleteVolume")
|
||||||
delete_volume "$@"
|
delete_volume "$@"
|
||||||
;;
|
;;
|
||||||
|
"Config")
|
||||||
|
metadata_config
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "action : ${fonction} not known !"
|
echo "action : ${fonction} not known !"
|
||||||
echo "avalable action :"
|
echo "avalable action :"
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ function qemu_start_vm {
|
||||||
add_in_db "vm" "${vm_name}" "${subnet_name}" "${tap_id}" "${metadata_port}" "${ip}"
|
add_in_db "vm" "${vm_name}" "${subnet_name}" "${tap_id}" "${metadata_port}" "${ip}"
|
||||||
create_tap "${tap_id}" "br-${subnet_id}" "${vpc_name}"
|
create_tap "${tap_id}" "br-${subnet_id}" "${vpc_name}"
|
||||||
metadata_start "${vpc_name}" "${gateway_ip}" "${metadata_port}" "${vm_name}" "${ssh_key}"
|
metadata_start "${vpc_name}" "${gateway_ip}" "${metadata_port}" "${vm_name}" "${ssh_key}"
|
||||||
ip netnes exec "${vpc_name}" iptable -t nat -A PREROUTING -s "${ip}/32" -d "169.254.169.254/32" -p tcp -m tcp --dport 80 -j DNAT --to-destination "${gateway_ip}:8080"
|
ip netns exec "${vpc_name}" iptable -t nat -A PREROUTING -s "${ip}/32" -d "169.254.169.254/32" -p tcp -m tcp --dport 80 -j DNAT --to-destination "${gateway_ip}:8080"
|
||||||
|
|
||||||
print_in_color "${COLOR_GREEN}" "Start vm ${vm_name}"
|
print_in_color "${COLOR_GREEN}" "Start vm ${vm_name}"
|
||||||
ip netns exec "${vpc_name}" qemu-system-x86_64 \
|
ip netns exec "${vpc_name}" qemu-system-x86_64 \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue