Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated features, bump version to 6.0.0 #5326

Merged
merged 13 commits into from
Oct 25, 2022
Merged
11 changes: 11 additions & 0 deletions changelogs/fragments/deprecation-removals.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
removed_features:
- "mail callback plugin - the ``sender`` option is now required (https://github.com/ansible-collections/community.general/pull/5326)."
- "proxmox inventory plugin - the default of the ``want_proxmox_nodes_ansible_host`` option changed from ``true`` to ``false`` (https://github.com/ansible-collections/community.general/pull/5326)."
- "bitbucket* modules - ``username`` is no longer an alias of ``workspace``, but of ``user`` (https://github.com/ansible-collections/community.general/pull/5326)."
- "keycloak_group - the return value ``group`` has been removed. Use ``end_state`` instead (https://github.com/ansible-collections/community.general/pull/5326)."
- "keycloak_authentication - the return value ``flow`` has been removed. Use ``end_state`` instead (https://github.com/ansible-collections/community.general/pull/5326)."
- "vmadm - the ``debug`` option has been removed. It was not used anyway (https://github.com/ansible-collections/community.general/pull/5326)."
- "lxd_container - the default of the ``ignore_volatile_options`` option changed from ``true`` to ``false`` (https://github.com/ansible-collections/community.general/pull/5326)."
- "gitlab_group_members - ``gitlab_group`` must now always contain the full path, and no longer just the name or path (https://github.com/ansible-collections/community.general/pull/5326)."
- "gem - the default of the ``norc`` option changed from ``false`` to ``true`` (https://github.com/ansible-collections/community.general/pull/5326)."
- "module_helper module utils - remove the ``VarDict`` attribute from ``ModuleHelper``. Import ``VarDict`` from ``ansible_collections.community.general.plugins.module_utils.mh.mixins.vars`` instead (https://github.com/ansible-collections/community.general/pull/5326)."
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace: community
name: general
version: 5.8.0
version: 6.0.0
readme: README.md
authors:
- Ansible (https://github.com/ansible)
Expand Down
7 changes: 2 additions & 5 deletions plugins/callback/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@
sender:
description:
- Mail sender.
- Note that this will be required from community.general 6.0.0 on.
- This is required since community.general 6.0.0.
type: str
required: true
ini:
- section: callback_mail
key: sender
Expand Down Expand Up @@ -105,10 +106,6 @@ def set_options(self, task_keys=None, var_options=None, direct=None):
super(CallbackModule, self).set_options(task_keys=task_keys, var_options=var_options, direct=direct)

self.sender = self.get_option('sender')
if self.sender is None:
self._display.deprecated(
'The sender for the mail callback has not been specified. This will be an error in the future',
version='6.0.0', collection_name='community.general')
self.to = self.get_option('to')
self.smtphost = self.get_option('mta')
self.smtpport = self.get_option('mtaport')
Expand Down
2 changes: 2 additions & 0 deletions plugins/doc_fragments/bitbucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ class ModuleDocFragment(object):
description:
- The username.
- If not set the environment variable C(BITBUCKET_USERNAME) will be used.
- I(username) is an alias of I(user) since community.genreal 6.0.0. It was an alias of I(workspace) before.
type: str
version_added: 4.0.0
aliases: [ username ]
password:
description:
- The App password.
Expand Down
13 changes: 2 additions & 11 deletions plugins/inventory/proxmox.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,9 @@
description:
- Whether to set C(ansbile_host) for proxmox nodes.
- When set to C(true) (default), will use the first available interface. This can be different from what you expect.
- This currently defaults to C(true), but the default is deprecated since community.general 4.8.0.
The default will change to C(false) in community.general 6.0.0. To avoid a deprecation warning, please
set this parameter explicitly.
- The default of this option changed from C(true) to C(false) in community.general 6.0.0.
type: bool
default: false
filters:
version_added: 4.6.0
description: A list of Jinja templates that allow filtering hosts.
Expand Down Expand Up @@ -567,14 +566,6 @@ def _populate(self):
self.inventory.add_group(nodes_group)

want_proxmox_nodes_ansible_host = self.get_option("want_proxmox_nodes_ansible_host")
if want_proxmox_nodes_ansible_host is None:
display.deprecated(
'The want_proxmox_nodes_ansible_host option of the community.general.proxmox inventory plugin'
' currently defaults to `true`, but this default has been deprecated and will change to `false`'
' in community.general 6.0.0. To keep the current behavior and remove this deprecation warning,'
' explicitly set `want_proxmox_nodes_ansible_host` to `true` in your inventory configuration',
version='6.0.0', collection_name='community.general')
want_proxmox_nodes_ansible_host = True

# gather vm's on nodes
self._get_auth()
Expand Down
14 changes: 1 addition & 13 deletions plugins/module_utils/mh/module_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from ansible_collections.community.general.plugins.module_utils.mh.mixins.cmd import CmdMixin
from ansible_collections.community.general.plugins.module_utils.mh.mixins.state import StateMixin
from ansible_collections.community.general.plugins.module_utils.mh.mixins.deps import DependencyMixin
from ansible_collections.community.general.plugins.module_utils.mh.mixins.vars import VarsMixin, VarDict as _VD
from ansible_collections.community.general.plugins.module_utils.mh.mixins.vars import VarsMixin
from ansible_collections.community.general.plugins.module_utils.mh.mixins.deprecate_attrs import DeprecateAttrsMixin


Expand All @@ -25,8 +25,6 @@ class ModuleHelper(DeprecateAttrsMixin, VarsMixin, DependencyMixin, ModuleHelper
change_params = ()
facts_params = ()

VarDict = _VD # for backward compatibility, will be deprecated at some point

def __init__(self, module=None):
super(ModuleHelper, self).__init__(module)
for name, value in self.module.params.items():
Expand All @@ -38,16 +36,6 @@ def __init__(self, module=None):
fact=name in self.facts_params,
)

self._deprecate_attr(
attr="VarDict",
msg="ModuleHelper.VarDict attribute is deprecated, use VarDict from "
"the ansible_collections.community.general.plugins.module_utils.mh.mixins.vars module instead",
version="6.0.0",
collection_name="community.general",
target=ModuleHelper,
module=self.module,
)

def update_output(self, **kwargs):
self.update_vars(meta={"output": True}, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/source_control/bitbucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def bitbucket_argument_spec():
# TODO:
# - Rename user to username once current usage of username is removed
# - Alias user to username and deprecate it
user=dict(type='str', fallback=(env_fallback, ['BITBUCKET_USERNAME'])),
user=dict(type='str', aliases=['username'], fallback=(env_fallback, ['BITBUCKET_USERNAME'])),
password=dict(type='str', no_log=True, fallback=(env_fallback, ['BITBUCKET_PASSWORD'])),
)

Expand Down
15 changes: 3 additions & 12 deletions plugins/modules/cloud/lxd/lxd_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
- If set to C(true), options starting with C(volatile.) are ignored. As a result,
they are reapplied for each execution.
- This default behavior can be changed by setting this option to C(false).
- The current default value C(true) is deprecated since community.general 4.0.0,
and will change to C(false) in community.general 6.0.0.
- The default value changed from C(true) to C(false) in community.general 6.0.0.
type: bool
required: false
default: false
version_added: 3.7.0
profiles:
description:
Expand Down Expand Up @@ -769,6 +769,7 @@ def main():
),
ignore_volatile_options=dict(
type='bool',
default=False,
),
devices=dict(
type='dict',
Expand Down Expand Up @@ -832,16 +833,6 @@ def main():
supports_check_mode=False,
)

