Skip to content

Commit 78de09a

Browse files
WillDysonWilliam Dyson
andauthored
2021 07 freeipa dep fix (#40)
* removed krb5_server dependency on krb5_client * replaced the ca_certs role with tasks in tls_install_certs * added verification for FreeIPA TLS and clients * corrected note on ca certificates in freeipa docs Signed-off-by: William Dyson <[email protected]> Co-authored-by: William Dyson <[email protected]>
1 parent e87bd1e commit 78de09a

File tree

16 files changed

+117
-49
lines changed

16 files changed

+117
-49
lines changed

docs/freeipa.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ The playbook will not provision a firewall around the FreeIPA server.
4747

4848
## FreeIPA CA signed certificates or externally signed certificates?
4949

50-
In both cases, you'll want to refer to each CA certificate used (particularly important if you are using a different CA) by adding entries to `tls_ca_certs` e.g. (IPA CA)
51-
52-
```
53-
tls_ca_certs:
54-
- path: /etc/ipa/ca.crt
55-
alias: ipaca
56-
```
57-
5850
### FreeIPA CA signed certificates
5951

6052
Here, nothing has to be done.
@@ -67,6 +59,15 @@ In this case, please set `skip_ipa_signing` to `true`.
6759

6860
This will cause the playbook to stop after generating CSRs – identical to the non-FreeIPA case.
6961

62+
You will also need to configure your CA certificate like so (where `/path/to/ca.crt` is a path on the controller host):
63+
```
64+
tls_ca_certs:
65+
- path: /path/to/ca.crt
66+
alias: clusterca
67+
```
68+
69+
This will ensure that the generated truststore includes your external CA.
70+
7071
## AutoTLS or playbook configured?
7172

7273
### AutoTLS

roles/infrastructure/krb5_client/meta/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414

1515
---
1616
dependencies:
17-
- role: cloudera.cluster.infrastructure.krb5_common
17+
- role: cloudera.cluster.infrastructure.krb5_common
18+
- role: cloudera.cluster.infrastructure.krb5_conf

roles/infrastructure/krb5_client/tasks/freeipa.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,21 @@
2323
ipaclient_servers: "{{ groups['krb5_server'] }}"
2424
when: "krb5_kdc_type == 'Red Hat IPA' and 'krb5_server' in groups"
2525

26-
- name: Set sssd to enumerate users and groups
26+
- name: Set up renew_lifetime in krb5.conf
2727
lineinfile:
28-
path: /etc/sssd/sssd.conf
29-
insertafter: "^\\[domain/.+\\]"
30-
regexp: "^enumerate"
31-
line: "enumerate = True"
32-
when: "krb5_kdc_type == 'Red Hat IPA' and 'krb5_server' in groups"
33-
notify:
34-
- restart sssd
28+
path: /etc/krb5.conf
29+
insertafter: "^\\[libdefaults\\]"
30+
regexp: "^ renew_lifetime"
31+
line: " renew_lifetime = 7d"
32+
when:
33+
- krb5_kdc_type == 'Red Hat IPA'
34+
- "'cluster' in group_names or 'cloudera_manager' in group_names"
35+
36+
- name: Remove default_ccache_name in krb5.conf
37+
lineinfile:
38+
path: /etc/krb5.conf
39+
regexp: "^ default_ccache_name"
40+
state: absent
41+
when:
42+
- krb5_kdc_type == 'Red Hat IPA'
43+
- "'cluster' in group_names or 'cloudera_manager' in group_names"

roles/infrastructure/krb5_client/tasks/mit.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,3 @@
2222
lock_timeout: "{{ (ansible_os_family == 'RedHat') | ternary(60, omit) }}"
2323
name: "{{ krb5_packages }}"
2424
state: present
25-
26-
- name: Create krb5.conf
27-
template:
28-
src: "{{ krb5_conf_template | default('krb5.conf.j2') }}"
29-
dest: /etc/krb5.conf
30-
backup: yes
31-
when: not (skip_krb5_conf_distribution | default(False))
File renamed without changes.

roles/infrastructure/ca_certs/meta/main.yml renamed to roles/infrastructure/krb5_conf/meta/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414

1515
---
1616
dependencies:
17-
- role: cloudera.cluster.infrastructure.ca_common
17+
- role: cloudera.cluster.infrastructure.krb5_common

roles/infrastructure/ca_certs/tasks/clean.yml renamed to roles/infrastructure/krb5_conf/tasks/main.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
---
16-
- name: Clean CA Certs directory
17-
file:
18-
name: "{{ ca_server_root_path }}"
19-
state: absent
16+
- name: Setup MIT KRB5 Configuration
17+
when: krb5_kdc_type != 'Red Hat IPA'
18+
ansible.builtin.include_tasks: mit.yml

roles/infrastructure/ca_certs/tasks/fetch.yml renamed to roles/infrastructure/krb5_conf/tasks/mit.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,10 @@
1313
# limitations under the License.
1414

1515
---
16-
- name: Fetch CA Certs
17-
fetch:
18-
src: "{{ cert.src }}"
19-
dest: "{{ cert.dest }}"
20-
flat: yes
21-
loop:
22-
- src: "{{ ca_server_root_cert_path }}"
23-
dest: "{{ local_temp_dir }}/certs/cluster_rootca.pem"
24-
- src: "{{ ca_server_intermediate_cert_path }}"
25-
dest: "{{ local_temp_dir }}/certs/cluster_intca.pem"
26-
loop_control:
27-
loop_var: cert
16+
17+
- name: Create krb5.conf
18+
template:
19+
src: "{{ krb5_conf_template | default('krb5.conf.j2') }}"
20+
dest: /etc/krb5.conf
21+
backup: yes
22+
when: not (skip_krb5_conf_distribution | default(False))
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[libdefaults]
2+
default_realm = {{ krb5_realm|upper }}
3+
dns_lookup_kdc = false
4+
dns_lookup_realm = false
5+
ticket_lifetime = 1d
6+
renew_lifetime = 7d
7+
forwardable = true
8+
default_tgs_enctypes = {{ krb5_enc_types }}
9+
default_tkt_enctypes = {{ krb5_enc_types }}
10+
permitted_enctypes = {{ krb5_enc_types }}
11+
udp_preference_limit = 1
12+
kdc_timeout = 3000
13+
14+
[realms]
15+
{{ krb5_realm|upper }} = {
16+
kdc = {{ krb5_kdc_host | default(groups['krb5_server'][0]) }}
17+
admin_server = {{ krb5_kdc_host | default(groups['krb5_server'][0]) }}
18+
}
19+
20+
[domain_realm]
21+
.{{ ansible_domain }} = {{ krb5_realm|upper }}
22+
{{ ansible_domain }} = {{ krb5_realm|upper }}

roles/infrastructure/krb5_server/meta/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414

1515
---
1616
dependencies:
17-
- role: cloudera.cluster.infrastructure.krb5_client
17+
- role: cloudera.cluster.infrastructure.krb5_common
18+
- role: cloudera.cluster.infrastructure.krb5_conf

0 commit comments

Comments
 (0)