Package: nautobot-ssot-ipfabric
Nautobot SSoT IPFabricAnSSoTplugin providing a simple way to synchronize data betweenIPFabricandNautobot. Ensure data stays consistent between the two platforms by leveragingDiffSynccapabilities and allowing users to take full advantage of both platforms with up-to-date, synchronized data.Version MatrixHere is a compatibility matrix and the minimum versions required to run this plugin:IP FabricPythonNautobotssotssot-ipfabricpython-ipfabricpython-ipfabric-diagrams4.43.7.11.1.01.0.10.10.00.11.01.2.75.0.13.7.11.2.01.0.11.0.05.0.115.0.26.03.7.11.4.01.2.02.0.06.0.96.0.2Build StatusBranchStatusmaindevelopDocumentationDocumentation is hosted with Github Pages atNautobot SSoT IP Fabric DocumentationInstallationTo install the plugin from Pypipipinstallnautobot-ssot-ipfabricTo install the plugin manually from repository codegitclonegit@github.com:nautobot/nautobot-plugin-ssot-ipfabric.gitcdnautobot-plugin-ssot-ipfabricpipinstall.For additional detailed instructions on how to install Nautobot Plugins, checkout theofficial documentationEnvironment VariablesThis plugin relies on user provided environment variables to interact with IP Fabric.ipfabric_api_token- API Token for IP Fabricipfabric_host- IP Fabric URLnautobot_host- Nautobot URL (This is used to generate url links for chatops)ipfabric_ssl_verify- IP Fabric API SSL verificationipfabric_timeout- IP Fabric API timeoutExamplePLUGINS_CONFIGto be updated innautobot_config.pyafter successful installation. The chatops configuration is optional, but if you'd like to have the
ability to call the sync job through chatops, you will be required to configure it.PLUGINS=["nautobot_ssot","nautobot_ssot_ipfabric"]PLUGINS_CONFIG={"nautobot_chatops":{"enable_slack":True,"slack_api_token":os.environ.get("SLACK_API_TOKEN"),"slack_signing_secret":os.environ.get("SLACK_SIGNING_SECRET"),"session_cache_timeout":3600,},"nautobot_ssot_ipfabric":{"ipfabric_api_token":os.environ.get("IPFABRIC_API_TOKEN"),"ipfabric_host":os.environ.get("IPFABRIC_HOST"),"nautobot_host":os.environ.get("NAUTOBOT_HOST"),"ipfabric_ssl_verify":os.environ.get("IPFABRIC_SSL_VERIFY"),"ipfabric_timeout":os.environ.get("IPFABRIC_TIMEOUT"),},"nautobot_ssot":{"hide_example_jobs":True},"nautobot_chatops_ipfabric":{"IPFABRIC_API_TOKEN":os.environ.get("IPFABRIC_API_TOKEN"),"IPFABRIC_HOST":os.environ.get("IPFABRIC_HOST"),},}ChatOpsAs part of the SSoT synchronization capabilities with IP Fabric, this plugin extends theNautobot Plugin Chatops IPFabricby providing users with the ability to begin the sync job from a chatops command (Slack).ContributingPull requests are welcomed and automatically built and tested against multiple versions of Python and multiple version of Nautobot through Github Actions.The project is packaged with a light development environment based ondocker-composeto help with the local development of the project and to run the tests within Github Actions.The project is following Network to Code software development guideline and is leveraging:Black, Pylint, Bandit and pydocstyle for Python linting and formatting.Django unit test to ensure the plugin is working properly.Development EnvironmentThe development environment can be used in 2 ways. First, with a local poetry environment if you wish to develop outside of Docker with the caveat of using external services provided by Docker for PostgresQL and Redis. Second, all services are spun up using Docker and a local mount so you can develop locally, but Nautobot is spun up within the Docker container.Below is a quick start guide if you're already familiar with the development environment provided, but if you're not familiar, please read theGetting Started Guide.InvokeThePyInvokelibrary is used to provide some helper commands based on the environment. There are a few configuration parameters which can be passed to PyInvoke to override the default configuration:nautobot_ver: the version of Nautobot to use as a base for any built docker containers (default: 1.1.4)project_name: the default docker compose project name (default: nautobot_ssot_ipfabric)python_ver: the version of Python to use as a base for any built docker containers (default: 3.7)local: a boolean flag indicating if invoke tasks should be run on the host or inside the docker containers (default: False, commands will be run in docker containers)compose_dir: the full path to a directory containing the project compose filescompose_files: a list of compose files applied in order (seeMultiple Compose filesfor more information)UsingPyInvokethese configuration options can be overridden usingseveral methods. Perhaps the simplest is simply setting an environment variableINVOKE_NAUTOBOT_SSOT_IPFABRIC_VARIABLE_NAMEwhereVARIABLE_NAMEis the variable you are trying to override. The only exception iscompose_files, because it is a list it must be overridden in a yaml file. There is an exampleinvoke.yml(invoke.example.yml) in this directory which can be used as a starting point.Local Poetry Development EnvironmentCopydevelopment/creds.example.envtodevelopment/creds.env(This file will be ignored by Git and Docker)Uncomment thePOSTGRES_HOST,REDIS_HOST, andNAUTOBOT_ROOTvariables indevelopment/creds.envCreate aninvoke.ymlfile with the following contents at the root of the repo (you can alsocp invoke.example.yml invoke.ymland edit as necessary):---nautobot_ssot_ipfabric:local:truecompose_files:-"docker-compose.requirements.yml"Run the following commands:poetryshell
poetryinstall--extrasnautobotexport$(catdevelopment/dev.env|xargs)export$(catdevelopment/creds.env|xargs)invokestart&&sleep5nautobot-servermigrateIf you want to develop on the latest develop branch of Nautobot, run the following command:poetry add --optional git+https://github.com/nautobot/nautobot@develop. After the@symbol must match either a branch or a tag.You can now run nautobot-server commands as you would from theNautobot documentationfor example to start the development server:nautobot-serverrunserver0.0.0.0:8080--insecureNautobot server can now be accessed athttp://localhost:8080.It is typically recommended to launch the Nautobotrunservercommand in a separate shell so you can keep developing and manage the webserver separately.Docker Development EnvironmentThis project is managed byPython Poetryand has a few requirements to setup your development environment:Install Poetry, see thePoetry Documentationfor your operating system.Install Docker, see theDocker documentationfor your operating system.Once you have Poetry and Docker installed you can run the following commands to install all other development dependencies in an isolated python virtual environment:poetryshell
poetryinstall
invokestartNautobot server can now be accessed athttp://localhost:8080.To either stop or destroy the development environment use the following options.invoke stop- Stop the containers, but keep all underlying systems intactinvoke destroy- Stop and remove all containers, volumes, etc. (This results in data loss due to the volume being deleted)CLI Helper CommandsThe project is coming with a CLI helper based oninvoketo help setup the development environment. The commands are listed below in 3 categoriesdev environment,utilityandtesting.Each command can be executed withinvoke <command>. Environment variablesINVOKE_NAUTOBOT_SSOT_IPFABRIC_PYTHON_VERandINVOKE_NAUTOBOT_SSOT_IPFABRIC_NAUTOBOT_VERmay be specified to override the default versions. Each command also has its own helpinvoke <command> --helpDocker dev environmentbuild            Build all docker images.
  debug            Start Nautobot and its dependencies in debug mode.
  destroy          Destroy all containers and volumes.
  restart          Restart Nautobot and its dependencies.
  start            Start Nautobot and its dependencies in detached mode.
  stop             Stop Nautobot and its dependencies.Utilitycli              Launch a bash shell inside the running Nautobot container.
  create-user      Create a new user in django (default: admin), will prompt for password.
  makemigrations   Run Make Migration in Django.
  nbshell          Launch a nbshell session.
  shell-plus       Launch a shell_plus session, which uses iPython and automatically imports all models.Testingbandit           Run bandit to validate basic static code security analysis.
  black            Run black to check that Python files adhere to its style standards.
  flake8           This will run flake8 for the specified name and Python version.
  pydocstyle       Run pydocstyle to validate docstring formatting adheres to NTC defined standards.
  pylint           Run pylint code analysis.
  tests            Run all tests for this plugin.
  unittest         Run Django unit tests for the plugin.Project DocumentationDocumentation is auto-generated with Sphinx, myst-paerser and sphinx-autoapi. The latest code in themainbranch is providing the documentation with Github Pages. To build documentation locally as you are developing, perform the following commands.sphinx-build-vvv-bhtml./docsdocs/publiccddocs/public
python-mhttp.serverNow you can access the documentation locally athttp://localhost:8000/or the IP of the server hosting the development environment.QuestionsFor any questions or comments, please check theFAQfirst and feel free to swing by theNetwork to Code slack channel(channel #networktocode).
Sign uphereScreenshotsMain SSoT IP Fabric DashboardSync Details