Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

21 nautobot should start as a statefulset with an init container #22

Merged
7 changes: 0 additions & 7 deletions config/celery.bashrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
#!/bin/bash

HOME=/opt/celery
NAUTOBOT_ROOT=/opt/celery
PATH="/opt/celery/bin:$PATH"

export HOME
export NAUTOBOT_ROOT
export PATH

/usr/local/bin/python -m venv /opt/celery/
/opt/celery/bin/pip install -r /opt/celery/.celery/reqs
/opt/celery/bin/pip install -U pip
/opt/celery/bin/nautobot-server celery worker --loglevel DEBUG
19 changes: 17 additions & 2 deletions config/celery.init.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
#!/bin/bash

chown -v celery:celery /opt/celery
set -x

rm -rfv /opt/celery

mkdir -pv /opt/celery

chown -Rv celery:celery /opt/celery

apk add --no-cache sudo

sudo -u celery python -m venv /opt/celery

sudo -u celery /opt/celery/bin/pip install -U pip

sudo -u celery /opt/celery/bin/pip install -r /opt/celery/.celery/reqs
sudo -u celery /opt/celery/bin/pip install -r /opt/.celery/reqs

cat /opt/.celery/.bashrc > /opt/celery/.bashrc

chown -v celery:celery /opt/celery/.bashrc

NAUTOBOT_ROOT=/opt/celery
export NAUTOBOT_ROOT

sudo -E -u celery /opt/celery/bin/nautobot-server init
19 changes: 19 additions & 0 deletions config/nautobot.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

NAUTOBOT_ALLOWED_HOSTS="*"
NAUTOBOT_DB_ENGINE='django.db.backends.postgresql'
NAUTOBOT_DB_HOST='postgresql.postgresql.svc.cluster.local'
NAUTOBOT_DB_NAME='nautobot'
NAUTOBOT_DB_PORT='5432'
NAUTOBOT_DB_USER='nautobot'
NAUTOBOT_ROOT=/opt/nautobot
PATH="/opt/nautobot/bin:$PATH"

export NAUTOBOT_ALLOWED_HOSTS
export NAUTOBOT_DB_ENGINE
export NAUTOBOT_DB_HOST
export NAUTOBOT_DB_NAME
export NAUTOBOT_DB_PORT
export NAUTOBOT_DB_USER
export NAUTOBOT_ROOT
export PATH
32 changes: 32 additions & 0 deletions config/nautobot.init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

set -x

rm -rfv /opt/nautobot

mkdir -pv /opt/nautobot

chown -v nautobot:nautobot /opt/nautobot

apk add --no-cache sudo

sudo -u nautobot python -m venv /opt/nautobot

sudo -u nautobot /opt/nautobot/bin/pip install -U pip

sudo -u nautobot /opt/nautobot/bin/pip install -r /opt/.nautobot/reqs

cat /opt/.nautobot/.bashrc > /opt/nautobot/.bashrc

chown -v nautobot:nautobot /opt/nautobot/.bashrc

NAUTOBOT_ROOT=/opt/nautobot
export NAUTOBOT_ROOT

sudo -E -u nautobot /opt/nautobot/bin/nautobot-server init

sudo -E -u nautobot /opt/nautobot/bin/nautobot-server migrate

sudo -E -u nautobot /opt/nautobot/bin/nautobot-server createsuperuser --email "${NAUTOBOT_SUPERUSER_EMAIL}" --username "${NAUTOBOT_SUPERUSER_USERNAME}" --noinput

sudo -E -u nautobot /opt/nautobot/bin/nautobot-server collectstatic
Loading
Loading