From 4fec018547fd0cf5b8642a9e6f1643ecbfe46897 Mon Sep 17 00:00:00 2001 From: Nathan Rodet <nrodet@grandlyon.com> Date: Wed, 21 Dec 2022 15:54:58 +0100 Subject: [PATCH] Changes to cloud-init config --- terraform/cloud-init.yml | 18 ++++++++---------- terraform/main.tf | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/terraform/cloud-init.yml b/terraform/cloud-init.yml index a66e41b..6da91c1 100644 --- a/terraform/cloud-init.yml +++ b/terraform/cloud-init.yml @@ -11,8 +11,6 @@ packages: - git runcmd: -# Check env variables access - - "echo $USER_PASSWORD > test.txt" # Install Rust - "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" - "source \"$HOME/.cargo/env\"" @@ -20,13 +18,13 @@ runcmd: - "curl -fsSL https://get.docker.com -o get-docker.sh" - "sh get-docker.sh" # Install atrium - - "git clone https://github.com/nicolaspernoud/atrium.git ./root/atrium" + - "git clone https://github.com/nicolaspernoud/atrium.git" # Run Webtop Container - - "docker stop webtop" - - "docker rm webtop" - - "docker run -d --name=webtop --security-opt seccomp=unconfined -e PUID=0 -e PGID=0 -e TZ=Europe/Paris -e SUBFOLDER=/ -e KEYBOARD=fr-fr-azerty -e AUTO_LOGIN=false -p 80:3000 -v /root/webtop_data/:/config -v /var/run/docker.sock:/var/run/docker.sock --shm-size=8gb --cap-add=NET_ADMIN --privileged --restart unless-stopped --sysctl net.ipv6.conf.all.disable_ipv6=0 lscr.io/linuxserver/webtop:ubuntu-xfce" +# - "docker stop webtop" +# - "docker rm webtop" +# - "docker run -d --name=webtop --security-opt seccomp=unconfined -e PUID=0 -e PGID=0 -e TZ=Europe/Paris -e SUBFOLDER=/ -e KEYBOARD=fr-fr-azerty -e AUTO_LOGIN=false -p 80:3000 -v /root/webtop_data/:/config -v /var/run/docker.sock:/var/run/docker.sock --shm-size=8gb --cap-add=NET_ADMIN --privileged --restart unless-stopped --sysctl net.ipv6.conf.all.disable_ipv6=0 lscr.io/linuxserver/webtop:ubuntu-xfce" # Install Code Server - - "curl -fsSL https://code-server.dev/install.sh | sh" - - "mkdir -p /root/.config/code-server/" - - "echo 'bind-addr: 0.0.0.0:8080\nauth: password\npassword: yfB4W23G\ncert: false\n' > /root/.config/code-server/config.yaml" - - "systemctl enable --now code-server@$USER" +# - "curl -fsSL https://code-server.dev/install.sh | sh" +# - "mkdir -p /root/.config/code-server/" +# - "echo 'bind-addr: 0.0.0.0:8080\nauth: password\npassword: $(scw-userdata user_password)\ncert: false\n' > /root/.config/code-server/config.yaml" +# - "systemctl enable --now code-server@$USER" diff --git a/terraform/main.tf b/terraform/main.tf index bee8800..d423eed 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -83,7 +83,7 @@ resource "scaleway_instance_server" "user_instance_server" { security_group_id = scaleway_instance_security_group.www.id user_data = { - user_password = "export USER_PASSWORD=${var.USER_PASSWORD}" + user_password = var.USER_PASSWORD cloud-init = file("cloud-init.yml") } -- GitLab