From 7f55c9fc8eb05c525adeea69043620a7b3023ac4 Mon Sep 17 00:00:00 2001 From: Senthil Kumar Ganesan Date: Sat, 17 Sep 2016 03:16:48 -0700 Subject: [PATCH] dnos* -> dellos* (Rename module & updated copyright) (#4888) * Renamed the Modules from dnos* -> dellos*, updated copyright, corrected doc issues * Removed the unwanted module import --- network/{dnos10 => dellos10}/__init__.py | 0 .../dellos10_command.py} | 26 +++++++++++-------- .../dellos10_config.py} | 16 +++++++----- .../dellos10_facts.py} | 17 +++++++----- .../dellos10_template.py} | 22 +++++++++------- network/{dnos6 => dellos6}/__init__.py | 0 .../dellos6_command.py} | 26 +++++++++++-------- .../dellos6_config.py} | 14 ++++++---- network/{dnos9 => dellos9}/__init__.py | 0 .../dellos9_command.py} | 24 ++++++++++------- .../dellos9_config.py} | 14 ++++++---- .../dellos9_facts.py} | 14 ++++++---- .../dellos9_template.py} | 14 ++++++---- 13 files changed, 113 insertions(+), 74 deletions(-) rename network/{dnos10 => dellos10}/__init__.py (100%) rename network/{dnos10/dnos10_command.py => dellos10/dellos10_command.py} (91%) rename network/{dnos10/dnos10_config.py => dellos10/dellos10_config.py} (97%) rename network/{dnos10/dnos10_facts.py => dellos10/dellos10_facts.py} (98%) rename network/{dnos10/dnos10_template.py => dellos10/dellos10_template.py} (93%) rename network/{dnos6 => dellos6}/__init__.py (100%) rename network/{dnos6/dnos6_command.py => dellos6/dellos6_command.py} (91%) rename network/{dnos6/dnos6_config.py => dellos6/dellos6_config.py} (97%) rename network/{dnos9 => dellos9}/__init__.py (100%) rename network/{dnos9/dnos9_command.py => dellos9/dellos9_command.py} (92%) rename network/{dnos9/dnos9_config.py => dellos9/dellos9_config.py} (97%) rename network/{dnos9/dnos9_facts.py => dellos9/dellos9_facts.py} (98%) rename network/{dnos9/dnos9_template.py => dellos9/dellos9_template.py} (96%) diff --git a/network/dnos10/__init__.py b/network/dellos10/__init__.py similarity index 100% rename from network/dnos10/__init__.py rename to network/dellos10/__init__.py diff --git a/network/dnos10/dnos10_command.py b/network/dellos10/dellos10_command.py similarity index 91% rename from network/dnos10/dnos10_command.py rename to network/dellos10/dellos10_command.py index 7acdc837c2a..5c8e5ea35f2 100644 --- a/network/dnos10/dnos10_command.py +++ b/network/dellos10/dellos10_command.py @@ -1,5 +1,9 @@ #!/usr/bin/python # +# (c) 2015 Peter Sprygada, +# +# Copyright (c) 2016 Dell Inc. +# # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify @@ -18,9 +22,9 @@ DOCUMENTATION = """ --- -module: dnos10_command +module: dellos10_command version_added: "2.2" -author: "Senthil Kumar Ganesan (@skg_net)" +author: "Senthil Kumar Ganesan (@skg-net)" short_description: Run commands on remote devices running Dell OS10 description: - Sends arbitrary commands to a Dell OS10 node and returns the results @@ -28,12 +32,12 @@ description: argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met. - This module does not support running commands in configuration mode. - Please use M(dnos10_config) to configure Dell OS10 devices. + Please use M(dellos10_config) to configure Dell OS10 devices. extends_documentation_fragment: dellos10 options: commands: description: - - List of commands to send to the remote dnos10 device over the + - List of commands to send to the remote dellos10 device over the configured provider. The resulting output from the command is returned. If the I(wait_for) argument is provided, the module is not returned until the condition is satisfied or @@ -78,25 +82,25 @@ vars: tasks: - name: run show version on remote devices - dnos10_command: + dellos10_command: commands: show version provider: "{{ cli }}" - name: run show version and check to see if output contains OS10 - dnos10_command: + dellos10_command: commands: show version wait_for: result[0] contains OS10 provider: "{{ cli }}" - name: run multiple commands on remote nodes - dnos10_command: + dellos10_command: commands: - show version - show interface provider: "{{ cli }}" - name: run multiple commands and evaluate the output - dnos10_command: + dellos10_command: commands: - show version - show interface @@ -135,7 +139,7 @@ warnings: from ansible.module_utils.basic import get_exception from ansible.module_utils.netcli import CommandRunner, FailedConditionsError from ansible.module_utils.network import NetworkModule, NetworkError -import ansible.module_utils.dnos10 +import ansible.module_utils.dellos10 def to_lines(stdout): for item in stdout: @@ -168,9 +172,9 @@ def main(): 'check mode, not executing `%s`' % cmd) else: if cmd.startswith('conf'): - module.fail_json(msg='dnos10_command does not support running ' + module.fail_json(msg='dellos10_command does not support running ' 'config mode commands. Please use ' - 'dnos10_config instead') + 'dellos10_config instead') runner.add_command(cmd) for item in conditionals: diff --git a/network/dnos10/dnos10_config.py b/network/dellos10/dellos10_config.py similarity index 97% rename from network/dnos10/dnos10_config.py rename to network/dellos10/dellos10_config.py index 0c1ddf8bc21..e505799e0e8 100644 --- a/network/dnos10/dnos10_config.py +++ b/network/dellos10/dellos10_config.py @@ -1,5 +1,9 @@ #!/usr/bin/python # +# (c) 2015 Peter Sprygada, +# +# Copyright (c) 2016 Dell Inc. +# # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify @@ -18,9 +22,9 @@ DOCUMENTATION = """ --- -module: dnos10_config +module: dellos10_config version_added: "2.2" -author: "Senthil Kumar Ganesan (@skg_net)" +author: "Senthil Kumar Ganesan (@skg-net)" short_description: Manage Dell OS10 configuration sections description: - Dell OS10 configurations use a simple block indent file syntax @@ -138,11 +142,11 @@ options: """ EXAMPLES = """ -- dnos10_config: +- dellos10_config: lines: ['hostname {{ inventory_hostname }}'] provider: "{{ cli }}" -- dnos10_config: +- dellos10_config: lines: - 10 permit ip host 1.1.1.1 any log - 20 permit ip host 2.2.2.2 any log @@ -154,7 +158,7 @@ EXAMPLES = """ match: exact provider: "{{ cli }}" -- dnos10_config: +- dellos10_config: lines: - 10 permit ip host 1.1.1.1 any log - 20 permit ip host 2.2.2.2 any log @@ -190,7 +194,7 @@ saved: """ from ansible.module_utils.netcfg import NetworkConfig, dumps from ansible.module_utils.network import NetworkModule -from ansible.module_utils.dnos10 import get_config, get_sublevel_config +from ansible.module_utils.dellos10 import get_config, get_sublevel_config def get_candidate(module): candidate = NetworkConfig(indent=1) diff --git a/network/dnos10/dnos10_facts.py b/network/dellos10/dellos10_facts.py similarity index 98% rename from network/dnos10/dnos10_facts.py rename to network/dellos10/dellos10_facts.py index 6e2d0c1b6e9..bbccd20a34c 100644 --- a/network/dnos10/dnos10_facts.py +++ b/network/dellos10/dellos10_facts.py @@ -1,5 +1,9 @@ #!/usr/bin/python # +# (c) 2015 Peter Sprygada, +# +# Copyright (c) 2016 Dell Inc. +# # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify @@ -17,9 +21,9 @@ # DOCUMENTATION = """ --- -module: dnos10_facts +module: dellos10_facts version_added: "2.2" -author: "Senthil Kumar Ganesan (@skg_net)" +author: "Senthil Kumar Ganesan (@skg-net)" short_description: Collect facts from remote devices running Dell OS10 description: - Collects a base set of device facts from a remote device that @@ -43,16 +47,16 @@ options: EXAMPLES = """ # Collect all facts from the device -- dnos10_facts: +- dellos10_facts: gather_subset: all # Collect only the config and default facts -- dnos10_facts: +- dellos10_facts: gather_subset: - config # Do not collect hardware facts -- dnos10_facts: +- dellos10_facts: gather_subset: - "!hardware" """ @@ -125,12 +129,11 @@ ansible_net_neighbors: """ import re -import itertools from ansible.module_utils.basic import get_exception from ansible.module_utils.netcli import CommandRunner from ansible.module_utils.network import NetworkModule -import ansible.module_utils.dnos10 +import ansible.module_utils.dellos10 try: from lxml import etree as ET diff --git a/network/dnos10/dnos10_template.py b/network/dellos10/dellos10_template.py similarity index 93% rename from network/dnos10/dnos10_template.py rename to network/dellos10/dellos10_template.py index c957a2f0785..b9bec6a3311 100644 --- a/network/dnos10/dnos10_template.py +++ b/network/dellos10/dellos10_template.py @@ -1,5 +1,9 @@ #!/usr/bin/python # +# (c) 2015 Peter Sprygada, +# +# Copyright (c) 2016 Dell Inc. +# # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify @@ -17,9 +21,9 @@ # DOCUMENTATION = """ --- -module: dnos10_template +module: dellos10_template version_added: "2.2" -author: "Senthil Kumar Ganesan (@skg_net)" +author: "Senthil Kumar Ganesan (@skg-net)" short_description: Manage Dell OS10 device configurations over SSH. description: - Manages Dell OS10 network device configurations over SSH. This module @@ -44,7 +48,7 @@ options: current device running-config. When set to true, this will cause the module to push the contents of I(src) into the device without first checking if already configured. This argument is - mutually exclusive with O(config). + mutually exclusive with I(config). required: false default: false choices: [ "true", "false" ] @@ -54,7 +58,7 @@ options: the running-config from the node prior to making any changes. The backup file will be written to backup_{{ hostname }} in the root of the playbook directory. This argument is - mutually exclusive with O(config). + mutually exclusive with I(config). required: false default: false @@ -68,7 +72,7 @@ options: every task. The I(config) argument allows the implementer to pass in the configuration to use as the base config for comparison. This argument is mutually exclusive with - O(force) and O(backup). + I(force) and I(backup). required: false default: null @@ -76,20 +80,20 @@ options: EXAMPLES = """ - name: push a configuration onto the device - dnos10_template: + dellos10_template: host: hostname username: foo src: config.j2 - name: forceable push a configuration onto the device - dnos10_template: + dellos10_template: host: hostname username: foo src: config.j2 force: yes - name: provide the base configuration for comparison - dnos10_template: + dellos10_template: host: hostname username: foo src: candidate_config.txt @@ -117,7 +121,7 @@ responses: """ from ansible.module_utils.netcfg import NetworkConfig, dumps from ansible.module_utils.network import NetworkModule -import ansible.module_utils.dnos10 +import ansible.module_utils.dellos10 def get_config(module): diff --git a/network/dnos6/__init__.py b/network/dellos6/__init__.py similarity index 100% rename from network/dnos6/__init__.py rename to network/dellos6/__init__.py diff --git a/network/dnos6/dnos6_command.py b/network/dellos6/dellos6_command.py similarity index 91% rename from network/dnos6/dnos6_command.py rename to network/dellos6/dellos6_command.py index 173d2b7dc8a..3cc8137043c 100644 --- a/network/dnos6/dnos6_command.py +++ b/network/dellos6/dellos6_command.py @@ -1,5 +1,9 @@ #!/usr/bin/python # +# (c) 2015 Peter Sprygada, +# +# Copyright (c) 2016 Dell Inc. +# # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify @@ -18,21 +22,21 @@ DOCUMENTATION = """ --- -module: dnos6_command +module: dellos6_command version_added: "2.2" short_description: Run commands on remote devices running Dell OS6 description: - Sends arbitrary commands to a Dell OS6 node and returns the results - read from the device. The M(dnos6_command) module includes an + read from the device. The M(dellos6_command) module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met. - This module does not support running commands in configuration mode. - Please use M(dnos6_config) to configure Dell OS6 devices. + Please use M(dellos6_config) to configure Dell OS6 devices. extends_documentation_fragment: dellos6 options: commands: description: - - List of commands to send to the remote dnos6 device over the + - List of commands to send to the remote dellos6 device over the configured provider. The resulting output from the command is returned. If the I(waitfor) argument is provided, the module is not returned until the condition is satisfied or @@ -77,25 +81,25 @@ vars: tasks: - name: run show verion on remote devices - dnos6_command: + dellos6_command: commands: show version provider "{{ cli }}" - name: run show version and check to see if output contains Dell - dnos6_command: + dellos6_command: commands: show version wait_for: result[0] contains Dell provider "{{ cli }}" - name: run multiple commands on remote nodes - dnos6_command: + dellos6_command: commands: - show version - show interfaces provider "{{ cli }}" - name: run multiple commands and evaluate the output - dnos6_command: + dellos6_command: commands: - show version - show interfaces @@ -134,7 +138,7 @@ warnings: from ansible.module_utils.basic import get_exception from ansible.module_utils.netcli import CommandRunner, FailedConditionsError from ansible.module_utils.network import NetworkModule, NetworkError -import ansible.module_utils.dnos6 +import ansible.module_utils.dellos6 def to_lines(stdout): for item in stdout: @@ -168,9 +172,9 @@ def main(): 'check mode, not executing `%s`' % cmd) else: if cmd.startswith('conf'): - module.fail_json(msg='dnos6_command does not support running ' + module.fail_json(msg='dellos6_command does not support running ' 'config mode commands. Please use ' - 'dnos6_config instead') + 'dellos6_config instead') runner.add_command(cmd) for item in conditionals: diff --git a/network/dnos6/dnos6_config.py b/network/dellos6/dellos6_config.py similarity index 97% rename from network/dnos6/dnos6_config.py rename to network/dellos6/dellos6_config.py index 527dac8c413..008cb0122e8 100644 --- a/network/dnos6/dnos6_config.py +++ b/network/dellos6/dellos6_config.py @@ -1,5 +1,9 @@ #!/usr/bin/python # +# (c) 2015 Peter Sprygada, +# +# Copyright (c) 2016 Dell Inc. +# # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify @@ -18,7 +22,7 @@ DOCUMENTATION = """ --- -module: dnos6_config +module: dellos6_config version_added: "2.2" author: "Abirami N(@abirami-n)" short_description: Manage Dell OS6 configuration sections @@ -138,11 +142,11 @@ options: """ EXAMPLES = """ -- dnos6_config: +- dellos6_config: lines: ['hostname {{ inventory_hostname }}'] provider: "{{ cli }}" -- dnos6_config: +- dellos6_config: lines: - 10 permit ip 1.1.1.1 any log - 20 permit ip 2.2.2.2 any log @@ -154,7 +158,7 @@ EXAMPLES = """ match: exact provider: "{{ cli }}" -- dnos6_config: +- dellos6_config: lines: - 10 permit ip 1.1.1.1 any log - 20 permit ip 2.2.2.2 any log @@ -190,7 +194,7 @@ saved: """ from ansible.module_utils.netcfg import NetworkConfig, dumps, ConfigLine from ansible.module_utils.network import NetworkModule -from ansible.module_utils.dnos6 import get_config +from ansible.module_utils.dellos6 import get_config def get_candidate(module): candidate = NetworkConfig(indent=1) diff --git a/network/dnos9/__init__.py b/network/dellos9/__init__.py similarity index 100% rename from network/dnos9/__init__.py rename to network/dellos9/__init__.py diff --git a/network/dnos9/dnos9_command.py b/network/dellos9/dellos9_command.py similarity index 92% rename from network/dnos9/dnos9_command.py rename to network/dellos9/dellos9_command.py index f73055cd6d3..b6bc6ed9d70 100755 --- a/network/dnos9/dnos9_command.py +++ b/network/dellos9/dellos9_command.py @@ -1,5 +1,9 @@ #!/usr/bin/python # +# (c) 2015 Peter Sprygada, +# +# Copyright (c) 2016 Dell Inc. +# # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify @@ -18,7 +22,7 @@ DOCUMENTATION = """ --- -module: dnos9_command +module: dellos9_command version_added: "2.2" short_description: Run commands on remote devices running Dell OS9 description: @@ -27,12 +31,12 @@ description: argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met. - This module does not support running commands in configuration mode. - Please use M(dnos9_config) to configure Dell OS9 devices. + Please use M(dellos9_config) to configure Dell OS9 devices. extends_documentation_fragment: dellos9 options: commands: description: - - List of commands to send to the remote dnos9 device over the + - List of commands to send to the remote dellos9 device over the configured provider. The resulting output from the command is returned. If the I(wait_for) argument is provided, the module is not returned until the condition is satisfied or @@ -77,25 +81,25 @@ vars: tasks: - name: run show version on remote devices - dnos9_command: + dellos9_command: commands: show version provider "{{ cli }}" - name: run show version and check to see if output contains OS9 - dnos9_command: + dellos9_command: commands: show version wait_for: result[0] contains OS9 provider "{{ cli }}" - name: run multiple commands on remote nodes - dnos9_command: + dellos9_command: commands: - show version - show interfaces provider "{{ cli }}" - name: run multiple commands and evalute the output - dnos9_command: + dellos9_command: commands: - show version - show interfaces @@ -134,7 +138,7 @@ warnings: from ansible.module_utils.basic import get_exception from ansible.module_utils.netcli import CommandRunner, FailedConditionsError from ansible.module_utils.network import NetworkModule, NetworkError -import ansible.module_utils.dnos9 +import ansible.module_utils.dellos9 def to_lines(stdout): @@ -169,9 +173,9 @@ def main(): 'check mode, not executing `%s`' % cmd) else: if cmd.startswith('conf'): - module.fail_json(msg='dnos9_command does not support running ' + module.fail_json(msg='dellos9_command does not support running ' 'config mode commands. Please use ' - 'dnos9_config instead') + 'dellos9_config instead') runner.add_command(cmd) for item in conditionals: diff --git a/network/dnos9/dnos9_config.py b/network/dellos9/dellos9_config.py similarity index 97% rename from network/dnos9/dnos9_config.py rename to network/dellos9/dellos9_config.py index 0c336b0d108..a90531b0f6c 100755 --- a/network/dnos9/dnos9_config.py +++ b/network/dellos9/dellos9_config.py @@ -1,5 +1,9 @@ #!/usr/bin/python # +# (c) 2015 Peter Sprygada, +# +# Copyright (c) 2016 Dell Inc. +# # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify @@ -18,7 +22,7 @@ DOCUMENTATION = """ --- -module: dnos9_config +module: dellos9_config version_added: "2.2" author: "Dhivya P (@dhivyap)" short_description: Manage Dell OS9 configuration sections @@ -138,11 +142,11 @@ options: """ EXAMPLES = """ -- dnos9_config: +- dellos9_config: lines: ['hostname {{ inventory_hostname }}'] provider: "{{ cli }}" -- dnos9_config: +- dellos9_config: lines: - 10 permit ip host 1.1.1.1 any log - 20 permit ip host 2.2.2.2 any log @@ -154,7 +158,7 @@ EXAMPLES = """ match: exact provider: "{{ cli }}" -- dnos9_config: +- dellos9_config: lines: - 10 permit ip host 1.1.1.1 any log - 20 permit ip host 2.2.2.2 any log @@ -190,7 +194,7 @@ saved: """ from ansible.module_utils.netcfg import NetworkConfig, dumps from ansible.module_utils.network import NetworkModule -from ansible.module_utils.dnos9 import get_config, get_sublevel_config +from ansible.module_utils.dellos9 import get_config, get_sublevel_config def get_candidate(module): diff --git a/network/dnos9/dnos9_facts.py b/network/dellos9/dellos9_facts.py similarity index 98% rename from network/dnos9/dnos9_facts.py rename to network/dellos9/dellos9_facts.py index d475e2b5cd9..4b8b2a83a44 100644 --- a/network/dnos9/dnos9_facts.py +++ b/network/dellos9/dellos9_facts.py @@ -1,5 +1,9 @@ #!/usr/bin/python # +# (c) 2015 Peter Sprygada, +# +# Copyright (c) 2016 Dell Inc. +# # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify @@ -17,7 +21,7 @@ # DOCUMENTATION = """ --- -module: dnos9_facts +module: dellos9_facts version_added: "2.2" author: "Dhivya P (@dhivyap)" short_description: Collect facts from remote devices running Dell OS9 @@ -43,16 +47,16 @@ options: EXAMPLES = """ # Collect all facts from the device -- dnos9_facts: +- dellos9_facts: gather_subset: all # Collect only the config and default facts -- dnos9_facts: +- dellos9_facts: gather_subset: - config # Do not collect hardware facts -- dnos9_facts: +- dellos9_facts: gather_subset: - "!hardware" """ @@ -128,7 +132,7 @@ import itertools from ansible.module_utils.netcli import CommandRunner from ansible.module_utils.network import NetworkModule -import ansible.module_utils.dnos9 +import ansible.module_utils.dellos9 class FactsBase(object): diff --git a/network/dnos9/dnos9_template.py b/network/dellos9/dellos9_template.py similarity index 96% rename from network/dnos9/dnos9_template.py rename to network/dellos9/dellos9_template.py index cc0c04e5d5d..e4ec7364549 100755 --- a/network/dnos9/dnos9_template.py +++ b/network/dellos9/dellos9_template.py @@ -1,5 +1,9 @@ #!/usr/bin/python # +# (c) 2015 Peter Sprygada, +# +# Copyright (c) 2016 Dell Inc. +# # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify @@ -17,7 +21,7 @@ # DOCUMENTATION = """ --- -module: dnos9_template +module: dellos9_template version_added: "2.2" author: "Dhivya P (@dhivyap)" short_description: Manage Dell OS9 device configurations over SSH. @@ -76,20 +80,20 @@ options: EXAMPLES = """ - name: push a configuration onto the device - dnos9_template: + dellos9_template: host: hostname username: foo src: config.j2 - name: forceable push a configuration onto the device - dnos9_template: + dellos9_template: host: hostname username: foo src: config.j2 force: yes - name: provide the base configuration for comparison - dnos9_template: + dellos9_template: host: hostname username: foo src: candidate_config.txt @@ -117,7 +121,7 @@ responses: """ from ansible.module_utils.netcfg import NetworkConfig, dumps from ansible.module_utils.network import NetworkModule -import ansible.module_utils.dnos9 +import ansible.module_utils.dellos9 def get_config(module):