From beacfcab46be0c55bda4b3181b877b58738e3449 Mon Sep 17 00:00:00 2001 From: Lee VanGinkel Date: Tue, 27 Feb 2024 11:13:02 -0800 Subject: [PATCH] adding scripts to deploy docker and netbox --- mdd/scripts/docker-install.sh | 24 ++++++++++++++++++++ mdd/scripts/netbox-install.sh | 41 +++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 mdd/scripts/docker-install.sh create mode 100644 mdd/scripts/netbox-install.sh diff --git a/mdd/scripts/docker-install.sh b/mdd/scripts/docker-install.sh new file mode 100644 index 0000000..ba3f9be --- /dev/null +++ b/mdd/scripts/docker-install.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Update package listings +sudo apt update + +# Install necessary packages for Docker installation +sudo apt install -y apt-transport-https ca-certificates curl software-properties-common + +# Add Docker's official GPG key +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + +# Add Docker repository to APT sources +sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" + +# Update package listings again after adding new repository +sudo apt update + +# Install Docker +sudo apt install -y docker-ce + +# Add the current user to the Docker group +sudo usermod -aG docker $USER + +echo "Docker installation and user modification completed." \ No newline at end of file diff --git a/mdd/scripts/netbox-install.sh b/mdd/scripts/netbox-install.sh new file mode 100644 index 0000000..a6500f8 --- /dev/null +++ b/mdd/scripts/netbox-install.sh @@ -0,0 +1,41 @@ +!/bin/bash + +# Define the NetBox directory +HOME_DIR=/home/ubuntu/ + + +# Initialize an empty repository and fetch the contents into the existing directory +echo "Cloning the NetBox Docker repository into $HOME_DIR." +cd "$HOME_DIR" +sudo git clone https://github.com/netbox-community/netbox-docker.git + +# Change directory back to NETBOX_DIR +cd netbox-docker + +# Create or overwrite the docker-compose.override.yml with custom content +echo "Creating docker-compose.override.yml." +sudo tee docker-compose.override.yml <