Commit Graph

586 Commits

Author SHA1 Message Date
Rafael Guterres Jeffman
dc0a5585fb Add missing attributes to ipasudorule.
This patch adds the following attributes to ipasudorule:

    - order
    - sudooption
    - runasuser
    - runasgroup

It also fixes behavior of sudocmd assigned to the the sudorule, with the
adittion of the attributes:

    - allow_sudocmds
    - deny_sudocmds
    - allow_sudocmdgroups
    - deny_sudocmdgroups

README-sudorule and tests have been updated to comply with the changes.
2020-02-03 09:14:21 -03:00
Varun Mylaraiah
6b3cae53a5 Update README-sudorule.md 2019-12-30 15:21:29 +05:30
Rafael Guterres Jeffman
f501bfd886 Merge pull request #174 from t-woerner/ipahost_member_only_fail
ipahost: Enhanced failure msg for member params used without member action.
2019-12-24 12:19:52 -03:00
Rafael Guterres Jeffman
3fc5da58c4 Merge pull request #172 from t-woerner/ipahost_fix_auth_ind
ipahost: Fix choices of auth_ind parameter, allow to reset parameter
2019-12-23 20:46:05 -03:00
Rafael Guterres Jeffman
b226ed2c7b Merge pull request #173 from t-woerner/ipauser_allow_userauthtype_reset
ipauser: Allow reset of userauthtype, do not depend on first,last for…
2019-12-23 11:38:32 -03:00
Varun Mylaraiah
28fef00803 Update README-hbacsvcgroup.md 2019-12-23 08:38:39 +05:30
Thomas Woerner
a999f30110 Merge pull request #154 from rjeffman/vault
New vault management module.
2019-12-19 16:20:15 +01:00
Thomas Woerner
24515e40ad ipahost: Enhanced failure msg for member params used without member action
The failure message if member parameters like certificate, managedby_host,
principal, allow_create_keytab_* and allow_retrieve_keytab_* are used
without member action for state absent has been enhanced to propose the
member action.
2019-12-18 12:28:03 +01:00
Thomas Woerner
36c1c83708 ipauser: Allow reset of userauthtype, do not depend on first,last for mod
It was not possible to reset the userauthtype. The empty string has been
added to userauthtype for this.

Also ipauser will only depend on given first and last name if the user
does not exist yet. For the update operation these parameters are not
needed anymore.
2019-12-17 15:30:45 +01:00
Thomas Woerner
b6100f0c19 ipahost: Fix choices of auth_ind parameter, allow to reset parameter
The choices for the auth_ind parameter have been wrong. The choices are now
['radius', 'otp', 'pkinit', 'hardened', '']. The empty string has been added
to be able to rest auth_ind for the host entry.
2019-12-17 14:59:26 +01:00
Rafael Guterres Jeffman
af4e8432ad New vault management module.
There is a new vault management module placed in the plugins folder:

  plugins/modules/ipavault.py

The vault module allows to ensure presence and absence of vaults, manage
members and owner of the vault, and archive data in the vault.

Here is the documentation for the module:

    README-vault.md

New example playbooks have been added:

    playbooks/vault/data-archive-in-asymmetric-vault.yml
    playbooks/vault/data-archive-in-symmetric-vault.yml
    playbooks/vault/ensure-asymetric-vault-is-absent.yml
    playbooks/vault/ensure-asymetric-vault-is-present.yml
    playbooks/vault/ensure-service-vault-is-absent.yml
    playbooks/vault/ensure-service-vault-is-present.yml
    playbooks/vault/ensure-shared-vault-is-absent.yml
    playbooks/vault/ensure-shared-vault-is-present.yml
    playbooks/vault/ensure-standard-vault-is-absent.yml
    playbooks/vault/ensure-standard-vault-is-present.yml
    playbooks/vault/ensure-symetric-vault-is-absent.yml
    playbooks/vault/ensure-symetric-vault-is-present.yml
    playbooks/vault/ensure-vault-is-present-with-members.yml
    playbooks/vault/ensure-vault-member-group-is-absent.yml
    playbooks/vault/ensure-vault-member-group-is-present.yml
    playbooks/vault/ensure-vault-member-user-is-absent.yml
    playbooks/vault/ensure-vault-member-user-is-present.yml
    playbooks/vault/ensure-vault-owner-is-absent.yml
    playbooks/vault/ensure-vault-owner-is-present.yml

New tests added for the module:

    tests/vault/test_vault.yml
2019-12-16 14:39:42 -03:00
Thomas Woerner
b719b1afeb utils/build-galaxy-release.sh: Use ansible-galaxy instead of mazer
ansible-galaxy needs to be used to build the Ansible collection. mazer should
not be used any more.
v0.1.8
2019-12-13 22:38:01 +01:00
Thomas Woerner
26966e9b3d Update galaxy.yml: Add empty dependencies to calm down ansible-agalxy command
dependencoies may not be an empty dict like in the past, but it may also not
be missing. It simply needs to be empty.

Fixes #146 (ansible-freeipa collection not installable by 2.9 ansible-galaxy collection install)
2019-12-13 22:33:46 +01:00
Rafael Guterres Jeffman
6ae3044d90 Merge pull request #169 from t-woerner/ipauser-email-no-at
ipauser: Extend email addresses with default email domain if no domain is set
2019-12-13 13:25:03 -03:00
Rafael Guterres Jeffman
f1f81bd8a9 Merge pull request #166 from t-woerner/domain_validator_no_zone_overlap_check
ipaserver_test: Do not use zone_overlap_check for domain name validation
2019-12-13 13:24:48 -03:00
Thomas Woerner
bc3d3f4139 ipauser: Extend email addresses with default email domain if no domain is set
If there is no domain set for email addresses, extend the email addresses
with the default email domain that is gathered from the config_show output.

This fixes RHBZ#1747413 ([ansible-freeipa] user module throwing an error if..)
2019-12-12 22:59:42 +01:00
Thomas Woerner
b9790e0372 Merge pull request #162 from rjeffman/allow_apicommand_with_no_parameters
Allow execution of API commands that do not require parameters.
2019-12-12 22:39:04 +01:00
Thomas Woerner
501ca5128e Update README-host: Drop options from allow_*_keytab_ parameters docs
Drop options from the allow_create_keytab_ and allow_retrieve_keytab_
parameter documentation. There are no options.
2019-12-12 15:01:32 +01:00
Rafael Guterres Jeffman
0210899eb7 Allow execution of API commands that do not require a name.
There are some commands in the IPA API that do not require
arguments, and current implementation does not allow these
commands to be execute.

This patch adds api_command_no_name to allow the execution
of such commands, which is required, for example, to create
a vaultcontainer management module.
2019-12-11 09:48:32 -03:00
Thomas Woerner
9c853894d5 ipaserver_test: Do not use zone_overlap_check for domain name validation
The use of zone_overlay_check for the domain name validation is not good
for a repeated execution of the server deployment where setup_dns is
enabled. The zone overlay check will fail with "DNS zone X already exists
in DNS". zone_overlay_check is later on used in dns.install_check so it is
not needed to do it here also.

Fixes issues #164 (domain option validator should not call zone overlap..)
2019-12-10 22:42:08 +01:00
Thomas Woerner
1f8b171f96 Merge pull request #161 from abbra/fix-install-packages
Fix install packages in ipaserver and ipareplica roles
2019-12-09 20:37:46 +01:00
Alexander Bokovoy
592680f51f Install and enable firewalld if it is configured for ipareplica role
ipareplica role by default tries to configure firewalld but it didn't
check if firewalld related packages were installed.

Similar to DNS and trust to AD features, install firewalld-related
packages before trying to configure firewalld.

Additionally, enable and start firewalld.service because otherwise
firewall-cmd cannot communicate with firewalld itself (it is not
starting on demand).

