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/plugins
Pino Toscano bbd68e26a2
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
2023-03-22 20:19:55 +01:00
..
action Unflatmap community.general (#5461) 2022-11-02 20:42:29 +00:00
become Make pfexec become usable for illumos (#3889) 2022-10-05 08:26:40 +02:00
cache Remove unneccessary imports (#5940) 2023-02-12 19:48:39 +01:00
callback Remove unneccessary imports (#5940) 2023-02-12 19:48:39 +01:00
connection Add 'inventory_hostname' to the jail plugin documentation (#6118) 2023-03-03 22:56:24 +01:00
doc_fragments ldap moduls: add optional ca_cert_file option (#6185) 2023-03-22 07:39:58 +01:00
filter JC: Add plugin parser functionality to JC Filter Plugin (#6043) 2023-02-23 16:54:38 +01:00
inventory Adding support for -p option to specify port(s) to scan (#6165) 2023-03-19 13:27:10 +01:00
lookup stop passing loader/dataloader since it has been deprecated by ansible (#6074) 2023-02-25 15:29:27 +01:00
module_utils ldap moduls: add optional ca_cert_file option (#6185) 2023-03-22 07:39:58 +01:00
modules redhat_subscription: require credentials only when needed (#5664) 2023-03-22 20:19:55 +01:00
test Fix more copyright lines, add more default copyright lines (#5095) 2022-08-08 14:24:58 +02:00