Skip to content

Instantly share code, notes, and snippets.

@oakinogundeji
Last active April 15, 2023 22:59
Show Gist options
  • Save oakinogundeji/51d06e1aabcb5fc174c52918981fbcb5 to your computer and use it in GitHub Desktop.
Save oakinogundeji/51d06e1aabcb5fc174c52918981fbcb5 to your computer and use it in GitHub Desktop.
ec2 user data for mongodb data node member
#!/bin/bash
sudo apt update && sudo apt upgrade
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-add-repository -y ppa:ansible/ansible
sudo apt install -y build-essential git nodejs ansible python3-boto3 zip unzip
git clone https://<github_username>:<github_pat>@github.com/<github_username>/<repo_name>.git /home/ubuntu/<repo_name>
cd <repo_name>/<optional_sub_directory>
ansible-playbook <optional_path_to/>provisioning.yml --extra-vars "BACKUP_BUCKET=your_s3_bucket"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment