2.8 Core Deprecation Removal (#45232)
* Remove deprecated ansible.vars.unsafe_proxy. Fixes #45040 * Remove deprecated validate_md5 alias from fetch module. Fixes #45039 * Remove deprecated private arg from import/include_role. Fixes #45038 * All include deprecations bumped to 2.12. Fixes #45037 * Add changelog for deprecated removals
This commit is contained in:
parent
99aafcc8ca
commit
0015d4cef3
10 changed files with 8 additions and 69 deletions
4
changelogs/fragments/2.8-core-deprecations.yaml
Normal file
4
changelogs/fragments/2.8-core-deprecations.yaml
Normal file
|
@ -0,0 +1,4 @@
|
|||
minor_changes:
|
||||
- ansible.vars.unsafe_proxy - Removed deprecated file (https://github.com/ansible/ansible/issues/45040)
|
||||
- fetch - Removed deprecated validate_md5 alias (https://github.com/ansible/ansible/issues/45039)
|
||||
- include_role/import_role - Removed deprecated private argument (https://github.com/ansible/ansible/issues/45038)
|
|
@ -49,7 +49,6 @@ options:
|
|||
- Verify that the source and destination checksums match after the files are fetched.
|
||||
type: bool
|
||||
default: 'yes'
|
||||
aliases: [ "validate_md5" ]
|
||||
flat:
|
||||
version_added: "1.2"
|
||||
description:
|
||||
|
|
|
@ -48,12 +48,6 @@ options:
|
|||
- Overrides the role's metadata setting to allow using a role more than once with the same parameters.
|
||||
type: bool
|
||||
default: 'yes'
|
||||
private:
|
||||
description:
|
||||
- This option is a no op, and the functionality described in previous versions was not implemented. This
|
||||
option will be removed in Ansible v2.8.
|
||||
type: bool
|
||||
default: 'no'
|
||||
notes:
|
||||
- Handlers are made available to the whole play.
|
||||
- "Since Ansible 2.7: variables defined in C(vars) and C(defaults) for the role are exposed at playbook parsing time.
|
||||
|
|
|
@ -51,10 +51,6 @@ options:
|
|||
- Overrides the role's metadata setting to allow using a role more than once with the same parameters.
|
||||
type: bool
|
||||
default: 'yes'
|
||||
private:
|
||||
description:
|
||||
- This option is a no op, and the functionality described in previous versions was not implemented. This
|
||||
option will be removed in Ansible v2.8.
|
||||
public:
|
||||
description:
|
||||
- This option dictates whether the role's C(vars) and C(defaults) are exposed to the playbook. If set to C(yes)
|
||||
|
|
|
@ -95,7 +95,7 @@ class Playbook:
|
|||
|
||||
if any(action in entry for action in ('import_playbook', 'include')):
|
||||
if 'include' in entry:
|
||||
display.deprecated("'include' for playbook includes. You should use 'import_playbook' instead", version="2.8")
|
||||
display.deprecated("'include' for playbook includes. You should use 'import_playbook' instead", version="2.12")
|
||||
pb = PlaybookInclude.load(entry, basedir=self._basedir, variable_manager=variable_manager, loader=self._loader)
|
||||
if pb is not None:
|
||||
self._entries.extend(pb._entries)
|
||||
|
|
|
@ -46,7 +46,7 @@ class IncludeRole(TaskInclude):
|
|||
|
||||
BASE = ('name', 'role') # directly assigned
|
||||
FROM_ARGS = ('tasks_from', 'vars_from', 'defaults_from') # used to populate from dict in role
|
||||
OTHER_ARGS = ('apply', 'private', 'public', 'allow_duplicates') # assigned to matching property
|
||||
OTHER_ARGS = ('apply', 'public', 'allow_duplicates') # assigned to matching property
|
||||
VALID_ARGS = tuple(frozenset(BASE + FROM_ARGS + OTHER_ARGS)) # all valid args
|
||||
|
||||
# =================================================================================
|
||||
|
@ -54,7 +54,6 @@ class IncludeRole(TaskInclude):
|
|||
|
||||
# private as this is a 'module options' vs a task property
|
||||
_allow_duplicates = FieldAttribute(isa='bool', default=True, private=True)
|
||||
_private = FieldAttribute(isa='bool', default=None, private=True)
|
||||
_public = FieldAttribute(isa='bool', default=False, private=True)
|
||||
|
||||
def __init__(self, block=None, role=None, task_include=None):
|
||||
|
@ -127,13 +126,7 @@ class IncludeRole(TaskInclude):
|
|||
raise AnsibleParserError("'name' is a required field for %s." % ir.action, obj=data)
|
||||
|
||||
if 'public' in ir.args and ir.action != 'include_role':
|
||||
raise AnsibleParserError('Invalid options for %s: private' % ir.action, obj=data)
|
||||
|
||||
if 'private' in ir.args:
|
||||
display.deprecated(
|
||||
msg='Supplying "private" for "%s" is a no op, and is deprecated' % ir.action,
|
||||
version='2.8'
|
||||
)
|
||||
raise AnsibleParserError('Invalid options for %s: public' % ir.action, obj=data)
|
||||
|
||||
# validate bad args, otherwise we silently ignore
|
||||
bad_opts = my_arg_names.difference(IncludeRole.VALID_ARGS)
|
||||
|
|
|
@ -55,9 +55,7 @@ class ActionModule(ActionBase):
|
|||
dest = self._task.args.get('dest', None)
|
||||
flat = boolean(self._task.args.get('flat'), strict=False)
|
||||
fail_on_missing = boolean(self._task.args.get('fail_on_missing', True), strict=False)
|
||||
validate_checksum = boolean(self._task.args.get('validate_checksum',
|
||||
self._task.args.get('validate_md5', True)),
|
||||
strict=False)
|
||||
validate_checksum = boolean(self._task.args.get('validate_checksum', True), strict=False)
|
||||
|
||||
# validate source and dest are strings FIXME: use basic.py and module specs
|
||||
if not isinstance(source, string_types):
|
||||
|
@ -66,13 +64,6 @@ class ActionModule(ActionBase):
|
|||
if not isinstance(dest, string_types):
|
||||
result['msg'] = "Invalid type supplied for dest option, it must be a string"
|
||||
|
||||
# validate_md5 is the deprecated way to specify validate_checksum
|
||||
if 'validate_md5' in self._task.args and 'validate_checksum' in self._task.args:
|
||||
result['msg'] = "validate_checksum and validate_md5 cannot both be specified"
|
||||
|
||||
if 'validate_md5' in self._task.args:
|
||||
display.deprecated('Use validate_checksum instead of validate_md5', version='2.8')
|
||||
|
||||
if source is None or dest is None:
|
||||
result['msg'] = "src and dest are required"
|
||||
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
# (c) 2017, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
# This is backwards compat. unsafe_proxy was moved to avoid circular imports.
|
||||
from ansible.utils.unsafe_proxy import * # pylint: disable=wildcard-import,unused-wildcard-import
|
||||
|
||||
try:
|
||||
from __main__ import display
|
||||
except:
|
||||
from ansible.utils.display import Display
|
||||
display = Display()
|
||||
|
||||
display.deprecated('ansible.vars.unsafe_proxy is deprecated. Use ansible.utils.unsafe_proxy instead.', version='2.8')
|
|
@ -66,11 +66,7 @@
|
|||
name: role3
|
||||
tasks_from: vartest.yml
|
||||
vars_from: role3vars.yml
|
||||
private: no
|
||||
|
||||
# FIXME Setting private: no in previous task does not make the variables
|
||||
# available to the play
|
||||
#
|
||||
- name: Assert that variables defined in previous task are available to play
|
||||
assert:
|
||||
that:
|
||||
|
|
|
@ -69,10 +69,7 @@
|
|||
name: role3
|
||||
tasks_from: vartest.yml
|
||||
vars_from: role3vars.yml
|
||||
private: no
|
||||
|
||||
# FIXME Setting private: no in previous task does not make the variables
|
||||
# available to the play
|
||||
- name: Assert that variables defined in previous task are available to play
|
||||
assert:
|
||||
that:
|
||||
|
|
Loading…
Reference in a new issue