Skip to content

Instantly share code, notes, and snippets.

@arif-ali
Created January 19, 2021 20:24
Show Gist options
  • Save arif-ali/f8a2b50e44492b0d8c9cc683c687566f to your computer and use it in GitHub Desktop.
Save arif-ali/f8a2b50e44492b0d8c9cc683c687566f to your computer and use it in GitHub Desktop.
Quick deploy of VM and bootstrapped juju in LXD
nodename=as3-maas-node-01
system_id=$(maas admin machines read hostname=${nodename} | jq .[].system_id | sed s/\"/g)
maas admin machine deploy ${system_id} user_data="$(base64 user-data-lxd.yaml)"
#cloud-config
ssh_import_id:
- lp:arif-ali
byobu_by_default: enable
timezone: "Europe/London"
# Allow ssh passwords
ssh_pwauth: True
## Update apt database and upgrade packages on first boot
package_update: true
package_upgrade: true
groups:
- lxd: [ ubuntu ]
users:
- default
## Install additional packages on first boot
packages:
- tox
snap:
commands:
- ['install', 'juju', '--classic']
lxd:
init:
storage_backend: dir
bridge:
mode: new
name: lxdbr0
ipv4_address: 10.1.0.1
ipv4_netmask: 24
ipv4_nat: true
# Runs any command that we need to run post install
runcmd:
- [ "juju", "bootstrap", "localhost", "lxd" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment