53 lines
1.2 KiB
YAML
Executable File
53 lines
1.2 KiB
YAML
Executable File
#cloud-config
|
|
# Run 'apt-get update' on first boot
|
|
apt_update: true
|
|
|
|
# Run 'apt-get upgrade' on first boot
|
|
# disabled for testing
|
|
apt_upgrade: true
|
|
|
|
packages:
|
|
- curl
|
|
- git
|
|
- wget
|
|
- unzip
|
|
- python3-pip
|
|
- build-essential
|
|
- python3-dev
|
|
- python3-venv
|
|
- python3-wheel
|
|
- libxslt-dev
|
|
- libzip-dev
|
|
- libldap2-dev
|
|
- libsasl2-dev
|
|
- python3-setuptools
|
|
- node-less
|
|
- postgresql
|
|
|
|
# boot commands
|
|
# These are like 'runcmd', but run very early in the boot process & run on every boot by default.
|
|
bootcmd:
|
|
- echo $(whoami) > /root/boot.txt
|
|
|
|
runcmd:
|
|
# enable postgres
|
|
- systemctl enable --now postgresql.service
|
|
# create db user
|
|
- su - postgres -c "createuser -s ubuntu"
|
|
# setup directories
|
|
- sudo -u ubuntu mkdir /home/ubuntu/config
|
|
- sudo -u ubuntu mkdir /home/ubuntu/custom
|
|
- sudo -u ubuntu mkdir /home/ubuntu/db
|
|
|
|
# set the locale
|
|
locale: en_US.UTF-8
|
|
|
|
# timezone: set the timezone for this instance
|
|
timezone: UTC
|
|
|
|
# Log all cloud-init process output (info & errors) to a logfile
|
|
output: {all: ">> /var/log/cloud-init-output.log"}
|
|
|
|
# final_message written to log when cloud-init processes are finished
|
|
final_message: "System boot (via cloud-init) is COMPLETE, after $UPTIME seconds. Finished at $TIMESTAMP"
|