1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

added supports_check_mode=True to info/facts modules (#3084) (#3094)

* added supports_check_mode=True to info/facts modules

* added changelog fragment

* rolled back vertica_info

* rolled back utm_proxy_*_info

* updated changelog fragment with latest adjustments

* Update changelogs/fragments/3084-info-checkmode.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

* added check mode to xenserver_facts + oneview_*_info

* added check mode to utm_proxy_*_info

* updated changelog

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 7da2c16b4a)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2021-07-27 17:23:10 +00:00 committed by GitHub
parent ad8cd8efb3
commit 35de2377f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 85 additions and 25 deletions

View file

@ -0,0 +1,24 @@
bugfixes:
- ali_instance_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- memset_memstore_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- memset_server_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- xenserver_facts - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- rax_facts - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- smartos_image_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- snmp_facts - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- oneview_datacenter_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- oneview_enclosure_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- oneview_ethernet_network_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- oneview_fc_network_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- oneview_fcoe_network_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- oneview_logical_interconnect_group_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- oneview_network_set_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- oneview_san_manager_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- idrac_redfish_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- redfish_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- xfconf_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- utm_aaa_group_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- utm_ca_host_key_cert_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- utm_network_interface_address_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- utm_proxy_frontend_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).
- utm_proxy_location_info - added support to check mode (https://github.com/ansible-collections/community.general/pull/3084).

View file

@ -201,7 +201,7 @@ class OneViewModuleBase(object):
resource_client = None
def __init__(self, additional_arg_spec=None, validate_etag_support=False):
def __init__(self, additional_arg_spec=None, validate_etag_support=False, supports_check_mode=False):
"""
OneViewModuleBase constructor.
@ -210,7 +210,7 @@ class OneViewModuleBase(object):
"""
argument_spec = self._build_argument_spec(additional_arg_spec, validate_etag_support)
self.module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=False)
self.module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=supports_check_mode)
self._check_hpe_oneview_sdk()
self._create_oneview_client()

View file

@ -386,7 +386,10 @@ def main():
filters=dict(type='dict')
)
)
module = AnsibleModule(argument_spec=argument_spec)
module = AnsibleModule(
argument_spec=argument_spec,
supports_check_mode=True,
)
if HAS_FOOTMARK is False:
module.fail_json(msg=missing_required_lib('footmark'), exception=FOOTMARK_IMP_ERR)

View file

@ -149,7 +149,7 @@ def main():
api_key=dict(required=True, type='str', no_log=True),
name=dict(required=True, type='str')
),
supports_check_mode=False
supports_check_mode=True,
)
# populate the dict with the user-provided vars.

View file

@ -274,7 +274,7 @@ def main():
api_key=dict(required=True, type='str', no_log=True),
name=dict(required=True, type='str')
),
supports_check_mode=False
supports_check_mode=True,
)
# populate the dict with the user-provided vars.

View file

@ -160,7 +160,9 @@ def get_srs(session):
def main():
module = AnsibleModule({})
module = AnsibleModule(
supports_check_mode=True,
)
if not HAVE_XENAPI:
module.fail_json(changed=False, msg="python xen api required for this module")

View file

@ -124,6 +124,7 @@ def main():
required_together=rax_required_together(),
mutually_exclusive=[['address', 'id', 'name']],
required_one_of=[['address', 'id', 'name']],
supports_check_mode=True,
)
if not HAS_PYRAX:

View file

@ -97,7 +97,7 @@ def main():
argument_spec=dict(
filters=dict(default=None),
),
supports_check_mode=False,
supports_check_mode=True,
)
image_facts = ImageFacts(module)

View file

@ -288,7 +288,7 @@ def main():
['username', 'level', 'integrity', 'authkey'],
['privacy', 'privkey'],
),
supports_check_mode=False,
supports_check_mode=True,
)
m_args = module.params

View file