If and administrator considers not to use firewalld, a default for
ipareplica_setup_firewalld variable has to be set to 'no'.

Fixes: https://github.com/freeipa/ansible-freeipa/issues/116
2019-12-09 21:30:14 +02:00
Alexander Bokovoy
2136c73409 Install and enable firewalld if it is configured for ipaserver role
ipaserver role by default tries to configure firewalld but it didn't
check if firewalld related packages were installed.

Similar to DNS and trust to AD features, install firewalld-related
packages before trying to configure firewalld.

Additionally, enable and start firewalld.service because otherwise
firewall-cmd cannot communicate with firewalld itself (it is not
starting on demand).

If and administrator considers not to use firewalld, a default for
ipaserver_setup_firewalld variable has to be set to 'no'.

Fixes: https://github.com/freeipa/ansible-freeipa/issues/116
2019-12-09 21:26:38 +02:00
Thomas Woerner
bf1e53cb70 Update README.md
Exchange ipaclient_allow_repair and ipaclient_otp in Special Variables
2019-12-06 17:54:29 +01:00
Thomas Woerner
7073921f6c roles/ipaclient/README.md: Add information about ipaclient_otp
The docuemntation of ipaclient_otp was not part of the pull request
102 (commit d1af0ff). The role README has been updated.
2019-12-06 17:50:47 +01:00
Rafael Guterres Jeffman
1dd2b54e77 Merge pull request #155 from t-woerner/ipahost-extension
ipahost: Extension to be able handle several hosts and all settings
v0.1.7
2019-12-02 14:01:21 -03:00
Thomas Woerner
a62e355f9c Merge pull request #157 from t-woerner/centos8
ipa[server,replica,client]: Add support for CentOS-8
2019-12-02 17:30:50 +01:00
Thomas Woerner
fbe2880452 Merge pull request #156 from t-woerner/env_krb5ccname
ansible_freeipa_module: Better support for KRB5CCNAME environment variable
2019-12-02 17:30:42 +01:00
Thomas Woerner
94b1f25b37 ipahost: Extension to be able handle several hosts and all settings
The ipahost management module was not able to add several hosts at once.
Addtionally there have been settings missing.

ansible_freeipa_module has been extended to provide two additional functions
that are needed to simplify the extension of the ipahost module:

    gen_add_del_lists(user_list, res_list)
    encode_certificate(cert)

gen_add_del_lists will generate the lists for the addition and removal of
members using the provided user and ipa settings.

encode_certificate will encode a certificate using base64 with also taking
FreeIPA and Python versions into account.

The missing settings in ipahost have been:

    certificate
    managedby_host
    principal
    create_keytab_[user,group,host,hostgroup]
    retrieve_keytab_[user,group,host,hostgroup]
    sshpubkey
    userclass
    auth_ind
    requires_pre_auth
    ok_as_delegate
    ok_to_auth_as_delegate

The README-host.md file has been updated to provide information about the
new settings and also the members. Also examples for the new things have
been added.

New example playbooks have been added:

    playbooks/host/add-host.yml
    playbooks/host/host-member-allow_create_keytab-absent.yml
    playbooks/host/host-member-allow_create_keytab-present.yml
    playbooks/host/host-member-allow_retrieve_keytab-absent.yml
    playbooks/host/host-member-allow_retrieve_keytab-present.yml
    playbooks/host/host-member-certificate-absent.yml
    playbooks/host/host-member-certificate-present.yml
    playbooks/host/host-member-managedby_host-absent.yml
    playbooks/host/host-member-managedby_host-present.yml
    playbooks/host/host-member-principal-absent.yml
    playbooks/host/host-member-principal-present.yml
    playbooks/host/host-present-with-allow_create_keytab.yml
    playbooks/host/host-present-with-allow_retrieve_keytab.yml
    playbooks/host/host-present-with-certificate.yml
    playbooks/host/host-present-with-managedby_host.yml
    playbooks/host/host-present-with-principal.yml
    playbooks/host/host-present-with-randompassword.yml
    playbooks/host/host-present.yml
    playbooks/host/hosts-member-certificate-absent.yml
    playbooks/host/hosts-member-certificate-present.yml
    playbooks/host/hosts-member-managedby_host-absent.yml
    playbooks/host/hosts-member-managedby_host-present.yml
    playbooks/host/hosts-member-principal-absent.yml
    playbooks/host/hosts-member-principal-present.yml
    playbooks/host/hosts-present-with-certificate.yml
    playbooks/host/hosts-present-with-managedby_host.yml
    playbooks/host/hosts-present-with-randompasswords.yml

New tests have been added for the module:

    tests/host/certificate/cert1.der
    tests/host/certificate/cert1.pem
    tests/host/certificate/cert2.der
    tests/host/certificate/cert2.pem
    tests/host/certificate/cert3.der
    tests/host/certificate/cert3.pem
    tests/host/certificate/private1.key
    tests/host/certificate/private2.key
    tests/host/certificate/private3.key
    tests/host/certificate/test_host_certificate.yml
    tests/host/certificate/test_hosts_certificate.yml
    tests/host/test_host.yml
    tests/host/test_host_allow_create_keytab.yml
    tests/host/test_host_allow_retrieve_keytab.yml
    tests/host/test_host_managedby_host.yml
    tests/host/test_host_principal.yml
    tests/host/test_host_random.yml
    tests/host/test_hosts.yml
    tests/host/test_hosts_managedby_host.yml
    tests/host/test_hosts_principal.yml
2019-12-02 17:23:04 +01:00
Thomas Woerner
5d7f2788f3 ipa[server,replica,client]: Add support for CentOS-8
The files for RHEL-8 (RedHat-8.yml) have simply been linked to CentOS-8.yml
for the ipaserver, ipareplica and ipaclient roles.

Fixes issue #121 (roles/*/vars needs CentOS-8.yml files)
2019-12-02 15:58:47 +01:00
Thomas Woerner
e77f4daaa9 ansible_freeipa_module: Better support for KRB5CCNAME environment variable
The use of gssapi.creds.Credentials is not good if krb5 ticket forwarding
is used. It will fail. gssapi.Credentials with usage and store is the proper
way to do this.
2019-12-02 15:51:00 +01:00
Thomas Woerner
8da4b73b44 Merge pull request #153 from rjeffman/api_context_change
Added context configuration to api_connect.
2019-11-29 18:22:46 +01:00
Rafael Guterres Jeffman
608614110d Added context configuration to api_connect.
This patch allows the connection to the ipa api to use a context different
than 'server', if needed.
2019-11-29 12:59:33 -03:00
Rafael Guterres Jeffman
16cbb87126 Merge pull request #147 from t-woerner/ipaclient_sssd_option_name_fix
ipaclient: Fix misspelled sssd options
2019-11-21 10:12:04 -03:00
Varun Mylaraiah
db49ac66d7 Merge pull request #148 from t-woerner/return_random_passwords
ipauser, ipahost: Return random password
2019-11-21 11:57:01 +05:30
Thomas Woerner
c36cb9543b ipahost: Return generated random password
The random password is only returned if random is yes and the host did
not exist or update_password is yes.

If only one host is handled by the module, the returned dict is containing
this dict:

  { "randompassword": "<the host random password>" }

If several hosts are handled by the module (future feature):

  { "<host>": { "randompassword": "<the host random password>" } }

Fixes issue #134 (ipahost does not return the random password)
2019-11-20 19:50:39 +01:00
Thomas Woerner
b5f209225b ipauser: Return generated random password
The random password is only returned if random is yes and user did not exist
or update_password is yes.

If only one user is handled by the module, the returned dict is containing
this dict:

  { "randompassword": "<the user random password>" }

If several users are handled by the module:

  { "<user>": { "randompassword": "<the user random password>" } }

