|
#cloud-config |
|
package_upgrade: true |
|
packages: |
|
- bash-completion |
|
- tree |
|
- openssh |
|
- postgresql-server |
|
- postgresql-contrib |
|
- redis |
|
- curl |
|
- git |
|
- awscli2 |
|
- openssl |
|
- openssl-devel |
|
- libyaml-devel |
|
- ncurses |
|
- ncurses-devel |
|
- ncurses-compat-libs |
|
- perl |
|
- "@development-tools" |
|
- gmp-devel |
|
- autoconf |
|
- sbcl |
|
- ecl |
|
- podman |
|
timezone: America/Los_Angeles |
|
write_files: |
|
- path: /run/scripts/setup-asdf.sh |
|
content: | |
|
#!/bin/bash -e |
|
|
|
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1 |
|
echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc |
|
echo '. "$HOME/.asdf/completions/asdf.bash"' >> ~/.bashrc |
|
source ~/.bashrc |
|
asdf update |
|
asdf plugin add ruby |
|
asdf plugin add nodejs |
|
asdf plugin add erlang |
|
asdf plugin add elixir |
|
asdf install ruby latest |
|
asdf install nodejs latest |
|
asdf install erlang latest |
|
asdf install elixir latest |
|
asdf global ruby latest |
|
asdf global nodejs latest |
|
asdf global erlang latest |
|
asdf global elixir latest |
|
npm install -g npm |
|
npm install -g yarn |
|
owner: root:root |
|
permissions: '0744' |
|
- path: /run/scripts/setup-qlot.sh |
|
content: | |
|
#!/bin/bash -e |
|
|
|
curl --proto '=https' --tlsv1.2 -LsSf https://qlot.tech/installer > /tmp/install-qlot |
|
cat /tmp/install-qlot |
|
chmod +x /tmp/install-qlot |
|
/tmp/install-qlot |
|
|
|
echo -e '\nexport PATH="/home/user/.qlot/bin:$PATH"' >> /home/user/.bashrc |
|
- path: /run/scripts/setup-haskell.sh |
|
content: | |
|
#!/bin/bash -e |
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org > /tmp/get-ghcup |
|
cat /tmp/get-ghcup |
|
chmod +x /tmp/get-ghcup |
|
/tmp/get-ghcup |
|
owner: root:root |
|
permissions: '0744' |
|
- path: /run/scripts/setup-postgresql.sh |
|
content: | |
|
#!/bin/bash -e |
|
|
|
postgresql-setup --initdb --unit postgresql |
|
systemctl enable postgresql |
|
systemctl start postgresql |
|
sudo -u postgres createuser user |
|
echo "local all user trust" >> /etc/postgresql/15/main/pg_hba.conf |
|
systemctl reload postgresql |
|
owner: root:root |
|
permissions: '0744' |
|
- path: /run/scripts/setup-redis.sh |
|
content: | |
|
#!/bin/bash -e |
|
|
|
systemctl enable redis |
|
systemctl start redis |
|
owner: root:root |
|
permissions: '0744' |
|
runcmd: |
|
- chown -R user:user /home/user |
|
- chmod +x /run/scripts/setup-asdf.sh |
|
- chmod +x /run/scripts/setup-qlot.sh |
|
- chmod +x /run/scripts/setup-haskell.sh |
|
- chown user:user /run/scripts/setup-asdf.sh |
|
- chown user:user /run/scripts/setup-qlot.sh |
|
- chown user:user /run/scripts/setup-haskell.sh |
|
- cd /home/user && sudo -H -u user /run/scripts/setup-asdf.sh |
|
- cd /home/user && sudo -H -u user /run/scripts/setup-qlot.sh |
|
- cd /home/user && sudo -H -u user /run/scripts/setup-haskell.sh |
|
- /run/scripts/setup-postgresql.sh |
|
- /run/scripts/setup-redis.sh |
|
users: |
|
- name: user |
|
gecos: User |
|
primary_group: user |
|
sudo: ['ALL=(ALL) NOPASSWD:ALL'] |
|
groups: sudo |
|
shell: /bin/bash |
|
ssh-authorized-keys: [] |