if module.params['ignore_volatile_options'] is None:
module.params['ignore_volatile_options'] = True
module.deprecate(
'If the keyword "volatile" is used in a playbook in the config'
'section, a "changed" message will appear with every run, even without a change'
'to the playbook.'
'This will change in the future. Please test your scripts'
'by "ignore_volatile_options: false". To keep the old behavior, set that option explicitly to "true"',
version='6.0.0', collection_name='community.general')

lxd_manage = LXDContainerManagement(module=module)
lxd_manage.run()

Expand Down
3 changes: 1 addition & 2 deletions plugins/modules/cloud/smartos/vmadm.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ def create_payload(module, uuid):
# Create the JSON payload (vmdef) and return the filename.

# Filter out the few options that are not valid VM properties.
module_options = ['debug', 'force', 'state']
module_options = ['force', 'state']
# @TODO make this a simple {} comprehension as soon as py2 is ditched
# @TODO {k: v for k, v in p.items() if k not in module_options}
vmdef = dict([(k, v) for k, v in module.params.items() if k not in module_options and v])
Expand Down Expand Up @@ -689,7 +689,6 @@ def main():
nics=dict(type='list', elements='dict'),
resolvers=dict(type='list', elements='str'),
filesystems=dict(type='list', elements='dict'),
debug=dict(type='bool', removed_in_version='6.0.0', removed_from_collection='community.general'),
)

