-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
459 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,23 +2,26 @@ | |
# CREDS File: Store private information. Copied to creds.env and always ignored | ||
################################################################################ | ||
# Nautobot Configuration Secret Items | ||
SECRET_KEY=r8OwDznj!!dci#P9ghmRfdu1Ysxm0AiPeDCQhKE+N_rClfWNj | ||
NAUTOBOT_CREATE_SUPERUSER=true | ||
NAUTOBOT_SUPERUSER_API_TOKEN=0123456789abcdef0123456789abcdef01234567 | ||
NAUTOBOT_DB_PASSWORD=changeme | ||
NAUTOBOT_NAPALM_USERNAME='' | ||
NAUTOBOT_NAPALM_PASSWORD='' | ||
NAUTOBOT_REDIS_PASSWORD=changeme | ||
NAUTOBOT_SECRET_KEY='changeme' | ||
NAUTOBOT_SUPERUSER_NAME=admin | ||
NAUTOBOT_SUPERUSER_EMAIL=[email protected] | ||
NAUTOBOT_SUPERUSER_PASSWORD=admin | ||
NAUTOBOT_SUPERUSER_API_TOKEN=0123456789abcdef0123456789abcdef01234567 | ||
|
||
# Nauotbot DB Password to connect to the backend | ||
# - NOTE: Should be the same as the selected backend (MySQL or Postgres password) | ||
NAUTOBOT_DB_PASSWORD=notverysecurepwd | ||
# Postgres | ||
POSTGRES_PASSWORD=${NAUTOBOT_DB_PASSWORD} | ||
PGPASSWORD=${NAUTOBOT_DB_PASSWORD} | ||
|
||
# MySQL Credentials | ||
MYSQL_ROOT_PASSWORD=notverysecurepwd | ||
MYSQL_PASSWORD=notverysecurepwd | ||
|
||
# Postgres Credentials | ||
POSTGRES_PASSWORD=notverysecurepwd | ||
MYSQL_ROOT_PASSWORD=${NAUTOBOT_DB_PASSWORD} | ||
MYSQL_PASSWORD=${NAUTOBOT_DB_PASSWORD} | ||
|
||
# Redis Credentials | ||
REDIS_PASSWORD=notverysecurepwd | ||
NAUTOBOT_REDIS_PASSWORD=${REDIS_PASSWORD} | ||
NAUTOBOT_LOG_LEVEL=DEBUG | ||
# Use these to override values in development.env | ||
# NAUTOBOT_DB_HOST=localhost | ||
# NAUTOBOT_REDIS_HOST=localhost | ||
# NAUTOBOT_CONFIG=development/nautobot_config.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,53 +2,39 @@ | |
# DEV File: Store environment information. NOTE: Secrets NOT stored here! | ||
################################################################################ | ||
# Nautobot Configuration Environment Variables | ||
ALLOWED_HOSTS=* | ||
BANNER_TOP="Local" | ||
CHANGELOG_RETENTION=0 | ||
MAX_PAGE_SIZE=0 | ||
METRICS_ENABLED=True | ||
NAPALM_TIMEOUT=5 | ||
NAUTOBOT_ROOT=/opt/nautobot | ||
NAUTOBOT_ALLOWED_HOSTS=* | ||
NAUTOBOT_BANNER_TOP="Local" | ||
NAUTOBOT_CHANGELOG_RETENTION=0 | ||
|
||
NAUTOBOT_DEBUG=True | ||
NAUTOBOT_DJANGO_EXTENSIONS_ENABLED=True | ||
NAUTOBOT_DJANGO_TOOLBAR_ENABLED=True | ||
NAUTOBOT_LOG_LEVEL=DEBUG | ||
NAUTOBOT_METRICS_ENABLED=True | ||
NAUTOBOT_NAPALM_TIMEOUT=5 | ||
NAUTOBOT_MAX_PAGE_SIZE=0 | ||
|
||
# Redis Configuration Environment Variables | ||
REDIS_HOST=redis | ||
NAUTOBOT_REDIS_HOST=${REDIS_HOST} | ||
NAUTOBOT_REDIS_HOST=redis | ||
NAUTOBOT_REDIS_PORT=6379 | ||
# Uncomment NAUTOBOT_REDIS_SSL if using SSL | ||
# NAUTOBOT_REDIS_SSL=True | ||
|
||
SUPERUSER_EMAIL=[email protected] | ||
SUPERUSER_NAME=admin | ||
|
||
# Nautobot DB Connection Environment Variables | ||
NAUTOBOT_DB_HOST=db | ||
NAUTOBOT_DB_NAME=nautobot | ||
NAUTOBOT_DB_USER=nautobot | ||
NAUTOBOT_DB_HOST=db | ||
NAUTOBOT_DB_TIMEOUT=300 | ||
|
||
# Uncomment the environment variables that related to your DB backend. | ||
NAUTOBOT_DB_ENGINE=django.db.backends.postgresql | ||
NAUTOBOT_DB_PORT=5432 | ||
# NAUTOBOT_DB_ENGINE=django.db.backends.mysql | ||
# NAUTOBOT_DB_PORT=3306 | ||
# Use them to overwrite the defaults in nautobot_config.py | ||
# NAUTOBOT_DB_ENGINE=django.db.backends.postgresql | ||
# NAUTOBOT_DB_PORT=5432 | ||
|
||
# Needed for Postgres should match the values for Nautobot above | ||
POSTGRES_DB=nautobot | ||
POSTGRES_USER=nautobot | ||
PGUSER=nautobot | ||
POSTGRES_HOST=postgres | ||
POSTGRES_USER=${NAUTOBOT_DB_USER} | ||
POSTGRES_DB=${NAUTOBOT_DB_NAME} | ||
|
||
# Needed for MYSQL should match the values for Nautobot above | ||
MYSQL_DATABASE=nautobot | ||
MYSQL_USER=nautobot | ||
MYSQL_USER=${NAUTOBOT_DB_USER} | ||
MYSQL_DATABASE=${NAUTOBOT_DB_NAME} | ||
MYSQL_ROOT_HOST=% | ||
|
||
NAUTOBOT_DLM_ENABLED_METRICS = "nautobot_lcm_software_compliance_per_device_type,nautobot_lcm_software_compliance_per_inventory_item,nautobot_lcm_hw_end_of_support_per_part_number,nautobot_metrics_lcm_hw_end_of_support_site" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Custom ENVs for Mysql | ||
# Due to docker image limitations for Mysql, we need "root" user to create more than one database table | ||
NAUTOBOT_DB_USER=root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,50 @@ | ||
--- | ||
x-nautobot-build: | ||
&nautobot-build | ||
x-nautobot-build: &nautobot-build | ||
build: | ||
args: | ||
NAUTOBOT_VER: "${NAUTOBOT_VER}" | ||
PYTHON_VER: "${PYTHON_VER}" | ||
context: "../" | ||
dockerfile: "development/Dockerfile" | ||
x-nautobot-base: | ||
&nautobot-base | ||
x-nautobot-base: &nautobot-base | ||
image: "nautobot-device-lifecycle-mgmt/nautobot:${NAUTOBOT_VER}-py${PYTHON_VER}" | ||
env_file: | ||
- "dev.env" | ||
- "development.env" | ||
- "creds.env" | ||
tty: true | ||
|
||
version: "3.4" | ||
services: | ||
nautobot: | ||
ports: | ||
- "0.0.0.0:8080:8080" | ||
depends_on: | ||
redis: | ||
condition: "service_started" | ||
db: | ||
condition: "service_healthy" | ||
<<: [ *nautobot-build, *nautobot-base ] | ||
celery_worker: | ||
<<: | ||
- *nautobot-base | ||
- *nautobot-build | ||
worker: | ||
entrypoint: | ||
- "sh" | ||
- "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env | ||
- "watchmedo auto-restart --directory './' --pattern '*.py' --recursive -- nautobot-server celery worker -l $$NAUTOBOT_LOG_LEVEL --events" | ||
- "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env | ||
- "nautobot-server celery worker -l $$NAUTOBOT_LOG_LEVEL --events" ## $$ because of docker-compose | ||
depends_on: | ||
- "nautobot" | ||
- "redis" | ||
nautobot: | ||
condition: "service_healthy" | ||
healthcheck: | ||
interval: "30s" | ||
timeout: "10s" | ||
start_period: "30s" | ||
retries: 3 | ||
test: | ||
[ | ||
"CMD", | ||
"bash", | ||
"-c", | ||
"nautobot-server celery inspect ping --destination celery@$$HOSTNAME" | ||
] | ||
test: ["CMD", "bash", "-c", "nautobot-server celery inspect ping --destination celery@$$HOSTNAME"] ## $$ because of docker-compose | ||
<<: *nautobot-base | ||
celery_beat: | ||
beat: | ||
entrypoint: | ||
- "sh" | ||
- "-c" | ||
- "nautobot-server celery beat -l $$NAUTOBOT_LOG_LEVEL" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env | ||
healthcheck: | ||
disable: true | ||
- "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env | ||
- "nautobot-server celery beat -l $$NAUTOBOT_LOG_LEVEL" ## $$ because of docker-compose | ||
depends_on: | ||
- "nautobot" | ||
- "redis" | ||
<<: *nautobot-base | ||
healthcheck: | ||
disable: true | ||
<<: *nautobot-base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,37 @@ | ||
--- | ||
version: "3.4" | ||
|
||
services: | ||
nautobot: | ||
environment: | ||
- "NAUTOBOT_DB_ENGINE=django.db.backends.mysql" | ||
env_file: | ||
- "development.env" | ||
- "creds.env" | ||
- "development_mysql.env" | ||
worker: | ||
environment: | ||
- "NAUTOBOT_DB_ENGINE=django.db.backends.mysql" | ||
env_file: | ||
- "development.env" | ||
- "creds.env" | ||
- "development_mysql.env" | ||
db: | ||
image: "mysql:8" | ||
command: | ||
- "--default-authentication-plugin=mysql_native_password" | ||
- "--max_connections=1000" | ||
env_file: | ||
- "dev.env" | ||
- "development.env" | ||
- "creds.env" | ||
- "development_mysql.env" | ||
volumes: | ||
- "lcm_mysql_data:/var/lib/mysql" | ||
ports: | ||
- "3306:3306" | ||
- "mysql_data:/var/lib/mysql" | ||
healthcheck: | ||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"] | ||
test: | ||
- "CMD" | ||
- "mysqladmin" | ||
- "ping" | ||
- "-h" | ||
- "localhost" | ||
timeout: "20s" | ||
retries: 10 | ||
volumes: | ||
lcm_mysql_data: # yamllint disable-line rule:empty-values | ||
mysql_data: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
--- | ||
version: "3.4" | ||
services: | ||
redis: | ||
image: "redis:6-alpine" | ||
command: | ||
- "sh" | ||
- "-c" # this is to evaluate the $REDIS_PASSWORD from the env | ||
- "redis-server --appendonly yes --requirepass $$REDIS_PASSWORD" | ||
- "-c" # this is to evaluate the $NAUTOBOT_REDIS_PASSWORD from the env | ||
- "redis-server --appendonly yes --requirepass $$NAUTOBOT_REDIS_PASSWORD" | ||
env_file: | ||
- "dev.env" | ||
- "development.env" | ||
- "creds.env" | ||
ports: | ||
- "6379:6379" |
Oops, something went wrong.