2675 Commits

Author SHA1 Message Date
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
Thomas Woerner
7eb98eaaef roles/ipaclient/tasks/install.yml: Fix principal/keytab check, set default principle early 2017-09-15 14:29:17 +02:00
Thomas Woerner
945da71207 Merge remote-tracking branch 'upstream/master' 2017-09-15 14:12:12 +02:00
Thomas Woerner
db12c0959a library/ipajoin.py: Fix principal usage with otp
With otp usage the user supplied principal may not be used for join.
2017-09-15 14:06:39 +02:00
Florence Blanc-Renaud
c824cf6745 Fix logic trying to obtain a keytab
When ipahost is run to generate an OTP and the host is already existing,
the OTP is properly generated but ipa-join will fail if the host is
already enrolled (ie when it has a keytab).
Add a step calling ipa host-disable to erase OTP and keytab before
requesting an OTP.
2017-09-15 13:49:09 +02:00
Thomas Woerner
6a9bc0df82 roles/ipaclient/tasks/install.yml: Fix typo in comment 2017-09-15 12:54:32 +02:00
Thomas Woerner
609f12c4fc roles/ipaclient/tasks/install.yml: Set default principal if not set
If use_otp is not enabled, then the principal will be set to "admin" after
the discovery has been done. If use_otp is enabled, then the princial will
be set to "admin" after the join has been done - as admin will not match
with the otp.
2017-09-15 12:52:05 +02:00
Thomas Woerner
fd88ba1c7d roles/ipaclient/tasks/install.yml: Checks for principal, keytab and password 2017-09-15 12:51:40 +02:00
Thomas Woerner
2d95d0df95 roles/ipaclient: New ipaclient_use_otp setting to force otp usage
The use of otp can be forced to not transfer the admin password while setting
up the ipa client. Only the one-time-password will be transferred to the
client machine.

ipaclient_password will be overwritten by the otp password.
2017-09-15 12:49:22 +02:00
Thomas Woerner
c088e3f9a6 library/ipajoin.py: Add kinit_attempts default value
Also: Add ipaclient_kinit_attempts default value to
roles/ipaclient/defaults/main.yml
2017-09-15 12:26:03 +02:00
Thomas Woerner
3cd878d10b library/ipajoin.py: Fix required_one_of, add mutually_exclusive
The one_of check was using a tuple instead of a list, the check for principal
or keytab has been removed, a new mutually exclusive check for password
xor keytab has been added.
2017-09-15 12:22:34 +02:00
Thomas Woerner
fa1eeb042c library/ipa{api,discovery,extras,nss,sssd}.py: Drop unused required_one_of 2017-09-15 12:20:46 +02:00
Thomas Woerner
e7520a5b1f roles/ipaclient/tasks/install.yml: Tew additional checks for password, keytab and otp 2017-09-15 10:09:28 +02:00
Thomas Woerner
fcea9c2b6c library/ipaclient.py: Compatibility to ipa 4.4 and later 2017-09-15 10:08:36 +02:00
Thomas Woerner
d1a36f4342 library/ipaextras.py: Compatibility to ipa 4.4 and later, new version check 2017-09-15 09:40:09 +02:00
Thomas Woerner
71b19d3f07 library/ipanss.py: Compatibilty to ipa 4.4 and later, new version check 2017-09-15 09:40:08 +02:00
Thomas Woerner
2c2ae77bed library/ipaapi.py: Compatibilty to ipa 4.4 and later, new version check 2017-09-15 09:40:08 +02:00
Thomas Woerner
0b4aec7b6a roles/krb5: Compatibility for ipa 4.4 and later
New variables have been added (undefined by default):
  krb5_dns_canonicalize_hostname
  krb5_pkinit_anchors
  krb5_pkinit_pool

