mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Remove deprecated options from modules (#50246)
* Remove deprecated options from modules * Update tests * Add porting guide notes
This commit is contained in:
@@ -103,17 +103,6 @@ options:
|
||||
configuration action.
|
||||
default: "@"
|
||||
version_added: "2.3"
|
||||
force:
|
||||
description:
|
||||
- The force argument instructs the module to not consider the
|
||||
current devices 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.
|
||||
- Note this argument should be considered deprecated. To achieve
|
||||
the equivalent, set the C(match=none) which is idempotent. This argument
|
||||
will be removed in Ansible 2.6.
|
||||
type: bool
|
||||
default: 'no'
|
||||
backup:
|
||||
description:
|
||||
- This argument will cause the module to create a full backup of
|
||||
@@ -145,16 +134,6 @@ options:
|
||||
type: bool
|
||||
default: 'no'
|
||||
version_added: "2.2"
|
||||
save:
|
||||
description:
|
||||
- The C(save) argument instructs the module to save the running-
|
||||
config to the startup-config at the conclusion of the module
|
||||
running. If check mode is specified, this argument is ignored.
|
||||
- This option is deprecated as of Ansible 2.4 and will be removed
|
||||
in Ansible 2.8, use C(save_when) instead.
|
||||
type: bool
|
||||
default: 'no'
|
||||
version_added: "2.2"
|
||||
save_when:
|
||||
description:
|
||||
- When changes are made to the device running-configuration, the
|
||||
@@ -394,19 +373,12 @@ def main():
|
||||
|
||||
diff_against=dict(choices=['startup', 'intended', 'running']),
|
||||
diff_ignore_lines=dict(type='list'),
|
||||
|
||||
# save is deprecated as of ans2.4, use save_when instead
|
||||
save=dict(default=False, type='bool', removed_in_version='2.8'),
|
||||
|
||||
# force argument deprecated in ans2.2
|
||||
force=dict(default=False, type='bool', removed_in_version='2.6')
|
||||
)
|
||||
|
||||
argument_spec.update(ios_argument_spec)
|
||||
|
||||
mutually_exclusive = [('lines', 'src'),
|
||||
('parents', 'src'),
|
||||
('save', 'save_when')]
|
||||
('parents', 'src')]
|
||||
|
||||
required_if = [('match', 'strict', ['lines']),
|
||||
('match', 'exact', ['lines']),
|
||||
@@ -478,7 +450,7 @@ def main():
|
||||
running_config = module.params['running_config']
|
||||
startup_config = None
|
||||
|
||||
if module.params['save_when'] == 'always' or module.params['save']:
|
||||
if module.params['save_when'] == 'always':
|
||||
save_config(module, result)
|
||||
elif module.params['save_when'] == 'modified':
|
||||
output = run_commands(module, ['show running-config', 'show startup-config'])
|
||||
|
||||
Reference in New Issue
Block a user