Skip to content

Repository files navigation

Opengear NG Ansible Collection

The Opengear NG Collection includes a variety of Ansible content to help automate the management of Opengear network appliances.

Main CI Status

Supported Products

The Opengear NG collection supports the following Opengear product families:

  • OM12xx
  • OM13xx
  • OM22xx
  • CM80xx
  • CM81xx

Supported Firmware

The Opengear NG collection is confirmed to work with device firmware versions in the following table at time of release. Modules are not guaranteed to work with other versions due to API differences.

opengear.ng Version Device Firmware
0.1.0 25.11.9

Modules

Name Description
opengear.ng.auth Manage remote authentication, authorization, and accounting (AAA) configuration.
opengear.ng.config_diff Compare current device configuration to file.
opengear.ng.config_export Export current device configuration to file.
opengear.ng.config_import Import device configuration from file merging with current device configuration.
opengear.ng.config_restore Restore device configuration from file.
opengear.ng.conns Manage network connection configuration.
opengear.ng.facts Gather device information and network resource configuration facts.
opengear.ng.failover Manage failover configuration and retrieve failover status.
opengear.ng.groups Manage user group configuration.
opengear.ng.local_password_policy Manage the local password policy (expiry and complexity) for local users.
opengear.ng.pdu_config Manage configuration for PDUs connected to the device.
opengear.ng.pdu_control Send power actions to PDU outlets.
opengear.ng.pdu_status Gather live status for PDUs and their outlets.
opengear.ng.physifs Manage physical network interface configuration.
opengear.ng.ports_config Manage serial port configuration.
opengear.ng.ports_auto_discover Manage port auto-discovery on Opengear devices.
opengear.ng.ports_control Send control commands to serial ports.
opengear.ng.ports_sessions Gather and manage active pmshell sessions on serial ports.
opengear.ng.ports_status Gather live status for serial ports.
opengear.ng.services_config Manage singleton service configuration (NTP, LLDP, SNMP, SSH, routing, HTTPS certificate, etc).
opengear.ng.services_snmp_alert_managers Manage SNMP Alert Manager configuration.
opengear.ng.services_syslog Manage remote syslog server configuration.
opengear.ng.static_routes Manage static route configuration.
opengear.ng.system_config Manage general system configuration including admin info, banner, FIPS, and session timeouts.
opengear.ng.system_authorized_keys Manage SSH authorized keys for system access.
opengear.ng.system_factory_reset Erase device configuration, restoring the appliance to factory defaults.
opengear.ng.system_firmware_upgrade Manage firmware upgrades on Opengear devices.
opengear.ng.system_reboot Reboot an Opengear appliance.
opengear.ng.system_time Manage system time and timezone configuration.
opengear.ng.users Manage user configuration.
opengear.ng.users_authorized_keys Manage configuration of user authorized keys on Opengear devices.

Connections

Modules in this collection use the Ansible httpapi connection plugin by default to communicate with Opengear devices via the REST API.

The following modules are exceptions that require ansible_connection: ssh to be used and do not support the default httpapi connection.

See each module's documentation and examples for configuration and usage alongside httpapi modules.

Installing The Collection

You can install the latest release of this collection with the Ansible Galaxy CLI:

ansible-galaxy collection install opengear.ng

You can also include it in a requirements.yml file and install it with ansible-galaxy collection install -r requirements.yml, using the format:

---
collections:
  - name: opengear.ng

Developers: See CONTRIBUTING.md for local development installation instructions.

Using NG Collection

This collection includes network resource modules.

Authentication

This collection uses the Ansible httpapi connection plugin for authentication.

Authentication is handled by the Opengear REST API using standard Ansible connection variables.

Inventory Example

To connect to an Opengear device, define hosts in inventory.yml.

all:
  children:
    opengear:
      hosts:
        my-device:
          ansible_host: 192.168.1.1
      vars:
        ansible_connection: httpapi
        ansible_network_os: opengear.ng.http_api  # required - httpapi plugin to use for this collection
        ansible_httpapi_use_ssl: true
        ansible_httpapi_validate_certs: false
        ansible_user: "{{ opengear_user }}"
        ansible_password: "{{ opengear_password }}"

Playbook Example

You can call modules by their Fully Qualified Collection Namespace (FQCN) such as opengear.ng.users.

The following example task replaces configuration for an entity in the existing configuration of an Opengear network device, using the FQCN:

---
- name: Example playbook for managing groups
  hosts: opengear
  gather_facts: false

  tasks:
    - name: Replace device configuration of group1.
      opengear.ng.groups:
        config:
          - name: group1
            enabled: true
            description: This is an example group
            members: []
            access_rights: ['web_ui', 'pmshell']
            ports: ['port-1','port-2']
        state: replaced

Gathering Facts

Use opengear.ng.facts with gather_network_resources to retrieve device facts. The following subsets are available:

Subset Description
auth Remote authentication, authorization, and accounting (AAA) configuration.
conns Network connection configuration.
failover Failover configuration and status.
groups User group configuration.
local_password_policy Local password policy (expiry and complexity) configuration.
pdu_config PDU configuration.
pdu_status Live PDU and outlet status data.
physifs Physical network interface configuration.
ports_auto_discover Port auto-discovery schedule and status.
ports_config Serial port configuration.
ports_sessions Active pmshell sessions on serial ports.
ports_status Live port status.
services_config Singleton service configuration (NTP, LLDP, SNMP, SSH, routing, etc).
services_snmp_alert_managers SNMP Alert Manager configuration.
services_syslog Remote syslog server configuration.
static_routes Static route configuration.
system_authorized_keys System-level SSH authorized keys.
system_config General system configuration (admin info, banner, FIPS, session timeouts)
system_diskspace Disk space facts for all mounts.
system_firmware_upgrade Current firmware version and upgrade status.
system_info Read-only system identity facts (model, serial number, firmware version).
system_time System time and timezone configuration.
users User configuration.
users_authorized_keys Per-user SSH authorized keys.
- name: Gather system information and disk space facts
  opengear.ng.facts:
    gather_network_resources:
      - system_info
      - system_diskspace

Further Examples

For more examples of opengear.ng module usage, see Examples.

For general Ansible collection usage, see Using Ansible Collections.

Contributing

Contributions are welcome! Please read our Contributing Guide before submitting a pull request.

Code of Conduct

This collection follows the Ansible project's Code of Conduct. Please read and familiarize yourself with this document.

More information

Licensing

GNU General Public License v3.0 or later.

See LICENSE to see the full text.

About

Ansible Network Collection for Opengear devices — In active development, not yet released

Topics

Resources

Contributing

Stars

14 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages