Commit Graph

554 Commits

Author SHA1 Message Date
Thomas Woerner
9108065ea7 pwpolicy: Fix new bool checks for IPA prior to 4.9.10
With 4.9.10, the value of bools have been changed from "TRUE" and
"FALSE" to real bool values.

With IPA < 4.9.10 the new bool checks distcheck and usercheck failed
the tests for enabling the checks with a "already enabled" error.

A new version check altogether with providing the ansible module for
gen_args has been added. The values True and False are now transformed
into "TRUE" and "FALSE" for IPA < 4.9.10.

The function bool_param has been renamed to bool_or_empty_param to match
the int_or_empty_param and to have a more explaining name.
2023-01-16 16:35:02 +01:00
Thomas Woerner
fc5fc9d9ef Merge pull request #1012 from rjeffman/pwpolicy_clean_values
pwpolicy: Allow clearing policy values.
2023-01-13 15:00:25 +01:00
Rafael Guterres Jeffman
1d8deb8e2d Fix issues raised by Pylint version 2.14.4. 2023-01-12 12:34:28 -03:00
Rafael Guterres Jeffman
410682a01d pwpolicy: Allow clearing policy values.
All values for pwpolicy can be cleared with an empty string in IPA CLI,
and this behavior was missing in ansible-freeipa.

As of today, there is an issue in FreeIPA that does not allow clearing
'minlength' policy. The is is tracked by the FreeIPA project through
https://pagure.io/freeipa/issue/9297

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2150334
2023-01-12 12:18:57 -03:00
Denis Karpelevich
483d51b418 Use netgroup_find instead of netgroup_show to workaround IPA bug.
Patch fixes https://bugzilla.redhat.com/show_bug.cgi?id=2144724 which
depends on https://pagure.io/freeipa/issue/9284.
Add comment why replacing `netgroup_show` with `netgroup_find`.

Signed-off-by: Denis Karpelevich <dkarpele@redhat.com>
2023-01-04 20:30:44 +01:00
Thomas Woerner
3b73ad6b27 Merge pull request #971 from rjeffman/pwpolicy_update_params
pwpolicy: Add support for password check and grace limit.
2022-11-29 16:21:49 +01:00
Rafael Guterres Jeffman
d859ddc7fe sudorule: Add support for 'hostmask' parameter
The hostmask parameter allows matching a sudorule against a network
address, and was missing from ipasudorule module.

Documentation and tests were updated to reflect changes.

Two new example playbooks are available:

    playbooks/sudorule/ensure-sudorule-hostmask-member-is-absent.yml
    playbooks/sudorule/ensure-sudorule-hostmask-member-is-present.yml
2022-11-23 18:30:48 -03:00
Rafael Guterres Jeffman
58725364c1 pwpolicy: Add support for password check and grace limit.
On recent versions of FreeIPA option to verify passwords and for
controlling a password grace period have been added to IPA API.

This patch adds support for the parameters maxrepeat, maxsequence,
dictcheck and usercheck, available since FreeIPA, 4.9 and gracelimit,
available since FreeIPA 4.9.10.

Test playbooks for the module have been updated with the new supported
parameters.

New example playbooks can be found at:

    playbooks/pwpolicy/pwpolicy_grace_limit.yml
    playbooks/pwpolicy/pwpolicy_password_check.yml
2022-11-18 11:25:45 -03:00
Thomas Woerner
68c52b564a Merge pull request #875 from dkarpele/dkarpele-cert-show
New netgroup management module
2022-11-11 13:26:35 +01:00
Rafael Guterres Jeffman
4ad3c84cae Merge pull request #932 from t-woerner/fix_dnsrecord_docs_for_ansible_test
ipadnsrecord: Fix documentation sections and agument spec
2022-10-26 20:36:46 -03:00
Thomas Woerner
77c6770bfc ipadnsrecord: Fix documentation sections and agument spec
ansible-test with ansible-2.14 is adding a lot of new tests to ensure
that the documentation section and the agument spec is complete. Needed
changes:

DOCUMENTATION section

- `type: str` needs to be set for string parameters
- `type: list` needs to be set for list parameters
- `elements: str` needs to be given for list of string parameters
- `type: string` is not valid and needs to be replaced by `type: str`
- `suboptions` instead of `options` needs to be used for dict parameters
- `authors` needs to be given with the github user also: `Name (@user)`
- `choices` needs to match `argument_spec`
- `description` needs to match parameter
- all parameters need to be defined

argument_spec

- `elements="str"` needs to be added to all list of string parameters
- `no_log=False` or `no_log=True` needs to be set for all parameters
  that have `key` in the name or for dicts also in one the key names
- `elements="dict"` needs to be added to all list of dict parameters

The `copyright` date is extended with `-2022`.
2022-10-26 22:37:21 +02:00
Thomas Woerner
44e2718aa1 ipahost: Fix documentation sections and agument spec
ansible-test with ansible-2.14 is adding a lot of new tests to ensure
that the documentation section and the agument spec is complete. Needed
changes:

DOCUMENTATION section

- `type: str` needs to be set for string parameters
- `type: list` needs to be set for list parameters
- `elements: str` needs to be given for list of string parameters
- `suboptions` instead of `options` needs to be used for dict parameters
- `required` tags need to be fixed according to the `argument_spec`
- `aliases` tag needs to match `argument_spec`
- `type` tag needs to match `argument_spec`
- `default` tag needs to match `argument_spec`
- `author` needs to be given with the github user also: `Name (@user)`

RETURN section

- `contains` needs to be used instead of `options` for dicts
- `type: str` needs to be used for string parameters

argument_spec

- `elements="str"` needs to be added to all list of string parameters
- `no_log=False` or `no_log=True` needs to be set for all parameters
  that have `key` in the name or for dicts also in one the key names

The `copyright` date is extended with `-2022`.

Additional changes:

- Parameter sshpubkey changed to list of strings in argument_spec
- New test test/host/test_host_sshpubkey.yml
2022-10-26 17:32:34 +02:00
Rafael Guterres Jeffman
c1827807c6 Merge pull request #957 from t-woerner/fix_user_docs_for_ansible_test
ipauser: Fix documentation sections and agument spec
2022-10-26 08:42:00 -03:00
Rafael Guterres Jeffman
5c1c4d83c2 Merge pull request #958 from t-woerner/fix_vault_docs_for_ansible_test
ipavault: Fix documentation sections and agument spec
2022-10-26 08:41:50 -03:00
Rafael Guterres Jeffman
38e874fddb Merge pull request #931 from t-woerner/fix_dnsforwardzone_docs_for_ansible_test
ipadnsforwardzone: : Fix documentation sections and agument spec
2022-10-21 15:30:53 -03:00
Denis Karpelevich
495677df38 New netgroup management module
There is a new netgroup management module placed in the plugins folder:

    plugins/modules/ipanetgroup.py

The netgroup module allows to ensure presence or absence of netgroup
and manage netgroup members.

Here is the documentation for the module:

    README-netgroup.md

New example playbooks have been added:

    playbooks/netgroup/netgroup-absent.yml
    playbooks/netgroup/netgroup-member-absent.yml
    playbooks/netgroup/netgroup-member-present.yml
    playbooks/netgroup/netgroup-present.yml

New tests for the module:

    tests/netgroup/test_netgroup.yml
    tests/netgroup/test_netgroup_client_context.yml
    tests/netgroup/test_netgroup_member.yml
    tests/netgroup/test_netgroup_member_absent.yml
    tests/netgroup/test_netgroup_member_case_insensitive.yml

Signed-off-by: Denis Karpelevich <dkarpele@redhat.com>
2022-10-19 21:38:39 +02:00
Rafael Guterres Jeffman
6e44b4d034 Merge pull request #954 from t-woerner/fix_ipatopologysegment_docs_for_ansible_test
ipatopologysegment: Fix documentation sections and agument spec
2022-10-19 11:06:56 -03:00
Thomas Woerner
9c71d91a2e ipatopologysegment: Fix documentation sections and agument spec
ansible-test with ansible-2.14 is adding a lot of new tests to ensure
that the documentation section and the agument spec is complete. Needed
changes:

DOCUMENTATION section

- `type: str` needs to be set for string parameters
- `author` needs to be given with the github user also: `Name (@user)`

argument_spec

- `type="str"` needs to added to all string parameters

The `copyright` date is extended with `-2022`.
2022-10-19 15:56:39 +02:00
Thomas Woerner
2621b311f9 ipavault: Fix documentation sections and agument spec
ansible-test with ansible-2.14 is adding a lot of new tests to ensure
that the documentation section and the agument spec is complete. Needed
changes:

DOCUMENTATION section

- `type: str` needs to be set for string parameters
- `type: bool` needs to be set for bool parameters

