426 Commits

Author SHA1 Message Date
Thomas Woerner
3edc1bedca Make ipaserver role working with ipa 4.5(.4) 2018-01-28 11:46:31 +01:00
Thomas Woerner
c5462d4aac roles/ipaserver/library/ipaserver_test: Return dns.ip_adresses and dns.reverse_zones
These global variables are initialized in the dns module in the
dns.install_check function. The settings are needed to be able to do a
proper dns setup in the ipaserver_setup_dns ansible module.
2017-12-08 13:39:36 +01:00
Thomas Woerner
e215b67dbc module_utils/ansible_ipa_server.py: New function ansible_module_get_parsed_ip_addresses
This methods creates a list of ipautil.CheckedIPAddress from the provided
ip string list.
2017-12-08 13:36:26 +01:00
Thomas Woerner
d009b80621 library/ipadiscovery: Add time synchronization calls
Attempt to sync time if on_master is not set and no_ntp is not set: At
first with given or dicovered time servers. If no ntp servers have been
given or discovered, then with the ipa server.

New parameters:
  on_master:
    description: IPA client installation on IPA server
    required: false
    default: false
    type: bool
    default: no
  ntp_servers:
    description: List of NTP servers to use
    required: false
    type: list
    default: []
  no_ntp:
    description: Do not sync time and do not detect time servers
    required: false
    default: false
    type: bool
    default: no

The ntp_servers output parameter is now always an empty list if on_master
or no_ntp is set.
2017-12-06 12:53:19 +01:00
Thomas Woerner
120786672e library/ipadiscovery: Drop unused check parameter 2017-12-06 12:52:46 +01:00
Thomas Woerner
a7e78597c6 Add support for on_master flag
This is needed to be able to use ipaclient role in the server role
2017-12-06 12:46:57 +01:00
Thomas Woerner
d2d4d95a5a Remove test remains from new ipasever role 2017-12-01 13:27:56 +01:00
Thomas Woerner
079049fa66 New role for ipaserver installation
The support for external cert files is not complete yet.
2017-12-01 13:24:01 +01:00
Thomas Woerner
86323feb80 roles/ipaclient/tasks/install.yml: Allow to specify different hostname
ipaclient_hostname needs to be specified in the inventory file for the hosts
where the name needs to get changed.

Example:
192.168.1.1 ipaclient_hostname=ipaclient1.mine.local

The option should not be specified in [ipaclients:vars] as all hosts would
get the same name.
2017-11-09 13:20:44 +01:00
Thomas Woerner
bb603fbd9f roles/ipaclient/tasks/uninstall.yml: No need to use python3 test for uninstall 2017-11-09 13:19:58 +01:00
Thomas Woerner
7b51df6c33 roles/ipaclient/tasks/[un]install.yml: Use better formatting for commands 2017-11-09 13:19:08 +01:00
Thomas Woerner
11bf327c64 roles/ipaclient/defaults/main.yml: Do not use false string for bool values 2017-11-09 13:17:42 +01:00
Thomas Woerner
d8ba096eb9 New global ansible_ipa_client utils module
With ansible 2.3.1 it is possible to have one place as an additional utils
module to do all the needed steps to be able to generate the environment for
new and older ipa versions.

The library modules are now a lot smaller.

The minimal ansible version has been increased to 2.3.1.

In the future it might now also be possible to have a special
ansible_ipa_client version for ipa < 4.4 in this utils module.
2017-11-09 13:16:28 +01:00
Thomas Woerner
fb047d7e4e Merge pull request #4 from flo-renaud/simplify_uninstall
Simplify ipaclient uninstall
2017-10-16 14:21:53 +02:00
Thomas Woerner
e3ae3476a5 roles/ipaclient/tasks/install.yml: Add keytab or password required test
The failed test result in ipahost will not be seen because of the no_log
setting to hide the generated password.
2017-10-13 16:38:45 +02:00
Thomas Woerner
8af5a26873 roles/ipaclient/tasks/install.yml: Use ipadiscovery.hostname for ipahost
The use of ansible_fqdn could result in a failure if DNS hostname and IP
do not match.
2017-10-13 16:37:10 +02:00
Thomas Woerner
ccdd43f0b5 Extended python3 test to do an additional client test
The additional client test is needed to make sure that the client is
installed for python3 usage. The ipalib test has not been sufficient.
2017-10-13 16:13:57 +02:00
Florence Blanc-Renaud
a0b8bd39e0 Simplify ipaclient uninstall
Currently ipaclient role is using the module ipaclient only for uninstallation,
and this module contains a lot of unused code.
It is simpler to directly call the command-line
   ipa-client-install --uninstall -U
and remove the ipaclient module.
2017-10-12 09:47:03 +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
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
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
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
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
cd5b7711f6 roles/ipaclient/tasks/install.yml: Better message for cleanup and stop 2017-09-25 15:59:04 +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
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
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
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
b19db21cf3 roles/ipaclient/tasks/install.yml: Test for empty ipaclient_principal and ipaclient_keytab 2017-09-18 17:39:35 +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
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
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