From 64c10516df90d84d808488368396c4d5272624fc Mon Sep 17 00:00:00 2001 From: Ibrahim Mkusa Date: Sun, 17 Nov 2024 16:09:13 -0500 Subject: [PATCH] containerizing omada controller --- .gitignore | 1 + README.md | 2 +- docker/omada/Dockerfile | 4 +++ docker/omada/download_omada.sh | 6 +++++ docker/omada/omada/readme.txt | 29 +++++++++++++++++++++ docker/omada/omada_install.sh | 21 +++++++++++++++ aws-amis.pkr.hcl => packer/aws-amis.pkr.hcl | 0 aws-export.sh => packer/aws-export.sh | 0 {scripts => packer/scripts}/initial.sh | 0 9 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 docker/omada/Dockerfile create mode 100755 docker/omada/download_omada.sh create mode 100644 docker/omada/omada/readme.txt create mode 100755 docker/omada/omada_install.sh rename aws-amis.pkr.hcl => packer/aws-amis.pkr.hcl (100%) rename aws-export.sh => packer/aws-export.sh (100%) rename {scripts => packer/scripts}/initial.sh (100%) diff --git a/.gitignore b/.gitignore index 5e22a1f..dfc08c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ id_rsa.pub +Omada_SDN_Controller_v5.14.32.4_linux_x64 diff --git a/README.md b/README.md index 4e2fb83..9af3766 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ ## AMI builds using packer -Packer builds to automate image creation. Got tired of doing it manually. +Builds to automate image and container creation. Got tired of doing it manually. diff --git a/docker/omada/Dockerfile b/docker/omada/Dockerfile new file mode 100644 index 0000000..8e2b848 --- /dev/null +++ b/docker/omada/Dockerfile @@ -0,0 +1,4 @@ +FROM debian:bookworm +COPY ./omada-install.sh . +RUN chmod +x omada-install.sh;sudo ./omada-install.sh +CMD ["tpeap", "start"] diff --git a/docker/omada/download_omada.sh b/docker/omada/download_omada.sh new file mode 100755 index 0000000..6e57cbc --- /dev/null +++ b/docker/omada/download_omada.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +wget https://static.tp-link.com/upload/software/2024/202411/20241115/Omada_SDN_Controller_v5.14.32.4_linux_x64.tar.gz -O omada_sdn.tar.gz +mkdir omada +tar xvf omada_sdn.tar.gz -C omada +rm -rf omada_sdn.tar.gz diff --git a/docker/omada/omada/readme.txt b/docker/omada/omada/readme.txt new file mode 100644 index 0000000..0cfea32 --- /dev/null +++ b/docker/omada/omada/readme.txt @@ -0,0 +1,29 @@ +Omada Controller v5.14.32.4 for Linux (X64) + +For how to install Omada Controller on the Linux operation system, please refer to the faq: https://www.tp-link.com/en/support/faq/2917/ +If you are using the old controller and planning to upgrade to this version, please follow the Omada Controller Upgrade Guide. +Upgrade Guide: https://www.tp-link.com/en/omada-sdn/controller-upgrade + +Notes: +1. This version of Omada Controller supports Java 8 and MongoDB 3.0-3.6. And there are no built-in JRE and MongoDB, so you need to install them by yourself. +2. You need to install jsvc and curl first before you install Omada Controller. +3. If you want Omada Controller to run as a non-root user (it runs as root by default), please refer to https://www.tp-link.com/support/faq/3583/ +4. Supporting 64-bit Linux operating system, including Ubuntu 14.04/16.04/18.04, CentOS 6.x/7.x, Fedora 20 (or above) and Debian 8/9. + +Installation Steps: +1. Install Java 8. +2. Install MongoDB 3.0-3.6 +3. Install jsvc +4. Install curl +5. Install Omada SDN Controller +5. Start the Omada Controller service using the command: tpeap start. Launch a web browser and visit http://localhost:8088 or https://localhost:8043 to enter the management interface of Omada Controller. +You can also use the following commands to stop the service or view the service status: + To stop the service: tpeap stop + To view the service status: tpeap status +6. Follow the quick setup wizard to complete the basic settings. + For more instructions, please refer to the User Guide of Omada Controller. + +Tips: +1. To uninstall Omada Controller, run the command: sudo bash /opt/tplink/EAPController/uninstall.sh +2. If the Omada Controller cannot detect EAP devices, it is possibly because the firewall intercepts the service. +Please make sure that the ports 8088, 8043, 27001, 27002, 29810, 29811, 29812, 29813 and 29814 are available. diff --git a/docker/omada/omada_install.sh b/docker/omada/omada_install.sh new file mode 100755 index 0000000..33bf14b --- /dev/null +++ b/docker/omada/omada_install.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +function install_prereqs() { + sudo apt install -y jsvc curl default-jre default-jdk + sudo apt-get install gnupg curl -y +} + +function install_mongodb () { + curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \ + sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \ + --dearmor + echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] http://repo.mongodb.org/apt/debian bookworm/mongodb-org/8.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list + sudo apt-get update -y + sudo apt-get install -y mongodb-org +} + +install_prereqs +install_mongodb +cd omada/Omada_SDN_Controller_v5.14.32.4_linux_x64/ || exit +sudo ./install.sh + diff --git a/aws-amis.pkr.hcl b/packer/aws-amis.pkr.hcl similarity index 100% rename from aws-amis.pkr.hcl rename to packer/aws-amis.pkr.hcl diff --git a/aws-export.sh b/packer/aws-export.sh similarity index 100% rename from aws-export.sh rename to packer/aws-export.sh diff --git a/scripts/initial.sh b/packer/scripts/initial.sh similarity index 100% rename from scripts/initial.sh rename to packer/scripts/initial.sh