Skip to content

datacom-teracom/ansible_collections.dmos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Datacom DmOS Collection - datacom.dmos

The Ansible Datacom DmOS collection includes a variety of Ansible content to help automate the management of Datacom DmOS equipment.

Available features

  • dmos_commands
  • dmos_l2_interface
  • dmos_l3 interface
  • dmos_linkagg
  • dmos_lldp
  • dmos_log
  • dmos_sntp
  • dmos_twamp
  • dmos_vlan

Usage guideline

Install collection

Install requirements

sudo pip3 install ansible
sudo pip3 install paramiko

Install collection from ansible-galaxy

ansible-galaxy collection install datacom.dmos

Install collection from source code

git clone https://github.com/datacom-teracom/ansible_collections.dmos.git
cd ansible_collections.dmos
ansible-galaxy collection build
ansible-galaxy collection install datacom-dmos-*.tar.gz

Verify installation and show module documentation

ansible-doc datacom.dmos.dmos_vlan

example

Basic example need two files:

  • hosts
  • vlan.yml

Invetory example

Change xxx.xxx.xxx.xxx to Datacom DmOS switch ip.

hosts

[all:vars]
ansible_connection=ansible.netcommon.network_cli

[dmos]
DM4170 ansible_host=xxx.xxx.xxx.xxx

[dmos:vars]
ansible_user=admin
ansible_ssh_pass=admin
ansible_network_os=datacom.dmos.dmos

playbook example

vlan.yml

---

- hosts: dmos
  gather_facts: no
  collections:
    - datacom.dmos
  tasks:
      - name: Configure vlan_ids
        dmos_vlan:
          config:
            - vlan_id: 2019
              interface:
                - name: gigabit-ethernet-1/1/1
                  tagged: true
              name: null
            - vlan_id: 2020
              name: dmos_vlan
              interface:
                - name: gigabit-ethernet-1/1/2
                  tagged: false
            - vlan_id: 2021
      - name: Remove vlan_ids
        dmos_vlan:
          config: []
          state: deleted

Running example

ansible-playbook -i hosts vlan.yml