From ad7282c6dd8adbf8af5ab0c62e5f275ef8f2edeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Wed, 2 Nov 2022 11:47:27 +0100 Subject: [PATCH] add pre-requisites --- aws-ec2-podman/cloud-init/user-data.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws-ec2-podman/cloud-init/user-data.yaml b/aws-ec2-podman/cloud-init/user-data.yaml index 4284b03..36e0ee0 100644 --- a/aws-ec2-podman/cloud-init/user-data.yaml +++ b/aws-ec2-podman/cloud-init/user-data.yaml @@ -11,12 +11,16 @@ packages: - java-17-openjdk-headless - maven-openjdk17 - git +- bzip2 +- tmux runcmd: # Disable SSH password authentication - [ "sed", "-i.post-install", "-e", "s/PasswordAuthentication no/PasswordAuthentication yes/", "/etc/ssh/sshd_config" ] - [ "systemctl", "restart", "sshd" ] # Enable sudo without password - [ "sed", "-i.post-install", "-e", "s/^%wheel\tALL=(ALL)\tALL/%wheel ALL=(ALL) NOPASSWD: ALL/", "/etc/sudoers" ] +# Run the post-install script +- [ "/usr/local/bin/post-install.sh" ] write_files: - path: /etc/neofetch/config.conf content: | @@ -110,6 +114,15 @@ write_files: neofetch --config /etc/neofetch/config.conf fi permissions: '0755' +- path: /usr/local/bin/post-install.sh + content: | + #!/bin/bash + set -Eeuo pipefail + curl -sSfL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash + curl -sSfL https://github.com/redhat-cop/template2helm/releases/download/v0.1.0/linux-amd64-template2helm.bz2 | bunzip2 -c > /usr/local/bin/template2helm + chmod 755 /usr/local/bin/template2helm + curl -sSfL https://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.11.12/openshift-client-linux.tar.gz | tar -zx -C /usr/local/bin oc kubectl + permissions: '0755' groups: - lab users: