#cloud-config

# System update
package_update: true
package_upgrade: true

# Install Packages
packages:
  - curl
  - git

runcmd:
#
# cloud-init execute cmd before HOME and USER are set.
#
  - "export HOME=/root"
  - "export USER=root"
#
# Install Rust
#
  - "curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/scripts/rust.sh | bash"
#
# Install Docker
#
  - "curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/scripts/docker.sh | bash"
#
# Install Atrium
#
  - "curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/config-files/atrium.yaml -o root/atrium.yaml"
  - "curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/scripts/atrium.sh | bash"
#
# Install And Run Code Server
#
  - "curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/config-files/config.yaml -o root/config.yaml"
  - "curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/scripts/code-server.sh | bash"
#
# Run Webtop Container
#
  - "curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/scripts/webtop.sh | sh"
#
# Install Repository
#
  - "git clone https://github.com/NathanRodet/rust-axum-demo /root/rust-axum-demo"