This is related to issue #134 (ipahost does not return the random password)
2019-11-20 19:49:32 +01:00
Thomas Woerner
6ad82e6bc7 ipaclient: Fix misspelled sssd options
The sssd options in the ipaclient role missed a 's' in the role. The readme
of the role used the proper names with 3 's'. The names in the role have
been fixed and if the old setting are used, they will be used in the first
place.

Also utils/ansible-ipa-client-install has been adaped to use the proper
option names now.

This fixes issue #145 (The ipaclient role misspells sssd)
2019-11-20 12:26:29 +01:00
Thomas Woerner
63924dd6fc Update README-user.md
Add missing information about action variable.
2019-11-19 15:25:53 +01:00
Thomas Woerner
d7a109b7bf Update README-user.md
Fix "Example playbook to delete a user is absent, but preserved"
2019-11-19 15:24:19 +01:00
Thomas Woerner
439552ed8a Merge pull request #143 from cdchapman/feature/support-sn-alias
Support 'sn' alias of 'last' for surname
2019-11-15 16:48:56 +01:00
Thomas Woerner
80d9c05e66 Update ipauser.py: Fix typo in users.name description 2019-11-15 16:37:07 +01:00
Thomas Woerner
f816d3e7ff Update galaxy.yml: Update description, drop empty dependencies
Update description, drop empty dependencies.
Fixes #146 (ansible-freeipa collection not installable by 2.9 ansible-galaxy collection install)
2019-11-12 16:12:37 +01:00
Thomas Woerner
539e15aab3 Update README.md: Add ansible-galaxy collection command for ansible 2.9+
Add command and information about ansible-galaxy collection install. Installing collections
using the ansible-galaxy command is only supported with ansible 2.9+. The mazer tool can
be used for to install the collection for ansible 2.8:
2019-11-12 10:54:07 +01:00
Chris Chapman
f7eef810af Add 'sn' as an alias of 'last' 2019-11-09 11:45:19 -07:00
Chris Chapman
1e3235e281 Only change one to test that 'sn' returns the same value as 'last' 2019-11-09 11:44:52 -07:00
Chris Chapman
12408e0143 Support 'sn' alias of 'last' for surname 2019-11-07 14:05:03 -07:00
Rafael Guterres Jeffman
b06ef3fc09 Merge pull request #142 from t-woerner/ipahostgroup_tests
ipahostgroup: Fix changed flag, support IPA 4.6 on RHEL-7, new test cases
2019-11-07 09:52:05 -03:00
Thomas Woerner
dba8c204ff Merge pull request #141 from rjeffman/sudorule
New sudorule (Sudo Rule) management module
2019-11-07 13:46:16 +01:00
Rafael Guterres Jeffman
2f62160846 New sudorule (Sudo Rule) management module
There is a new sudorule (Sudo Rule) management module placed in the plugins
folder:

  plugins/modules/ipasudorule.py

The sudorule module allows to ensure presence and absence of Sudo Rules.

Here is the documentation for the module:

  README-sudorule.md

New example playbooks have been added:

    playbooks/sudorule/ensure-sudorule-host-member-is-absent.yml
    playbooks/sudorule/ensure-sudorule-host-member-is-present.yml
    playbooks/sudorule/ensure-sudorule-hostgroup-member-is-absent.yml
    playbooks/sudorule/ensure-sudorule-hostgroup-member-is-present.yml
    playbooks/sudorule/ensure-sudorule-is-absent.yml
    playbooks/sudorule/ensure-sudorule-is-disabled.yml
    playbooks/sudorule/ensure-sudorule-is-enabled.yml
    playbooks/sudorule/ensure-sudorule-is-present.yml
    playbooks/sudorule/ensure-sudorule-sudocmd-is-absent.yml
    playbooks/sudorule/ensure-sudorule-sudocmd-is-present.yml

New tests added for the module:

  tests/hbacrule/test_sudorule.yml
2019-11-07 09:37:45 -03:00