These are set according to the ipa version requirements. See
roles/ipaclient/tasks/install.yml
2017-09-15 09:40:08 +02:00
Thomas Woerner
a5fb29566f library/ipasssd.py: Compatibilty to ipa 4.4 and later, new version check
For ipa versions prior to 4.5 it is needed to use ipa-client-install script
as a source for functions. But the script contains a global finally clause
in which the generated ccache file gets removed. Threfore the script is
temporarily copied to ipa_client_install.py and the global finally clause
gets removed from the copy. All this is done in a temporary directory, which
gets removed right after the import has been done.
2017-09-15 09:40:08 +02:00
Thomas Woerner
a572dfb69e library/sssd.py: Renamed to ipasssd 2017-09-15 09:40:08 +02:00
Thomas Woerner
218d77e9c6 library/ipajoin.py: Compatibilty to ipa 4.4 and later, new version check
For ipa versions prior to 4.5 it is needed to use ipa-client-install script
as a source for functions. But the script contains a global finally clause
in which the generated ccache file gets removed. Threfore the script is
temporarily copied to ipa_client_install.py and the global finally clause
gets removed from the copy. All this is done in a temporary directory, which
gets removed right after the import has been done.

A Object called options is generated as ipa-client-install and also
ipaclient/install/client.py functions are using this object.

inspect.argspec is used on configure_krb5_conf to find out if the function
requires configure_sssd as an optional argument or in the options object.
2017-09-15 09:40:08 +02:00
Thomas Woerner
6e3f133aee library/ipafstore.py: Compatibilty to ipa 4.4 and later, new version check 2017-09-15 09:40:08 +02:00
Thomas Woerner
56063ae373 library/ipadiscovery.py: Compatibilty to ipa 4.4 and later, new version check
freeipa 4.4 is the first version that supports all needed functions.
Therefore a check has been added to make sure that ipadiscovery fails for
versions before 4.4.

The python bindings of ipa versions before 4.6 are having a different
structure.
2017-09-15 09:40:08 +02:00
Thomas Woerner
4f06e9df65 library/ipadiscovery.py: New return: ipa_python_version
ipa_python_version is the version gathered from ipapython.version.NUM_VERSION.
For ipa versions before 3.2.1, the version is generated from
ipapython.version.VERSION because NUM_VERSION changed the format two times
before 3.2.1.
2017-09-15 09:40:08 +02:00
Thomas Woerner
0c5905fddb library/ipadiscovery.py: Add ca_cert_file argument for discovery 2017-09-15 09:40:08 +02:00
Thomas Woerner
2253a415f4 library/ipadiscovery.py: Allow to use server only also
The discovery was not working if a server has been specified. The domain has
been needed additionally. The domain is now gathered from the server name if
it is missing in this case.
2017-09-15 09:40:08 +02:00
Thomas Woerner
4789595428 library/fstore.py: Renaed to ipafstore 2017-09-15 09:40:08 +02:00
Thomas Woerner
20538cc86e New module fstore to backup files using IPA client sysrestore
- Backup ipa default conf
- Backup krb5.conf
2017-08-31 18:45:28 +02:00
Thomas Woerner
893e32b7c6 roles/ipaclient/defaults/main.yml: Remove default values for some vars
This is needed to be able to use defined and undefined checks.
2017-08-31 17:44:57 +02:00
Thomas Woerner
ba1e5c210f roles/ipaclient/tasks/install.yml: Replace ipaserver_ by ipaclient_ 2017-08-31 17:36:47 +02:00
Thomas Woerner
b26b223dec library/ipanss.py: principal option is optional 2017-08-31 17:34:45 +02:00
Thomas Woerner
e5b6eb2381 library/ipajoin.py: Fix required tags for servers and domain in docs 2017-08-31 17:34:02 +02:00
Thomas Woerner
b6bac014a5 Add newline in authors list 2017-08-30 14:56:32 +02:00
Thomas Woerner
6d8874ad63 iRenamed README to README.md 2017-08-30 14:55:44 +02:00
Thomas Woerner
4ac9963b3d New README 2017-08-30 14:53:51 +02:00
Thomas Woerner
2da53eb414 inventory/hosts: Updated inventory file 2017-08-30 14:51:42 +02:00