maxlareo.cumuluslinux

CumulusLinux

Ansible Galaxy

This is an Ansible role that helps you manage Cumulus Linux using the NCLU module.

Requirements

Only Cumulus Linux version 3.2 and above is supported; older versions do not work with NCLU.

Role Variables

Variable Description Type Default
cl_license CumulusLinux license String ''
cl_hostname Name of the device String cumulus
cl_time_zone Timezone String Etc/UTC
cl_time_ntp_servers List of NTP servers, with an option to add iburst Array []
cl_time_ntp_source NTP source interface String eth0
cl_locales Enable locales from locale-gen Array []
cl_dns_nameserver DNS nameserver with ipv4 and ipv6 subarrays Hash {}
cl_commands Ansible NCLU atomic commands, allowing add/del actions, processed first Hash {}
cl_snmp SNMP server settings using net add snmp-server Hash {}
cl_syslog Syslog settings with ipv4 and ipv6 subarrays Hash {}
cl_interface Interface settings using net add interface Hash {}
cl_bond Bond settings using net add bond Hash {}
cl_vlan VLAN settings using net add vlan Hash {}

Dependencies

None

Custom Lookup

Recursive

I created a lookup plugin that helps manage Cumulus Linux interface configurations using Ansible. This plugin can read nested data and convert it into a list of commands.

For example, given the following structure:

cl_interface:
  swp1:
    ip:
      address: 192.168.1.1/24
    link:
      speed: 100
  swp2:
    bridge:
      trunk:
        vlans:
          - 1-5
          - 10,12

It produces this output:

swp1 ip address 192.168.1.1/24
swp2 bridge trunk vlans 1-5
swp2 bridge trunk vlans 10,12

This makes complex configurations easier to read.

Example Playbook

    - hosts: leaf01
      roles:
        - cumuluslinux
      vars:
        cl_license: [email protected]|thequickbrownfoxjumpsoverthelazydog312
        cl_hostname: leaf01
        cl_time_zone: Europe/Paris
        cl_time_ntp_servers:
          - 0.cumulusnetworks.pool.ntp.org iburst
          - 1.cumulusnetworks.pool.ntp.org 
          - 2.cumulusnetworks.pool.ntp.org 
          - 3.cumulusnetworks.pool.ntp.org 
        cl_time_ntp_source: eth1
        cl_locales:
          - en_US.UTF-8 UTF-8
          - fr_FR.UTF-8 UTF-8
        cl_dns_nameserver:
          ipv4:
            - 9.9.9.9
            - 1.1.1.1
          ipv6:
            - 2620:fe::fe
        cl_interface:
          swp1:
            ip:
              address: 192.168.1.1/24
            link:
              speed: 100
          swp2:
            bridge:
              trunk:
                vlans:
                  - 1-5
                  - 10,12
        cl_snmp:
          listening-address:
            ip:
              - 192.168.1.10
              - 192.168.1.20
          readonly-community:
            my_rocommunity:
              access: any
        cl_commands:
          add:
            vrf: mgmt
          del:
            snmp-server: all
        cl_syslog:
          ipv4:
            - ip: 192.168.1.10
              port: 5000
              proto: tcp
            - ip: 192.168.1.20
              port: 6000
          ipv6:
            - ip: 2001:db8::1
              port: 5000
        cl_bond:
          uplink:
            bond:
              slaves:
                - swp1
                - swp2
        cl_vlan:
          100:
            ip:
              address:
                - 10.10.10.0/24

License

MIT License

Author Information

Maxime Lareo

Feedback, bug reports, and requests are always welcome!

Informazioni sul progetto

Manage CumulusLinux via NCLU

Installa
ansible-galaxy install maxlareo.cumuluslinux
Licenza
mit
Download
119
Proprietario