- `type: list` needs to be set for list parameters
- `elements: str` needs to be given for list of string parameters
- `type: string` is not valid and needs to be replaced by `type: str`
- `required` tags need to be fixed according to the `argument_spec`
- `aliases` tag needs to match `argument_spec`
- `author` needs to be given with the github user also: `Name (@user)`
- `choices` needs to match `argument_spec`
- all parameters need to be defined

RETURN section

- `contains` needs to be used instead of `options` for dicts
- `type: string` is not valid and needs to be replaced by `type: str`

argument_spec

- `elements="str"` needs to be added to all list of string parameters
- `default=.*` needs to be dropped if `required=True` is also given

The `copyright` date is extended with `-2022`.
2022-10-19 15:43:28 +02:00
Rafael Guterres Jeffman
706eb15291 documentation: Change occurences of whitelist to allowlist.
This change follows language use recomendation from NISTIR 8366,
"Guidance for NIST Staff on Using Inclusive Language in Documentary
Standards", accessible from

    https://nvlpubs.nist.gov/nistpubs/ir/2021/NIST.IR.8366.pdf
2022-10-18 21:13:20 -03:00
Rafael Guterres Jeffman
c808ad6e34 ipaconfig: Do not require enable_sid for add_sids or netbios_name
Current behavior of ipaconfig mimics FreeIPA CLI and requires that
'enable_sid' is set to True every time add_sids or netbios_name are
used. It is sufficient that SID generation is enabled to use add_sids
and netbios_name, but the IPA API requires 'enable_sid' so that the
operations are executed.

This patch allows ansible-freeipa plugin ipaconfig to run 'add_sids' or
set 'netbios_name without requiring 'enable_sid' to be set on the
playbook.

