Microbolt ❤️ Cloud
Ansible is a simple IT automation tool that can make your applications and systems easier to deploy. It is a powerful tool that can be used to automate the deployment and configuration of your Microbolt node(s).
Someone once said,
“Ain’t nobody got time to sit through RaspiBolt more than once. Once you’ve learned how to build a Bitcoin node with your hands the next ones should just build themselves.”
— 1ma (Unhosted Marcellus)
and here we are.
This guide assumes you have a basic understanding of Proxmox/Debian and can read basic shell commands or scripts, identify variables, and modify them as needed. Default values are provided for all variables, but you can customize them to suit your requirements. You don’t need to be a Proxmox/Debian expert, but you should be able to SSH into your system. Installing Proxmox/Debian is out of scope.
Prerequisites
Variables
| Variable | Description | Default |
|---|---|---|
blank | Blank template ID | 9000 |
alpine | Alpine template ID | 9010 |
storage | Storage ID | local-zfs |
ssd | SSD flag | 1 |
username | Cloud-init username | satoshi |
ssh_keyfile | SSH key file | /etc/pve/priv/authorized_keys |
password | Cloud-init password | changeme |
microbolt | Microbolt VM ID | 2140 |
name | Microbolt VM name | nakamoto01 |
cores | Microbolt VM cores | 4 |
memory | Microbolt VM memory | 8192 |
vlan | Microbolt VM VLAN | 1 |
second_storage | Second storage ID | local-zfs |
second_ssd | Second SSD flag | 1 |
SSH into your Proxmox/Debian server and run the following commands.
Blank template
It is highly recommended to create a blank Linux template if you are using Proxmox/Debian. You’ll thank me later.
qm create "${blank:-9000}" \
--name template \
--ostype l26 \
--agent enabled=1,fstrim_cloned_disks=1 \
--cpu host \
--balloon 0 \
--vga serial0 \
--scsihw virtio-scsi-pci \
--net0 virtio,bridge=vmbr0,firewall=1 \
--serial0 socket
qm template "${blank:-9000}"Alpine cloud template
Clone the blank template
qm clone "${blank:-9000}" "${alpine:-9010}" \
--name alpine-3.20 \
--fullDownload the cloud image
wget https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/cloud/\
nocloud_alpine-3.20.3-x86_64-bios-cloudinit-r0.qcow2Create the Alpine cloud template
To use your own SSH keys from GitHub, simply replace <username> with your
actual GitHub username.
wget -qO- https://github.com/<username>.keys > ./github_keys
export ssh_keyfile=./github_keysqm set "${alpine:-9010}" \
--scsi0 "${storage:-local-zfs}:0,import-from=$(pwd)/nocloud_alpine-3.20.3-x86_64-bios-cloudinit-r0.qcow2,iothread=1,discard=on,ssd=${ssd:-1}" \
--ide0 "${storage:-local-zfs}:cloudinit" \
--tags alpine \
--ciuser "${username:-satoshi}" \
--sshkeys "${ssh_keyfile:-/etc/pve/priv/authorized_keys}" \
--cipassword "${password:-changeme}" \
--ipconfig0 "ip6=auto,ip=dhcp" \
--boot order=scsi0 \
--ciupgrade 1 \
--scsihw virtio-scsi-single
qm template "${alpine:-9010}"Clean up
rm nocloud_alpine-3.20.3-x86_64-bios-cloudinit-r0.qcow2Microbolt VM
Clone the Alpine cloud template
qm clone "${alpine:-9010}" "${microbolt:-2140}" \
--name "${name:-nakamoto01}" \
--fullSet the Microbolt VM
qm set "${microbolt:-2140}" \
--onboot 1 \
--cores "${cores:-2}" \
--memory "${memory:-8192}" \
--net0 "virtio,bridge=vmbr0,firewall=1,tag=${vlan:-1}" \
--tags "alpine,microbolt"Rezise the disk(s)
qm disk resize "${microbolt:-2140}" scsi0 2048GStart the VM
qm start "${microbolt:-2140}"Installation
Run the following commands on your main machine.
Install Ansible
apk add ansibleClone the repository
git clone https://github.com/microbolt-guide/ansible.git && cd ansibleConfigure the inventory
cp inventory/hosts.ini.example inventory/hosts.iniEdit the hosts.ini file
vi inventory/hosts.iniConfigure the variables
Edit the global variables in group_vars/all.yaml file
vi inventory/group_vars/all.yamlAnd/or modify for a single host, view examples inside the host_vars directory
cat inventory/host_vars/nakamoto01.yaml.exampleRun the playbook
./deploy.shStart and enable the services
./services.sh start enable