Compare commits
1 Commits
jammy_jell
...
232601f093
| Author | SHA1 | Date | |
|---|---|---|---|
|
232601f093
|
@@ -1,5 +1,5 @@
|
|||||||
node.default['bitcoin']['version'] = '26.0'
|
node.default['bitcoin']['version'] = '27.1'
|
||||||
node.default['bitcoin']['checksum'] = 'ab1d99276e28db62d1d9f3901e85ac358d7f1ebcb942d348a9c4e46f0fcdc0a1'
|
node.default['bitcoin']['checksum'] = '0c1051fd921b8fae912f5c2dfd86b085ab45baa05cd7be4585b10b4d1818f3da'
|
||||||
node.default['bitcoin']['username'] = 'satoshi'
|
node.default['bitcoin']['username'] = 'satoshi'
|
||||||
node.default['bitcoin']['usergroup'] = 'bitcoin'
|
node.default['bitcoin']['usergroup'] = 'bitcoin'
|
||||||
node.default['bitcoin']['network'] = 'mainnet'
|
node.default['bitcoin']['network'] = 'mainnet'
|
||||||
|
|||||||
@@ -12,8 +12,9 @@ if node["bitcoin"]["blocksdir_mount_type"]
|
|||||||
include_recipe "kosmos-bitcoin::blocksdir-mount"
|
include_recipe "kosmos-bitcoin::blocksdir-mount"
|
||||||
end
|
end
|
||||||
|
|
||||||
%w{ libtool autotools-dev make automake cmake curl g++-multilib libtool
|
%w{
|
||||||
binutils-gold bsdmainutils pkg-config python3 patch }.each do |pkg|
|
libtool autotools-dev make automake cmake curl g++-10-multilib
|
||||||
|
binutils-gold bsdmainutils pkg-config python3 patch }.each do |pkg|
|
||||||
apt_package pkg
|
apt_package pkg
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ end
|
|||||||
|
|
||||||
execute "compile_bitcoin-core_dependencies" do
|
execute "compile_bitcoin-core_dependencies" do
|
||||||
cwd "/usr/local/bitcoind/depends"
|
cwd "/usr/local/bitcoind/depends"
|
||||||
command "make NO_QT=1"
|
command "make CC=gcc-10 CXX=g++-10 NO_QT=1"
|
||||||
action :nothing
|
action :nothing
|
||||||
notifies :run, 'bash[compile_bitcoin-core]', :immediately
|
notifies :run, 'bash[compile_bitcoin-core]', :immediately
|
||||||
end
|
end
|
||||||
@@ -35,7 +36,7 @@ bash "compile_bitcoin-core" do
|
|||||||
cwd "/usr/local/bitcoind"
|
cwd "/usr/local/bitcoind"
|
||||||
code <<-EOH
|
code <<-EOH
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
./configure --prefix=$PWD/depends/x86_64-pc-linux-gnu
|
./configure CC=gcc-10 CXX=g++-10 --prefix=$PWD/depends/x86_64-pc-linux-gnu
|
||||||
make
|
make
|
||||||
EOH
|
EOH
|
||||||
action :nothing
|
action :nothing
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
release = "20240514"
|
ubuntu_server_cloud_image_release = "20230506"
|
||||||
|
|
||||||
node.default["kosmos_kvm"]["host"]["qemu_base_image"] = {
|
node.default["kosmos_kvm"]["host"]["qemu_base_image"] = {
|
||||||
"url" => "https://cloud-images.ubuntu.com/releases/jammy/release-#{release}/ubuntu-22.04-server-cloudimg-amd64-disk-kvm.img",
|
"url" => "https://cloud-images.ubuntu.com/releases/focal/release-#{ubuntu_server_cloud_image_release}/ubuntu-20.04-server-cloudimg-amd64-disk-kvm.img",
|
||||||
"checksum" => "2e7698b3ebd7caead06b08bd3ece241e6ce294a6db01f92ea12bcb56d6972c3f",
|
"checksum" => "27d2b91fd2b715729d739e2a3155dce70d1aaae4f05c177f338b9d4b60be638c",
|
||||||
"path" => "/var/lib/libvirt/images/base/ubuntu-22.04-server-cloudimg-amd64-disk-kvm-#{release}.qcow2"
|
"path" => "/var/lib/libvirt/images/base/ubuntu-20.04-server-cloudimg-amd64-disk-kvm-#{ubuntu_server_cloud_image_release}.qcow2"
|
||||||
}
|
}
|
||||||
|
|
||||||
# A systemd.timer OnCalendar config value
|
# A systemd.timer OnCalendar config value
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ DISKSIZE=${4:-10} # 10GB default
|
|||||||
# Directory where image files will be stored
|
# Directory where image files will be stored
|
||||||
IMAGE_DIR=/var/lib/libvirt/images
|
IMAGE_DIR=/var/lib/libvirt/images
|
||||||
IMAGE_PATH=$IMAGE_DIR/${VMNAME}.qcow2
|
IMAGE_PATH=$IMAGE_DIR/${VMNAME}.qcow2
|
||||||
CIDATA_PATH=${IMAGE_DIR}/${VMNAME}-cloudinit
|
CIDATA_PATH=${IMAGE_DIR}/cidata-${VMNAME}.iso
|
||||||
BASE_FILE=<%= @base_image_path %>
|
BASE_FILE=<%= @base_image_path %>
|
||||||
|
|
||||||
# Create the VM image if it does not already exist
|
# Create the VM image if it does not already exist
|
||||||
@@ -38,8 +38,9 @@ qemu-img info "$IMAGE_PATH"
|
|||||||
# Check if the cloud-init metadata file exists
|
# Check if the cloud-init metadata file exists
|
||||||
# if not, generate it
|
# if not, generate it
|
||||||
if [ ! -r $CIDATA_PATH ]; then
|
if [ ! -r $CIDATA_PATH ]; then
|
||||||
mkdir -p $CIDATA_PATH
|
pushd $(dirname $CIDATA_PATH)
|
||||||
pushd $CIDATA_PATH
|
mkdir -p $VMNAME
|
||||||
|
cd $VMNAME
|
||||||
|
|
||||||
cat > user-data <<-EOS
|
cat > user-data <<-EOS
|
||||||
#cloud-config
|
#cloud-config
|
||||||
@@ -61,19 +62,25 @@ instance-id: $VMNAME
|
|||||||
local-hostname: $VMNAME
|
local-hostname: $VMNAME
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
|
genisoimage -output "$CIDATA_PATH" -volid cidata -joliet -rock user-data meta-data
|
||||||
|
chown libvirt-qemu:kvm "$CIDATA_PATH"
|
||||||
|
chmod 600 "$CIDATA_PATH"
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# setting --os-variant to ubuntu20.04 and ubuntu18.04 breaks SSH and networking
|
||||||
virt-install \
|
virt-install \
|
||||||
--name "$VMNAME" \
|
--name "$VMNAME" \
|
||||||
--ram "$RAM" \
|
--ram "$RAM" \
|
||||||
--vcpus "$CPUS" \
|
--vcpus "$CPUS" \
|
||||||
--cpu host \
|
--cpu host \
|
||||||
--arch x86_64 \
|
--arch x86_64 \
|
||||||
--osinfo detect=on,name=ubuntujammy \
|
--os-type linux \
|
||||||
|
--os-variant ubuntu16.04 \
|
||||||
--hvm \
|
--hvm \
|
||||||
--virt-type kvm \
|
--virt-type kvm \
|
||||||
--disk "$IMAGE_PATH" \
|
--disk "$IMAGE_PATH" \
|
||||||
|
--cdrom "$CIDATA_PATH" \
|
||||||
--boot hd \
|
--boot hd \
|
||||||
--network=bridge=virbr0,model=virtio \
|
--network=bridge=virbr0,model=virtio \
|
||||||
--graphics none \
|
--graphics none \
|
||||||
@@ -81,5 +88,4 @@ virt-install \
|
|||||||
--console pty \
|
--console pty \
|
||||||
--channel unix,mode=bind,path=/var/lib/libvirt/qemu/$VMNAME.guest_agent.0,target_type=virtio,name=org.qemu.guest_agent.0 \
|
--channel unix,mode=bind,path=/var/lib/libvirt/qemu/$VMNAME.guest_agent.0,target_type=virtio,name=org.qemu.guest_agent.0 \
|
||||||
--autostart \
|
--autostart \
|
||||||
--import \
|
--import
|
||||||
--cloud-init root-password-generate=off,disable=on,meta-data=$CIDATA_PATH/meta-data,user-data=$CIDATA_PATH/user-data
|
|
||||||
|
|||||||
Reference in New Issue
Block a user