If SID generation is enabled, 'add_sids' and 'netbios_name' can be used
without 'enable_sid: yes'. If SID generation is not enabled, an error
message will be raised if 'enable_sid: yes' is not used.
2022-10-18 11:13:43 -03:00
Rafael Guterres Jeffman
320168071f ipaconfig: Do not allow enable_sid set to False.
Once enabled, SID cannot be disabled. This patch ensures that an error
is raised if one tries to disable SID.
2022-10-17 12:26:57 -03:00
Thomas Woerner
aa4cc3bf45 Merge pull request #920 from rjeffman/ipaconfig_fix_fail_json
ipaconfig: Fix fail_json calls.
2022-10-13 11:07:36 +02:00
Rafael Guterres Jeffman
fa86cd2944 Merge pull request #948 from t-woerner/fix_service_docs_for_ansible_test
ipaservice:: Fix documentation sections and agument spec
2022-10-08 17:20:57 -03:00
Rafael Guterres Jeffman
49dbf9fd6c Merge pull request #947 from t-woerner/fix_server_docs_for_ansible_test
ipaserver: Fix documentation sections and agument spec
2022-10-08 17:17:44 -03:00
Rafael Guterres Jeffman
f194e919a0 Merge pull request #945 from t-woerner/fix_role_docs_for_ansible_test
iparole: Fix documentation sections and agument spec
2022-10-08 17:10:14 -03:00
Rafael Guterres Jeffman
69a2be7b51 Merge pull request #946 from t-woerner/fix_selfservice_docs_for_ansible_test
ipaselfservice: Fix documentation sections and agument spec
2022-10-08 17:06:39 -03:00
Rafael Guterres Jeffman
684dfd9cf3 Merge pull request #943 from t-woerner/fix_privilege_docs_for_ansible_test
ipaprivilege: Fix documentation sections and agument spec
2022-10-08 17:05:26 -03:00
Rafael Guterres Jeffman
aebb4456ab Merge pull request #942 from t-woerner/fix_permission_docs_for_ansible_test
ipapermission: Fix documentation sections and agument spec
2022-10-08 16:57:26 -03:00
Rafael Guterres Jeffman
3877fb689f Merge pull request #940 from t-woerner/fix_idrange_docs_for_ansible_test
ipaidrange: Fix documentation sections and agument spec
2022-10-06 08:57:51 -03:00
Rafael Guterres Jeffman
1bf7fb7233 Merge pull request #944 from t-woerner/fix_pwpolicy_docs_for_ansible_test
ipapwpolicy: Fix documentation sections and agument spec
2022-10-04 15:21:08 -03:00
Rafael Guterres Jeffman
5382c625b2 Merge pull request #949 from t-woerner/fix_servicedelegationrule_docs_for_ansible_test
ipaservicedelegationrule: Fix documentation sections and agument spec
2022-10-04 15:19:58 -03:00
Rafael Guterres Jeffman
61277c0898 Merge pull request #950 from t-woerner/fix_servicedelegationtarget_docs_for_ansible_test
ipaservicedelegationtarget: Fix documentation sections and agument spec
2022-10-04 15:16:52 -03:00
Rafael Guterres Jeffman
cd36d32fea Merge pull request #951 from t-woerner/fix_ipasudocmd_docs_for_ansible_test
ipasudocmd: Fix documentation sections and agument spec
2022-10-04 15:15:05 -03:00
Rafael Guterres Jeffman
0411b12bbb Merge pull request #955 from t-woerner/fix_ipatopologysuffix_docs_for_ansible_test
ipatopologysuffix: Fix documentation sections and agument spec
2022-10-04 15:10:12 -03:00
Rafael Guterres Jeffman
b2ea0d79be Merge pull request #952 from t-woerner/fix_ipasudocmdgroup_docs_for_ansible_test
ipasudocmdgroup: Fix documentation sections and agument spec
2022-10-04 15:08:44 -03:00
Rafael Guterres Jeffman
b7c0954553 Merge pull request #956 from t-woerner/fix_ipatrust_docs_for_ansible_test
ipatrust Fix documentation sections and agument spec
2022-10-04 15:07:29 -03:00
Rafael Guterres Jeffman
87d0812396 Merge pull request #939 from t-woerner/fix_hostgroup_docs_for_ansible_test
ipahostgroup: Fix documentation sections and agument spec
2022-10-04 14:58:43 -03:00
Rafael Guterres Jeffman
49ad4cbfe1 Merge pull request #937 from t-woerner/fix_hbacsvcgroup_docs_for_ansible_test
ipahbacsvcgroup: Fix documentation sections and agument spec
2022-10-03 16:51:33 -03:00
Rafael Guterres Jeffman
2f8911eba5 Merge pull request #936 from t-woerner/fix_hbacsvc_docs_for_ansible_test
ipahbacsvc: Fix documentation sections and agument spec
2022-10-03 16:50:13 -03:00
Rafael Guterres Jeffman
031b6f2f16 Merge pull request #941 from t-woerner/fix_location_docs_for_ansible_test
ipalocation: Fix documentation sections and agument spec
2022-09-30 23:43:22 -03:00
Rafael Guterres Jeffman
35210b3646 Merge pull request #935 from t-woerner/fix_hbacrule_docs_for_ansible_test
ipahbacrule: Fix documentation sections and agument spec
2022-09-30 23:42:10 -03:00
Rafael Guterres Jeffman
d1ce1526d2 Merge pull request #934 from t-woerner/fix_group_docs_for_ansible_test
ipagroup: Fix documentation sections and agument spec
2022-09-30 23:33:46 -03:00
Rafael Guterres Jeffman
0161fea4df Merge pull request #930 from t-woerner/fix_dnsconfig_docs_for_ansible_test
ipadnsconfig: Fix documentation sections and agument spec
2022-09-30 23:26:48 -03:00
Rafael Guterres Jeffman
757c0a142b Merge pull request #933 from t-woerner/fix_dnszone_docs_for_ansible_test
ipadnszone: Fix documentation sections and agument spec
2022-09-30 23:25:07 -03:00
Rafael Guterres Jeffman
f4fcf1b578 Merge pull request #929 from t-woerner/fix_delegation_docs_for_ansible_test
ipadelegation: : Fix documentation sections and agument spec
2022-09-30 22:34:46 -03:00
Rafael Guterres Jeffman
4da89de1d4 ipaconfig: Fix fail_json calls.
Ansible's fail_json() method required that the message paramater was
passed with a keyword parameter, rather than a positional one. Although
this seems to work with ansible-core 2.13+, it might not work with
previous versions of Ansible.

This patch fixes the behaviour for all supported Ansible versions.
2022-09-30 15:29:21 -03:00
Rafael Guterres Jeffman
0ad7635332 Merge pull request #953 from t-woerner/fix_ipasudorule_docs_for_ansible_test
ipasudorule: Fix documentation sections and agument spec
2022-09-30 15:10:27 -03:00
Rafael Guterres Jeffman
0ba404733d Merge pull request #928 from t-woerner/fix_config_docs_for_ansible_test
ipaconfig: Fix documentation sections and agument spec
2022-09-30 15:07:20 -03:00
Rafael Guterres Jeffman
3c1c3ebe55 Merge pull request #927 from t-woerner/fix_automountmap_docs_for_ansible_test
ipaautomountmap: Fix documentation sections and agument spec
2022-09-30 15:05:07 -03:00