Commit Graph

1960 Commits

Author SHA1 Message Date
Thomas Woerner
a1eb56d5bf Merge pull request #2 from flo-renaud/fixdoc
Fix modules documentation and remove unused variables
2017-10-11 17:09:38 +02:00
Florence Blanc-Renaud
92d73ae2b8 Fix otp + force-join usecase
When the client already has a working keytab, use_otp is disabled. This creates
an issue when ipaclient_force_join is set, because the join module is called
with ipaadmin_principal and ipaadmin_password, but these variables may be
undefined if ipaadmin_keytab is used instead.
We should not disable OTP when force-join is specified.
2017-10-11 16:48:26 +02:00
Florence Blanc-Renaud
4bb1e84530 Fix modules documentation and remove unused variables 2017-10-11 16:14:36 +02:00
Thomas Woerner
63fd53eb77 Use Python2/3 to detect ansible_python_interpreter
With the test it is not needed to pin down the python interpreter for ansible
modules. It is therefore possible to use a Python2 version on Fedora-27 and
a Python3 version on Fedora-26.
2017-10-10 17:20:59 +02:00
Thomas Woerner
07a831a3a4 Merge pull request #1 from spoore1/master
change pkinit_anchors to kdc-ca-bundle
2017-10-06 14:53:48 +02:00
Scott Poore
2183bb68cc change pkinit_anchors to kdc-ca-bundle
In the client krb5.conf setup, a pkinit_anchors entry
was being added for pki-ca-bundle.  This should instead
be kdc-ca-bundle.

Signed-off-by: Scott Poore <spoore@redhat.com>
2017-10-05 11:46:07 -05:00
Thomas Woerner
d99dcbbffb library/ipajoin.py: Fixed comment for missing keytab 2017-10-05 10:42:57 +02:00
Thomas Woerner
99c0891880 library/ipajoin.py: Fixed white spaces for comments and imports 2017-10-05 10:42:35 +02:00
Thomas Woerner
ea77aa2820 library/ipatest.py: Fixed example descriptions 2017-10-05 10:41:48 +02:00
Thomas Woerner
6482a0d1c3 library/ipatest.py: Drop unused prinipal from module parameters
The principal is not used and needed in the module, therefore it got removed.
2017-10-05 10:39:43 +02:00
Thomas Woerner
c696ea3ebf New module ipafixca to fix a missing ca.crt file.
This is done right ipanss is used as this is failing without the ca.crt file.
2017-10-04 17:40:13 +02:00
Thomas Woerner
a6c8505938 roles/ipaclient/tasks/install.yml: New fail for missing ca.crt file 2017-10-04 17:39:37 +02:00
Thomas Woerner
b51980ee5d roles/ipaclient/tasks/install.yml: New fails, no end_play with ipajoin.changed
The new results from ipatest (krb5_conf_ok and ipa_test_ok) are now used for
additional fails to suggest to enable allow_repair.

The playbook is not ended anymore if ipajoin changed something.
2017-10-04 17:38:23 +02:00
Thomas Woerner
455f5c9811 roles/ipaclient/vars/rhel.yml: Removed unused file 2017-10-04 17:28:06 +02:00
Thomas Woerner
990da8341f ipaclient vars: Renamed ipaclient_package to ipaclient_packages
The rename was needed to be able to have more than one package in the list
of required packages.

For RHEL-7.3 it has been needed to add ipa-admintools to have /usr/bin/ipa
available. libselinux-python has been added for all.
2017-10-04 17:22:40 +02:00
Thomas Woerner
c78507409c library/ipatest.py: New validation tests: krb5.conf and ipa ping
The first validation test of the krb5.keytab is now done using the system
krb5.conf file. If this test failed, then the validation will be done with
the temporary krb5.conf file.

An additionally IPA test has been added. For now this is "ipa ping" as there
seems not to be a more comprehensive validation test for proper IPA
configuration.
2017-10-04 17:13:19 +02:00
Thomas Woerner
36f941b5f5 library/ipafstore.py: Fix example to user proper module name 2017-10-04 16:54:09 +02:00
Thomas Woerner
161fd027ab library/ipaapi.py: Fixed create_db version check
create_db is requiring an additional argument for IPA version 4.4.4 still.
2017-10-04 16:52:27 +02:00
Thomas Woerner
e908ee4b52 library/ipatest.py: Additional ccache removal 2017-10-02 19:03:18 +02:00
Thomas Woerner
afcc72807c library/ipatest.py: New return value ca_crt_exists
This will provide information if the ca.crt file exists. This will be needed
to be able to decide what needs to be fixed later on.
2017-10-02 19:01:50 +02:00
Thomas Woerner
0611704cb5 library/ipatest.py: Fix krb5_keytab_ok detection to work always 2017-10-02 19:00:25 +02:00
Thomas Woerner
92b824d8d2 roles/ipaclient/tasks/install.yml: ccache cleanup, new always clause
Add big block has been added that contains all steps where the ccache is
created an used. With the block it is possible to add an always clause to
remove the ccachae also in the error case. The cleanup of the ccache is
also done in the beginning to make sure that no ccache leftover will be
used.
2017-10-02 18:54:23 +02:00
Thomas Woerner
895a887701 Add support for Python3 based freeipa versions (F-27+), make Python3 default
Add configuration for F-26, F-27 and RHEL-7 to be Python2 based
2017-10-02 17:12:15 +02:00
Thomas Woerner
e797410e62 library/ipaclient.py: Fix mixture of tabs and spaces for Python3 2017-10-02 17:04:23 +02:00
Thomas Woerner
354039321e Fix raise call for Python3 support 2017-10-02 17:03:44 +02:00
Thomas Woerner
cd5b7711f6 roles/ipaclient/tasks/install.yml: Better message for cleanup and stop 2017-09-25 15:59:04 +02:00
Thomas Woerner
95811b0287 library/ipajoin.py: Drop unused subject base gathering from certificate
ipajoin is not called always and therefore we can no depend on the subject
base gathered from the certificate output of the join call.
2017-09-25 15:57:59 +02:00
Thomas Woerner
7ee3cead85 library/ipadiscovery.py: Drop subject base guessing
The subject base generated in discovery is only a guess and might have been
changed by the admin at installation process. Therefore it is needed to
get this from the server - done in ipaapi as we are authenticaed there already
to use the api.
2017-09-25 15:55:49 +02:00
Thomas Woerner
6dc469fdb8 library/ipaapi.py: Add call to api to get subject base form server
The subject base generated in discovery is only a guess and might have been
changed by the admin at installation process. Therefore it is needed to
get this from the server.

subject_base has been added as a new return value.

Use subject base form ipaapi in roles/ipaclient/tasks/install.yml instead of
guessed value from ipadiscovery.
2017-09-25 15:54:21 +02:00
Thomas Woerner
860794232e library/ipajoin.py: Fail for already joined hosts if krb5.keytab is missing
It is not possible to restore a missing krb5.keytab using the admin
credential. Therefore the only way is to fail in this case.
2017-09-21 12:16:02 +02:00
Thomas Woerner
375500df37 roles/ipaclient/tasks/install.yml: Set no_log:yes for OTP generation and usage 2017-09-19 18:08:24 +02:00
Thomas Woerner
4918ac508f Renamed ipaclient_{principal,password} to ipaadmin_{principal,password}
This has been done to make clear that these are admin settings and to make
these settings consistent to ipaadmin_keytab.
2017-09-19 17:54:30 +02:00
Thomas Woerner
2ca4200141 library/ipanss.py: mkhomedir is a bool, added missing type 2017-09-19 15:30:43 +02:00
Thomas Woerner
0303a148fe README.md: Fixed typo, minimal ipa version 2017-09-19 15:16:56 +02:00
Thomas Woerner
8152ecf31e roles/ipaclient/tasks/install.yml: Use ipajoin also if force_join is set 2017-09-19 15:16:24 +02:00
Thomas Woerner
aa2048aef9 roles/ipaclient/tasks/install.yml: Drop ipaclient_keytab empty string test 2017-09-19 10:00:17 +02:00
Thomas Woerner
7428a47977 roles/ipaclient/tasks/install.yml: Fix use of wrong quotes 2017-09-19 09:57:24 +02:00
Thomas Woerner
edab4274bb roles/ipaclient/tasks/install.yml: Properly test ipaclient_keytab for join 2017-09-18 18:23:33 +02:00
Thomas Woerner
9e6866cbb9 README.md: Added description about ipaclient_use_otp and ipaclient_allow_repair 2017-09-18 18:10:13 +02:00
Thomas Woerner
ed91cc1d28 New ipaclient_allow_repair switch
When allow_repair is enabled, then the playbook will continue for an
already joined host. The remaining steps ipaconf, ipasssd, krb5, ipaapi,
ipanss and ipaextras will be redone.

If allow_repair is disabled, then the meta module will be
used with the end_play option to stop the processing of the playbook
without an error.
2017-09-18 18:00:41 +02:00
Thomas Woerner
7ab7494ed2 roles/ipaclient/tasks/install.yml: Add ipatest, disable otp and join if ipatest.krb5_keytab_ok
If a working krb5.keytab has been detected on the host then use_otp will be
disabled and join will not be called. This is done to preserve the keytab
entry in the host entry on the server.

Enforcing the creation of a one-time-password will result in a host-disable
call for the host entry. This will remove an existing keytab and password from
the entry.
2017-09-18 17:52:46 +02:00
Thomas Woerner
1f2d397588 library/ipajoin.py: Return changed state and new parameter already_joined
The choined tag is only set if changes have been done with the join.

already_joined is set if the ipa-join command is filing with error 13
(already joined). The module is not calling fail_json in this case anymore.
2017-09-18 17:44:23 +02:00
Thomas Woerner
b19db21cf3 roles/ipaclient/tasks/install.yml: Test for empty ipaclient_principal and ipaclient_keytab 2017-09-18 17:39:35 +02:00
Thomas Woerner
9fa0419ddf library/ipanss.py: Check if principal is an empty string 2017-09-18 17:36:11 +02:00
Thomas Woerner
0a8672fcb5 library/ipajoin.py: Enhanced tests for password and keytab
mutually_exclusive and required_one_of are only able to check if the parameters
are defined, but not if they are set to "".
2017-09-18 17:33:08 +02:00
Thomas Woerner
bf64c0bb8f library/ipatest.py: New ipa test module
Test if the krb5.keytab on the machine is valid and can be used.

options:
  servers:
    description: The FQDN of the IPA servers to connect to.
    required: true
  domain:
    description: The primary DNS domain of an existing IPA deployment.
    required: true
  realm:
    description: The Kerberos realm of an existing IPA deployment.
    required: true
  hostname:
    description: The hostname of the machine to join (FQDN).
    required: true
  kdc:
    description: The name or address of the host running the KDC.
    required: true
  principal:
    description: The authorized kerberos principal used to join the IPA realm.
    required: false
  kinit_attempts:
    description: Repeat the request for host Kerberos ticket X times.
    required: false
    default: 5

returns:
  krb5_keytab_ok:
    description: The flag describes if krb5.keytab on the host is usable.
    returned: always
    type: bool
2017-09-18 17:29:24 +02:00
Thomas Woerner
8daef41e0a roles/ipaclient/tasks/install.yml: Do not set principal with keytab for join 2017-09-15 18:56:09 +02:00
Thomas Woerner
6dcecdc296 roles/ipaclient/tasks/install.yml: Use ipaadmin_keytab for admin keytab
The use od ipaclient_keytab for ipahost is not correct as the admin keytab
needs to be used here.
2017-09-15 18:55:30 +02:00
Thomas Woerner
f366fb5270 roles/ipaclient/tasks/install.yml: Purge realm from keytab also needed for force_join
For force_join it is also needed to purge the realm information from the
keytab, otherwise new entries will be added with every join.
2017-09-15 15:39:07 +02:00
Thomas Woerner
4b2b6751b2 roles/ipaclient/tasks/install.yml: Purge realm from keytab after otp generation
If a otp has bene generated it is needed to purge the realm from an exising
host keytab. If there is no host keytab or if the keytab is not containing
information about the realm, ipa-rmkeytab will fail and these two errors are
ignored.
2017-09-15 15:08:22 +02:00