Create the base Ubuntu 20.04 cloud image with code
This commit is contained in:
parent
176083497c
commit
6f7b493173
@ -1,11 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# The base VM was downloaded using the following commands:
|
|
||||||
# mkdir /var/lib/libvirt/images/base
|
|
||||||
# curl -o http://cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-amd64-disk-kvm.img /var/lib/libvirt/images/base/ubuntu-20.04-server-cloudimg-amd64-disk-kvm.qcow2
|
|
||||||
# chown -R libvirt-qemu:root /var/lib/libvirt/images/base
|
|
||||||
|
|
||||||
if [[ $# -eq 0 ]] ; then
|
if [[ $# -eq 0 ]] ; then
|
||||||
echo 'USAGE: create_vm VMNAME'
|
echo 'USAGE: create_vm VMNAME'
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -26,6 +26,21 @@
|
|||||||
|
|
||||||
package %w(virtinst libvirt-daemon-system)
|
package %w(virtinst libvirt-daemon-system)
|
||||||
|
|
||||||
|
directory "/var/lib/libvirt/images/base" do
|
||||||
|
recursive true
|
||||||
|
owner "libvirt-qemu"
|
||||||
|
group "root"
|
||||||
|
mode "0750"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Base Ubuntu 20.04 image
|
||||||
|
remote_file "/var/lib/libvirt/images/base/ubuntu-20.04-server-cloudimg-amd64-disk-kvm.qcow2" do
|
||||||
|
source "http://cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-amd64-disk-kvm.img"
|
||||||
|
owner "libvirt-qemu"
|
||||||
|
group "root"
|
||||||
|
mode "0640"
|
||||||
|
end
|
||||||
|
|
||||||
cookbook_file "/usr/local/sbin/create_vm" do
|
cookbook_file "/usr/local/sbin/create_vm" do
|
||||||
source "create_vm"
|
source "create_vm"
|
||||||
mode "0750"
|
mode "0750"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user