Skip to content

Commit b2de462

Browse files
authored
Update for ECS 1.5.0 release (#110)
* Add ecs_accounts to be distinct from default_accounts * No longer import rpm package postgresxx-devel to avoid dependency on epel repo rpm perl-IPC-Run in RHEL8 * Remove ECS db schemas from general list of default db's as external db is deprecated in ECS * Process ECS TLS ACLs separately from base * Support Postgresql 12 & higher * Support MySQL8 * Default ecs_nodes to empty [] when not specified * Fix for external auth when none desired * Allow any path for autotls private key * Refactor 'vars/' in external_auth role * Fix ext_auth, pvc_ecs prerequisites * Fix IPA verify when deploying ECS Signed-off-by: Chuck Levesque <clevesque@cloudera.com>
1 parent bebdfca commit b2de462

File tree

27 files changed

+581
-185
lines changed

27 files changed

+581
-185
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,4 @@ dmypy.json
162162
# Cython debug symbols
163163
cython_debug/
164164

165+
.DS_Store

roles/cloudera_manager/autotls/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616

1717
host_ssh_username: root
1818
host_ssh_password: cloudera
19+
sudoerUser: centos

roles/cloudera_manager/autotls/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
- name: Set node_key on one line
5050
set_fact:
51-
node_key_one_line: "{{ lookup('file', '~/node_key' ) | replace('\n', '\\n') | replace('\"', '\\\"' ) }}"
51+
node_key_one_line: "{{ lookup('file', private_key_path ) | replace('\n', '\\n') | replace('\"', '\\\"' ) }}"
5252
when: not use_password
5353

5454
- name: DEBUG Auto-TLS using key

roles/cloudera_manager/autotls/templates/auto-tls-key.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"configureAllServices" : "true",
44
"sshPort" : 22,
55
{% if freeipa_activated %}"trustedCaCerts" : "/etc/ipa/ca.crt",{% endif %}
6-
"userName" : "root",
7-
"privateKey": "{{ node_key_one_line }}"
8-
}
9-
6+
"userName" : "{{ sudoerUser|default("root") }}",
7+
"privateKey": "{{ node_key_one_line|default('~/node_key') }}"
8+
"passphrase": "{{ passphrase|default("") }}"
9+
}

roles/cloudera_manager/common/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ cloudera_manager_database_type: "{{ database_type }}"
2727
cloudera_manager_database_name: scm
2828
cloudera_manager_database_user: scm
2929
cloudera_manager_database_password: changeme
30-
cloudera_manager_database_port: "{{ database_port | cloudera.cluster.default_database_port }}"
30+
cloudera_manager_database_port: "{{ database_type | cloudera.cluster.default_database_port }}"
3131
cloudera_manager_agent_lib_directory: /var/lib/cloudera-scm-agent
3232
cloudera_manager_cmf_java_opts_default: "-Xmx4G -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp"
Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Cloudera, Inc.
1+
# Copyright 2023 Cloudera, Inc.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -13,31 +13,5 @@
1313
# limitations under the License.
1414

1515
---
16-
cloudera_manager_external_auth:
17-
provider: "{{ 'FreeIPA' if freeipa_activated == true else omit }}"
18-
external_first: no
19-
external_only: no
20-
external_set: "{{ 'yes' if freeipa_activated == true else 'no' }}"
21-
role_mappings: "{{ default_free_ipa_role_mappings if freeipa_activated == true else omit }}"
2216

23-
default_free_ipa_role_mappings:
24-
- group: admins
25-
roles: [ ROLE_ADMIN ]
26-
- group: auditors
27-
roles: [ ROLE_AUDITOR ]
28-
- group: users
29-
roles: [ ROLE_USER ]
30-
31-
auth_providers:
32-
FreeIPA:
33-
type: LDAP
34-
ldap_url: "{{ ipa_ldap_url }}"
35-
ldap_base_dn:
36-
ldap_bind_user_dn: "{{ ipa_ldap_user_bind_dn }}"
37-
ldap_bind_password: "{{ ipa_ldap_user_bind_password }}"
38-
ldap_search_base:
39-
user: "{{ ipa_ldap_user_search_base }}"
40-
group: "{{ ipa_ldap_group_search_base }}"
41-
ldap_search_filter:
42-
user: "{{ ipa_ldap_user_search_filter }}"
43-
group: "{{ ipa_ldap_user_group_filter }}"
17+
freeipa_activated: False

roles/cloudera_manager/external_auth/tasks/main.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Cloudera, Inc.
1+
# Copyright 2023 Cloudera, Inc.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -14,6 +14,15 @@
1414

1515
---
1616

17+
- name: Conditionally load in variables for initializing IPA
18+
ansible.builtin.include_vars:
19+
file: freeipa.yml
20+
when:
21+
- freeipa_activated
22+
- cloudera_manager_external_auth is undefined
23+
- cloudera_manager_version is version('6.0.0','>=')
24+
25+
1726
- name: Select external auth provider details
1827
set_fact:
1928
auth_provider: "{{ auth_providers[cloudera_manager_external_auth.provider] }}"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright 2023 Cloudera, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
---
16+
17+
default_free_ipa_role_mappings:
18+
- group: admins
19+
roles: [ ROLE_ADMIN ]
20+
- group: auditors
21+
roles: [ ROLE_AUDITOR ]
22+
- group: users
23+
roles: [ ROLE_USER ]
24+
25+
cloudera_manager_external_auth:
26+
provider: "FreeIPA"
27+
external_first: no
28+
external_only: no
29+
external_set: yes
30+
role_mappings: "{{ default_free_ipa_role_mappings }}"
31+
32+
auth_providers:
33+
FreeIPA:
34+
type: LDAP
35+
ldap_url: "{{ ipa_ldap_url }}"
36+
ldap_base_dn:
37+
ldap_bind_user_dn: "{{ ipa_ldap_user_bind_dn }}"
38+
ldap_bind_password: "{{ ipa_ldap_user_bind_password }}"
39+
ldap_search_base:
40+
user: "{{ ipa_ldap_user_search_base }}"
41+
group: "{{ ipa_ldap_group_search_base }}"
42+
ldap_search_filter:
43+
user: "{{ ipa_ldap_user_search_filter }}"
44+
group: "{{ ipa_ldap_user_group_filter }}"

roles/cloudera_manager/external_auth/vars/main.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,44 @@ auth_role_display_names:
2929
ROLE_OPERATOR: Operator
3030
ROLE_USER: Read-Only
3131
ROLE_USER_ADMIN: User Administrator
32+
33+
default_free_ipa_role_mappings:
34+
- group: admins
35+
roles: [ ROLE_ADMIN ]
36+
- group: auditors
37+
roles: [ ROLE_AUDITOR ]
38+
- group: users
39+
roles: [ ROLE_USER ]
40+
when:
41+
- freeipa_activated
42+
- cloudera_manager_external_auth is undefined
43+
- cloudera_manager_version is version('6.0.0','>=')
44+
45+
cloudera_manager_external_auth:
46+
provider: "FreeIPA"
47+
external_first: no
48+
external_only: no
49+
external_set: yes
50+
role_mappings: "{{ default_free_ipa_role_mappings }}"
51+
when:
52+
- freeipa_activated
53+
- cloudera_manager_external_auth is undefined
54+
- cloudera_manager_version is version('6.0.0','>=')
55+
56+
auth_providers:
57+
FreeIPA:
58+
type: LDAP
59+
ldap_url: "{{ ipa_ldap_url }}"
60+
ldap_base_dn:
61+
ldap_bind_user_dn: "{{ ipa_ldap_user_bind_dn }}"
62+
ldap_bind_password: "{{ ipa_ldap_user_bind_password }}"
63+
ldap_search_base:
64+
user: "{{ ipa_ldap_user_search_base }}"
65+
group: "{{ ipa_ldap_group_search_base }}"
66+
ldap_search_filter:
67+
user: "{{ ipa_ldap_user_search_filter }}"
68+
group: "{{ ipa_ldap_user_group_filter }}"
69+
when:
70+
- freeipa_activated
71+
- cloudera_manager_external_auth is undefined
72+
- cloudera_manager_version is version('6.0.0','>=')

roles/config/services/mgmt/tasks/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Cloudera, Inc.
1+
# Copyright 2023 Cloudera, Inc.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
1717
# This variable is used by other roles
1818
# please take care when changing it
1919
- set_fact:
20-
databases: "{{ database_defaults | combine(definition.mgmt.databases | default({}), recursive=True) }}"
20+
databases: "{{ databases_cm_svcs | combine(definition.mgmt.databases | default({}), recursive=True) }}"
2121

2222
- name: Reset custom configuration dictionary
2323
set_fact:
@@ -35,4 +35,4 @@
3535
# please take care when changing it
3636
- name: Merge custom configurations
3737
set_fact:
38-
merged_configs: "{{ custom_configs | combine(definition.mgmt.configs | default({}), recursive=True) }}"
38+
merged_configs: "{{ custom_configs | combine(definition.mgmt.configs | default({}), recursive=True) }}"

0 commit comments

Comments
 (0)