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.
This commit is contained in:
Thomas Woerner
2017-09-15 12:52:05 +02:00
parent fd88ba1c7d
commit 609f12c4fc

View File

@@ -16,6 +16,11 @@
check: yes
register: ipadiscovery
- name: Install - Set default principal if no keytab is given and no OTP usage
set_fact:
ipaclient_principal: admin
when: ipaclient_principal is undefined and ipaclient_keytab is undefined and not ipaclient_use_otp | bool
# The following block is executed when using OTP to enroll IPA client
# ie when ipaclient_use_otp is set.
# It connects to ipaserver and add the host with --random option in order
@@ -125,6 +130,11 @@
#debug: yes
register: ipaapi
- name: Install - Set default principal after OTP usage
set_fact:
ipaclient_principal: admin
when: ipaclient_principal is undefined and ipaclient_keytab is undefined and ipaclient_use_otp | bool
- name: Install - Create IPA NSS database
ipanss:
servers: "{{ ipadiscovery.servers }}"