Commit Graph

61 Commits

Author SHA1 Message Date
Florence Blanc-Renaud
5b57c8b792 ipahost module: fix the module for IPA 4.4 server
The module had unused imports preventing execution with an IPA 4.4 server.
The commit removes unneeded imports, and adds documentation details.
2017-10-17 17:06:14 +02:00
Florence Blanc-Renaud
4bb1e84530 Fix modules documentation and remove unused variables 2017-10-11 16:14:36 +02: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
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
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
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
2ca4200141 library/ipanss.py: mkhomedir is a bool, added missing type 2017-09-19 15:30:43 +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
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
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
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
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
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
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
cd2d7511b0 New module to configure IPA extras like NTP, SSH, firefox and NIS 2017-08-30 14:42:44 +02:00
Thomas Woerner
403c28b46b New module to cteate IPA NSS database 2017-08-30 14:41:25 +02:00
Thomas Woerner
e66c936622 New module to create temporary NSS database, call IPA API for remaining enrollment parts 2017-08-30 14:38:52 +02:00
Thomas Woerner
09d15b511b New module to configure sssd using SSSDConfig
The advantage of the use of SSSDConfig is that an existing configuration could be changed and not simply overwritten.
2017-08-30 14:36:49 +02:00