From a727930f075d1f9c2b493766da9afd6a7f6fd192 Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Tue, 16 Jan 2018 18:23:58 +0530 Subject: [PATCH] Remove deprecated params from module argspec nxos modules (#34911) * Remove deprecated param from module argspec nxos modules Signed-off-by: Trishna Guha * fix nxos_vrrp syntaxerror * Add choices for version _nxos_ip_interface * remove check_args function * remove include_defaults --- .../network/nxos/_nxos_ip_interface.py | 16 ++--- .../modules/network/nxos/_nxos_portchannel.py | 8 --- lib/ansible/modules/network/nxos/nxos_acl.py | 14 +--- lib/ansible/modules/network/nxos/nxos_bgp.py | 4 ++ .../modules/network/nxos/nxos_bgp_neighbor.py | 3 +- .../modules/network/nxos/nxos_config.py | 2 +- .../modules/network/nxos/nxos_evpn_global.py | 12 ---- .../modules/network/nxos/nxos_evpn_vni.py | 10 +-- .../modules/network/nxos/nxos_feature.py | 14 +--- .../nxos/nxos_gir_profile_management.py | 27 +------- lib/ansible/modules/network/nxos/nxos_hsrp.py | 4 ++ lib/ansible/modules/network/nxos/nxos_igmp.py | 15 +--- .../network/nxos/nxos_igmp_interface.py | 14 +--- .../modules/network/nxos/nxos_interface.py | 5 ++ .../network/nxos/nxos_interface_ospf.py | 10 +-- .../modules/network/nxos/nxos_linkagg.py | 4 ++ .../modules/network/nxos/nxos_logging.py | 3 +- .../modules/network/nxos/nxos_nxapi.py | 10 --- lib/ansible/modules/network/nxos/nxos_ospf.py | 10 +-- .../modules/network/nxos/nxos_ospf_vrf.py | 13 ++-- .../network/nxos/nxos_pim_interface.py | 3 + .../network/nxos/nxos_pim_rp_address.py | 6 ++ .../modules/network/nxos/nxos_reboot.py | 14 ++-- .../modules/network/nxos/nxos_rollback.py | 10 +-- .../modules/network/nxos/nxos_snmp_host.py | 8 ++- .../modules/network/nxos/nxos_system.py | 1 - lib/ansible/modules/network/nxos/nxos_vlan.py | 9 +++ lib/ansible/modules/network/nxos/nxos_vrf.py | 5 ++ .../modules/network/nxos/nxos_vrf_af.py | 2 - lib/ansible/modules/network/nxos/nxos_vrrp.py | 15 ++-- .../common/set_lookup_source.yaml-not-on-nxos | 68 ------------------- 31 files changed, 85 insertions(+), 254 deletions(-) delete mode 100644 test/integration/targets/nxos_system/tests/common/set_lookup_source.yaml-not-on-nxos diff --git a/lib/ansible/modules/network/nxos/_nxos_ip_interface.py b/lib/ansible/modules/network/nxos/_nxos_ip_interface.py index d900c53b42..1d9d9f496a 100644 --- a/lib/ansible/modules/network/nxos/_nxos_ip_interface.py +++ b/lib/ansible/modules/network/nxos/_nxos_ip_interface.py @@ -50,6 +50,12 @@ options: - IPv4 or IPv6 Address. required: false default: null + version: + description: + - Version of IP address. If the IP address is IPV4 version should be v4. + If the IP address is IPV6 version should be v6. + default: v4 + choices: ['v4', 'v6'] mask: description: - Subnet mask for IPv4 or IPv6 Address in decimal format. @@ -73,11 +79,6 @@ options: required: false default: false version_added: "2.4" - include_defaults: - description: - - Specify if the complete running configuration for module operations should be used. - default: true - type: bool state: description: - Specify desired state of the resource. @@ -532,10 +533,7 @@ def main(): state=dict(required=False, default='present', choices=['present', 'absent']), allow_secondary=dict(required=False, default=False, - type='bool'), - include_defaults=dict(default=True), - config=dict(), - save=dict(type='bool', default=False) + type='bool') ) argument_spec.update(nxos_argument_spec) diff --git a/lib/ansible/modules/network/nxos/_nxos_portchannel.py b/lib/ansible/modules/network/nxos/_nxos_portchannel.py index 32c13911bc..1d113f382c 100644 --- a/lib/ansible/modules/network/nxos/_nxos_portchannel.py +++ b/lib/ansible/modules/network/nxos/_nxos_portchannel.py @@ -68,11 +68,6 @@ options: required: false choices: ['true', 'false'] default: false - include_defaults: - description: - - Specify if the complete running configuration for module operations should be used. - default: false - type: bool state: description: - Manage the state of the resource. @@ -444,9 +439,6 @@ def main(): members=dict(required=False, default=None, type='list'), force=dict(required=False, default='false', type='str', choices=['true', 'false']), state=dict(required=False, choices=['absent', 'present'], default='present'), - include_defaults=dict(default=False), - config=dict(), - save=dict(type='bool', default=False) ) argument_spec.update(nxos_argument_spec) diff --git a/lib/ansible/modules/network/nxos/nxos_acl.py b/lib/ansible/modules/network/nxos/nxos_acl.py index 6cf9d7a438..865f48a9b8 100644 --- a/lib/ansible/modules/network/nxos/nxos_acl.py +++ b/lib/ansible/modules/network/nxos/nxos_acl.py @@ -192,11 +192,6 @@ options: choices: ['af11', 'af12', 'af13', 'af21', 'af22', 'af23','af31','af32', 'af33', 'af41', 'af42', 'af43', 'cs1', 'cs2', 'cs3', 'cs4', 'cs5', 'cs6', 'cs7', 'default', 'ef'] - include_defaults: - description: - - Specify if the complete running configuration for module operations should be used. - default: false - type: bool state: description: - Specify desired state of the resource. @@ -433,14 +428,7 @@ def main(): 'cs1', 'cs2', 'cs3', 'cs4', 'cs5', 'cs6', 'cs7', 'default', 'ef']), - state=dict(choices=['absent', 'present', 'delete_acl'], default='present'), - protocol=dict(choices=['http', 'https'], default='http'), - host=dict(required=True), - username=dict(type='str'), - password=dict(no_log=True, type='str'), - include_defaults=dict(default=False), - config=dict(), - save=dict(type='bool', default=False) + state=dict(choices=['absent', 'present', 'delete_acl'], default='present') ) argument_spec.update(nxos_argument_spec) diff --git a/lib/ansible/modules/network/nxos/nxos_bgp.py b/lib/ansible/modules/network/nxos/nxos_bgp.py index a13526847a..1f5f9fdbd8 100644 --- a/lib/ansible/modules/network/nxos/nxos_bgp.py +++ b/lib/ansible/modules/network/nxos/nxos_bgp.py @@ -71,6 +71,10 @@ options: required: false choices: ['true','false'] default: null + bestpath_compare_neighborid: + description: + - Enable/Disable neighborid. Use this when more paths available than max path config. + choices: ['true', 'false'] bestpath_cost_community_ignore: description: - Enable/Disable Ignores the cost community for BGP best-path diff --git a/lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py b/lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py index 1b0f8c34f1..310734232d 100644 --- a/lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py +++ b/lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py @@ -446,8 +446,7 @@ def main(): timers_holdtime=dict(required=False, type='str'), transport_passive_only=dict(required=False, type='bool'), update_source=dict(required=False, type='str'), - m_facts=dict(required=False, default=False, type='bool'), - state=dict(choices=['present', 'absent'], default='present', required=False), + state=dict(choices=['present', 'absent'], default='present', required=False) ) argument_spec.update(nxos_argument_spec) diff --git a/lib/ansible/modules/network/nxos/nxos_config.py b/lib/ansible/modules/network/nxos/nxos_config.py index 54d531f908..02374043ca 100644 --- a/lib/ansible/modules/network/nxos/nxos_config.py +++ b/lib/ansible/modules/network/nxos/nxos_config.py @@ -44,6 +44,7 @@ options: device config parser. required: false default: null + aliases: ['commands'] parents: description: - The ordered set of parents that uniquely identify the section @@ -287,7 +288,6 @@ backup_path: sample: /playbooks/ansible/backup/nxos_config.2016-07-16@22:28:34 """ -import os from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.network.common.config import NetworkConfig, dumps diff --git a/lib/ansible/modules/network/nxos/nxos_evpn_global.py b/lib/ansible/modules/network/nxos/nxos_evpn_global.py index e4d7d6329c..3e42648352 100644 --- a/lib/ansible/modules/network/nxos/nxos_evpn_global.py +++ b/lib/ansible/modules/network/nxos/nxos_evpn_global.py @@ -57,20 +57,9 @@ from ansible.module_utils.network.nxos.nxos import get_config, load_config from ansible.module_utils.network.nxos.nxos import get_capabilities, nxos_argument_spec -def check_args(module, warnings): - for key in ('include_defaults', 'config', 'save'): - if module.params[key] is not None: - warnings.append('argument %s is no longer supported, ignoring value' % key) - - def main(): argument_spec = dict( nv_overlay_evpn=dict(required=True, type='bool'), - - # deprecated in Ans2.3 - include_defaults=dict(), - config=dict(), - save=dict() ) argument_spec.update(nxos_argument_spec) @@ -80,7 +69,6 @@ def main(): result = {'changed': False} warnings = list() - check_args(module, warnings) if warnings: result['warnings'] = warnings diff --git a/lib/ansible/modules/network/nxos/nxos_evpn_vni.py b/lib/ansible/modules/network/nxos/nxos_evpn_vni.py index 90b9bfabac..5337cb0317 100644 --- a/lib/ansible/modules/network/nxos/nxos_evpn_vni.py +++ b/lib/ansible/modules/network/nxos/nxos_evpn_vni.py @@ -74,11 +74,6 @@ options: - Sets the route-target 'import' extended communities. required: false default: null - include_defaults: - description: - - Specify if the complete running configuration for module operations should be used. - default: true - type: bool state: description: - Determines whether the config should be present or not @@ -243,10 +238,7 @@ def main(): route_target_both=dict(required=False, type='list'), route_target_import=dict(required=False, type='list'), route_target_export=dict(required=False, type='list'), - state=dict(choices=['present', 'absent'], default='present', required=False), - include_defaults=dict(default=True), - config=dict(), - save=dict(type='bool', default=False) + state=dict(choices=['present', 'absent'], default='present', required=False) ) argument_spec.update(nxos_argument_spec) diff --git a/lib/ansible/modules/network/nxos/nxos_feature.py b/lib/ansible/modules/network/nxos/nxos_feature.py index 09b46ecf7d..6c3cc6fa0b 100644 --- a/lib/ansible/modules/network/nxos/nxos_feature.py +++ b/lib/ansible/modules/network/nxos/nxos_feature.py @@ -76,12 +76,6 @@ from ansible.module_utils.network.nxos.nxos import load_config, run_commands from ansible.module_utils.network.nxos.nxos import get_capabilities, nxos_argument_spec -def check_args(module, warnings): - for key in ('include_defaults', 'config', 'save'): - if module.params[key] is not None: - warnings.append('argument %s is no longer supported, ignoring value' % key) - - def get_available_features(feature, module): available_features = {} feature_regex = r'(?P\S+)\s+\d+\s+(?P.*)' @@ -213,12 +207,7 @@ def validate_feature(module, mode='show'): def main(): argument_spec = dict( feature=dict(type='str', required=True), - state=dict(choices=['enabled', 'disabled'], default='enabled'), - - # deprecated in Ans2.3 - include_defaults=dict(), - config=dict(), - save=dict() + state=dict(choices=['enabled', 'disabled'], default='enabled') ) argument_spec.update(nxos_argument_spec) @@ -226,7 +215,6 @@ def main(): module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True) warnings = list() - check_args(module, warnings) results = dict(changed=False, warnings=warnings) feature = validate_feature(module) diff --git a/lib/ansible/modules/network/nxos/nxos_gir_profile_management.py b/lib/ansible/modules/network/nxos/nxos_gir_profile_management.py index d5d02fb764..edaf00eafa 100644 --- a/lib/ansible/modules/network/nxos/nxos_gir_profile_management.py +++ b/lib/ansible/modules/network/nxos/nxos_gir_profile_management.py @@ -53,18 +53,6 @@ options: required: false default: present choices: ['present','absent'] - include_defaults: - description: - - Specify to retrieve or not the complete running configuration - for module operations. - required: false - default: false - choices: ['true','false'] - config: - description: - - Specify the configuration string to be used for module operations. - required: false - default: null ''' EXAMPLES = ''' @@ -74,16 +62,11 @@ EXAMPLES = ''' commands: - router eigrp 11 - isolate - host: "{{ inventory_hostname }}" - username: "{{ un }}" - password: "{{ pwd }}" + # Remove the maintenance-mode profile - nxos_gir_profile_management: mode: maintenance state: absent - host: "{{ inventory_hostname }}" - username: "{{ un }}" - password: "{{ pwd }}" ''' RETURN = ''' @@ -120,7 +103,7 @@ changed: import re from ansible.module_utils.network.nxos.nxos import get_config, load_config, run_commands -from ansible.module_utils.network.nxos.nxos import nxos_argument_spec, check_args +from ansible.module_utils.network.nxos.nxos import nxos_argument_spec from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.network.common.config import CustomNetworkConfig @@ -175,10 +158,7 @@ def main(): argument_spec = dict( commands=dict(required=False, type='list'), mode=dict(required=True, choices=['maintenance', 'normal']), - state=dict(choices=['absent', 'present'], - default='present'), - include_defaults=dict(default=False), - config=dict() + state=dict(choices=['absent', 'present'], default='present') ) argument_spec.update(nxos_argument_spec) @@ -187,7 +167,6 @@ def main(): supports_check_mode=True) warnings = list() - check_args(module, warnings) state = module.params['state'] commands = module.params['commands'] or [] diff --git a/lib/ansible/modules/network/nxos/nxos_hsrp.py b/lib/ansible/modules/network/nxos/nxos_hsrp.py index 64ae967539..0faba42ffb 100644 --- a/lib/ansible/modules/network/nxos/nxos_hsrp.py +++ b/lib/ansible/modules/network/nxos/nxos_hsrp.py @@ -61,6 +61,10 @@ options: - HSRP priority. required: false default: null + preempt: + description: + - Enable/Disable preempt. + choices: ['enabled', 'disabled'] vip: description: - HSRP virtual IP address. diff --git a/lib/ansible/modules/network/nxos/nxos_igmp.py b/lib/ansible/modules/network/nxos/nxos_igmp.py index c62cc33a3c..a1a023c155 100644 --- a/lib/ansible/modules/network/nxos/nxos_igmp.py +++ b/lib/ansible/modules/network/nxos/nxos_igmp.py @@ -59,11 +59,6 @@ options: required: false default: null choices: ['true', 'false'] - include_defaults: - description: - - Specify if the complete running configuration for module operations should be used. - default: false - type: bool state: description: - Manages desired state of the resource. @@ -75,18 +70,15 @@ EXAMPLES = ''' - name: Default igmp global params (all params except restart) nxos_igmp: state: default - host: "{{ inventory_hostname }}" - name: Ensure the following igmp global config exists on the device nxos_igmp: flush_routes: true enforce_rtr_alert: true - host: "{{ inventory_hostname }}" - name: Restart the igmp process nxos_igmp: restart: true - host: "{{ inventory_hostname }}" ''' RETURN = ''' @@ -121,12 +113,7 @@ def main(): flush_routes=dict(type='bool'), enforce_rtr_alert=dict(type='bool'), restart=dict(type='bool', default=False), - - state=dict(choices=['present', 'default'], default='present'), - - include_defaults=dict(default=False), - config=dict(), - save=dict(type='bool', default=False) + state=dict(choices=['present', 'default'], default='present') ) argument_spec.update(nxos_argument_spec) diff --git a/lib/ansible/modules/network/nxos/nxos_igmp_interface.py b/lib/ansible/modules/network/nxos/nxos_igmp_interface.py index 489a229c1e..163f5a638e 100644 --- a/lib/ansible/modules/network/nxos/nxos_igmp_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_igmp_interface.py @@ -159,11 +159,6 @@ options: required: false choices: ['true', 'false'] default: null - include_defaults: - description: - - Specify if the complete running configuration for module operations should be used. - default: true - type: bool state: description: - Manages desired state of the resource. @@ -176,11 +171,7 @@ EXAMPLES = ''' interface: ethernet1/32 startup_query_interval: 30 state: present - username: "{{ un }}" - password: "{{ pwd }}" - host: "{{ inventory_hostname }}" ''' - RETURN = ''' proposed: description: k/v pairs of parameters passed into module @@ -539,10 +530,7 @@ def main(): oif_source=dict(required=False, type='str'), restart=dict(type='bool', default=False), state=dict(choices=['present', 'absent', 'default'], - default='present'), - include_defaults=dict(default=True), - config=dict(), - save=dict(type='bool', default=False) + default='present') ) argument_spec.update(nxos_argument_spec) diff --git a/lib/ansible/modules/network/nxos/nxos_interface.py b/lib/ansible/modules/network/nxos/nxos_interface.py index 6093447df8..8570821ca1 100644 --- a/lib/ansible/modules/network/nxos/nxos_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_interface.py @@ -129,6 +129,11 @@ options: required: true default: present choices: ['present','absent','default'] + delay: + description: + - Time in seconds to wait before checking for the operational state on remote + device. This wait is applicable for operational state arguments. + default: 10 """ EXAMPLES = """ diff --git a/lib/ansible/modules/network/nxos/nxos_interface_ospf.py b/lib/ansible/modules/network/nxos/nxos_interface_ospf.py index 0468daf773..8de0fbac67 100644 --- a/lib/ansible/modules/network/nxos/nxos_interface_ospf.py +++ b/lib/ansible/modules/network/nxos/nxos_interface_ospf.py @@ -111,11 +111,6 @@ options: - Specifies the message_digest password. Valid value is a string. required: false default: null - include_defaults: - description: - - Specify if the complete running configuration for module operations should be used. - default: true - type: bool state: description: - Determines whether the config should be present or not @@ -386,10 +381,7 @@ def main(): message_digest_algorithm_type=dict(required=False, type='str', choices=['md5']), message_digest_encryption_type=dict(required=False, type='str', choices=['cisco_type_7', '3des']), message_digest_password=dict(required=False, type='str', no_log=True), - state=dict(choices=['present', 'absent'], default='present', required=False), - include_defaults=dict(default=True), - config=dict(), - save=dict(type='bool', default=False) + state=dict(choices=['present', 'absent'], default='present', required=False) ) argument_spec.update(nxos_argument_spec) diff --git a/lib/ansible/modules/network/nxos/nxos_linkagg.py b/lib/ansible/modules/network/nxos/nxos_linkagg.py index 4e77592594..a5814ca906 100644 --- a/lib/ansible/modules/network/nxos/nxos_linkagg.py +++ b/lib/ansible/modules/network/nxos/nxos_linkagg.py @@ -68,6 +68,10 @@ options: required: false default: present choices: ['present','absent'] + purge: + description: + - Purge links not defined in the I(aggregate) parameter. + default: no """ EXAMPLES = """ diff --git a/lib/ansible/modules/network/nxos/nxos_logging.py b/lib/ansible/modules/network/nxos/nxos_logging.py index c198b21dbc..6117b9386c 100644 --- a/lib/ansible/modules/network/nxos/nxos_logging.py +++ b/lib/ansible/modules/network/nxos/nxos_logging.py @@ -45,7 +45,8 @@ options: - Facility name for logging. dest_level: description: - - Set logging severity levels. C(alias level). + - Set logging severity levels. + aliases: ['level'] facility_level: description: - Set logging serverity levels for facility based log messages. diff --git a/lib/ansible/modules/network/nxos/nxos_nxapi.py b/lib/ansible/modules/network/nxos/nxos_nxapi.py index 502ba94653..63935e144c 100644 --- a/lib/ansible/modules/network/nxos/nxos_nxapi.py +++ b/lib/ansible/modules/network/nxos/nxos_nxapi.py @@ -153,10 +153,6 @@ def check_args(module, warnings): warnings.append('state=stopped is deprecated and will be removed in a ' 'a future release. Please use state=absent instead') - for key in ['config']: - if module.params[key]: - warnings.append('argument %s is deprecated and will be ignored' % key) - for key in ['http_port', 'https_port']: if module.params[key] is not None: if not 1 <= module.params[key] <= 65535: @@ -271,15 +267,9 @@ def main(): argument_spec = dict( http=dict(aliases=['enable_http'], type='bool'), http_port=dict(type='int'), - https=dict(aliases=['enable_https'], type='bool'), https_port=dict(type='int'), - sandbox=dict(aliases=['enable_sandbox'], type='bool'), - - # deprecated (Ansible 2.3) arguments - config=dict(), - state=dict(default='present', choices=['started', 'stopped', 'present', 'absent']) ) diff --git a/lib/ansible/modules/network/nxos/nxos_ospf.py b/lib/ansible/modules/network/nxos/nxos_ospf.py index c9cb7f50ce..409c6c1782 100644 --- a/lib/ansible/modules/network/nxos/nxos_ospf.py +++ b/lib/ansible/modules/network/nxos/nxos_ospf.py @@ -41,11 +41,6 @@ options: required: false default: present choices: ['present','absent'] - include_defaults: - description: - - Specify if the complete running configuration for module operations should be used. - default: true - type: bool ''' EXAMPLES = ''' @@ -116,10 +111,7 @@ def state_absent(module, proposed, candidate): def main(): argument_spec = dict( ospf=dict(required=True, type='str'), - state=dict(choices=['present', 'absent'], default='present', required=False), - include_defaults=dict(default=True), - config=dict(), - save=dict(type='bool', default=False) + state=dict(choices=['present', 'absent'], default='present', required=False) ) argument_spec.update(nxos_argument_spec) diff --git a/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py b/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py index 929b513a70..ca4380e4d9 100644 --- a/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py +++ b/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py @@ -120,11 +120,11 @@ options: required: false choices: ['true','false'] default: null - include_defaults: + state: description: - - Specify if the complete running configuration for module operations should be used. - default: true - type: bool + - State of ospf vrf configuration. + default: present + choices: ['present', 'absent'] ''' EXAMPLES = ''' @@ -361,10 +361,7 @@ def main(): timer_throttle_spf_max=dict(required=False, type='str'), auto_cost=dict(required=False, type='str'), passive_interface=dict(required=False, type='bool'), - state=dict(choices=['present', 'absent'], default='present', required=False), - include_defaults=dict(default=True), - config=dict(), - save=dict(type='bool', default=False) + state=dict(choices=['present', 'absent'], default='present', required=False) ) argument_spec.update(nxos_argument_spec) diff --git a/lib/ansible/modules/network/nxos/nxos_pim_interface.py b/lib/ansible/modules/network/nxos/nxos_pim_interface.py index 6b05860278..9f00e21756 100644 --- a/lib/ansible/modules/network/nxos/nxos_pim_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_pim_interface.py @@ -54,6 +54,9 @@ options: required: false default: true choices: ['true', 'false'] + dr_prio: + description: + - Configures priority for PIM DR election on interface. hello_auth_key: description: - Authentication for hellos on this interface. diff --git a/lib/ansible/modules/network/nxos/nxos_pim_rp_address.py b/lib/ansible/modules/network/nxos/nxos_pim_rp_address.py index 4a13e5bba7..b03a95ac82 100644 --- a/lib/ansible/modules/network/nxos/nxos_pim_rp_address.py +++ b/lib/ansible/modules/network/nxos/nxos_pim_rp_address.py @@ -64,6 +64,12 @@ options: required: false choices: ['true','false'] default: null + state: + description: + - Specify desired state of the resource. + required: true + default: present + choices: ['present','absent','default'] ''' EXAMPLES = ''' - nxos_pim_rp_address: diff --git a/lib/ansible/modules/network/nxos/nxos_reboot.py b/lib/ansible/modules/network/nxos/nxos_reboot.py index 4e4e74c55e..cd79147fb7 100644 --- a/lib/ansible/modules/network/nxos/nxos_reboot.py +++ b/lib/ansible/modules/network/nxos/nxos_reboot.py @@ -47,9 +47,6 @@ options: EXAMPLES = ''' - nxos_reboot: confirm: true - host: "{{ inventory_hostname }}" - username: "{{ username }}" - password: "{{ password }}" ''' RETURN = ''' @@ -74,7 +71,9 @@ def reboot(module): def main(): - argument_spec = {} + argument_spec = dict( + confirm=dict(default=False, type='bool') + ) argument_spec.update(nxos_argument_spec) module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True) @@ -83,9 +82,10 @@ def main(): check_args(module, warnings) results = dict(changed=False, warnings=warnings) - if not module.check_mode: - reboot(module) - results['changed'] = True + if module.params['confirm']: + if not module.check_mode: + reboot(module) + results['changed'] = True module.exit_json(**results) diff --git a/lib/ansible/modules/network/nxos/nxos_rollback.py b/lib/ansible/modules/network/nxos/nxos_rollback.py index e8757a4e0b..8dffca82f0 100644 --- a/lib/ansible/modules/network/nxos/nxos_rollback.py +++ b/lib/ansible/modules/network/nxos/nxos_rollback.py @@ -50,11 +50,6 @@ options: with checkpoint_file. required: false default: null - include_defaults: - description: - - Specify if the complete running configuration for module operations should be used. - default: false - type: bool ''' EXAMPLES = ''' @@ -109,10 +104,7 @@ def rollback(filename, module): def main(): argument_spec = dict( checkpoint_file=dict(required=False), - rollback_to=dict(required=False), - include_defaults=dict(default=True), - config=dict(), - save=dict(type='bool', default=False) + rollback_to=dict(required=False) ) argument_spec.update(nxos_argument_spec) diff --git a/lib/ansible/modules/network/nxos/nxos_snmp_host.py b/lib/ansible/modules/network/nxos/nxos_snmp_host.py index 36b6a0590f..df2f4bf40f 100644 --- a/lib/ansible/modules/network/nxos/nxos_snmp_host.py +++ b/lib/ansible/modules/network/nxos/nxos_snmp_host.py @@ -46,6 +46,10 @@ options: required: false default: v2c choices: ['v2c', 'v3'] + v3: + description: + - Use this when verion is v3. SNMPv3 Security level. + choices: ['noauth', 'auth', 'priv'] community: description: - Community string or v3 username. @@ -56,11 +60,11 @@ options: - UDP port number (0-65535). required: false default: null - type: + snmp_type: description: - type of message to send to host. required: false - default: traps + default: trap choices: ['trap', 'inform'] vrf: description: diff --git a/lib/ansible/modules/network/nxos/nxos_system.py b/lib/ansible/modules/network/nxos/nxos_system.py index ac236ee355..c41760b7e8 100644 --- a/lib/ansible/modules/network/nxos/nxos_system.py +++ b/lib/ansible/modules/network/nxos/nxos_system.py @@ -347,7 +347,6 @@ def main(): name_servers=dict(type='list'), system_mtu=dict(type='int'), - lookup_source=dict(), state=dict(default='present', choices=['present', 'absent']) ) diff --git a/lib/ansible/modules/network/nxos/nxos_vlan.py b/lib/ansible/modules/network/nxos/nxos_vlan.py index db3511ecc5..7ce2f097e6 100644 --- a/lib/ansible/modules/network/nxos/nxos_vlan.py +++ b/lib/ansible/modules/network/nxos/nxos_vlan.py @@ -88,6 +88,15 @@ options: aggregate: description: List of VLANs definitions. version_added: "2.5" + purge: + description: + - Purge VLANs not defined in the I(aggregate) parameter. + default: no + delay: + description: + - Time in seconds to wait before checking for the operational state on remote + device. This wait is applicable for operational state arguments. + default: 10 ''' EXAMPLES = ''' diff --git a/lib/ansible/modules/network/nxos/nxos_vrf.py b/lib/ansible/modules/network/nxos/nxos_vrf.py index 7eb8ced417..291819453b 100644 --- a/lib/ansible/modules/network/nxos/nxos_vrf.py +++ b/lib/ansible/modules/network/nxos/nxos_vrf.py @@ -95,6 +95,11 @@ options: - Description of the VRF. required: false default: null + delay: + description: + - Time in seconds to wait before checking for the operational state on remote + device. This wait is applicable for operational state arguments. + default: 10 ''' EXAMPLES = ''' diff --git a/lib/ansible/modules/network/nxos/nxos_vrf_af.py b/lib/ansible/modules/network/nxos/nxos_vrf_af.py index b70602cce9..281674ea17 100644 --- a/lib/ansible/modules/network/nxos/nxos_vrf_af.py +++ b/lib/ansible/modules/network/nxos/nxos_vrf_af.py @@ -93,8 +93,6 @@ def main(): afi=dict(required=True, choices=['ipv4', 'ipv6']), route_target_both_auto_evpn=dict(required=False, type='bool'), state=dict(choices=['present', 'absent'], default='present'), - - m_facts=dict(default=False, type='bool', removed_in_version="2.4"), safi=dict(choices=['unicast', 'multicast'], removed_in_version="2.4"), ) diff --git a/lib/ansible/modules/network/nxos/nxos_vrrp.py b/lib/ansible/modules/network/nxos/nxos_vrrp.py index 3c1d58239c..18ff5a2637 100644 --- a/lib/ansible/modules/network/nxos/nxos_vrrp.py +++ b/lib/ansible/modules/network/nxos/nxos_vrrp.py @@ -54,6 +54,10 @@ options: - VRRP priority. required: false default: null + preempt: + description: + - Enable/Disable preempt. + choices: ['True', 'False'] vip: description: - VRRP virtual IP address. @@ -70,12 +74,6 @@ options: required: false choices: ['shutdown', 'no shutdown'] default: no shutdown - version_added: "2.2" - include_defaults: - description: - - Specify if the complete running configuration for module operations should be used. - default: false - type: bool state: description: - Specify desired state of the resource. @@ -338,10 +336,7 @@ def main(): choices=['shutdown', 'no shutdown'], default='no shutdown'), authentication=dict(required=False, type='str'), - state=dict(choices=['absent', 'present'], required=False, default='present'), - include_defaults=dict(default=False), - config=dict(), - save=dict(type='bool', default=False) + state=dict(choices=['absent', 'present'], required=False, default='present') ) argument_spec.update(nxos_argument_spec) diff --git a/test/integration/targets/nxos_system/tests/common/set_lookup_source.yaml-not-on-nxos b/test/integration/targets/nxos_system/tests/common/set_lookup_source.yaml-not-on-nxos deleted file mode 100644 index 087209245d..0000000000 --- a/test/integration/targets/nxos_system/tests/common/set_lookup_source.yaml-not-on-nxos +++ /dev/null @@ -1,68 +0,0 @@ ---- -- debug: msg="START {{ connection.transport }}/set_lookup_source.yaml" - -- name: setup - nxos_config: - lines: - - no ip domain lookup source-interface - - vrf definition ansible - match: none - provider: "{{ connection }}" - -- name: configure lookup_source - nxos_system: - lookup_source: Management1 - provider: "{{ connection }}" - register: result - -- assert: - that: - - result.changed == true - - "'ip domain lookup source-interface Management1' in result.commands" - -- name: verify lookup_source - nxos_system: - lookup_source: Management1 - provider: "{{ connection }}" - register: result - -- assert: - that: - - result.changed == false - -- name: change to vrf - nxos_system: - lookup_source: - - interface: Management1 - vrf: ansible - provider: "{{ connection }}" - register: result - -- assert: - that: - - result.changed == true - - "'no ip domain lookup source-interface Management1' in result.commands" - - "'ip domain lookup vrf ansible source-interface Management1' in result.commands" - - result.commands|length == 2 - -- name: verify change to vrf - nxos_system: - lookup_source: - - interface: Management1 - vrf: ansible - provider: "{{ connection }}" - register: result - -- assert: - that: - - result.changed == false - -- name: teardown - nxos_config: - lines: - - no ip domain lookup source-interface - - no vrf definition ansible - match: none - provider: "{{ connection }}" - -- debug: msg="END {{ connection.transport }}/set_lookup_source.yaml"