Browse Source

add pre-requisites

main
Nicolas Massé 3 years ago
parent
commit
ad7282c6dd
  1. 13
      aws-ec2-podman/cloud-init/user-data.yaml

13
aws-ec2-podman/cloud-init/user-data.yaml

@ -11,12 +11,16 @@ packages:
- java-17-openjdk-headless - java-17-openjdk-headless
- maven-openjdk17 - maven-openjdk17
- git - git
- bzip2
- tmux
runcmd: runcmd:
# Disable SSH password authentication # Disable SSH password authentication
- [ "sed", "-i.post-install", "-e", "s/PasswordAuthentication no/PasswordAuthentication yes/", "/etc/ssh/sshd_config" ] - [ "sed", "-i.post-install", "-e", "s/PasswordAuthentication no/PasswordAuthentication yes/", "/etc/ssh/sshd_config" ]
- [ "systemctl", "restart", "sshd" ] - [ "systemctl", "restart", "sshd" ]
# Enable sudo without password # Enable sudo without password
- [ "sed", "-i.post-install", "-e", "s/^%wheel\tALL=(ALL)\tALL/%wheel ALL=(ALL) NOPASSWD: ALL/", "/etc/sudoers" ] - [ "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: write_files:
- path: /etc/neofetch/config.conf - path: /etc/neofetch/config.conf
content: | content: |
@ -110,6 +114,15 @@ write_files:
neofetch --config /etc/neofetch/config.conf neofetch --config /etc/neofetch/config.conf
fi fi
permissions: '0755' 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: groups:
- lab - lab
users: users:

Loading…
Cancel
Save