# Add our 'simple' options to options dict.
Expand Down
36 changes: 0 additions & 36 deletions plugins/modules/identity/keycloak/keycloak_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,39 +173,6 @@
returned: always
type: str

flow:
description:
- JSON representation for the authentication.
- Deprecated return value, it will be removed in community.general 6.0.0. Please use the return value I(end_state) instead.
returned: on success
type: dict
sample: {
"alias": "Copy of first broker login",
"authenticationExecutions": [
{
"alias": "review profile config",
"authenticationConfig": {
"alias": "review profile config",
"config": { "update.profile.on.first.login": "missing" },
"id": "6f09e4fb-aad4-496a-b873-7fa9779df6d7"
},
"configurable": true,
"displayName": "Review Profile",
"id": "8f77dab8-2008-416f-989e-88b09ccf0b4c",
"index": 0,
"level": 0,
"providerId": "idp-review-profile",
"requirement": "REQUIRED",
"requirementChoices": [ "REQUIRED", "ALTERNATIVE", "DISABLED" ]
}
],
"builtIn": false,
"description": "Actions taken after first broker login with identity provider account, which is not yet linked to any Keycloak account",
"id": "bc228863-5887-4297-b898-4d988f8eaa5c",
"providerId": "basic-flow",
"topLevel": true
}

end_state:
description: Representation of the authentication after module execution.
returned: on success
Expand Down Expand Up @@ -407,7 +374,6 @@ def main():
result['diff'] = dict(before='', after='')
result['changed'] = False
result['end_state'] = {}
result['flow'] = result['end_state']
result['msg'] = new_auth_repr["alias"] + ' absent'
module.exit_json(**result)

Expand Down Expand Up @@ -440,7 +406,6 @@ def main():
if exec_repr is not None:
auth_repr["authenticationExecutions"] = exec_repr
result['end_state'] = auth_repr
result['flow'] = result['end_state']

else:
if state == 'present':
Expand Down Expand Up @@ -478,7 +443,6 @@ def main():
if exec_repr is not None:
auth_repr["authenticationExecutions"] = exec_repr
result['end_state'] = auth_repr
result['flow'] = result['end_state']

else:
# Process a deletion (because state was not 'present')
Expand Down
58 changes: 0 additions & 58 deletions plugins/modules/identity/keycloak/keycloak_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,59 +214,6 @@
manage: true
manageMembership: true
view: true

