Config contexts
Config contexts allow you to add arbitrary YAML/JSON data to devices, in a similar fashion to how Ansible does it (through the use of host and group variables). The data can come from multiple sources and is flattened and presented as a single data structure for a given device. In Nautobot, we have config contexts (based on groups and hosts).
Imagine being able to add any YAML data you already have in a Git repository directly into Nautobot. Well, that’s possible with config contexts. Here is an example of what that could look like in Nautobot (being viewed as YAML):
Figure 6.36 – Understanding the Config Context tab in a detailed device view
On the left-hand side, you can view a completed rendered config context (similar to a rendered device’s facts and variables in Ansible). On the right-hand side, you can view your Local Config Context (scoped for a single device, such as a host variable) and other source contexts...