kayobe/ansible/roles/dell-switch
Pierre Riteau 4bd6dfecba Remove documentation and use of dell_switch_delegate_to
The dell_switch_delegate_to parameter was removed from the dell-switch
role in commit da75d6b734.

Change-Id: Ia70d48d417d68140ea9e3abd1409c6b0945e638c
2018-12-19 13:05:01 +01:00
..
defaults Use local_action instead of delegate_to in switch config tasks 2017-10-12 10:49:13 +00:00
tasks Fix ansible warnings for when clauses with curly braces 2017-10-20 12:14:35 +01:00
templates Dell switch: Add spaces before interface config to ensure correct match 2017-03-24 16:14:48 +00:00
README.md Remove documentation and use of dell_switch_delegate_to 2018-12-19 13:05:01 +01:00

Dell Switch

This role configures Dell switches using the dellos6 or dellos9 Ansible modules. It provides a fairly minimal abstraction of the configuration interface provided by the dellos modules, allowing for application of arbitrary switch configuration options.

Requirements

The switches should be configured to allow SSH access.

Role Variables

dell_switch_type is the type of Dell switch. One of dellos6, dellos9.

dell_switch_provider is authentication provider information passed as the provider argument to the dellos modules.

dell_switch_config is a list of configuration lines to apply to the switch, and defaults to an empty list.

dell_switch_interface_config contains interface configuration. It is a dict mapping switch interface names to configuration dicts. Each dict may contain the following items:

  • description - a description to apply to the interface.
  • config - a list of per-interface configuration.

Dependencies

None

Example Playbook

The following playbook configures hosts in the dellos9-switches group. It assumes host variables for each switch holding the host, username and passwords. It applies global configuration for LLDP, and enables two 10G ethernet interfaces as switchports.

---
- name: Ensure DellOS switches are configured
  hosts: dellos9-switches
  gather_facts: no
  roles:
    - role: dell-switch
      dell_switch_type: "dellos9"
      dell_switch_provider:
        host: "{{ switch_host }}"
        username: "{{ switch_user }}"
        password: "{{ switch_password }}"
        authorize: yes
        auth_pass: "{{ switch_auth_pass }}"
      dell_switch_config:
        - "protocol lldp"
        - " advertise dot3-tlv max-frame-size"
        - " advertise management-tlv management-address system-description system-name"
        - " advertise interface-port-desc"
        - " no disable"
        - " exit"
      dell_switch_interface_config:
        Te1/1/1:
          description: server-1
          config:
            - "no shutdown"
            - "switchport"
        Te1/1/2:
          description: server-2
          config:
            - "no shutdown"
            - "switchport"

Author Information