mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35:20 +00:00
scripts: Add Ubuntu cloud-init data
Add cloud-init data for Ubuntu and introduce a convenience script that can be used to generate cloud-init disk images for manual testing. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
be199e5560
commit
f86b9dd95e
13
scripts/create-cloud-init.sh
Executable file
13
scripts/create-cloud-init.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
rm /tmp/clear-cloudinit.img
|
||||
mkdosfs -n config-2 -C /tmp/clear-cloudinit.img 8192
|
||||
mcopy -oi /tmp/clear-cloudinit.img -s test_data/cloud-init/clear/openstack ::
|
||||
|
||||
rm /tmp/ubuntu-cloudinit.img
|
||||
mkdosfs -n cidata -C /tmp/ubuntu-cloudinit.img 8192
|
||||
mcopy -oi /tmp/ubuntu-cloudinit.img -s test_data/cloud-init/ubuntu/user-data ::
|
||||
mcopy -oi /tmp/ubuntu-cloudinit.img -s test_data/cloud-init/ubuntu/meta-data ::
|
||||
mcopy -oi /tmp/ubuntu-cloudinit.img -s test_data/cloud-init/ubuntu/network-config ::
|
||||
|
2
test_data/cloud-init/ubuntu/meta-data
Executable file
2
test_data/cloud-init/ubuntu/meta-data
Executable file
@ -0,0 +1,2 @@
|
||||
instance-id: cloud
|
||||
local-hostname: cloud
|
12
test_data/cloud-init/ubuntu/network-config
Normal file
12
test_data/cloud-init/ubuntu/network-config
Normal file
@ -0,0 +1,12 @@
|
||||
network:
|
||||
version: 1
|
||||
config:
|
||||
- type: physical
|
||||
name: eth0
|
||||
mac_address: 12:34:56:78:90:ab
|
||||
subnets:
|
||||
- type: static
|
||||
address: 192.168.2.2/24
|
||||
gateway: 192.168.2.1
|
||||
dns_nameservers:
|
||||
- 192.168.2.1
|
10
test_data/cloud-init/ubuntu/user-data
Executable file
10
test_data/cloud-init/ubuntu/user-data
Executable file
@ -0,0 +1,10 @@
|
||||
#cloud-config
|
||||
users:
|
||||
- name: cloud
|
||||
passwd: $6$7125787751a8d18a$sHwGySomUA1PawiNFWVCKYQN.Ec.Wzz0JtPPL1MvzFrkwmop2dq7.4CYf03A5oemPQ4pOFCCrtCelvFBEle/K.
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
lock_passwd: False
|
||||
inactive: False
|
||||
shell: /bin/bash
|
||||
|
||||
ssh_pwauth: True
|
Loading…
Reference in New Issue
Block a user