@ -116,7 +116,10 @@ class DatacenterInfoModule(OneViewModuleBase):
)
def __init__(self):
super(DatacenterInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
super(DatacenterInfoModule, self).__init__(
additional_arg_spec=self.argument_spec,
supports_check_mode=True,
)
def execute_module(self):

View file

@ -163,7 +163,10 @@ class EnclosureInfoModule(OneViewModuleBase):
)
def __init__(self):
super(EnclosureInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
super(EnclosureInfoModule, self).__init__(
additional_arg_spec=self.argument_spec,
supports_check_mode=True,
)
def execute_module(self):

View file

@ -114,7 +114,10 @@ class EthernetNetworkInfoModule(OneViewModuleBase):
)
def __init__(self):
super(EthernetNetworkInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
super(EthernetNetworkInfoModule, self).__init__(
additional_arg_spec=self.argument_spec,
supports_check_mode=True,
)
self.resource_client = self.oneview_client.ethernet_networks

View file

@ -83,7 +83,10 @@ class FcNetworkInfoModule(OneViewModuleBase):
params=dict(required=False, type='dict')
)
super(FcNetworkInfoModule, self).__init__(additional_arg_spec=argument_spec)
super(FcNetworkInfoModule, self).__init__(
additional_arg_spec=argument_spec,
supports_check_mode=True,
)
def execute_module(self):

View file

@ -82,7 +82,10 @@ class FcoeNetworkInfoModule(OneViewModuleBase):
params=dict(type='dict'),
)
super(FcoeNetworkInfoModule, self).__init__(additional_arg_spec=argument_spec)
super(FcoeNetworkInfoModule, self).__init__(
additional_arg_spec=argument_spec,
supports_check_mode=True,
)
def execute_module(self):

View file

@ -96,7 +96,10 @@ class LogicalInterconnectGroupInfoModule(OneViewModuleBase):
params=dict(type='dict'),
)
super(LogicalInterconnectGroupInfoModule, self).__init__(additional_arg_spec=argument_spec)
super(LogicalInterconnectGroupInfoModule, self).__init__(
additional_arg_spec=argument_spec,
supports_check_mode=True,
)
def execute_module(self):
if self.module.params.get('name'):

View file

@ -135,7 +135,10 @@ class NetworkSetInfoModule(OneViewModuleBase):
)
def __init__(self):
super(NetworkSetInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
super(NetworkSetInfoModule, self).__init__(
additional_arg_spec=self.argument_spec,
supports_check_mode=True,
)
def execute_module(self):

View file

@ -90,7 +90,10 @@ class SanManagerInfoModule(OneViewModuleBase):
)
def __init__(self):
super(SanManagerInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
super(SanManagerInfoModule, self).__init__(
additional_arg_spec=self.argument_spec,
supports_check_mode=True,
)
self.resource_client = self.oneview_client.san_managers
def execute_module(self):

View file

@ -191,7 +191,7 @@ def main():
mutually_exclusive=[
('username', 'auth_token'),
],
supports_check_mode=False
supports_check_mode=True,
)
category = module.params['category']

View file

@ -318,7 +318,7 @@ def main():
mutually_exclusive=[
('username', 'auth_token'),
],
supports_check_mode=False
supports_check_mode=True,
)
# admin credentials used for authentication

View file

@ -132,6 +132,7 @@ class XFConfInfo(CmdModuleHelper):
required_by=dict(
property=['channel']
),
supports_check_mode=True,
)
command = 'xfconf-query'

View file

@ -110,7 +110,8 @@ def main():
module = UTMModule(
argument_spec=dict(
name=dict(type='str', required=True)
)
),
supports_check_mode=True,
)
try:
UTM(module, endpoint, key_to_check_for_changes, info_only=True).execute()

View file

@ -88,7 +88,8 @@ def main():
module = UTMModule(
argument_spec=dict(
name=dict(type='str', required=True)
)
),
supports_check_mode=True,
)
try:
# This is needed because the bool value only accepts int values in the backend

View file

@ -84,7 +84,8 @@ def main():
module = UTMModule(
argument_spec=dict(
name=dict(type='str', required=True)
)
),
supports_check_mode=True,
)
try:
UTM(module, endpoint, key_to_check_for_changes, info_only=True).execute()

View file

@ -128,8 +128,9 @@ def main():
key_to_check_for_changes = []
module = UTMModule(
argument_spec=dict(
name=dict(type='str', required=True)
)
name=dict(type='str', required=True),
),
supports_check_mode=True,
)
try:
UTM(module, endpoint, key_to_check_for_changes, info_only=True).execute()

View file

@ -109,8 +109,9 @@ def main():
key_to_check_for_changes = []
module = UTMModule(
argument_spec=dict(
name=dict(type='str', required=True)
)
name=dict(type='str', required=True),
),
supports_check_mode=True,
)
try:
UTM(module, endpoint, key_to_check_for_changes, info_only=True).execute()