Skip to content

[Feature]: Config template render module #1447

@Omripresent

Description

@Omripresent

NetBox version

v4.1.11

Feature type

New Module

Proposed functionality

Allow the use of the builtin configuration render feature directly via Ansible.

This new module provides better integration with Netbox's config render capabilities allowing to streamline automation processes via Ansible.

Proposed module signature:

netbox.netbox.netbox_config_render:
  data:
    device: "<device name>"                        # mutually exclusive to virtual_machine
    virtual_machine: "<VM name>"                   # mutually exclusive to device
    config_template: "<name of template>"          # optional
    dest: "<destination file to save the config>"  # optional

Use case

We have multiple workflows of updating network devices via Netbox config render and Ansible to push the config out.

This will be the updated flow with this module.

- name: Render and save device config
  netbox.netbox.netbox_config_render:
    data:
      device: "{{ inventory_hostname }}"
      dest: "{{ inventory_hostname }}.cfg"
- name: load configure file into device
  junipernetworks.junos.junos_config:
    src: {{ inventory_hostname }}.cfg
    comment: update config

External dependencies

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions