GithubHelp home page GithubHelp logo

dell-networking / ansible-role-dellos-system Goto Github PK

View Code? Open in Web Editor NEW
4.0 6.0 9.0 41 KB

The dellos-system facilitates the configuration of system attributes in devices running Dell EMC Networking Operating Systems.

Home Page: https://galaxy.ansible.com/Dell-Networking/dellos-system/

License: Apache License 2.0

ansible hostname dell os9

ansible-role-dellos-system's Introduction

System role

This role facilitates the configuration of global system attributes, and is abstracted for dellos6, dellos9, and dellos10. It specifically enables configuration of hostname and enable password for all three dellos. In addition, dellos9 supports the configuration of management route, hash alogrithm, clock, line terminal, banner, and reload type.

The dellos-system role requires an SSH connection for connectivity to a Dell EMC Networking device. You can use any of the built-in OS connection variables .

Installation

ansible-galaxy install Dell-Networking.dellos-system

Role variables

  • Role is abstracted using the ansible_network_os variable that can take dellos9, dellos6, and dellos10 values
  • If dellos_cfg_generate is set to true, the variable generates the role configuration commands in a file
  • Any role variable with a corresponding state variable set to absent negates the configuration of that variable
  • Setting an empty value for any variable negates the corresponding configuration
  • Variables and values are case-sensitive

dellos_system keys

Key Type Description Support
hostname string Configures a hostname to the device (no negate command) dellos9, dellos6, dellos10
unique_hostname boolean: true,false* Configures a unique hostname in the switch dellos9
enable_password string Configures the enable password dellos6, dellos9
mtu integer Configures the maximum transmission unit (MTU) for all interfaces dellos6
hardware_forwarding string: scaled-l2,scaled-l3-routes,scaled-l3-hosts Configures hardware forwarding mode dellos10
management_rt list Configures the management route dellos9
management_rt.ip string (required) Configures the IP destination prefix for the management route (A.B.C.D format for IPv4, A:B:C:D::E format for IPv6) dellos9
management_rt.ipv4 boolean: true*,false Specifies if the management route is an IPv4 or IPv6 address; if false or undefined, the IP is set as IPv6 dellos9
management_rt.state string: absent,present* Deletes the management route if set to absent dellos9
line_terminal dictionary Configures the terminal line (see line_terminal.*) dellos9
line_terminal.<terminal> dictionary Configures the primary or virtual terminal line (console <line_number> or vty <line_number> values) dellos9
<terminal>.exec_timeout string Configures the EXEC timeout ( values) dellos9
<terminal>.exec_banner boolean: true,false* Configures the EXEC banner dellos9
<terminal>.login_banner boolean: true,false* Configures the login banner dellos9
<terminal>.motd_banner boolean: true,false* Configures the MOTD banner dellos9
service_passwd_encryption boolean: true,false Configures system password encryption dellos9
hash_algo dictionary Configures hash algorithm commands (see hash_algo.*) dellos9, dellos10
hash_algo.algo list Configures hashing algorithm (see algo.*) dellos9, dellos10
algo.name string (required) Configures the name of the hashing algorithm dellos9, dellos10
algo.mode string (required) Configures the hashing algorithm mode dellos9, dellos10
algo.stack_unit integer Configures the stack-unit for the hashing algorithm dellos9
algo.port_set integer Configures the port-pipe set for the hashing algorithm dellos9
algo.state string: absent,present* Deletes the hashing algorithm if set to absent dellos9, dellos10
hash_algo.seed list Configures the hashing algorithm seed (see seed.*) dellos9
seed.value integer (required) Configures the hashing algorithm seed value dellos9
seed.stack_unit integer Configures the stack-unit for the hashing algorithm seed dellos9
seed.port_set integer Configures the port-pipe set for the hashing algorithm seed dellos9
seed.state string: absent,present* Deletes the hashing algorithm seed if set to absent dellos9
banner dictionary Configures global banner commands (see banner.*) dellos9
banner.login dictionary Configures the login banner (see login.*) dellos9
login.ack_enable boolean: true,false Configures positive acknowledgement dellos9
login.ack_prompt string Configures the positive acknowledgement prompt dellos9
login.keyboard_interactive boolean: true,false Configures the keyboard interactive prompt dellos9
login.banner_text string Configures the banner text for the login banner; 'c c' format where 'c' is a delimiting character dellos9
banner.exec string Configures the banner text for EXEC process creation banner; 'c c' where 'c' is a delimiting character for dellos9 dellos9
banner.motd string Configures the banner text for the message of the day banner; 'c c' where 'c' is a delimiting character for dellos9 dellos9
load_balance dictionary Configures the global traffic load balance (see load_balance.*) dellos9, dellos10
load_balance.ingress_port boolean: true,false Specifies whether to use the source port ID for the hashing algorithm dellos9, dellos10
load_balance.tcp_udp boolean: true, false Configures whether to use TCP/UDP ports in packets for hashing algorithm dellos9
load_balance.ip_selection list Configures IPv4 key fields to use in hashing algorithm; mutually exclusive with load_balance.tcp_udp for dellos9 devices (see ip_selection.*) dellos9, dellos10
ip_selection.field string Configures IPv4 key fields to use in hashing algorithm dellos9, dellos10
ip_selection.state string: absent,present* Deletes the IPv4 key fields if set to absent dellos9, dellos10
load_balance.ipv6_selection list Configures IPv6 key fields to use in hashing algorithm; mutually exclusive with load_balance.tcp_udp for dellos9 devices (see ipv6_selection.*) dellos9, dellos10
ipv6_selection.field string Configures IPv6 key fields to use in hashing algorithm dellos9, dellos10
ipv6_selection.state string: absent,present* Deletes the IPv6 key fields if set to absent dellos9, dellos10
load_balance.mac_selection list Configures MAC key fields to use in hashing algorithm (see mac_selection.*) dellos10
mac_selection.field string Configures MAC key fields to use in hashing algorithm dellos10
mac_selection.state string: absent,present* Deletes the MAC key fields if set to absent dellos10
load_balance.tcp_udp_selection list Configures TCP UDP ports for load balancing configurations (see tcp_udp_selection.*) dellos10
tcp_udp_selection.field string Configures TCP UDP port fields to use in hashing algorithm dellos10
tcp_udp_selection.state string: absent,present* Deletes the TCP UDP ports if set to absent dellos10
load_balance.tunnel dictionary Configures tunnel key fields to use in hashing algorithm (see tunnel.*) dellos9
tunnel.hash_field list Configures hash field selection (see hash_field.*) dellos9
hash_field.name string (required) Configures the hash field selection dellos9
hash_field.header string Configures header for load balance dellos9
hash_field.state string: absent,present* Deletes the hash key selection field if set to absent dellos9
clock dictionary Configures time-of-day clock (see clock.*) dellos9
clock.summer_time dictionary Configures summer (daylight savings) time (see summer_time.*) dellos9
summer_time.timezone_name string (required) Configures the time zone name dellos9
summer_time.type string (required) Configures absolute or recurring summer time dellos9
summer_time.start_datetime string Configures start datetime; hrs:mins format dellos9
summer_time.end_datetime string Configures end datetime; hrs:mins format dellos9
summer_time.offset_mins integer Configures offset minutes to add (1 to 1440) dellos9
summer_time.state string: absent,present* Deletes the summer time clock if set to absent dellos9
clock.timezone dictionary Configures timezone (see timezone.*) dellos9
timezone.name string (required) Configures the timezone name dellos9
timezone.offset_hours integer Configures offset hours to add (-23 to 23) dellos9
timezone.offset_mins integer Configures offset minutes to add (0 to 59) dellos9
timezone.state string: absent,present* Deletes the time zone if set to absent dellos9
reload_type dictionary Configures the reload type (see reload_type.*) dellos9
reload_type.auto_save boolean: true,false* Configures the auto save option for downloaded configuration/script file dellos9
reload_type.boot_type string: bmp-reload,normal-reload Configures the boot type dellos9
reload_type.boot_type_state string: absent,present* Deletes the boot type if set to absent dellos9
reload_type.config_scr_download boolean: true,false* Configures whether config/script file needs to be downloaded dellos9
reload_type.dhcp_timeout integer Configures DHCP timeout in minutes (0 to 50) dellos9
reload_type.retry_count integer Configures the number of retries for image and configuration download (0 to 6) dellos9
reload_type.relay boolean: true,false* Configures the addition of option82 in DHCP client packets dellos9
reload_type.relay_remote_id string Configures customize remote ID dellos9
reload_type.vendor_class_identifier boolean: true,false* Configures vendor-class-identifier for DHCP option60 dellos9

NOTE: Asterisk (*) denotes the default value if none is specified.

Connection variables


Ansible Dell EMC Networking roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible group_vars or host_vars directories, or inventory or in the playbook itself.

Key Required Choices Description
ansible_host yes Specifies the hostname or address for connecting to the remote device over the specified transport
ansible_port no Specifies the port used to build the connection to the remote device; if value is unspecified, the ANSIBLE_REMOTE_PORT option is used; it defaults to 22
ansible_ssh_user no Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the ANSIBLE_REMOTE_USER environment variable value is used
ansible_ssh_pass no Specifies the password that authenticates the connection to the remote device
ansible_become no yes, no* Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the ANSIBLE_BECOME environment variable value is used, and the device attempts to execute all commands in non-privileged mode
ansible_become_method no enable, sudo* Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the ANSIBLE_BECOME_METHOD environment variable value is used
ansible_become_pass no Specifies the password to use if required to enter privileged mode on the remote device; if ansible_become is set to no this key is not applicable
ansible_network_os yes dellos6/dellos9/dellos10, null* Loads the correct terminal and cliconf plugins to communicate with the remote device

NOTE: Asterisk (*) denotes the default value if none is specified.

Dependencies

The dellos-system role is built on modules included in the core Ansible code. These modules were added in Ansible version 2.2.0.

Example playbook

This example uses the dellos-system role to completely set the NTP server, hostname, enable password, management route, hash alogrithm, clock, line terminal, banner and reload type. It creates a hosts file with the switch details and corresponding variables. The hosts file should define the ansible_network_os variable with corresponding Dell EMC networking OS name.

When dellos_cfg_generate is set to true, the variable generates the configuration commands as a .part file in build_dir path. By default, the variable is set to false. The system role writes a simple playbook that only references the dellos-system role. By including the role, you automatically get access to all of the tasks to configure system features.

Sample hosts file

leaf1 ansible_host= <ip_address> 

Sample host_vars/leaf1

hostname: leaf1
ansible_become: yes
ansible_become_method: xxxxx
ansible_become_pass: xxxxx
ansible_ssh_user: xxxxx
ansible_ssh_pass: xxxxx
ansible_network_os: dellos9
build_dir: ../temp/dellos9
  
dellos_system:
  hostname: host1
  unique_hostname: True
  enable_password: dell
  service_passwd_encryption: true
  banner:
    exec: t hai t
    login:
      ack_enable: true
      ack_prompt: testbanner
      keyboard_interactive: true
      banner_text: cloginbannerc
    motd: t ansibletest t
  hash_algo:
    algo:
      - name: lag
        mode: xor1
        stack_unit: 0
        port_set: 0
        state: present
      - name: ecmp
        mode: xor1
        stack_unit: 0
        port_set: 0
        state: present
    seed:
      - value: 3
        stack_unit: 0
        port_set: 0
        state: present
      - value: 2
        state: present
  load_balance:
    ingress_port: true
    ip_selection: 
       - field: vlan dest-ip
         state: present
    ipv6_selection: 
       - field: dest-ipv6 vlan
         state: present
    tunnel:
      hash_field:
        - name: mac-in-mac
          header: tunnel-header-mac
          state: present
  clock:
    summer_time:
      timezone_name: PST
      type: date
      start_datetime: 2 jan 1993 22:33
      end_datetime: 3 jan 2017 22:33
      offset_mins: 20
    timezone:
      name: IST
      offset_hours: -5
      offset_mins: 20
  reload_type:
    auto_save: true
    boot_type: normal-reload
    boot_type_state: absent
    config_scr_download: true
    dhcp_timeout: 5
    retry_count: 3
    relay: true
    relay_remote_id: ho
    vendor_class_identifier: aa
  management_rt:
    - ip: 10.16.148.254
      state: present
      ipv4: True
  line_terminal:
    vty 0:
      exec_timeout: 40
      exec_banner: true
    vty 1:
      exec_timeout: 40 200
      motd_banner: true

Simple playbook to setup system - leaf.yaml

- hosts: leaf1
  roles:
     - Dell-Networking.dellos-system

Run

ansible-playbook -i hosts leaf.yaml

(c) 2017 Dell Inc. or its subsidiaries. All Rights Reserved.

ansible-role-dellos-system's People

Contributors

abirami-n avatar amybuck avatar bk2zsto avatar dhivyap avatar javeedf avatar raghavendra-akkalie avatar skg-net avatar teralype avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ansible-role-dellos-system's Issues

banner.motd in OS10

Would be good to have this working in OS10 or if there is another workaround I can use to get this to work in my Ansible Configuration.

"msg": "'dict object' has no attribute 'iteritems'"

Hi been running into issues with some of the roles running ansible 2.9.4 and python 3.6.9
From what I've googled it could be an issue with python 3.0 . I'll try and load an old python 2 instance just for testing to confirm.

Some modules like the snmp module work fine but a straight forward code sample to set hostname of switch fails like this.For time being I've fallen back to the module but I much prefer using roles as it looks cleaner. I've hit some weird idempotentency issues with the module when paired to lists.

dellos_system:
hostname: switcha

Full Debug As Follow
1598 1581615382.81322: Loading TerminalModule 'dellos6' from /home/user/.local/lib/python3.6/site-packages/ansible/plugins/terminal/dellos6.py
1598 1581615382.81572: trying /home/user/.local/lib/python3.6/site-packages/ansible/plugins/cliconf
1598 1581615382.81797: Loading Cliconf 'dellos6' from /home/user/.local/lib/python3.6/site-packages/ansible/plugins/cliconf/dellos6.py
1598 1581615382.81852: trying /home/user/.local/lib/python3.6/site-packages/ansible/plugins/become
1598 1581615382.81921: Loading BecomeModule 'enable' from /home/user/.local/lib/python3.6/site-packages/ansible/plugins/become/enable.py (found_in_cache=True, class_only=False)
<192.168.0.1> attempting to start connection
<192.168.0.1> using connection plugin network_cli
<192.168.0.1> found existing local domain socket, using it!
<192.168.0.1> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
<192.168.0.1> updating play_context for connection
<192.168.0.1> 1599 1581615383.12797: trying /home/user/.local/lib/python3.6/site-packages/ansible/plugins/connection/pycache
1599 1581615383.12842: trying /home/user/.local/lib/python3.6/site-packages/ansible/plugins/connection
1599 1581615383.13688: Loaded config def from plugin (connection/ssh)
1599 1581615383.13692: Loading Connection 'ssh' from /home/user/.local/lib/python3.6/site-packages/ansible/plugins/connection/ssh.py (searched paths: /home/user/.local/lib/python3.6/site-packages/ansible/plugins/connection/pycache:/home/user/.local/lib/python3.6/site-packages/ansible/plugins/connection) (found_in_cache=False, class_only=True)

<192.168.0.1> local domain socket path is /home/user/.ansible/pc/7c9bb661b1
1598 1581615383.16711: Loading ActionModule 'dellos6' from /home/user/.local/lib/python3.6/site-packages/ansible/plugins/action/dellos6.py (searched paths: /home/user/.local/lib/python3.6/site-packages/ansible/plugins/action/pycache:/home/user/.local/lib/python3.6/site-packages/ansible/plugins/action)
1598 1581615383.16761: starting attempt loop
1598 1581615383.16787: running the handler
1598 1581615383.17840: handler run complete
1598 1581615383.17888: attempt loop complete, returning result
1598 1581615383.17917: _execute() done
1598 1581615383.17946: dumping result to json
1598 1581615383.17971: done dumping result, returning
1598 1581615383.18004: done running TaskExecutor() for 192.168.0.1/TASK: Dell-Networking.dellos-system : Provisioning system configuration for dellos6 [e4b97a72-eb95-0db1-ee28-000000000018]
1598 1581615383.18043: sending task result for task e4b97a72-eb95-0db1-ee28-000000000018
1598 1581615383.18143: done sending task result for task e4b97a72-eb95-0db1-ee28-000000000018
1598 1581615383.18185: WORKER PROCESS EXITING
1527 1581615383.18343: marking 192.168.0.1 as failed
1527 1581615383.18373: marking host 192.168.0.1 failed, current state: HOST STATE: block=3, task=4, rescue=0, always=0, run_state=ITERATING_TASKS, fail_state=FAILED_NONE, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False
1527 1581615383.18408: ^ failed state is now: HOST STATE: block=3, task=4, rescue=0, always=0, run_state=ITERATING_COMPLETE, fail_state=FAILED_TASKS, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False
1527 1581615383.18440: getting the next task for host 192.168.0.1
1527 1581615383.18461: host 192.168.0.1 is done iterating, returning
fatal: [192.168.0.1]: FAILED! => {
"changed": false,
"msg": "'dict object' has no attribute 'iteritems'"
}

management_rt in os10

Really would be nice to set a gateway for the mgmt interface in OS10. I notice management_rt supports OS9, but not OS10.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.