Bump version of main to 8.0.0; remove deprecations, deprecate some leftovers (#7358)

* Remove disable_facts from xfconf module.

* Remove deprecated module_helper CmdMixin and users.

* Deprecate ArgFormat as well, which wasn't explicitly deprecated yet.

* Remove state=get from gconftool2.

* Remove default of access_level in gitlab_runner.

* Remove state=list from manageiq_polices.

* Remove state=list from manageiq_tags.

* Consul: when state=absent, certain options can no longer be specified.

* Remove support for Ansible 2.9 and ansible-base 2.10 from ansible_galaxy_install.

* Bump community.general version to 8.0.0.

* Fix gconftool2 tests.

* Remove mh.mixins.cmd module_utils completely.

* Re-add removed anchor on its first non-removed usage.

* remove references in return doc, refactor method _setup210plus

* remove no longer needed check in function parse_check

* improve expression

* Fix YAML.

* Lint.

---------

Co-authored-by: Alexei Znamensky <russoz@gmail.com>
This commit is contained in:
Felix Fontein 2023-10-09 13:31:27 +02:00 committed by GitHub
parent c7084c6c30
commit 40809ed953
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 88 additions and 514 deletions

View file

@ -34,11 +34,7 @@ options:
description:
- V(absent) - policy_profiles should not exist,
- V(present) - policy_profiles should exist,
- >
V(list) - list current policy_profiles and policies.
This state is deprecated and will be removed 8.0.0.
Please use the module M(community.general.manageiq_policies_info) instead.
choices: ['absent', 'present', 'list']
choices: ['absent', 'present']
default: 'present'
policy_profiles:
type: list
@ -133,7 +129,7 @@ from ansible_collections.community.general.plugins.module_utils.manageiq import
def main():
actions = {'present': 'assign', 'absent': 'unassign', 'list': 'list'}
actions = {'present': 'assign', 'absent': 'unassign'}
argument_spec = dict(
policy_profiles=dict(type='list', elements='dict'),
resource_id=dict(type='int'),
@ -141,7 +137,7 @@ def main():
resource_type=dict(required=True, type='str',
choices=list(manageiq_entities().keys())),
state=dict(required=False, type='str',
choices=['present', 'absent', 'list'], default='present'),
choices=['present', 'absent'], default='present'),
)
# add the manageiq connection arguments to the arguments
argument_spec.update(manageiq_argument_spec())
@ -162,13 +158,6 @@ def main():
resource_name = module.params['resource_name']
state = module.params['state']
if state == "list":
module.deprecate(
'The value "list" for "state" is deprecated. Please use community.general.manageiq_policies_info instead.',
version='8.0.0',
collection_name='community.general'
)
# get the action and resource type
action = actions[state]
resource_type = manageiq_entities()[resource_type_key]
@ -176,13 +165,8 @@ def main():
manageiq = ManageIQ(module)
manageiq_policies = manageiq.policies(resource_id, resource_type, resource_name)
if action == 'list':
# return a list of current profiles for this object
current_profiles = manageiq_policies.query_resource_profiles()
res_args = dict(changed=False, profiles=current_profiles)
else:
# assign or unassign the profiles
res_args = manageiq_policies.assign_or_unassign_profiles(policy_profiles, action)
# assign or unassign the profiles
res_args = manageiq_policies.assign_or_unassign_profiles(policy_profiles, action)
module.exit_json(**res_args)