Skip to content

Commit

Permalink
added a sample that uses ubuntu core 64 bit version (#64)
Browse files Browse the repository at this point in the history
Also has sample install of zfs and node-exporter

Co-authored-by: gshiva <[email protected]>
  • Loading branch information
gshiva and gshiva authored May 14, 2020
1 parent b9b6bb0 commit 9cffe7f
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions samples/pi-ubuntu-core-secure-zfs-nodeexporter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"variables": {
"home": "{{env `HOME`}}",
"node_exporter_version": "0.18.1"
},
"builders": [{
"type": "arm-image",
"image_type": "raspberrypi",
"qemu_binary": "qemu-aarch64-static",
"iso_url" : "http://cdimage.ubuntu.com/releases/20.04/release/ubuntu-20.04-preinstalled-server-arm64+raspi.img.xz",
"iso_checksum_type":"sha256",
"iso_checksum":"48167067d65c5192ffe041c9cc4958cb7fcdfd74fa15e1937a47430ed7b9de99",
"last_partition_extra_size" : "1073741824",
"image_mounts": ["/boot/firmware","/"],
"chroot_mounts": [
["proc", "proc", "/proc"],
["sysfs", "sysfs", "/sys"],
["bind", "/dev", "/dev"],
["devpts", "devpts", "/dev/pts"],
["binfmt_misc", "binfmt_misc", "/proc/sys/fs/binfmt_misc"],
["bind", "/run/resolvconf", "/run/resolvconf"]
]
}],
"provisioners": [
{
"type": "shell",
"inline": ["touch /boot/ssh"]
},
{
"type": "file",
"source": "{{user `home`}}/.ssh/id_rsa.pub",
"destination": "/home/pi/.ssh/authorized_keys"
},
{
"type": "shell",
"inline": [
"sed '/PasswordAuthentication/d' -i /etc/ssh/ssh_config",
"echo >> /etc/ssh/ssh_config",
"echo 'PasswordAuthentication no' >> /etc/ssh/ssh_config"
]
},
{
"type": "shell",
"inline": [
"apt-get update",
"apt-get install -y zfs-dkms, atop",
"curl -SL https://github.com/prometheus/node_exporter/releases/download/v{{user `node_exporter_version`}}/node_exporter-{{user `node_exporter_version`}}.linux-armv7.tar.gz > node_exporter.tar.gz",
"sudo tar -xvf node_exporter.tar.gz -C /usr/local/bin/ --strip-components=1",
"cd /etc/systemd/system/",
"curl -sSLo - https://raw.githubusercontent.com/prometheus/node_exporter/master/examples/systemd/node_exporter.service |sed -e 's|/etc/sysconfig/node_exporter|/etc/default/node_exporter|' |sed -e 's/^User.*//' > node_exporter.service",
"curl -sSLo - https://raw.githubusercontent.com/prometheus/node_exporter/master/examples/systemd/sysconfig.node_exporter |sed -e 's/^OPTIONS/#OPTIONS/;aOPTIONS=\"\"' >/etc/default/node_exporter",
"systemctl daemon-reload",
"systemctl enable node_exporter.service",
"systemctl start node_exporter.service"
]
}
]
}

0 comments on commit 9cffe7f

Please sign in to comment.