You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### Install upstream (Keycloak) from keycloak releases
72
67
73
-
#### Install RHSSO from the Red Hat Customer Support Portal, when the following variables are defined
68
+
This is the default approach when RHN credentials are not defined. Keycloak is downloaded from keycloak builds (hosted on github.com) locally, and distributed to target nodes.
74
69
75
-
```
76
-
keycloak_admin_password: "<changeme>"
70
+
71
+
#### Install RHSSO from the Red Hat Customer Support Portal
72
+
73
+
Define the credentials as follows, and the default behaviour is to download a fresh archive of RHSSO on the controller node, then distribute to target nodes.
74
+
75
+
```yaml
77
76
rhn_username: '<customer_portal_username>'
78
77
rhn_password: '<customer_portal_password>'
79
-
rhsso_rhn_id: '<sso_product_id>'
78
+
# (keycloak_rhsso_enable defaults to True)
80
79
```
81
80
82
-
where `sso_product_id` is the ID for the specific Red Hat Single Sign-On version, ie. _101971_ will install version _7.5_)
83
81
84
-
#### Install RHSSO from remote sources like Nexus etc, when the following variables are defined
82
+
#### Install from controller node (local source)
85
83
84
+
Making the keycloak zip archive (or the RHSSO zip archive), available to the playbook repository root directory, and setting `keycloak_offline_install` to `True`, allows to skip
85
+
the download tasks. The local path for the archive matches the downloaded archive path, so it is also used as a cache when multiple hosts are provisioned in a cluster.
86
+
87
+
```yaml
88
+
keycloak_offline_install: True
86
89
```
87
-
keycloak_admin_password: "<changeme>"
90
+
91
+
And depending on `keycloak_rhsso_enable`:
92
+
93
+
* `True`: install RHSSO using file rh-sso-x.y.z-server-dist.zip
94
+
* `False`: install keycloak using file keycloak-x.y.zip
`playbooks/keycloak-realm.yml` creates provided realm, user federation(s), client(s), client role(s) and client user(s) if they don't exist.
136
+
[`playbooks/keycloak-realm.yml`](playbooks/keycloak-realm.yml) creates provided realm, user federation(s), client(s), client role(s) and client user(s) if they don't exist.
137
+
121
138
122
139
### Example configuration command
123
140
124
141
Execute the following command from the source root directory
Copy file name to clipboardExpand all lines: roles/keycloak/README.md
+57-45Lines changed: 57 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,15 @@ This role requires the `python3-netaddr` library installed on the controller nod
14
14
* or via the collection: `pip install -r requirements.txt`
15
15
16
16
17
+
Dependencies
18
+
------------
19
+
20
+
The roles depends on:
21
+
22
+
* the `redhat_csp_download` role from [middleware_automation.redhat_csp_download](https://github.com/ansible-middleware/redhat-csp-download) collection if Red Hat Single Sign-on zip have to be downloaded from RHN.
23
+
* the `wildfly_driver` role from [middleware_automation.wildfly](https://github.com/ansible-middleware/wildfly) collection
24
+
25
+
17
26
Versions
18
27
--------
19
28
@@ -25,9 +34,10 @@ Versions
25
34
Role Defaults
26
35
-------------
27
36
37
+
* Service configuration
38
+
28
39
| Variable | Description | Default |
29
40
|:---------|:------------|:---------|
30
-
|`keycloak_rhsso_enable`| Enable Red Hat Single Sign-on installation |`False`|
31
41
|`keycloak_ha_enabled`| Enable auto configuration for database backend, clustering and remote caches on infinispan |`False`|
32
42
|`keycloak_db_enabled`| Enable auto configuration for database backend |`True` if `keycloak_ha_enabled` is True, else `False`|
33
43
|`keycloak_admin_user`| Administration console user account |`admin`|
@@ -41,14 +51,26 @@ Role Defaults
41
51
|`keycloak_management_https_port`| TLS management port |`9993`|
@@ -84,32 +106,14 @@ The following variables are _required_ only when `keycloak_db_enabled` is True:
84
106
|`keycloak_db_user`| username for connecting to postgres |`keycloak-user`|
85
107
|`keycloak_db_pass`| password for connecting to postgres |`keycloak-pass`|
86
108
87
-
The following variable can be used to install Keycloak or Red Hat Single Sign-On from local path:
88
-
89
-
| Variable | Description | Example |
90
-
|:---------|:------------|:---------|
91
-
|`zip_file_local_path`| Full local path of upstream(Keycloak) or Red Hat Single Sign-On zip file on Ansible control plane |`tmp/rhsso/rh-sso-7.5-server-dist.zip`|
92
-
93
-
The following variable can be used to install Red Hat Single Sign-On from source via url, auth support is not added right now.
94
-
95
-
| Variable | Description | Example |
96
-
|:---------|:------------|:---------|
97
-
|`rhsso_source_download_url`| URL to download Red Hat Single Sign-On zip file from source |`http://localhost:8081/nexus/rhsso/rh-sso-7.5-server-dist.zip`|
98
-
99
-
100
-
Dependencies
101
-
------------
102
-
103
-
The roles depends on:
104
109
105
-
* the `redhat_csp_download` role from [middleware_automation.redhat_csp_download](https://github.com/ansible-middleware/redhat-csp-download) collection if Red Hat Single Sign-on zip have to be downloaded from RHN.
106
-
* the `wildfly_driver` role from [middleware_automation.wildfly](https://github.com/ansible-middleware/wildfly) collection
110
+
Example Playbooks
111
+
-----------------
107
112
113
+
_NOTE_: use ansible vaults or other security systems for storing credentials.
108
114
109
-
Example Playbook
110
-
----------------
111
115
112
-
The following is an example playbook that makes use of the role to install keycloak from remote
116
+
*The following is an example playbook that makes use of the role to install keycloak from remote:
113
117
114
118
```yaml
115
119
---
@@ -124,23 +128,7 @@ The following is an example playbook that makes use of the role to install keycl
124
128
keycloak_admin_password: "changeme"
125
129
```
126
130
127
-
The following is an example playbook that makes use of the role to install keycloak from local path on Ansible node
128
-
129
-
```yaml
130
-
---
131
-
- hosts: ...
132
-
collections:
133
-
- middleware_automation.keycloak
134
-
tasks:
135
-
- name: Include keycloak role
136
-
include_role:
137
-
name: keycloak
138
-
vars:
139
-
keycloak_admin_password: "changeme"
140
-
zip_file_local_path: "/tmp/keycloak/keycloak-16.1.0.zip"# This should be local path on Ansible node of upstream(keycloak) zip file
141
-
```
142
-
143
-
The following is an example playbook that makes use of the role to install Red Hat Single Sign-On from RHN
131
+
* The following is an example playbook that makes use of the role to install Red Hat Single Sign-On from RHN:
144
132
145
133
```yaml
146
134
---
@@ -157,9 +145,30 @@ The following is an example playbook that makes use of the role to install Red H
157
145
vars:
158
146
keycloak_admin_password: "changeme"
159
147
keycloak_rhsso_enable: True
148
+
rhn_username: '<customer portal username>'
149
+
rhn_password: '<customer portal password>'
160
150
```
161
151
162
-
The following is an example playbook that makes use of the role to install Red Hat Single Sign-On from source url
152
+
153
+
* The following example playbook makes use of the role to install keycloak from the controller node:
154
+
155
+
```yaml
156
+
---
157
+
- hosts: ...
158
+
collections:
159
+
- middleware_automation.keycloak
160
+
tasks:
161
+
- name: Include keycloak role
162
+
include_role:
163
+
name: keycloak
164
+
vars:
165
+
keycloak_admin_password: "changeme"
166
+
keycloak_offline_install: True
167
+
# This should be the filename of keycloak archive on Ansible node: keycloak-16.1.0.zip
168
+
```
169
+
170
+
171
+
* This playbook installs Red Hat Single Sign-On from an alternate url:
163
172
164
173
```yaml
165
174
---
@@ -173,10 +182,12 @@ The following is an example playbook that makes use of the role to install Red H
173
182
vars:
174
183
keycloak_admin_password: "changeme"
175
184
keycloak_rhsso_enable: True
176
-
rhsso_source_download_url: "<REPLACE with - Source download url>"# This should be the full of remote source rhsso zip file
185
+
keycloak_rhsso_download_url: "<REPLACE with download url>"
186
+
# This should be the full of remote source rhsso zip file and can contain basic authentication credentials
177
187
```
178
188
179
-
The following is an example playbook that makes use of the role to install Red Hat Single Sign-On from local path on Ansible node
189
+
190
+
* The following is an example playbook that makes use of the role to install Red Hat Single Sign-On from the controller node:
180
191
181
192
```yaml
182
193
---
@@ -190,7 +201,8 @@ The following is an example playbook that makes use of the role to install Red H
190
201
vars:
191
202
keycloak_admin_password: "changeme"
192
203
keycloak_rhsso_enable: True
193
-
zip_file_local_path: "/tmp/rhsso/rh-sso-7.5-server-dist.zip"# This should be local path on Ansible node of rhsso zip file
204
+
keycloak_offline_install: True
205
+
# This should be the filename of rhsso zip file on Ansible node: rh-sso-7.5-server-dist.zip
0 commit comments