group:
description:
- Representation of the group after module execution.
- Deprecated return value, it will be removed in community.general 6.0.0. Please use the return value I(end_state) instead.
returned: always
type: complex
contains:
id:
description: GUID that identifies the group.
type: str
returned: always
sample: 23f38145-3195-462c-97e7-97041ccea73e
name:
description: Name of the group.
type: str
returned: always
sample: grp-test-123
attributes:
description: Attributes applied to this group.
type: dict
returned: always
sample:
attr1: ["val1", "val2", "val3"]
path:
description: URI path to the group.
type: str
returned: always
sample: /grp-test-123
realmRoles:
description: An array of the realm-level roles granted to this group.
type: list
returned: always
sample: []
subGroups:
description: A list of groups that are children of this group. These groups will have the same parameters as
documented here.
type: list
returned: always
clientRoles:
description: A list of client-level roles granted to this group.
type: list
returned: always
sample: []
access:
description: A dict describing the accesses you have to this group based on the credentials used.
type: dict
returned: always
sample:
manage: true
manageMembership: true
view: true

'''

from ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak import KeycloakAPI, camel, \
Expand Down Expand Up @@ -356,7 +303,6 @@ def main():
result['diff'] = dict(before='', after='')
result['changed'] = False
result['end_state'] = {}
result['group'] = result['end_state']
result['msg'] = 'Group does not exist; doing nothing.'
module.exit_json(**result)

Expand All @@ -377,7 +323,6 @@ def main():
after_group = kc.get_group_by_name(name, realm)

result['end_state'] = after_group
result['group'] = result['end_state']

result['msg'] = 'Group {name} has been created with ID {id}'.format(name=after_group['name'],
id=after_group['id'])
Expand All @@ -391,7 +336,6 @@ def main():
if desired_group == before_group:
result['changed'] = False
result['end_state'] = desired_group
result['group'] = result['end_state']
result['msg'] = "No changes required to group {name}.".format(name=before_group['name'])
module.exit_json(**result)

Expand All @@ -410,7 +354,6 @@ def main():
after_group = kc.get_group_by_groupid(desired_group['id'], realm=realm)

result['end_state'] = after_group
result['group'] = result['end_state']

result['msg'] = "Group {id} has been updated".format(id=after_group['id'])
module.exit_json(**result)
Expand All @@ -430,7 +373,6 @@ def main():
kc.delete_group(groupid=gid, realm=realm)

result['end_state'] = {}
result['group'] = result['end_state']

result['msg'] = "Group {name} has been deleted".format(name=before_group['name'])

Expand Down
13 changes: 3 additions & 10 deletions plugins/modules/packaging/language/gem.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@
version_added: 3.3.0
norc:
type: bool
default: true
description:
- Avoid loading any C(.gemrc) file. Ignored for RubyGems prior to 2.5.2.
- The current default value C(false) has been deprecated in community.general 5.0.0.
Explicitly specify the value to prevent the deprecation warning to be shown."
- From community.general 6.0.0 on, the default will be changed to C(true).
- The default changed from C(false) to C(true) in community.general 6.0.0.
version_added: 3.3.0
env_shebang:
description:
Expand Down Expand Up @@ -298,7 +297,7 @@ def main():
user_install=dict(required=False, default=True, type='bool'),
install_dir=dict(required=False, type='path'),
bindir=dict(type='path'),
norc=dict(type='bool'),
norc=dict(type='bool', default=True),
pre_release=dict(required=False, default=False, type='bool'),
include_doc=dict(required=False, default=False, type='bool'),
env_shebang=dict(required=False, default=False, type='bool'),
Expand All @@ -316,12 +315,6 @@ def main():
module.fail_json(msg="Cannot maintain state=latest when installing from local source")
if module.params['user_install'] and module.params['install_dir']:
module.fail_json(msg="install_dir requires user_install=false")
if module.params['norc'] is None:
module.deprecate(
'The default of the norc option has been deprecated. It will be changed to `true`'
' in community.general 6.0.0. Specify an explicit value to get rid of this message',
version='6.0.0', collection_name='community.general')
module.params['norc'] = False

if not module.params['gem_source']:
module.params['gem_source'] = module.params['name']
Expand Down
Loading