Generating configurations using Nautobot
In this final recipe of the chapter, you will use the dynamic inventory from the previous section and enrich it with more data from Nautobot to render configuration snippets for all data center network devices:
- Create a new Ansible playbook,
pb_build_config.yml, with one task to define two variables:graph_variablesandquery_string. The first contains the name of the network device, and the second is a GraphQL query string that will retrieve the interface’s name, description, IP address, and status to render the configuration:root@cookbook-lab:~/cookbook-lab/chapters/ch12/dynamic_inventory# vi pb_build_config.yml --- - name: Create Interface Configuration Snippets hosts: all gather_facts: no connection: local vars: nautobot_url: http://127.0.0.1:8080 nautobot_token: 47a72c0b6b7a9c70c07501625a77fd398de59d1c...