Skip to content

Commit

Permalink
Add nautobot-ssot and add default account docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jtdub committed May 29, 2023
1 parent cd4dcf8 commit 5861aa9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,18 @@ The container can be built locally, if preferred.
docker run -itd --name nautobot -p 8000:8000 nautobot-lab
```

## The Default Account

The nautobot-lab container comes with a user pre-defined. The username is `demo` and its corresponding password is `nautobot`. If you choose to build your own container, you can define your own attributes for the default account by setting the following environment variables before executing the `docker build` command.

* NAUTOBOT_USERNAME
* NAUTOBOT_EMAIL
* NAUTOBOT_PASSWORD
* NAUTOBOT_TOKEN

## Creating a Super User

Once the container has started and all the services have stabilized, you will need to create a Super User account to start exploring Nautobot. The `nautobot-server createsuperuser` command will prompt you for a username, email address, and password. The email address is unused in this particular workflow and can be left blank.
Once the container has started and all the services have stabilized, you can create a Super User account to start exploring Nautobot. The `nautobot-server createsuperuser` command will prompt you for a username, email address, and password. The email address is unused in this particular workflow and can be left blank.

```shell
% docker exec -it nautobot nautobot-server createsuperuser
Expand All @@ -79,6 +88,7 @@ The Nautobot Lab container comes with the following applications pre-installed:
* [Capacity Metrics](https://github.com/nautobot/nautobot-plugin-capacity-metrics)
* [Golden Config](https://docs.nautobot.com/projects/golden-config/en/latest/user/app_overview/)
* [Nornir](https://docs.nautobot.com/projects/plugin-nornir/en/latest/user/app_overview/)
* [Nautobot SSoT](https://docs.nautobot.com/projects/ssot/en/latest/user/app_overview/)

These applications can give you a sense of what is possible with Nautobot as a network automation platform and can assist you with populating the lab environment with data that is unique to you. For the applications that require access to network devices, you can set the `NAPALM_USERNAME` AND `NAPALM_PASSWORD` environment variables when starting the container.

Expand Down
1 change: 1 addition & 0 deletions pb_nautobot_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
- "nautobot-capacity-metrics"
- "nautobot-golden-config"
- "nautobot-plugin-nornir"
- "nautobot-ssot"
- "supervisor"
loop_control:
loop_var: "nautobot_item"
Expand Down
4 changes: 2 additions & 2 deletions templates/default_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
print("Create User() model instance.")
User = get_user_model()

print(f"Create {os.getenv("NAUTOBOT_USERNAME")} account.")
print(f"Create {os.getenv('NAUTOBOT_USERNAME')} account.")
account = User(
username=os.getenv("NAUTOBOT_USERNAME"),
email=os.getenv("NAUTOBOT_EMAIL"),
Expand All @@ -26,7 +26,7 @@
)
account.save()

print(f"Create {os.getenv("NAUTOBOT_USERNAME")} API token.")
print(f"Create {os.getenv('NAUTOBOT_USERNAME')} API token.")
token = Token(
key=os.getenv("NAUTOBOT_TOKEN"),
write_enabled=True,
Expand Down
4 changes: 3 additions & 1 deletion templates/nautobot_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@
"nautobot_data_validation_engine",
"nautobot_capacity_metrics",
"nautobot_golden_config",
"nautobot_plugin_nornir"
"nautobot_plugin_nornir",
"nautobot_ssot"
]

# Plugins configuration settings. These settings are used by various plugins that the user may have installed.
Expand All @@ -241,6 +242,7 @@
# }
# }
PLUGINS_CONFIG = {
"nautobot_ssot": {},
"nautobot_device_onboarding": {},
"nautobot_circuit_maintenance": {
"raw_notification_initial_days_since": 100,
Expand Down
13 changes: 1 addition & 12 deletions templates/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# import subprocess
import os
import pytest
import pynautobot
Expand All @@ -7,17 +6,7 @@
@pytest.fixture
def nautobot():
token = os.getenv("NAUTOBOT_TOKEN")
# create_token = [
# "u=User.objects.get_or_create(username='demo', password='nautobot', is_staff=True, is_superuser=True)",
# f"Token.objects.get_or_create(key='{token}', user_id=u[0].pk, write_enabled=True)",
# ]
# nautobot_shell = [
# "nautobot-server",
# "nbshell",
# "--command",
# "; ".join(create_token)
#]
# subprocess.run(nautobot_shell, check=True)

return pynautobot.api(
url="http://localhost:8000",
token=f"{token}",
Expand Down

0 comments on commit 5861aa9

Please sign in to comment.