1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/changelogs/fragments
patchback[bot] 47b8df8019
[PR #5664/bbd68e26 backport][stable-6] redhat_subscription: require credentials only when needed (#6222)
redhat_subscription: require credentials only when needed (#5664)

The module currently has a static 'required_if' statement for its
parameters that forces any of 'username' or 'activationkey' or 'token'
in case state=present; while this is generally a good idea, it can be
an extra requirements in some cases. In particular, if the system is
already registered, there is no need for credentials -- some of the
operations of the module, such as manipulating pools, can be done
perfectly without credentials.

Hence:
- change the static 'required_if' to require credentials only when
  forcing the registration
- check for credentials manually when a registration is needed, i.e.
  on an unregistered system; the fail message is the same as the one
  shown by 'required_if'

Adapt the tests to this new situation:
- test_without_required_parameters now needs to mock an unregistered
  system
- add a new version of test_without_required_parameters to test an
  already registered system
- add a simple test case for only state=present usable on an already
  registered system
- remove the credentials from a test case for pool attachment that
  mocks an already registered system

(cherry picked from commit bbd68e26a2)

Co-authored-by: Pino Toscano <ptoscano@redhat.com>
2023-03-22 20:56:22 +01:00
..
.keep Rename changelogs/fragments/.empty -> changelogs/fragments/.keep 2020-08-07 08:17:57 +02:00
4387-nmcli-mtu-for-vlan-connection-fix.yml [PR #6104/2dee3464 backport][stable-6] nmcli: fixed inability to change mtu on vlan connection (#6140) 2023-03-04 10:21:59 +01:00
5664-redhat_subscription-credentials-when-needed.yaml [PR #5664/bbd68e26 backport][stable-6] redhat_subscription: require credentials only when needed (#6222) 2023-03-22 20:56:22 +01:00
6049-dconf-strings.yml [PR #6049/627371e2 backport][stable-6] dconf: Check for changes properly despite style of quotes used by user (#6145) 2023-03-05 11:49:43 +01:00
6111-influxdb_user-check-mode.yaml [PR #6111/3fb1ff0b backport][stable-6] Fix influxdb_user grants in check mode (#6214) 2023-03-22 13:16:21 +01:00
6112-fix_key_error_in_gitlab_runner_creation_update.yml [PR #6130/c077818c backport][stable-6] Fixes #6112: community.general.gitlab_runner KeyError: 'access_level' (#6142) 2023-03-04 10:38:59 +01:00
6114-memset-add-url-error-handling.yml [PR #6114/6cf67448 backport][stable-6] memset*.py: Fixed URLError handling (#6157) 2023-03-08 13:58:39 +01:00
6117-remove-stormssh-depend.yml [PR #6117/3862de3f backport][stable-6] Removes dependency on StormSSH (#6179) 2023-03-12 15:50:07 +01:00
6118-jail-plugin-fix-default-inventory_hostname.yml [PR #6118/9a97bc7c backport][stable-6] Add 'inventory_hostname' to the jail plugin documentation (#6137) 2023-03-03 23:10:59 +01:00
6119-opkg-update.yaml [PR #6119/345a6930 backport][stable-6] opkg: fix bug when update_cache=true (#6124) 2023-03-02 07:15:28 +01:00
6122-redhat_subscription-subscribe-via-dbus.yaml [PR #6122/e939cd07 backport][stable-6] redhat_subscription: use D-Bus for registration if possible (#6188) 2023-03-14 23:06:41 +01:00
6127-yarn-ignore-warnings.yml [PR #6129/df34569f backport][stable-6] Updating yarn.list to not fail when when warnings are emitted (#6189) 2023-03-15 07:28:40 +01:00
6131-fix-interfaces_file-for-no-leading-spaces.yml [PR #6131/abcba9db backport][stable-6] Interfaces file spaces fix (#6169) 2023-03-09 20:31:08 +01:00
6138-fix-yarn-global.yml [PR #6138/3d67f518 backport][stable-6] Fix Yarn global not working without explicit executable path (#6141) 2023-03-04 10:21:50 +01:00
6149-openbsd_pkg-term.yml [PR #6149/b97bee3f backport][stable-6] openbsd_pkg: set TERM to 'dumb' in execute_command (#6190) 2023-03-15 07:29:38 +01:00
6154-znode-optional-tls.yml [PR #6154/1dd86bcb backport][stable-6] add optional use_tls parameter (#6191) 2023-03-15 07:29:48 +01:00
6160-add-command-make-output.yml [PR #6160/a49ad340 backport][stable-6] [make] Provide built command in the module output (#6186) 2023-03-14 21:03:54 +01:00
6165-nmap-port.yml [PR #6165/bf8f2950 backport][stable-6] Adding support for -p option to specify port(s) to scan (#6207) 2023-03-19 13:54:53 +01:00
6180-replace-deprecated-badzipfile.yml [PR #6180/f66cc7c9 backport][stable-6] Replace deprecated error with BadZipFile (#6216) 2023-03-22 13:16:05 +01:00
6211-rhsm-require-root.yml [PR #6211/9f67cbbe backport][stable-6] rhsm modules: cleanly fail when not run as root (#6218) 2023-03-22 17:57:46 +00:00
xxxx-ldap-ca-cert-file.yml [PR #6185/512bf4b7 backport][stable-6] ldap moduls: add optional ca_cert_file option (#6217) 2023-03-22 13:15:48 +01:00