mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2026-03-27 13:53:04 +00:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b427cb8a24 | ||
|
|
fa39e9b824 | ||
|
|
320a5f0d9a | ||
|
|
7141e1c9b2 | ||
|
|
9bc1ae69e9 | ||
|
|
bfbbacc72b | ||
|
|
feec4d9f8b | ||
|
|
ba127153ff | ||
|
|
b14d75dfab | ||
|
|
1d6a6eb7ee | ||
|
|
1ab3ebc2a4 | ||
|
|
d16c23faf9 | ||
|
|
978494524f | ||
|
|
1a73c39a91 | ||
|
|
9e6a6f6076 |
@@ -6,6 +6,33 @@ middleware\_automation.keycloak Release Notes
|
||||
|
||||
This changelog describes changes after version 0.2.6.
|
||||
|
||||
v2.2.2
|
||||
======
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- Copying of key material for TLS configuration `#210 <https://github.com/ansible-middleware/keycloak/pull/210>`_
|
||||
- Validate certs parameter for JDBC driver downloads `#207 <https://github.com/ansible-middleware/keycloak/pull/207>`_
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- Turn off controller privilege escalation `#209 <https://github.com/ansible-middleware/keycloak/pull/209>`_
|
||||
|
||||
v2.2.1
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Internal release, documentation or test changes only.
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- JDBC provider: fix clause in argument validation `#204 <https://github.com/ansible-middleware/keycloak/pull/204>`_
|
||||
|
||||
v2.2.0
|
||||
======
|
||||
|
||||
|
||||
@@ -503,3 +503,32 @@ releases:
|
||||
- 201.yaml
|
||||
- 202.yaml
|
||||
release_date: '2024-05-01'
|
||||
2.2.1:
|
||||
changes:
|
||||
bugfixes:
|
||||
- 'JDBC provider: fix clause in argument validation `#204 <https://github.com/ansible-middleware/keycloak/pull/204>`_
|
||||
|
||||
'
|
||||
release_summary: Internal release, documentation or test changes only.
|
||||
fragments:
|
||||
- 204.yaml
|
||||
- v2.2.1-devel_summary.yaml
|
||||
release_date: '2024-05-02'
|
||||
2.2.2:
|
||||
changes:
|
||||
bugfixes:
|
||||
- 'Turn off controller privilege escalation `#209 <https://github.com/ansible-middleware/keycloak/pull/209>`_
|
||||
|
||||
'
|
||||
minor_changes:
|
||||
- 'Copying of key material for TLS configuration `#210 <https://github.com/ansible-middleware/keycloak/pull/210>`_
|
||||
|
||||
'
|
||||
- 'Validate certs parameter for JDBC driver downloads `#207 <https://github.com/ansible-middleware/keycloak/pull/207>`_
|
||||
|
||||
'
|
||||
fragments:
|
||||
- 207.yaml
|
||||
- 209.yaml
|
||||
- 210.yaml
|
||||
release_date: '2024-05-06'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
namespace: middleware_automation
|
||||
name: keycloak
|
||||
version: "2.2.0"
|
||||
version: "2.2.2"
|
||||
readme: README.md
|
||||
authors:
|
||||
- Romain Pelisse <rpelisse@redhat.com>
|
||||
|
||||
0
github.json
Normal file
0
github.json
Normal file
@@ -9,11 +9,13 @@
|
||||
keycloak_quarkus_log: file
|
||||
keycloak_quarkus_log_level: debug
|
||||
keycloak_quarkus_https_key_file_enabled: true
|
||||
keycloak_quarkus_key_file: "/opt/keycloak/certs/key.pem"
|
||||
keycloak_quarkus_cert_file: "/opt/keycloak/certs/cert.pem"
|
||||
keycloak_quarkus_key_file_copy_enabled: true
|
||||
keycloak_quarkus_key_content: "{{ lookup('file', 'key.pem') }}"
|
||||
keycloak_quarkus_cert_file_copy_enabled: true
|
||||
keycloak_quarkus_cert_file_src: cert.pem
|
||||
keycloak_quarkus_log_target: /tmp/keycloak
|
||||
keycloak_quarkus_ks_vault_enabled: true
|
||||
keycloak_quarkus_ks_vault_file: "/opt/keycloak/certs/keystore.p12"
|
||||
keycloak_quarkus_ks_vault_file: "/opt/keycloak/vault/keystore.p12"
|
||||
keycloak_quarkus_ks_vault_pass: keystorepassword
|
||||
keycloak_quarkus_systemd_wait_for_port: true
|
||||
keycloak_quarkus_systemd_wait_for_timeout: 20
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
delegate_to: localhost
|
||||
changed_when: False
|
||||
|
||||
- name: Create conf directory # risky-file-permissions in test user account does not exist yet
|
||||
- name: Create vault directory
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: "/opt/keycloak/certs/"
|
||||
path: "/opt/keycloak/vault"
|
||||
mode: 0755
|
||||
|
||||
- name: Make sure a jre is available (for keytool to prepare keystore)
|
||||
@@ -39,10 +39,6 @@
|
||||
- name: Copy certificates and vault
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item }}"
|
||||
dest: "/opt/keycloak/certs/{{ item }}"
|
||||
src: keystore.p12
|
||||
dest: /opt/keycloak/vault/keystore.p12
|
||||
mode: 0444
|
||||
loop:
|
||||
- cert.pem
|
||||
- key.pem
|
||||
- keystore.p12
|
||||
|
||||
@@ -316,6 +316,19 @@ argument_specs:
|
||||
default: '/var/log/keycloak'
|
||||
type: "str"
|
||||
description: "Set the destination of the keycloak log folder link"
|
||||
keycloak_jdbc_download_url:
|
||||
description: "Override the default Maven Central download URL for the JDBC driver"
|
||||
type: "str"
|
||||
keycloak_jdbc_download_user:
|
||||
description: "Set a username with which to authenticate when downloading JDBC drivers from an alternative location"
|
||||
type: "str"
|
||||
keycloak_jdbc_download_pass:
|
||||
description: "Set a password with which to authenticate when downloading JDBC drivers from an alternative location (requires keycloak_jdbc_download_user)"
|
||||
type: "str"
|
||||
keycloak_jdbc_download_validate_certs:
|
||||
default: true
|
||||
description: "Allow the option to ignore invalid certificates when downloading JDBC drivers from a custom URL"
|
||||
type: "bool"
|
||||
downstream:
|
||||
options:
|
||||
sso_version:
|
||||
|
||||
@@ -16,6 +16,12 @@
|
||||
become: true
|
||||
when:
|
||||
- not dest_path.stat.exists
|
||||
- name: "Verify valid parameters for download credentials when specified"
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
When JDBC driver download credentials are set, both the username and the password MUST be set
|
||||
when:
|
||||
- (keycloak_jdbc_download_user is undefined and keycloak_jdbc_download_pass is not undefined) or (keycloak_jdbc_download_pass is undefined and keycloak_jdbc_download_user is not undefined)
|
||||
|
||||
- name: "Retrieve JDBC Driver from {{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_url }}"
|
||||
ansible.builtin.get_url:
|
||||
@@ -23,6 +29,9 @@
|
||||
dest: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_dir }}/{{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_filename }}"
|
||||
group: "{{ keycloak_service_group }}"
|
||||
owner: "{{ keycloak_service_user }}"
|
||||
url_username: "{{ keycloak_jdbc_download_user | default(omit) }}"
|
||||
url_password: "{{ keycloak_jdbc_download_pass | default(omit) }}"
|
||||
validate_certs: "{{ keycloak_jdbc_download_validate_certs | default(omit) }}"
|
||||
mode: 0640
|
||||
become: true
|
||||
|
||||
|
||||
@@ -44,8 +44,12 @@ Role Defaults
|
||||
|`keycloak_quarkus_http_relative_path` | Set the path relative to / for serving resources. The path must start with a / | `/` |
|
||||
|`keycloak_quarkus_http_enabled`| Enable listener on HTTP port | `True` |
|
||||
|`keycloak_quarkus_https_key_file_enabled`| Enable listener on HTTPS port | `False` |
|
||||
|`keycloak_quarkus_key_file`| The file path to a private key in PEM format | `{{ keycloak.home }}/conf/server.key.pem` |
|
||||
|`keycloak_quarkus_cert_file`| The file path to a server certificate or certificate chain in PEM format | `{{ keycloak.home }}/conf/server.crt.pem` |
|
||||
|`keycloak_quarkus_key_file_copy_enabled`| Enable copy of key file to target host | `False` |
|
||||
|`keycloak_quarkus_key_content`| Content of the TLS private key. Use `"{{ lookup('file', 'server.key.pem') }}"` to lookup a file. | `""` |
|
||||
|`keycloak_quarkus_key_file`| The file path to a private key in PEM format | `/etc/pki/tls/private/server.key.pem` |
|
||||
|`keycloak_quarkus_cert_file_copy_enabled`| Enable copy of cert file to target host | `False`|
|
||||
|`keycloak_quarkus_cert_file_src`| Set the source file path | `""` |
|
||||
|`keycloak_quarkus_cert_file`| The file path to a server certificate or certificate chain in PEM format | `/etc/pki/tls/certs/server.crt.pem` |
|
||||
|`keycloak_quarkus_https_key_store_enabled`| Enable configuration of HTTPS via a key store | `False` |
|
||||
|`keycloak_quarkus_key_store_file`| Deprecated, use `keycloak_quarkus_https_key_store_file` instead. ||
|
||||
|`keycloak_quarkus_key_store_password`| Deprecated, use `keycloak_quarkus_https_key_store_password` instead.||
|
||||
|
||||
@@ -47,8 +47,12 @@ keycloak_quarkus_java_opts: "{{ keycloak_quarkus_java_heap_opts + ' ' + keycloak
|
||||
|
||||
### TLS/HTTPS configuration
|
||||
keycloak_quarkus_https_key_file_enabled: false
|
||||
keycloak_quarkus_key_file: "{{ keycloak.home }}/conf/server.key.pem"
|
||||
keycloak_quarkus_cert_file: "{{ keycloak.home }}/conf/server.crt.pem"
|
||||
keycloak_quarkus_key_file_copy_enabled: false
|
||||
keycloak_quarkus_key_content: ""
|
||||
keycloak_quarkus_key_file: "/etc/pki/tls/private/server.key.pem"
|
||||
keycloak_quarkus_cert_file_copy_enabled: false
|
||||
keycloak_quarkus_cert_file_src: ""
|
||||
keycloak_quarkus_cert_file: "/etc/pki/tls/certs/server.crt.pem"
|
||||
#### key store configuration
|
||||
keycloak_quarkus_https_key_store_enabled: false
|
||||
keycloak_quarkus_https_key_store_file: "{{ keycloak.home }}/conf/key_store.p12"
|
||||
|
||||
@@ -108,12 +108,28 @@ argument_specs:
|
||||
default: false
|
||||
description: "Enable configuration of HTTPS via files in PEM format"
|
||||
type: "bool"
|
||||
keycloak_quarkus_key_file_copy_enabled:
|
||||
default: false
|
||||
description: "Enable copy of key file to target host"
|
||||
type: "bool"
|
||||
keycloak_quarkus_key_content:
|
||||
default: ""
|
||||
description: "Content of the TLS private key"
|
||||
type: "str"
|
||||
keycloak_quarkus_key_file:
|
||||
default: "{{ keycloak.home }}/conf/server.key.pem"
|
||||
default: "/etc/pki/tls/private/server.key.pem"
|
||||
description: "The file path to a private key in PEM format"
|
||||
type: "str"
|
||||
keycloak_quarkus_cert_file_copy_enabled:
|
||||
default: false
|
||||
description: "Enable copy of cert file to target host"
|
||||
type: "bool"
|
||||
keycloak_quarkus_cert_file_src:
|
||||
default: ""
|
||||
description: "Set the source file path"
|
||||
type: "str"
|
||||
keycloak_quarkus_cert_file:
|
||||
default: "{{ keycloak.home }}/conf/server.crt.pem"
|
||||
default: "/etc/pki/tls/certs/server.crt.pem"
|
||||
description: "The file path to a server certificate or certificate chain in PEM format"
|
||||
type: "str"
|
||||
keycloak_quarkus_https_key_store_enabled:
|
||||
@@ -385,6 +401,10 @@ argument_specs:
|
||||
keycloak_quarkus_jdbc_download_pass:
|
||||
description: "Set a password with which to authenticate when downloading JDBC drivers from an alternative location (requires keycloak_quarkus_jdbc_download_user)"
|
||||
type: "str"
|
||||
keycloak_quarkus_jdbc_download_validate_certs:
|
||||
default: true
|
||||
description: "Allow the option to ignore invalid certificates when downloading JDBC drivers from a custom URL"
|
||||
type: "bool"
|
||||
downstream:
|
||||
options:
|
||||
rhbk_version:
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
path: "{{ lookup('env', 'PWD') }}"
|
||||
register: local_path
|
||||
delegate_to: localhost
|
||||
run_once: true
|
||||
become: false
|
||||
|
||||
- name: Download keycloak archive
|
||||
@@ -108,15 +109,20 @@
|
||||
client_secret: "{{ rhn_password }}"
|
||||
product_id: "{{ (rhn_filtered_products | first).id }}"
|
||||
dest: "{{ local_path.stat.path }}/{{ keycloak.bundle }}"
|
||||
mode: '0640'
|
||||
owner: "{{ lookup('env', 'USER') | default(omit) }}"
|
||||
no_log: "{{ omit_rhn_output | default(true) }}"
|
||||
delegate_to: localhost
|
||||
run_once: true
|
||||
become: false
|
||||
|
||||
- name: Check downloaded archive
|
||||
ansible.builtin.stat:
|
||||
path: "{{ local_path.stat.path }}/{{ keycloak.bundle }}"
|
||||
register: local_archive_path
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
run_once: true
|
||||
|
||||
## copy and unpack
|
||||
- name: Copy archive to target nodes
|
||||
@@ -159,6 +165,32 @@
|
||||
when:
|
||||
- (not new_version_downloaded.changed) and path_to_workdir.stat.exists
|
||||
|
||||
- name: "Copy private key to target"
|
||||
ansible.builtin.copy:
|
||||
content: "{{ keycloak_quarkus_key_content }}"
|
||||
dest: "{{ keycloak_quarkus_key_file }}"
|
||||
owner: "{{ keycloak.service_user }}"
|
||||
group: "{{ keycloak.service_group }}"
|
||||
mode: 0640
|
||||
become: true
|
||||
when:
|
||||
- keycloak_quarkus_https_key_file_enabled is defined and keycloak_quarkus_https_key_file_enabled
|
||||
- keycloak_quarkus_key_file_copy_enabled is defined and keycloak_quarkus_key_file_copy_enabled
|
||||
- keycloak_quarkus_key_content | length > 0
|
||||
|
||||
- name: "Copy certificate to target"
|
||||
ansible.builtin.copy:
|
||||
src: "{{ keycloak_quarkus_cert_file_src }}"
|
||||
dest: "{{ keycloak_quarkus_cert_file }}"
|
||||
owner: "{{ keycloak.service_user }}"
|
||||
group: "{{ keycloak.service_group }}"
|
||||
mode: 0644
|
||||
become: true
|
||||
when:
|
||||
- keycloak_quarkus_https_key_file_enabled is defined and keycloak_quarkus_https_key_file_enabled
|
||||
- keycloak_quarkus_cert_file_copy_enabled is defined and keycloak_quarkus_cert_file_copy_enabled
|
||||
- keycloak_quarkus_cert_file_src | length > 0
|
||||
|
||||
- name: "Install {{ keycloak_quarkus_jdbc_engine }} JDBC driver"
|
||||
ansible.builtin.include_tasks: jdbc_driver.yml
|
||||
when:
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
When JDBC driver download credentials are set, both the username and the password MUST be set
|
||||
when:
|
||||
- keycloak_jdbc_download_user is undefined and keycloak_jdbc_download_pass is not undefined
|
||||
- keycloak_jdbc_download_pass is undefined and keycloak_jdbc_download_user is not undefined
|
||||
when:
|
||||
- (keycloak_quarkus_jdbc_download_user is undefined and keycloak_quarkus_jdbc_download_pass is not undefined) or (keycloak_quarkus_jdbc_download_pass is undefined and keycloak_quarkus_jdbc_download_user is not undefined)
|
||||
- name: "Retrieve JDBC Driver from {{ keycloak_jdbc_download_user | default(keycloak_quarkus_default_jdbc[keycloak_quarkus_jdbc_engine].driver_jar_url) }}"
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ keycloak_jdbc_download_url | default(keycloak_quarkus_default_jdbc[keycloak_quarkus_jdbc_engine].driver_jar_url) }}"
|
||||
url: "{{ keycloak_quarkus_jdbc_download_url | default(keycloak_quarkus_default_jdbc[keycloak_quarkus_jdbc_engine].driver_jar_url) }}"
|
||||
dest: "{{ keycloak.home }}/providers"
|
||||
owner: "{{ keycloak.service_user }}"
|
||||
group: "{{ keycloak.service_group }}"
|
||||
url_username: "{{ keycloak_jdbc_download_user | default(omit) }}"
|
||||
url_password: "{{ keycloak_jdbc_download_pass | default(omit) }}"
|
||||
url_username: "{{ keycloak_quarkus_jdbc_download_user | default(omit) }}"
|
||||
url_password: "{{ keycloak_quarkus_jdbc_download_pass | default(omit) }}"
|
||||
validate_certs: "{{ keycloak_quarkus_jdbc_download_validate_certs | default(omit) }}"
|
||||
mode: '0640'
|
||||
become: true
|
||||
notify:
|
||||
|
||||
Reference in New Issue
Block a user