26 lines
546 B
Bash
Executable file
26 lines
546 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
case "$1" in
|
|
vm)
|
|
qemu-system-x86_64 \
|
|
-nographic -serial mon:stdio \
|
|
-enable-kvm -cpu host -smp 4 -m 4G \
|
|
-device e1000,netdev=net0 \
|
|
-netdev user,id=net0,hostfwd=tcp::2222-:22 \
|
|
-drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE.fd \
|
|
-hda ft_chatons.qcow2
|
|
;;
|
|
command)
|
|
ansible -i ansible/inventory ft_chatons -a "$2"
|
|
;;
|
|
setup)
|
|
ansible-playbook -i ansible/inventory ansible/playbooks/install.yml -K
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {vm|command|setup} [command]"
|
|
exit 1
|
|
esac
|
|
|
|
|
|
|