mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2026-03-27 13:53:04 +00:00
Compare commits
132 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dded412bd0 | ||
|
|
5b70d3db2a | ||
|
|
e3ce4bd574 | ||
|
|
af0dc3c5f1 | ||
|
|
f3104285bc | ||
|
|
cb25c28bb8 | ||
|
|
3bb32ed075 | ||
|
|
80e4df8dce | ||
|
|
194101f010 | ||
|
|
f0f90b8930 | ||
|
|
38ff519624 | ||
|
|
9c361c9628 | ||
|
|
9a46b455f6 | ||
|
|
aa7902b9c3 | ||
|
|
0f17e09731 | ||
|
|
942b5fce0f | ||
|
|
bef20b6a57 | ||
|
|
d673fcf48a | ||
|
|
b72460e464 | ||
|
|
6c65fadf31 | ||
|
|
d12f62b89d | ||
|
|
7bb9647d0d | ||
|
|
0199e554b5 | ||
|
|
276444ce0e | ||
|
|
40c015d3e1 | ||
|
|
df7fab8f41 | ||
|
|
6330f08b28 | ||
|
|
5c8d7d9554 | ||
|
|
2513ac2c43 | ||
|
|
6e6bf2ff71 | ||
|
|
11621516e3 | ||
|
|
7c05ee5239 | ||
|
|
5251826477 | ||
|
|
0783000849 | ||
|
|
ca2dbe78c2 | ||
|
|
52d9286ea3 | ||
|
|
c8ebbe72d2 | ||
|
|
91ec411699 | ||
|
|
07b1c514bb | ||
|
|
345c50fb85 | ||
|
|
db0aafd465 | ||
|
|
b950cdb8b4 | ||
|
|
5b01123846 | ||
|
|
84d6e7baca | ||
|
|
ea735ea79e | ||
|
|
9db1cbd564 | ||
|
|
7933592725 | ||
|
|
3170af8b2b | ||
|
|
f400a5bbf8 | ||
|
|
5385fbb8e9 | ||
|
|
7fea211639 | ||
|
|
8738240a24 | ||
|
|
f195d164d1 | ||
|
|
7c4d420fea | ||
|
|
d45071bf58 | ||
|
|
10876ba615 | ||
|
|
f3815403c8 | ||
|
|
18d686b43a | ||
|
|
26a9249d07 | ||
|
|
fae3079751 | ||
|
|
a82e654cc4 | ||
|
|
cebec9c717 | ||
|
|
ad59cd8cb3 | ||
|
|
926353f395 | ||
|
|
fed86ac0c3 | ||
|
|
5f1f8b5762 | ||
|
|
bab3069712 | ||
|
|
fc6e00974d | ||
|
|
83525dbed0 | ||
|
|
7ec695ee15 | ||
|
|
14e7b402b7 | ||
|
|
832432b86c | ||
|
|
8f697f6a53 | ||
|
|
1dd579a6d1 | ||
|
|
3340428194 | ||
|
|
18e60daa93 | ||
|
|
874215a592 | ||
|
|
97bea7ba39 | ||
|
|
e99a0db174 | ||
|
|
3b03c54fed | ||
|
|
ced4ce7828 | ||
|
|
6986190159 | ||
|
|
db480d0bc9 | ||
|
|
bc4cb5c52a | ||
|
|
8f042d3e29 | ||
|
|
24eaacc1ac | ||
|
|
623db426e0 | ||
|
|
b77c166945 | ||
|
|
b7eef6a720 | ||
|
|
203e6c06ac | ||
|
|
aaae1d1129 | ||
|
|
cca20a067d | ||
|
|
2be35f9a67 | ||
|
|
19f1750a33 | ||
|
|
c3d8bbc94e | ||
|
|
c4b4be3c3b | ||
|
|
98e1633c43 | ||
|
|
fd375a141d | ||
|
|
0cf7b3ac49 | ||
|
|
370d424b24 | ||
|
|
01fd2cc4fd | ||
|
|
7471e07921 | ||
|
|
e8e0f6718b | ||
|
|
e4811221be | ||
|
|
6cb4aac556 | ||
|
|
aad373a8e9 | ||
|
|
fd0a4e4492 | ||
|
|
706677910b | ||
|
|
a3bffe9401 | ||
|
|
f566917bc2 | ||
|
|
44ad3b8e6d | ||
|
|
1a450ea1d7 | ||
|
|
b0a01a8e46 | ||
|
|
020bc86955 | ||
|
|
d72d46c945 | ||
|
|
c7d2bdcee3 | ||
|
|
43d978370d | ||
|
|
3d37def38d | ||
|
|
8d16e241c1 | ||
|
|
6ac0c18842 | ||
|
|
6334daf244 | ||
|
|
87ad97d57f | ||
|
|
242b1cea0a | ||
|
|
c0b72b6890 | ||
|
|
1cfa229a5f | ||
|
|
f013a99832 | ||
|
|
6bfe046f5e | ||
|
|
526f64e5eb | ||
|
|
a2c17f545e | ||
|
|
40c29d07b8 | ||
|
|
91a18bf571 | ||
|
|
ecb6cbb9bf |
@@ -21,19 +21,21 @@ warn_list:
|
||||
- experimental
|
||||
- ignore-errors
|
||||
- no-handler
|
||||
- fqcn-builtins
|
||||
- no-log-password
|
||||
- jinja[spacing]
|
||||
- jinja[invalid]
|
||||
- meta-no-tags
|
||||
- name[template]
|
||||
- name[casing]
|
||||
- fqcn[action]
|
||||
- schema[meta]
|
||||
- var-naming[no-role-prefix]
|
||||
- key-order[task]
|
||||
- blocked_modules
|
||||
|
||||
skip_list:
|
||||
- vars_should_not_be_used
|
||||
- file_is_small_enough
|
||||
- name[template]
|
||||
|
||||
use_default_rules: true
|
||||
parseable: true
|
||||
|
||||
55
.github/workflows/ci.yml
vendored
55
.github/workflows/ci.yml
vendored
@@ -5,53 +5,14 @@ on:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
COLORTERM: 'yes'
|
||||
TERM: 'xterm-256color'
|
||||
PYTEST_ADDOPTS: '--color=yes'
|
||||
schedule:
|
||||
- cron: '0 6 * * *'
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python_version: ["3.9"]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: ansible_collections/middleware_automation/keycloak
|
||||
|
||||
- name: Set up Python ${{ matrix.python_version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
|
||||
- name: Install yamllint, ansible and molecule
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install yamllint 'molecule[docker]~=3.5.2' ansible-core flake8 ansible-lint voluptuous
|
||||
pip install -r ansible_collections/middleware_automation/keycloak/requirements.txt
|
||||
|
||||
- name: Create default collection path
|
||||
run: |
|
||||
mkdir -p /home/runner/.ansible/
|
||||
ln -s /home/runner/work/keycloak/keycloak /home/runner/.ansible/collections
|
||||
|
||||
- name: Install ansible-lint custom rules
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: ansible-middleware/ansible-lint-custom-rules
|
||||
path: ansible_collections/ansible-lint-custom-rules/
|
||||
|
||||
- name: Run sanity tests
|
||||
run: ansible-test sanity -v --color --python ${{ matrix.python_version }} --exclude changelogs/fragments/.gitignore --skip-test symlinks
|
||||
working-directory: ./ansible_collections/middleware_automation/keycloak
|
||||
|
||||
- name: Run molecule test
|
||||
run: molecule test --all
|
||||
working-directory: ./ansible_collections/middleware_automation/keycloak
|
||||
env:
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
uses: ansible-middleware/github-actions/.github/workflows/ci.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
fqcn: 'middleware_automation/keycloak'
|
||||
molecule_tests: >-
|
||||
[ "default", "quarkus", "overridexml", "quarkus-devmode" ]
|
||||
|
||||
55
.github/workflows/docs.yml
vendored
55
.github/workflows/docs.yml
vendored
@@ -8,55 +8,10 @@ on:
|
||||
- "[0-9]+.[0-9]+.[0-9]+"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
COLORTERM: 'yes'
|
||||
TERM: 'xterm-256color'
|
||||
PYTEST_ADDOPTS: '--color=yes'
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'ansible-middleware/keycloak'
|
||||
permissions:
|
||||
actions: write
|
||||
checks: write
|
||||
contents: write
|
||||
deployments: write
|
||||
packages: write
|
||||
pages: write
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: ansible_collections/middleware_automation/keycloak
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
|
||||
- name: Install doc dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r ansible_collections/middleware_automation/keycloak/docs/requirements.txt
|
||||
pip install -r ansible_collections/middleware_automation/keycloak/requirements.txt
|
||||
sudo apt install -y sed hub
|
||||
|
||||
- name: Create default collection path
|
||||
run: |
|
||||
mkdir -p /home/runner/.ansible/
|
||||
ln -s /home/runner/work/keycloak/keycloak /home/runner/.ansible/collections
|
||||
|
||||
- name: Create changelog and documentation
|
||||
uses: ansible-middleware/collection-docs-action@main
|
||||
with:
|
||||
collection_fqcn: middleware_automation.keycloak
|
||||
collection_repo: ansible-middleware/keycloak
|
||||
dependencies: false
|
||||
commit_changelog: false
|
||||
commit_ghpages: true
|
||||
changelog_release: false
|
||||
generate_docs: true
|
||||
path: ansible_collections/middleware_automation/keycloak
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
uses: ansible-middleware/github-actions/.github/workflows/docs.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
fqcn: 'middleware_automation/keycloak'
|
||||
collection_fqcn: 'middleware_automation.keycloak'
|
||||
|
||||
86
.github/workflows/release.yml
vendored
86
.github/workflows/release.yml
vendored
@@ -5,87 +5,11 @@ on:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'ansible-middleware/keycloak'
|
||||
permissions:
|
||||
actions: write
|
||||
checks: write
|
||||
contents: write
|
||||
deployments: write
|
||||
packages: write
|
||||
pages: write
|
||||
outputs:
|
||||
tag_version: ${{ steps.get_version.outputs.TAG_VERSION }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.TRIGGERING_PAT }}
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: "3.x"
|
||||
|
||||
- name: Get current version
|
||||
id: get_version
|
||||
run: echo "::set-output name=TAG_VERSION::$(grep version galaxy.yml | awk -F'"' '{ print $2 }')"
|
||||
|
||||
- name: Check if tag exists
|
||||
id: check_tag
|
||||
run: echo "::set-output name=TAG_EXISTS::$(git tag | grep ${{ steps.get_version.outputs.TAG_VERSION }})"
|
||||
|
||||
- name: Fail if tag exists
|
||||
if: ${{ steps.get_version.outputs.TAG_VERSION == steps.check_tag.outputs.TAG_EXISTS }}
|
||||
uses: actions/github-script@v3
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('Release tag already exists')
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install ansible-core antsibull
|
||||
sudo apt install -y sed hub
|
||||
|
||||
- name: Build collection
|
||||
run: |
|
||||
ansible-galaxy collection build .
|
||||
|
||||
- name: Create changelog and documentation
|
||||
uses: ansible-middleware/collection-docs-action@main
|
||||
with:
|
||||
collection_fqcn: middleware_automation.keycloak
|
||||
collection_repo: ansible-middleware/keycloak
|
||||
dependencies: false
|
||||
commit_changelog: true
|
||||
commit_ghpages: false
|
||||
changelog_release: true
|
||||
generate_docs: false
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Publish collection
|
||||
env:
|
||||
ANSIBLE_GALAXY_API_KEY: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}
|
||||
run: |
|
||||
ansible-galaxy collection publish *.tar.gz --api-key $ANSIBLE_GALAXY_API_KEY
|
||||
|
||||
- name: Create release tag
|
||||
run: |
|
||||
git config user.name github-actions
|
||||
git config user.email github-actions@github.com
|
||||
git tag -a ${{ steps.get_version.outputs.TAG_VERSION }} -m "Release v${{ steps.get_version.outputs.TAG_VERSION }}" || true
|
||||
git push origin --tags
|
||||
|
||||
- name: Publish Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ steps.get_version.outputs.TAG_VERSION }}
|
||||
files: "*.tar.gz"
|
||||
body_path: gh-release.md
|
||||
uses: ansible-middleware/github-actions/.github/workflows/release.yml@main
|
||||
with:
|
||||
collection_fqcn: 'middleware_automation.keycloak'
|
||||
secrets:
|
||||
galaxy_token: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}
|
||||
|
||||
dispatch:
|
||||
needs: release
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,6 +2,8 @@
|
||||
*.zip
|
||||
.tmp
|
||||
.cache
|
||||
.vscode/
|
||||
__pycache__/
|
||||
docs/plugins/
|
||||
docs/roles/
|
||||
docs/_build/
|
||||
|
||||
@@ -6,6 +6,105 @@ middleware_automation.keycloak Release Notes
|
||||
|
||||
This changelog describes changes after version 0.2.6.
|
||||
|
||||
v1.3.0
|
||||
======
|
||||
|
||||
Major Changes
|
||||
-------------
|
||||
|
||||
- Run service as ``keycloak_service_user`` `#106 <https://github.com/ansible-middleware/keycloak/pull/106>`_
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- keycloak_quarkus: Update Keycloak to version 22.0.3 `#112 <https://github.com/ansible-middleware/keycloak/pull/112>`_
|
||||
- keycloak_quarkus: fix admin console redirect when running locally `#111 <https://github.com/ansible-middleware/keycloak/pull/111>`_
|
||||
- keycloak_quarkus: skip proxy config if ``keycloak_quarkus_proxy_mode`` is ``none`` `#109 <https://github.com/ansible-middleware/keycloak/pull/109>`_
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- keycloak_quarkus: fix validation failure upon port configuration change `#113 <https://github.com/ansible-middleware/keycloak/pull/113>`_
|
||||
|
||||
v1.2.8
|
||||
======
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- keycloak_quarkus: set openjdk 17 as default `#103 <https://github.com/ansible-middleware/keycloak/pull/103>`_
|
||||
- keycloak_quarkus: update to version 22.0.1 `#107 <https://github.com/ansible-middleware/keycloak/pull/107>`_
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- Fix incorrect checks for ``keycloak_jgroups_subnet`` `#98 <https://github.com/ansible-middleware/keycloak/pull/98>`_
|
||||
- Undefine ``keycloak_db_valid_conn_sql`` default `#91 <https://github.com/ansible-middleware/keycloak/pull/91>`_
|
||||
- Update bindep.txt package python3-devel to support RHEL9 `#105 <https://github.com/ansible-middleware/keycloak/pull/105>`_
|
||||
|
||||
v1.2.7
|
||||
======
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- Allow to override jgroups subnet `#93 <https://github.com/ansible-middleware/keycloak/pull/93>`_
|
||||
- keycloak-quarkus: update keycloakx to v21.1.1 `#92 <https://github.com/ansible-middleware/keycloak/pull/92>`_
|
||||
|
||||
v1.2.6
|
||||
======
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- Add profile features enabling/disabling `#87 <https://github.com/ansible-middleware/keycloak/pull/87>`_
|
||||
- Improve service restart behavior configuration `#88 <https://github.com/ansible-middleware/keycloak/pull/88>`_
|
||||
- Update default xa_datasource_class value for mariadb jdbc configuration `#89 <https://github.com/ansible-middleware/keycloak/pull/89>`_
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- Handle WFLYCTL0117 when background validation millis is 0 `#90 <https://github.com/ansible-middleware/keycloak/pull/90>`_
|
||||
|
||||
v1.2.5
|
||||
======
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- Add configuration for database connection pool validation `#85 <https://github.com/ansible-middleware/keycloak/pull/85>`_
|
||||
- Allow to configure administration endpoint URL `#86 <https://github.com/ansible-middleware/keycloak/pull/86>`_
|
||||
- Allow to force backend URLs to frontend URLs `#84 <https://github.com/ansible-middleware/keycloak/pull/84>`_
|
||||
- Introduce systemd unit restart behavior `#81 <https://github.com/ansible-middleware/keycloak/pull/81>`_
|
||||
|
||||
v1.2.4
|
||||
======
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- Add ``sqlserver`` to keycloak role jdbc configurations `#78 <https://github.com/ansible-middleware/keycloak/pull/78>`_
|
||||
- Add configurability for XA transactions `#73 <https://github.com/ansible-middleware/keycloak/pull/73>`_
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- Fix deprecation warning for ``ipaddr`` `#77 <https://github.com/ansible-middleware/keycloak/pull/77>`_
|
||||
- Fix undefined facts when offline patching sso `#71 <https://github.com/ansible-middleware/keycloak/pull/71>`_
|
||||
|
||||
v1.2.1
|
||||
======
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- Allow to setup keycloak HA cluster without remote cache store `#68 <https://github.com/ansible-middleware/keycloak/pull/68>`_
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- Pass attributes to realm clients `#69 <https://github.com/ansible-middleware/keycloak/pull/69>`_
|
||||
|
||||
v1.2.0
|
||||
======
|
||||
|
||||
|
||||
39
README.md
39
README.md
@@ -1,8 +1,11 @@
|
||||
# Ansible Collection - middleware_automation.keycloak
|
||||
|
||||
<!--start build_status -->
|
||||
[](https://github.com/ansible-middleware/keycloak/actions/workflows/ci.yml)
|
||||
|
||||
> **_NOTE:_ If you are Red Hat customer, install `redhat.sso` from [Automation Hub](https://console.redhat.com/ansible/ansible-dashboard) as the certified version of this collection.**
|
||||
|
||||
<!--end build_status -->
|
||||
Collection to install and configure [Keycloak](https://www.keycloak.org/) or [Red Hat Single Sign-On](https://access.redhat.com/products/red-hat-single-sign-on).
|
||||
|
||||
<!--start requires_ansible-->
|
||||
@@ -16,12 +19,15 @@ Plugins and modules within a collection may be tested with only specific Ansible
|
||||
|
||||
## Installation
|
||||
|
||||
<!--start galaxy_download -->
|
||||
### Installing the Collection from Ansible Galaxy
|
||||
|
||||
Before using the collection, you need to install it with the Ansible Galaxy CLI:
|
||||
|
||||
ansible-galaxy collection install middleware_automation.keycloak
|
||||
|
||||
<!--end galaxy_download -->
|
||||
|
||||
You can also include it in a `requirements.yml` file and install it via `ansible-galaxy collection install -r requirements.yml`, using the format:
|
||||
|
||||
```yaml
|
||||
@@ -51,42 +57,30 @@ A requirement file is provided to install:
|
||||
|
||||
### Install Playbook
|
||||
|
||||
* [`playbooks/keycloak.yml`](https://github.com/ansible-middleware/keycloak/blob/main/playbooks/keycloak.yml) installs the upstream(Keycloak) based on the defined variables.
|
||||
* [`playbooks/rhsso.yml`](https://github.com/ansible-middleware/keycloak/blob/main/playbooks/rhsso.yml) installs Red Hat Single Sign-On(RHSSO) based on defined variables.
|
||||
* [`playbooks/keycloak.yml`](https://github.com/ansible-middleware/keycloak/blob/main/playbooks/keycloak.yml) installs based on the defined variables (using most defaults).
|
||||
|
||||
Both playbooks include the `keycloak` role, with different settings, as described in the following sections.
|
||||
|
||||
For full service configuration details, refer to the [keycloak role README](https://github.com/ansible-middleware/keycloak/blob/main/roles/keycloak/README.md).
|
||||
|
||||
|
||||
#### Install from controller node (local source)
|
||||
#### Install from controller node (offline)
|
||||
|
||||
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
|
||||
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.
|
||||
Making the keycloak zip archive available to the playbook working directory, and setting `keycloak_offline_install` to `True`, allows to skip
|
||||
the download tasks. The local path for the archive does match the downloaded archive path, so that it is also used as a cache when multiple hosts are provisioned in a cluster.
|
||||
|
||||
```yaml
|
||||
keycloak_offline_install: True
|
||||
```
|
||||
|
||||
And depending on `keycloak_rhsso_enable`:
|
||||
|
||||
* `True`: install RHSSO using file rh-sso-x.y.z-server-dist.zip
|
||||
* `False`: install keycloak using file keycloak-x.y.zip
|
||||
<!--start rhn_credentials -->
|
||||
<!--end rhn_credentials -->
|
||||
|
||||
|
||||
#### Install from alternate sources (like corporate Nexus, artifactory, proxy, etc)
|
||||
|
||||
For RHSSO:
|
||||
|
||||
```yaml
|
||||
sso_download_url: "https://<internal-nexus.private.net>/<path>/<to>/rh-sso-x.y.z-server-dist.zip"
|
||||
```
|
||||
|
||||
For keycloak:
|
||||
|
||||
```yaml
|
||||
keycloak_download_url: "https://<internal-nexus.private.net>/<path>/<to>/keycloak-x.y.zip"
|
||||
```
|
||||
It is possible to perform downloads from alternate sources, using the `keycloak_download_url` variable; make sure the final downloaded filename matches with the source filename (ie. keycloak-legacy-x.y.zip or rh-sso-x.y.z-server-dist.zip).
|
||||
|
||||
|
||||
### Example installation command
|
||||
@@ -105,6 +99,8 @@ ansible-playbook -i <ansible_hosts> -e @rhn-creds.yml playbooks/keycloak.yml -e
|
||||
localhost ansible_connection=local
|
||||
```
|
||||
|
||||
Note: when deploying clustered configurations, all hosts belonging to the cluster must be present in ansible_play_batch; ie. they must be targeted by the same ansible-playbook execution.
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -133,9 +129,10 @@ ansible-playbook -i <ansible_hosts> playbooks/keycloak_realm.yml -e keycloak_adm
|
||||
|
||||
For full configuration details, refer to the [keycloak_realm role README](https://github.com/ansible-middleware/keycloak/blob/main/roles/keycloak_realm/README.md).
|
||||
|
||||
## Support
|
||||
|
||||
Keycloak collection v1.0.0 is a Beta release and for [Technical Preview](https://access.redhat.com/support/offerings/techpreview). If you have any issues or questions related to collection, please don't hesitate to contact us on Ansible-middleware-core@redhat.com or open an issue on https://github.com/ansible-middleware/keycloak/issues
|
||||
<!--start support -->
|
||||
<!--end support -->
|
||||
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
python39-devel [platform:rpm compile]
|
||||
python3-devel [compile platform:rpm]
|
||||
python39-devel [compile platform:centos-8 platform:rhel-8]
|
||||
git-lfs [platform:rpm]
|
||||
python3-netaddr [platform:rpm]
|
||||
python3-lxml [platform:rpm]
|
||||
|
||||
@@ -167,3 +167,151 @@ releases:
|
||||
- 63.yaml
|
||||
- 64.yaml
|
||||
release_date: '2023-03-16'
|
||||
1.2.1:
|
||||
changes:
|
||||
bugfixes:
|
||||
- 'Pass attributes to realm clients `#69 <https://github.com/ansible-middleware/keycloak/pull/69>`_
|
||||
|
||||
'
|
||||
minor_changes:
|
||||
- 'Allow to setup keycloak HA cluster without remote cache store `#68 <https://github.com/ansible-middleware/keycloak/pull/68>`_
|
||||
|
||||
'
|
||||
fragments:
|
||||
- 68.yaml
|
||||
- 69.yaml
|
||||
release_date: '2023-04-11'
|
||||
1.2.4:
|
||||
changes:
|
||||
bugfixes:
|
||||
- 'Fix deprecation warning for ``ipaddr`` `#77 <https://github.com/ansible-middleware/keycloak/pull/77>`_
|
||||
|
||||
'
|
||||
- 'Fix undefined facts when offline patching sso `#71 <https://github.com/ansible-middleware/keycloak/pull/71>`_
|
||||
|
||||
'
|
||||
minor_changes:
|
||||
- 'Add ``sqlserver`` to keycloak role jdbc configurations `#78 <https://github.com/ansible-middleware/keycloak/pull/78>`_
|
||||
|
||||
'
|
||||
- 'Add configurability for XA transactions `#73 <https://github.com/ansible-middleware/keycloak/pull/73>`_
|
||||
|
||||
'
|
||||
fragments:
|
||||
- 71.yaml
|
||||
- 73.yaml
|
||||
- 77.yaml
|
||||
- 78.yaml
|
||||
release_date: '2023-05-09'
|
||||
1.2.5:
|
||||
changes:
|
||||
minor_changes:
|
||||
- 'Add configuration for database connection pool validation `#85 <https://github.com/ansible-middleware/keycloak/pull/85>`_
|
||||
|
||||
'
|
||||
- 'Allow to configure administration endpoint URL `#86 <https://github.com/ansible-middleware/keycloak/pull/86>`_
|
||||
|
||||
'
|
||||
- 'Allow to force backend URLs to frontend URLs `#84 <https://github.com/ansible-middleware/keycloak/pull/84>`_
|
||||
|
||||
'
|
||||
- 'Introduce systemd unit restart behavior `#81 <https://github.com/ansible-middleware/keycloak/pull/81>`_
|
||||
|
||||
'
|
||||
fragments:
|
||||
- 81.yaml
|
||||
- 84.yaml
|
||||
- 85.yaml
|
||||
- 86.yaml
|
||||
release_date: '2023-05-26'
|
||||
1.2.6:
|
||||
changes:
|
||||
bugfixes:
|
||||
- 'Handle WFLYCTL0117 when background validation millis is 0 `#90 <https://github.com/ansible-middleware/keycloak/pull/90>`_
|
||||
|
||||
'
|
||||
minor_changes:
|
||||
- 'Add profile features enabling/disabling `#87 <https://github.com/ansible-middleware/keycloak/pull/87>`_
|
||||
|
||||
'
|
||||
- 'Improve service restart behavior configuration `#88 <https://github.com/ansible-middleware/keycloak/pull/88>`_
|
||||
|
||||
'
|
||||
- 'Update default xa_datasource_class value for mariadb jdbc configuration `#89
|
||||
<https://github.com/ansible-middleware/keycloak/pull/89>`_
|
||||
|
||||
'
|
||||
fragments:
|
||||
- 87.yaml
|
||||
- 88.yaml
|
||||
- 89.yaml
|
||||
- 90.yaml
|
||||
release_date: '2023-06-07'
|
||||
1.2.7:
|
||||
changes:
|
||||
minor_changes:
|
||||
- 'Allow to override jgroups subnet `#93 <https://github.com/ansible-middleware/keycloak/pull/93>`_
|
||||
|
||||
'
|
||||
- 'keycloak-quarkus: update keycloakx to v21.1.1 `#92 <https://github.com/ansible-middleware/keycloak/pull/92>`_
|
||||
|
||||
'
|
||||
fragments:
|
||||
- 92.yaml
|
||||
- 93.yaml
|
||||
release_date: '2023-06-19'
|
||||
1.2.8:
|
||||
changes:
|
||||
bugfixes:
|
||||
- 'Fix incorrect checks for ``keycloak_jgroups_subnet`` `#98 <https://github.com/ansible-middleware/keycloak/pull/98>`_
|
||||
|
||||
'
|
||||
- 'Undefine ``keycloak_db_valid_conn_sql`` default `#91 <https://github.com/ansible-middleware/keycloak/pull/91>`_
|
||||
|
||||
'
|
||||
- 'Update bindep.txt package python3-devel to support RHEL9 `#105 <https://github.com/ansible-middleware/keycloak/pull/105>`_
|
||||
|
||||
'
|
||||
minor_changes:
|
||||
- 'keycloak_quarkus: set openjdk 17 as default `#103 <https://github.com/ansible-middleware/keycloak/pull/103>`_
|
||||
|
||||
'
|
||||
- 'keycloak_quarkus: update to version 22.0.1 `#107 <https://github.com/ansible-middleware/keycloak/pull/107>`_
|
||||
|
||||
'
|
||||
fragments:
|
||||
- 103.yaml
|
||||
- 105.yaml
|
||||
- 107.yaml
|
||||
- 91.yaml
|
||||
- 98.yaml
|
||||
release_date: '2023-08-28'
|
||||
1.3.0:
|
||||
changes:
|
||||
bugfixes:
|
||||
- 'keycloak_quarkus: fix validation failure upon port configuration change `#113
|
||||
<https://github.com/ansible-middleware/keycloak/pull/113>`_
|
||||
|
||||
'
|
||||
major_changes:
|
||||
- 'Run service as ``keycloak_service_user`` `#106 <https://github.com/ansible-middleware/keycloak/pull/106>`_
|
||||
|
||||
'
|
||||
minor_changes:
|
||||
- 'keycloak_quarkus: Update Keycloak to version 22.0.3 `#112 <https://github.com/ansible-middleware/keycloak/pull/112>`_
|
||||
|
||||
'
|
||||
- 'keycloak_quarkus: fix admin console redirect when running locally `#111 <https://github.com/ansible-middleware/keycloak/pull/111>`_
|
||||
|
||||
'
|
||||
- 'keycloak_quarkus: skip proxy config if ``keycloak_quarkus_proxy_mode`` is
|
||||
``none`` `#109 <https://github.com/ansible-middleware/keycloak/pull/109>`_
|
||||
|
||||
'
|
||||
fragments:
|
||||
- 106.yaml
|
||||
- 109.yaml
|
||||
- 111.yaml
|
||||
- 112.yaml
|
||||
- 113.yaml
|
||||
release_date: '2023-09-25'
|
||||
|
||||
@@ -43,6 +43,7 @@ extensions = [
|
||||
'myst_parser',
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx_antsibull_ext',
|
||||
'ansible_basic_sphinx_ext',
|
||||
]
|
||||
|
||||
@@ -71,7 +72,7 @@ language = None
|
||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.tmp']
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
pygments_style = 'ansible'
|
||||
|
||||
highlight_language = 'YAML+Jinja'
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ antsibull>=0.17.0
|
||||
antsibull-docs
|
||||
antsibull-changelog
|
||||
ansible-core>=2.14.1
|
||||
ansible-pygments
|
||||
sphinx-rtd-theme
|
||||
git+https://github.com/felixfontein/ansible-basic-sphinx-ext
|
||||
myst-parser
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
namespace: middleware_automation
|
||||
name: keycloak
|
||||
version: "1.2.0"
|
||||
version: "1.3.0"
|
||||
readme: README.md
|
||||
authors:
|
||||
- Romain Pelisse <rpelisse@redhat.com>
|
||||
@@ -21,8 +21,11 @@ tags:
|
||||
- infrastructure
|
||||
- authentication
|
||||
- java
|
||||
- runtimes
|
||||
- middleware
|
||||
- a4mw
|
||||
dependencies:
|
||||
"middleware_automation.common": ">=1.0.0"
|
||||
"middleware_automation.common": ">=1.1.0"
|
||||
"ansible.posix": ">=1.4.0"
|
||||
repository: https://github.com/ansible-middleware/keycloak
|
||||
documentation: https://ansible-middleware.github.io/keycloak
|
||||
|
||||
@@ -45,3 +45,16 @@
|
||||
web_origins: "{{ keycloak_client_web_origins }}"
|
||||
users: "{{ keycloak_client_users }}"
|
||||
client_id: TestClient
|
||||
attributes:
|
||||
post.logout.redirect.uris: '/public/logout'
|
||||
pre_tasks:
|
||||
- name: "Retrieve assets server from env"
|
||||
ansible.builtin.set_fact:
|
||||
assets_server: "{{ lookup('env','MIDDLEWARE_DOWNLOAD_RELEASE_SERVER_URL') }}"
|
||||
|
||||
- name: "Set offline when assets server from env is defined"
|
||||
ansible.builtin.set_fact:
|
||||
sso_offline_install: True
|
||||
when:
|
||||
- assets_server is defined
|
||||
- assets_server | length > 0
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
---
|
||||
dependency:
|
||||
name: shell
|
||||
command: ansible-galaxy collection install -r molecule/requirements.yml -p $HOME/.ansible/collections --force-with-deps
|
||||
driver:
|
||||
name: docker
|
||||
lint: |
|
||||
ansible-lint --version
|
||||
ansible-lint -v
|
||||
platforms:
|
||||
- name: instance
|
||||
image: registry.access.redhat.com/ubi8/ubi-init:latest
|
||||
@@ -38,11 +32,8 @@ verifier:
|
||||
name: ansible
|
||||
scenario:
|
||||
test_sequence:
|
||||
- dependency
|
||||
- lint
|
||||
- cleanup
|
||||
- destroy
|
||||
- syntax
|
||||
- create
|
||||
- prepare
|
||||
- converge
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
vars:
|
||||
keycloak_admin_password: "remembertochangeme"
|
||||
keycloak_jvm_package: java-11-openjdk-headless
|
||||
keycloak_port: http://localhost:8080
|
||||
keycloak_uri: http://localhost:8080
|
||||
keycloak_management_port: http://localhost:9990
|
||||
tasks:
|
||||
- name: Populate service facts
|
||||
@@ -14,16 +14,44 @@
|
||||
that:
|
||||
- ansible_facts.services["keycloak.service"]["state"] == "running"
|
||||
- ansible_facts.services["keycloak.service"]["status"] == "enabled"
|
||||
- name: Verify we are running on requested jvm
|
||||
shell: |
|
||||
ps -ef | grep /usr/lib/jvm/java-11 | grep -v grep
|
||||
- name: Verify we are running on requested jvm # noqa blocked_modules command-instead-of-module
|
||||
ansible.builtin.shell: |
|
||||
set -o pipefail
|
||||
ps -ef | grep '/etc/alternatives/jre_11/' | grep -v grep
|
||||
args:
|
||||
executable: /bin/bash
|
||||
changed_when: no
|
||||
- name: Verify token api call
|
||||
ansible.builtin.uri:
|
||||
url: "{{ keycloak_port }}/auth/realms/master/protocol/openid-connect/token"
|
||||
url: "{{ keycloak_uri }}/auth/realms/master/protocol/openid-connect/token"
|
||||
method: POST
|
||||
body: "client_id=admin-cli&username=admin&password={{ keycloak_admin_password }}&grant_type=password"
|
||||
validate_certs: no
|
||||
register: keycloak_auth_response
|
||||
until: keycloak_auth_response.status == 200
|
||||
retries: 2
|
||||
delay: 2
|
||||
delay: 2
|
||||
- name: Fetch openid-connect config
|
||||
ansible.builtin.uri:
|
||||
url: "{{ keycloak_uri }}/auth/realms/TestRealm/.well-known/openid-configuration"
|
||||
method: GET
|
||||
validate_certs: no
|
||||
status_code: 200
|
||||
register: keycloak_openid_config
|
||||
- name: Verify expected config
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- keycloak_openid_config.json.registration_endpoint == 'http://localhost:8080/auth/realms/TestRealm/clients-registrations/openid-connect'
|
||||
- name: Get test realm clients
|
||||
ansible.builtin.uri:
|
||||
url: "{{ keycloak_uri }}/auth/admin/realms/TestRealm/clients"
|
||||
method: GET
|
||||
validate_certs: no
|
||||
status_code: 200
|
||||
headers:
|
||||
Authorization: "Bearer {{ keycloak_auth_response.json.access_token }}"
|
||||
register: keycloak_query_clients
|
||||
- name: Verify expected config
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- (keycloak_query_clients.json | selectattr('clientId','equalto','TestClient') | first)["attributes"]["post.logout.redirect.uris"] == '/public/logout'
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
keycloak_config_override_template: custom.xml.j2
|
||||
keycloak_http_port: 8081
|
||||
keycloak_management_http_port: 19990
|
||||
keycloak_service_runas: True
|
||||
roles:
|
||||
- role: keycloak
|
||||
tasks:
|
||||
@@ -41,3 +42,14 @@
|
||||
web_origins: "{{ keycloak_client_web_origins }}"
|
||||
users: "{{ keycloak_client_users }}"
|
||||
client_id: TestClient
|
||||
pre_tasks:
|
||||
- name: "Retrieve assets server from env"
|
||||
ansible.builtin.set_fact:
|
||||
assets_server: "{{ lookup('env','MIDDLEWARE_DOWNLOAD_RELEASE_SERVER_URL') }}"
|
||||
|
||||
- name: "Set offline when assets server from env is defined"
|
||||
ansible.builtin.set_fact:
|
||||
sso_offline_install: True
|
||||
when:
|
||||
- assets_server is defined
|
||||
- assets_server | length > 0
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
---
|
||||
dependency:
|
||||
name: shell
|
||||
command: ansible-galaxy collection install -r molecule/requirements.yml -p $HOME/.ansible/collections --force-with-deps
|
||||
driver:
|
||||
name: docker
|
||||
lint: |
|
||||
ansible-lint --version
|
||||
ansible-lint -v
|
||||
platforms:
|
||||
- name: instance
|
||||
image: registry.access.redhat.com/ubi8/ubi-init:latest
|
||||
@@ -38,11 +32,8 @@ verifier:
|
||||
name: ansible
|
||||
scenario:
|
||||
test_sequence:
|
||||
- dependency
|
||||
- lint
|
||||
- cleanup
|
||||
- destroy
|
||||
- syntax
|
||||
- create
|
||||
- prepare
|
||||
- converge
|
||||
|
||||
@@ -14,7 +14,14 @@
|
||||
ansible.builtin.set_fact:
|
||||
assets_server: "{{ lookup('env','MIDDLEWARE_DOWNLOAD_RELEASE_SERVER_URL') }}"
|
||||
|
||||
- name: "Download and deploy jws zips from {{ assets_server }}"
|
||||
- name: "Set offline when assets server from env is defined"
|
||||
ansible.builtin.set_fact:
|
||||
sso_offline_install: True
|
||||
when:
|
||||
- assets_server is defined
|
||||
- assets_server | length > 0
|
||||
|
||||
- name: "Download and deploy zips from {{ assets_server }}"
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ asset }}"
|
||||
dest: "{{ lookup('env', 'PWD') }}"
|
||||
|
||||
44
molecule/quarkus-devmode/converge.yml
Normal file
44
molecule/quarkus-devmode/converge.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
vars:
|
||||
keycloak_quarkus_admin_pass: "remembertochangeme"
|
||||
keycloak_admin_password: "remembertochangeme"
|
||||
keycloak_realm: TestRealm
|
||||
keycloak_quarkus_http_relative_path: ''
|
||||
keycloak_quarkus_log: file
|
||||
keycloak_quarkus_frontend_url: 'http://localhost:8080/'
|
||||
keycloak_quarkus_start_dev: True
|
||||
keycloak_quarkus_proxy_mode: none
|
||||
roles:
|
||||
- role: keycloak_quarkus
|
||||
- role: keycloak_realm
|
||||
keycloak_context: ''
|
||||
keycloak_client_default_roles:
|
||||
- TestRoleAdmin
|
||||
- TestRoleUser
|
||||
keycloak_client_users:
|
||||
- username: TestUser
|
||||
password: password
|
||||
client_roles:
|
||||
- client: TestClient
|
||||
role: TestRoleUser
|
||||
realm: "{{ keycloak_realm }}"
|
||||
- username: TestAdmin
|
||||
password: password
|
||||
client_roles:
|
||||
- client: TestClient
|
||||
role: TestRoleUser
|
||||
realm: "{{ keycloak_realm }}"
|
||||
- client: TestClient
|
||||
role: TestRoleAdmin
|
||||
realm: "{{ keycloak_realm }}"
|
||||
keycloak_realm: TestRealm
|
||||
keycloak_clients:
|
||||
- name: TestClient
|
||||
roles: "{{ keycloak_client_default_roles }}"
|
||||
realm: "{{ keycloak_realm }}"
|
||||
public_client: "{{ keycloak_client_public }}"
|
||||
web_origins: "{{ keycloak_client_web_origins }}"
|
||||
users: "{{ keycloak_client_users }}"
|
||||
client_id: TestClient
|
||||
45
molecule/quarkus-devmode/molecule.yml
Normal file
45
molecule/quarkus-devmode/molecule.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
- name: instance
|
||||
image: registry.access.redhat.com/ubi8/ubi-init:latest
|
||||
pre_build_image: true
|
||||
privileged: true
|
||||
command: "/usr/sbin/init"
|
||||
port_bindings:
|
||||
- "8080/tcp"
|
||||
- "8009/tcp"
|
||||
published_ports:
|
||||
- 0.0.0.0:8080:8080/tcp
|
||||
provisioner:
|
||||
name: ansible
|
||||
config_options:
|
||||
defaults:
|
||||
interpreter_python: auto_silent
|
||||
ssh_connection:
|
||||
pipelining: false
|
||||
playbooks:
|
||||
prepare: prepare.yml
|
||||
converge: converge.yml
|
||||
verify: verify.yml
|
||||
inventory:
|
||||
host_vars:
|
||||
localhost:
|
||||
ansible_python_interpreter: "{{ ansible_playbook_python }}"
|
||||
env:
|
||||
ANSIBLE_FORCE_COLOR: "true"
|
||||
verifier:
|
||||
name: ansible
|
||||
scenario:
|
||||
test_sequence:
|
||||
- cleanup
|
||||
- destroy
|
||||
- create
|
||||
- prepare
|
||||
- converge
|
||||
- idempotence
|
||||
- side_effect
|
||||
- verify
|
||||
- cleanup
|
||||
- destroy
|
||||
12
molecule/quarkus-devmode/prepare.yml
Normal file
12
molecule/quarkus-devmode/prepare.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: Prepare
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: Install sudo
|
||||
ansible.builtin.yum:
|
||||
name: sudo
|
||||
state: present
|
||||
|
||||
- name: "Display hera_home if defined."
|
||||
ansible.builtin.set_fact:
|
||||
hera_home: "{{ lookup('env', 'HERA_HOME') }}"
|
||||
1
molecule/quarkus-devmode/roles
Symbolic link
1
molecule/quarkus-devmode/roles
Symbolic link
@@ -0,0 +1 @@
|
||||
../../roles
|
||||
39
molecule/quarkus-devmode/verify.yml
Normal file
39
molecule/quarkus-devmode/verify.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
- name: Verify
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: Populate service facts
|
||||
ansible.builtin.service_facts:
|
||||
|
||||
- name: Check if keycloak service started
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- ansible_facts.services["keycloak.service"]["state"] == "running"
|
||||
- ansible_facts.services["keycloak.service"]["status"] == "enabled"
|
||||
|
||||
- name: Set internal envvar
|
||||
ansible.builtin.set_fact:
|
||||
hera_home: "{{ lookup('env', 'HERA_HOME') }}"
|
||||
|
||||
- name: Verify openid config
|
||||
block:
|
||||
- name: Fetch openID config # noqa blocked_modules command-instead-of-module
|
||||
ansible.builtin.shell: |
|
||||
set -o pipefail
|
||||
curl http://localhost:8080/realms/master/.well-known/openid-configuration -k | jq .
|
||||
args:
|
||||
executable: /bin/bash
|
||||
delegate_to: localhost
|
||||
register: openid_config
|
||||
changed_when: False
|
||||
- name: Verify endpoint URLs
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- (openid_config.stdout | from_json)["backchannel_authentication_endpoint"] == 'http://localhost:8080/realms/master/protocol/openid-connect/ext/ciba/auth'
|
||||
- (openid_config.stdout | from_json)['issuer'] == 'http://localhost:8080/realms/master'
|
||||
- (openid_config.stdout | from_json)['authorization_endpoint'] == 'http://localhost:8080/realms/master/protocol/openid-connect/auth'
|
||||
- (openid_config.stdout | from_json)['token_endpoint'] == 'http://localhost:8080/realms/master/protocol/openid-connect/token'
|
||||
delegate_to: localhost
|
||||
when:
|
||||
- hera_home is defined
|
||||
- hera_home | length == 0
|
||||
@@ -1,12 +1,6 @@
|
||||
---
|
||||
dependency:
|
||||
name: shell
|
||||
command: ansible-galaxy collection install -r molecule/requirements.yml -p $HOME/.ansible/collections --force-with-deps
|
||||
driver:
|
||||
name: docker
|
||||
lint: |
|
||||
ansible-lint --version
|
||||
ansible-lint -v
|
||||
platforms:
|
||||
- name: instance
|
||||
image: registry.access.redhat.com/ubi8/ubi-init:latest
|
||||
@@ -40,11 +34,8 @@ verifier:
|
||||
name: ansible
|
||||
scenario:
|
||||
test_sequence:
|
||||
- dependency
|
||||
- lint
|
||||
- cleanup
|
||||
- destroy
|
||||
- syntax
|
||||
- create
|
||||
- prepare
|
||||
- converge
|
||||
|
||||
@@ -11,27 +11,32 @@
|
||||
ansible.builtin.set_fact:
|
||||
hera_home: "{{ lookup('env', 'HERA_HOME') }}"
|
||||
|
||||
- ansible.builtin.command: openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 -nodes -subj '/CN=instance'
|
||||
- name: Create certificate request
|
||||
ansible.builtin.command: openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 -nodes -subj '/CN=instance'
|
||||
delegate_to: localhost
|
||||
changed_when: False
|
||||
|
||||
- block:
|
||||
- ansible.builtin.lineinfile:
|
||||
dest: /etc/hosts
|
||||
line: "127.0.0.1 instance"
|
||||
state: present
|
||||
delegate_to: localhost
|
||||
become: yes
|
||||
- name: Set /etc/hosts
|
||||
ansible.builtin.lineinfile:
|
||||
dest: /etc/hosts
|
||||
line: "127.0.0.1 instance"
|
||||
state: present
|
||||
delegate_to: localhost
|
||||
become: yes
|
||||
when:
|
||||
- hera_home is defined
|
||||
- hera_home | length == 0
|
||||
|
||||
- ansible.builtin.file:
|
||||
- name: Create conf directory # risky-file-permissions in test user account does not exist yet
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: /opt/keycloak/keycloak-18.0.0/conf/
|
||||
path: /opt/keycloak/keycloak-22.0.3/conf/
|
||||
mode: 0755
|
||||
|
||||
- ansible.builtin.copy:
|
||||
- name: Copy certificates
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item }}"
|
||||
dest: "/opt/keycloak/keycloak-18.0.0/conf/{{ item }}"
|
||||
dest: "/opt/keycloak/keycloak-22.0.3/conf/{{ item }}"
|
||||
mode: 0444
|
||||
loop:
|
||||
- cert.pem
|
||||
|
||||
@@ -4,26 +4,30 @@
|
||||
tasks:
|
||||
- name: Populate service facts
|
||||
ansible.builtin.service_facts:
|
||||
|
||||
- name: Check if keycloak service started
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- ansible_facts.services["keycloak.service"]["state"] == "running"
|
||||
- ansible_facts.services["keycloak.service"]["status"] == "enabled"
|
||||
|
||||
- set_fact:
|
||||
- name: Set internal envvar
|
||||
ansible.builtin.set_fact:
|
||||
hera_home: "{{ lookup('env', 'HERA_HOME') }}"
|
||||
|
||||
- block:
|
||||
- name: Fetch openID config
|
||||
shell: |
|
||||
- name: Verify openid config
|
||||
block:
|
||||
- name: Fetch openID config # noqa blocked_modules command-instead-of-module
|
||||
ansible.builtin.shell: |
|
||||
set -o pipefail
|
||||
curl https://instance:8443/realms/master/.well-known/openid-configuration -k | jq .
|
||||
args:
|
||||
executable: /bin/bash
|
||||
delegate_to: localhost
|
||||
register: openid_config
|
||||
- debug:
|
||||
msg: " {{ openid_config.stdout | from_json }}"
|
||||
delegate_to: localhost
|
||||
changed_when: False
|
||||
- name: Verify endpoint URLs
|
||||
assert:
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- (openid_config.stdout | from_json)["backchannel_authentication_endpoint"] == 'https://instance/realms/master/protocol/openid-connect/ext/ciba/auth'
|
||||
- (openid_config.stdout | from_json)['issuer'] == 'https://instance/realms/master'
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
---
|
||||
- name: Playbook for Keycloak X Hosts
|
||||
- name: Playbook for Keycloak X Hosts with HTTPS enabled
|
||||
hosts: all
|
||||
vars:
|
||||
keycloak_admin_password: "remembertochangeme"
|
||||
keycloak_quarkus_host: localhost:8443
|
||||
keycloak_quarkus_host: localhost
|
||||
keycloak_quarkus_port: 8443
|
||||
keycloak_quarkus_http_relative_path: ''
|
||||
keycloak_quarkus_log: file
|
||||
keycloak_quarkus_https_enabled: True
|
||||
|
||||
13
playbooks/keycloak_quarkus_dev.yml
Normal file
13
playbooks/keycloak_quarkus_dev.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: Playbook for Keycloak X Hosts in develop mode
|
||||
hosts: all
|
||||
vars:
|
||||
keycloak_admin_password: "remembertochangeme"
|
||||
keycloak_quarkus_host: localhost
|
||||
keycloak_quarkus_port: 8080
|
||||
keycloak_quarkus_http_relative_path: ''
|
||||
keycloak_quarkus_log: file
|
||||
keycloak_quarkus_start_dev: true
|
||||
keycloak_quarkus_proxy_mode: none
|
||||
roles:
|
||||
- middleware_automation.keycloak.keycloak_quarkus
|
||||
@@ -1,52 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2021 Eric Lavarde <elavarde@redhat.com>
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = '''
|
||||
name: version_sort
|
||||
short_description: Sort a list according to version order instead of pure alphabetical one
|
||||
version_added: 2.2.0
|
||||
author: Eric L. (@ericzolf)
|
||||
description:
|
||||
- Sort a list according to version order instead of pure alphabetical one.
|
||||
options:
|
||||
_input:
|
||||
description: A list of strings to sort.
|
||||
type: list
|
||||
elements: string
|
||||
required: true
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: Convert list of tuples into dictionary
|
||||
ansible.builtin.set_fact:
|
||||
dictionary: "{{ ['2.1', '2.10', '2.9'] | middleware_automation.keycloak.version_sort }}"
|
||||
# Result is ['2.1', '2.9', '2.10']
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
_value:
|
||||
description: The list of strings sorted by version.
|
||||
type: list
|
||||
elements: string
|
||||
'''
|
||||
|
||||
from ansible_collections.middleware_automation.keycloak.plugins.module_utils.version import LooseVersion
|
||||
|
||||
|
||||
def version_sort(value, reverse=False):
|
||||
'''Sort a list according to loose versions so that e.g. 2.9 is smaller than 2.10'''
|
||||
return sorted(value, key=LooseVersion, reverse=reverse)
|
||||
|
||||
|
||||
class FilterModule(object):
|
||||
''' Version sort filter '''
|
||||
|
||||
def filters(self):
|
||||
return {
|
||||
'version_sort': version_sort
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (c) 2021, Felix Fontein <felix@fontein.de>
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
"""Provide version object to compare version numbers."""
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
from ansible.module_utils.six import raise_from
|
||||
|
||||
try:
|
||||
from ansible.module_utils.compat.version import LooseVersion # noqa: F401, pylint: disable=unused-import
|
||||
except ImportError:
|
||||
try:
|
||||
from distutils.version import LooseVersion # noqa: F401, pylint: disable=unused-import
|
||||
except ImportError as exc:
|
||||
msg = 'To use this plugin or module with ansible-core 2.11, you need to use Python < 3.12 with distutils.version present'
|
||||
raise_from(ImportError(msg), exc)
|
||||
@@ -57,6 +57,7 @@ Role Defaults
|
||||
|`keycloak_ha_enabled`| Enable auto configuration for database backend, clustering and remote caches on infinispan | `False` |
|
||||
|`keycloak_ha_discovery`| Discovery protocol for HA cluster members | `JDBC_PING` if keycloak_db_enabled else `TCPPING` |
|
||||
|`keycloak_db_enabled`| Enable auto configuration for database backend | `True` if `keycloak_ha_enabled` is True, else `False` |
|
||||
|`keycloak_remote_cache_enabled`| Enable remote cache store when in clustered ha configurations | `True` if `keycloak_ha_enabled` else `False` |
|
||||
|`keycloak_admin_user`| Administration console user account | `admin` |
|
||||
|`keycloak_bind_address`| Address for binding service ports | `0.0.0.0` |
|
||||
|`keycloak_management_port_bind_address`| Address for binding management ports | `127.0.0.1` |
|
||||
@@ -71,7 +72,13 @@ Role Defaults
|
||||
|`keycloak_config_standalone_xml`| filename for configuration | `keycloak.xml` |
|
||||
|`keycloak_service_user`| posix account username | `keycloak` |
|
||||
|`keycloak_service_group`| posix account group | `keycloak` |
|
||||
|`keycloak_service_pidfile`| pid file path for service | `/run/keycloak.pid` |
|
||||
|`keycloak_service_restart_always`| systemd restart always behavior activation | `False`
|
||||
|`keycloak_service_restart_on_failure`| systemd restart on-failure behavior activation | `False`
|
||||
|`keycloak_service_startlimitintervalsec`| systemd StartLimitIntervalSec | `300` |
|
||||
|`keycloak_service_startlimitburst`| systemd StartLimitBurst | `5` |
|
||||
|`keycloak_service_restartsec`| systemd RestartSec | `10s` |
|
||||
|`keycloak_service_pidfile`| pid file path for service | `/run/keycloak/keycloak.pid` |
|
||||
|`keycloak_features` | List of `name`/`status` pairs of features (also known as profiles on RH-SSO) to `enable` or `disable`, example: `[ { name: 'docker', status: 'enabled' } ]` | `[]`
|
||||
|`keycloak_jvm_package`| RHEL java package runtime | `java-1.8.0-openjdk-headless` |
|
||||
|`keycloak_java_home`| JAVA_HOME of installed JRE, leave empty for using specified keycloak_jvm_package RPM path | `None` |
|
||||
|`keycloak_java_opts`| Additional JVM options | `-Xms1024m -Xmx2048m` |
|
||||
@@ -82,7 +89,7 @@ Role Defaults
|
||||
| Variable | Description | Default |
|
||||
|:---------|:------------|:---------|
|
||||
|`keycloak_offline_install` | perform an offline install | `False`|
|
||||
|`keycloak_download_url`| Download URL for keycloak | `https://github.com/keycloak/keycloak/releases/download/<version>/<archive>`|
|
||||
|`keycloak_download_url`| Download URL for keycloak | `https://github.com/keycloak/keycloak/releases/download/<version>/<archive>`|
|
||||
|`keycloak_version`| keycloak.org package version | `18.0.2` |
|
||||
|`keycloak_dest`| Installation root path | `/opt/keycloak` |
|
||||
|`keycloak_download_url` | Download URL for keycloak | `https://github.com/keycloak/keycloak/releases/download/{{ keycloak_version }}/{{ keycloak_archive }}` |
|
||||
@@ -105,6 +112,12 @@ Role Defaults
|
||||
|`keycloak_force_install` | Remove pre-existing versions of service | `False` |
|
||||
|`keycloak_url` | URL for configuration rest calls | `http://{{ keycloak_host }}:{{ keycloak_http_port }}` |
|
||||
|`keycloak_management_url` | URL for management console rest calls | `http://{{ keycloak_host }}:{{ keycloak_management_http_port }}` |
|
||||
|`keycloak_frontend_url_force` | Force backend requests to use the frontend URL | `False` |
|
||||
|`keycloak_db_background_validation` | Enable background validation of database connection | `False` |
|
||||
|`keycloak_db_background_validation_millis`| How frequenly the connection pool is validated in the background | `10000` if background validation enabled |
|
||||
|`keycloak_db_background_validate_on_match` | Enable validate on match for database connections | `False` |
|
||||
|`keycloak_frontend_url` | frontend URL for keycloak endpoint | `http://localhost:8080/auth/` |
|
||||
|
||||
|
||||
|
||||
Role Variables
|
||||
@@ -115,10 +128,10 @@ The following are a set of _required_ variables for the role:
|
||||
| Variable | Description |
|
||||
|:---------|:------------|
|
||||
|`keycloak_admin_password`| Password for the administration console user account (minimum 12 characters) |
|
||||
|`keycloak_frontend_url` | frontend URL for keycloak endpoint | `http://localhost:8080/auth` |
|
||||
|`keycloak_frontend_url` | frontend URL for keycloak endpoint | `http://localhost:8080/auth/` |
|
||||
|
||||
|
||||
The following variables are _required_ only when `keycloak_ha_enabled` is True:
|
||||
The following parameters are _required_ only when `keycloak_ha_enabled` is True:
|
||||
|
||||
| Variable | Description | Default |
|
||||
|:---------|:------------|:--------|
|
||||
@@ -126,7 +139,7 @@ The following variables are _required_ only when `keycloak_ha_enabled` is True:
|
||||
|`keycloak_modcluster_url` | _deprecated_ Host for the modcluster reverse proxy | `localhost` |
|
||||
|`keycloak_modcluster_port` | _deprecated_ Port for the modcluster reverse proxy | `6666` |
|
||||
|`keycloak_modcluster_urls` | List of {host,port} dicts for the modcluster reverse proxies | `[ { localhost:6666 } ]` |
|
||||
|`keycloak_jdbc_engine` | backend database engine when db is enabled: [ postgres, mariadb ] | `postgres` |
|
||||
|`keycloak_jdbc_engine` | backend database engine when db is enabled: [ postgres, mariadb, sqlserver ] | `postgres` |
|
||||
|`keycloak_infinispan_url` | URL for the infinispan remote-cache server | `localhost:11122` |
|
||||
|`keycloak_infinispan_user` | username for connecting to infinispan | `supervisor` |
|
||||
|`keycloak_infinispan_pass` | password for connecting to infinispan | `supervisor` |
|
||||
@@ -136,7 +149,7 @@ The following variables are _required_ only when `keycloak_ha_enabled` is True:
|
||||
|`keycloak_infinispan_trust_store_password`| Password for opening truststore | `changeit` |
|
||||
|
||||
|
||||
The following variables are _required_ only when `keycloak_db_enabled` is True:
|
||||
The following parameters are _required_ only when `keycloak_db_enabled` is True:
|
||||
|
||||
| Variable | Description | Default |
|
||||
|:---------|:------------|:---------|
|
||||
@@ -146,6 +159,14 @@ The following variables are _required_ only when `keycloak_db_enabled` is True:
|
||||
|`keycloak_db_pass` | password for connecting to postgres | `keycloak-pass` |
|
||||
|
||||
|
||||
The following variables are _optional_:
|
||||
|
||||
| Variable | Description |
|
||||
|:---------|:------------|
|
||||
|`keycloak_db_valid_conn_sql` | Override the default database connection validation query sql |
|
||||
|`keycloak_admin_url` | Override the default administration endpoint URL |
|
||||
|`keycloak_jgroups_subnet`| Override the subnet match for jgroups cluster formation; if not defined, it will be inferred from local machine route configuration |
|
||||
|
||||
Example Playbook
|
||||
-----------------
|
||||
|
||||
@@ -156,8 +177,6 @@ Example Playbook
|
||||
- hosts: ...
|
||||
vars:
|
||||
keycloak_admin_password: "remembertochangeme"
|
||||
collections:
|
||||
- middleware_automation.keycloak
|
||||
roles:
|
||||
- middleware_automation.keycloak.keycloak
|
||||
```
|
||||
|
||||
@@ -16,13 +16,20 @@ keycloak_config_dir: "{{ keycloak_jboss_home }}/standalone/configuration"
|
||||
keycloak_config_standalone_xml: "keycloak.xml"
|
||||
keycloak_config_path_to_standalone_xml: "{{ keycloak_jboss_home }}/standalone/configuration/{{ keycloak_config_standalone_xml }}"
|
||||
keycloak_config_override_template: ''
|
||||
keycloak_config_path_to_properties: "{{ keycloak_jboss_home }}/standalone/configuration/profile.properties"
|
||||
keycloak_service_runas: false
|
||||
keycloak_service_user: keycloak
|
||||
keycloak_service_group: keycloak
|
||||
keycloak_service_pidfile: "/run/keycloak.pid"
|
||||
keycloak_service_pidfile: "/run/keycloak/keycloak.pid"
|
||||
keycloak_service_name: keycloak
|
||||
keycloak_service_desc: Keycloak
|
||||
keycloak_service_start_delay: 10
|
||||
keycloak_service_start_retries: 25
|
||||
keycloak_service_restart_always: False
|
||||
keycloak_service_restart_on_failure: False
|
||||
keycloak_service_startlimitintervalsec: "300"
|
||||
keycloak_service_startlimitburst: "5"
|
||||
keycloak_service_restartsec: "10s"
|
||||
|
||||
keycloak_configure_firewalld: False
|
||||
|
||||
@@ -36,11 +43,13 @@ keycloak_http_port: 8080
|
||||
keycloak_https_port: 8443
|
||||
keycloak_ajp_port: 8009
|
||||
keycloak_jgroups_port: 7600
|
||||
keycloak_jgroups_subnet:
|
||||
keycloak_management_port_bind_address: 127.0.0.1
|
||||
keycloak_management_http_port: 9990
|
||||
keycloak_management_https_port: 9993
|
||||
keycloak_java_opts: "-Xms1024m -Xmx2048m"
|
||||
keycloak_prefer_ipv4: True
|
||||
keycloak_features: []
|
||||
|
||||
### Enable configuration for database backend, clustering and remote caches on infinispan
|
||||
keycloak_ha_enabled: False
|
||||
@@ -48,6 +57,8 @@ keycloak_ha_enabled: False
|
||||
keycloak_db_enabled: "{{ True if keycloak_ha_enabled else False }}"
|
||||
### Discovery protocol for ha cluster members, valus [ 'JDBC_PING', 'TCPPING' ]
|
||||
keycloak_ha_discovery: "{{ 'JDBC_PING' if keycloak_db_enabled else 'TCPPING' }}"
|
||||
### Remote cache store on infinispan cluster
|
||||
keycloak_remote_cache_enabled: "{{ True if keycloak_ha_enabled else False }}"
|
||||
|
||||
### Keycloak administration console user
|
||||
keycloak_admin_user: admin
|
||||
@@ -65,7 +76,9 @@ keycloak_modcluster_urls:
|
||||
port: "{{ keycloak_modcluster_port }}"
|
||||
|
||||
### keycloak frontend url
|
||||
keycloak_frontend_url: http://localhost:8080/auth
|
||||
keycloak_frontend_url: http://localhost:8080/auth/
|
||||
keycloak_frontend_url_force: False
|
||||
keycloak_admin_url:
|
||||
|
||||
### infinispan remote caches access (hotrod)
|
||||
keycloak_infinispan_user: supervisor
|
||||
@@ -77,11 +90,15 @@ keycloak_infinispan_use_ssl: False
|
||||
keycloak_infinispan_trust_store_path: /etc/pki/java/cacerts
|
||||
keycloak_infinispan_trust_store_password: changeit
|
||||
|
||||
### database backend engine: values [ 'postgres', 'mariadb' ]
|
||||
### database backend engine: values [ 'postgres', 'mariadb', 'sqlserver' ]
|
||||
keycloak_jdbc_engine: postgres
|
||||
### database backend credentials
|
||||
keycloak_db_user: keycloak-user
|
||||
keycloak_db_pass: keycloak-pass
|
||||
## connection validation
|
||||
keycloak_db_background_validation: False
|
||||
keycloak_db_background_validation_millis: "{{ 10000 if keycloak_db_background_validation else 0 }}"
|
||||
keycloak_db_background_validate_on_match: False
|
||||
keycloak_jdbc_url: "{{ keycloak_default_jdbc[keycloak_jdbc_engine].url }}"
|
||||
keycloak_jdbc_driver_version: "{{ keycloak_default_jdbc[keycloak_jdbc_engine].version }}"
|
||||
# override the variables above, following defaults show minimum supported versions
|
||||
@@ -92,5 +109,8 @@ keycloak_default_jdbc:
|
||||
mariadb:
|
||||
url: 'jdbc:mariadb://localhost:3306/keycloak'
|
||||
version: 2.7.4
|
||||
sqlserver:
|
||||
url: 'jdbc:sqlserver://localhost:1433;databaseName=keycloak;'
|
||||
version: 12.2.0
|
||||
# role specific vars
|
||||
keycloak_no_log: True
|
||||
|
||||
@@ -74,6 +74,11 @@ argument_specs:
|
||||
default: ""
|
||||
description: "Path to custom template for standalone.xml configuration"
|
||||
type: "str"
|
||||
keycloak_service_runas:
|
||||
# line 20 of keycloak/defaults/main.yml
|
||||
default: false
|
||||
description: "Enable execution of service as `keycloak_service_user`"
|
||||
type: "bool"
|
||||
keycloak_service_user:
|
||||
# line 29 of keycloak/defaults/main.yml
|
||||
default: "keycloak"
|
||||
@@ -86,9 +91,14 @@ argument_specs:
|
||||
type: "str"
|
||||
keycloak_service_pidfile:
|
||||
# line 31 of keycloak/defaults/main.yml
|
||||
default: "/run/keycloak.pid"
|
||||
default: "/run/keycloak/keycloak.pid"
|
||||
description: "PID file path for service"
|
||||
type: "str"
|
||||
keycloak_features:
|
||||
# line 17 of keycloak/defaults/main.yml
|
||||
default: "[]"
|
||||
description: "List of `name`/`status` pairs of features (also known as profiles on RH-SSO) to `enable` or `disable`, example: `[ { name: 'docker', status: 'enabled' } ]`"
|
||||
type: "list"
|
||||
keycloak_bind_address:
|
||||
# line 34 of keycloak/defaults/main.yml
|
||||
default: "0.0.0.0"
|
||||
@@ -96,7 +106,7 @@ argument_specs:
|
||||
type: "str"
|
||||
keycloak_management_port_bind_address:
|
||||
default: "127.0.0.1"
|
||||
description: "Address for binding the managemnt ports"
|
||||
description: "Address for binding the management ports"
|
||||
type: "str"
|
||||
keycloak_host:
|
||||
# line 35 of keycloak/defaults/main.yml
|
||||
@@ -199,6 +209,10 @@ argument_specs:
|
||||
default: "http://localhost"
|
||||
description: "Frontend URL for keycloak endpoints when a reverse proxy is used"
|
||||
type: "str"
|
||||
keycloak_frontend_url_force:
|
||||
default: False
|
||||
description: "Force backend requests to use the frontend URL"
|
||||
type: "bool"
|
||||
keycloak_infinispan_user:
|
||||
# line 62 of keycloak/defaults/main.yml
|
||||
default: "supervisor"
|
||||
@@ -237,7 +251,7 @@ argument_specs:
|
||||
keycloak_jdbc_engine:
|
||||
# line 72 of keycloak/defaults/main.yml
|
||||
default: "postgres"
|
||||
description: "Backend database flavour when db is enabled: [ postgres, mariadb ]"
|
||||
description: "Backend database flavour when db is enabled: [ postgres, mariadb, sqlserver ]"
|
||||
type: "str"
|
||||
keycloak_db_user:
|
||||
# line 74 of keycloak/defaults/main.yml
|
||||
@@ -290,10 +304,58 @@ argument_specs:
|
||||
default: "25"
|
||||
description: "How many time should Ansible retry to connect to the service after it was started, before failing."
|
||||
type: "int"
|
||||
keycloak_service_restart_always:
|
||||
default: false
|
||||
description: "systemd restart always behavior activation for keycloak"
|
||||
type: "bool"
|
||||
keycloak_service_restart_on_failure:
|
||||
default: false
|
||||
description: "systemd restart on-failure behavior activation for keycloak"
|
||||
type: "bool"
|
||||
keycloak_service_startlimitintervalsec:
|
||||
default: 300
|
||||
description: "systemd StartLimitIntervalSec for keycloak"
|
||||
type: "int"
|
||||
keycloak_service_startlimitburst:
|
||||
default: 5
|
||||
description: "systemd StartLimitBurst for keycloak"
|
||||
type: "int"
|
||||
keycloak_service_restartsec:
|
||||
default: "5s"
|
||||
description: "systemd RestartSec for keycloak"
|
||||
type: "str"
|
||||
keycloak_no_log:
|
||||
default: true
|
||||
type: "bool"
|
||||
description: "Changes default behavior for no_log for debugging purpose, do not change for production system."
|
||||
keycloak_remote_cache_enabled:
|
||||
default: "{{ True if keycloak_ha_enabled else False }}"
|
||||
description: "Enable remote cache store when in clustered ha configurations"
|
||||
type: "bool"
|
||||
keycloak_db_background_validation:
|
||||
default: False
|
||||
description: "Enable background validation of database connection"
|
||||
type: "bool"
|
||||
keycloak_db_background_validation_millis:
|
||||
default: "{{ 10000 if keycloak_db_background_validation else 0 }}"
|
||||
description: "How frequenly the connection pool is validated in the background"
|
||||
type: 'int'
|
||||
keycloak_db_background_validate_on_match:
|
||||
default: False
|
||||
description: "Enable validate on match for database connections"
|
||||
type: "bool"
|
||||
keycloak_db_valid_conn_sql:
|
||||
required: False
|
||||
description: "Override the default database connection validation query sql"
|
||||
type: "str"
|
||||
keycloak_admin_url:
|
||||
required: False
|
||||
description: "Override the default administration endpoint URL"
|
||||
type: "str"
|
||||
keycloak_jgroups_subnet:
|
||||
required: False
|
||||
description: "Override the subnet match for jgroups cluster formation; if not defined, it will be inferred from local machine route configuration"
|
||||
type: "str"
|
||||
downstream:
|
||||
options:
|
||||
sso_version:
|
||||
|
||||
@@ -53,6 +53,15 @@
|
||||
group: "{{ keycloak_service_group }}"
|
||||
mode: 0750
|
||||
|
||||
- name: Create pidfile folder
|
||||
become: yes
|
||||
ansible.builtin.file:
|
||||
dest: "{{ keycloak_service_pidfile | dirname }}"
|
||||
state: directory
|
||||
owner: "{{ keycloak_service_user if keycloak_service_runas else omit }}"
|
||||
group: "{{ keycloak_service_group if keycloak_service_runas else omit }}"
|
||||
mode: 0750
|
||||
|
||||
## check remote archive
|
||||
- name: Set download archive path
|
||||
ansible.builtin.set_fact:
|
||||
@@ -194,22 +203,42 @@
|
||||
become: yes
|
||||
changed_when: false
|
||||
|
||||
- name: Ensure permissions are correct on existing deploy
|
||||
ansible.builtin.command: chown -R "{{ keycloak_service_user }}:{{ keycloak_service_group }}" "{{ keycloak.home }}"
|
||||
when: keycloak_service_runas
|
||||
become: yes
|
||||
changed_when: false
|
||||
|
||||
# driver and configuration
|
||||
- name: "Install {{ keycloak_jdbc_engine }} driver"
|
||||
ansible.builtin.include_tasks: jdbc_driver.yml
|
||||
when: keycloak_jdbc[keycloak_jdbc_engine].enabled
|
||||
|
||||
- name: "Deploy {{ keycloak.service_name }} config to {{ keycloak_config_path_to_standalone_xml }} from {{ keycloak.config_template_source }}"
|
||||
- name: "Deploy custom {{ keycloak.service_name }} config to {{ keycloak_config_path_to_standalone_xml }} from {{ keycloak_config_override_template }}"
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: "templates/{{ keycloak.config_template_source }}"
|
||||
src: "templates/{{ keycloak_config_override_template }}"
|
||||
dest: "{{ keycloak_config_path_to_standalone_xml }}"
|
||||
owner: "{{ keycloak_service_user }}"
|
||||
group: "{{ keycloak_service_group }}"
|
||||
mode: 0640
|
||||
notify:
|
||||
- restart keycloak
|
||||
when: not keycloak_remotecache.enabled or keycloak_config_override_template | length > 0
|
||||
when: keycloak_config_override_template | length > 0
|
||||
|
||||
- name: "Deploy standalone {{ keycloak.service_name }} config to {{ keycloak_config_path_to_standalone_xml }}"
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: templates/standalone.xml.j2
|
||||
dest: "{{ keycloak_config_path_to_standalone_xml }}"
|
||||
owner: "{{ keycloak_service_user }}"
|
||||
group: "{{ keycloak_service_group }}"
|
||||
mode: 0640
|
||||
notify:
|
||||
- restart keycloak
|
||||
when:
|
||||
- not keycloak_ha_enabled
|
||||
- keycloak_config_override_template | length == 0
|
||||
|
||||
- name: Create tcpping cluster node list
|
||||
ansible.builtin.set_fact:
|
||||
@@ -218,14 +247,29 @@
|
||||
{
|
||||
"name": item,
|
||||
"address": 'jgroups-' + item,
|
||||
"inventory_host": hostvars[item].ansible_default_ipv4.address | default(item) + '[' + keycloak_jgroups_port + ']',
|
||||
"inventory_host": hostvars[item].ansible_default_ipv4.address | default(item) + '[' + (keycloak_jgroups_port | string) + ']',
|
||||
"value": hostvars[item].ansible_default_ipv4.address | default(item)
|
||||
}
|
||||
] }}
|
||||
loop: "{{ ansible_play_batch }}"
|
||||
loop: "{{ ansible_play_batch }}"
|
||||
when: keycloak_ha_enabled and keycloak_ha_discovery == 'TCPPING'
|
||||
|
||||
- name: "Deploy {{ keycloak.service_name }} config with remote cache store to {{ keycloak_config_path_to_standalone_xml }}"
|
||||
- name: "Deploy HA {{ keycloak.service_name }} config to {{ keycloak_config_path_to_standalone_xml }}"
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: templates/standalone-ha.xml.j2
|
||||
dest: "{{ keycloak_config_path_to_standalone_xml }}"
|
||||
owner: "{{ keycloak_service_user }}"
|
||||
group: "{{ keycloak_service_group }}"
|
||||
mode: 0640
|
||||
notify:
|
||||
- restart keycloak
|
||||
when:
|
||||
- keycloak_ha_enabled
|
||||
- not keycloak_remote_cache_enabled
|
||||
- keycloak_config_override_template | length == 0
|
||||
|
||||
- name: "Deploy HA {{ keycloak.service_name }} config with infinispan remote cache store to {{ keycloak_config_path_to_standalone_xml }}"
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: templates/standalone-infinispan.xml.j2
|
||||
@@ -235,4 +279,19 @@
|
||||
mode: 0640
|
||||
notify:
|
||||
- restart keycloak
|
||||
when: keycloak_remotecache.enabled
|
||||
when:
|
||||
- keycloak_ha_enabled
|
||||
- keycloak_remote_cache_enabled
|
||||
- keycloak_config_override_template | length == 0
|
||||
|
||||
- name: "Deploy profile.properties file to {{ keycloak_config_path_to_properties }}"
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: keycloak-profile.properties.j2
|
||||
dest: "{{ keycloak_config_path_to_properties }}"
|
||||
owner: "{{ keycloak_service_user }}"
|
||||
group: "{{ keycloak_service_group }}"
|
||||
mode: 0640
|
||||
notify:
|
||||
- restart keycloak
|
||||
when: keycloak_features | length > 0
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
- name: Validate persistence configuration
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- keycloak_jdbc_engine is defined and keycloak_jdbc_engine in [ 'postgres', 'mariadb' ]
|
||||
- keycloak_jdbc_engine is defined and keycloak_jdbc_engine in [ 'postgres', 'mariadb', 'sqlserver' ]
|
||||
- keycloak_jdbc_url | length > 0
|
||||
- keycloak_db_user | length > 0
|
||||
- keycloak_db_pass | length > 0
|
||||
@@ -43,4 +43,5 @@
|
||||
- "{{ keycloak_jvm_package }}"
|
||||
- unzip
|
||||
- procps-ng
|
||||
- initscripts
|
||||
- initscripts
|
||||
- tzdata-java
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
- name: Set download patch archive path
|
||||
ansible.builtin.set_fact:
|
||||
patch_archive: "{{ keycloak_dest }}/{{ sso_patch_bundle }}"
|
||||
patch_bundle: "{{ sso_patch_bundle }}"
|
||||
patch_version: "{{ sso_patch_version }}"
|
||||
when: sso_patch_version is defined
|
||||
|
||||
- name: Check download patch archive path
|
||||
@@ -10,6 +12,7 @@
|
||||
path: "{{ patch_archive }}"
|
||||
register: patch_archive_path
|
||||
when: sso_patch_version is defined
|
||||
become: yes
|
||||
|
||||
- name: Perform patch download from RHN via JBossNetwork API
|
||||
delegate_to: localhost
|
||||
@@ -32,15 +35,15 @@
|
||||
run_once: yes
|
||||
|
||||
- name: Determine patch versions list
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
filtered_versions: "{{ rhn_products.results | map(attribute='file_path') | select('match', '^[^/]*/rh-sso-.*[0-9]*[.][0-9]*[.][0-9]*.*$') | map('regex_replace','[^/]*/rh-sso-([0-9]*[.][0-9]*[.][0-9]*)-.*','\\1' ) | list | unique }}"
|
||||
when: sso_patch_version is not defined or sso_patch_version | length == 0
|
||||
delegate_to: localhost
|
||||
run_once: yes
|
||||
|
||||
- name: Determine latest version
|
||||
set_fact:
|
||||
sso_latest_version: "{{ filtered_versions | middleware_automation.keycloak.version_sort | last }}"
|
||||
ansible.builtin.set_fact:
|
||||
sso_latest_version: "{{ filtered_versions | middleware_automation.common.version_sort | last }}"
|
||||
when: sso_patch_version is not defined or sso_patch_version | length == 0
|
||||
delegate_to: localhost
|
||||
run_once: yes
|
||||
@@ -55,7 +58,7 @@
|
||||
run_once: yes
|
||||
|
||||
- name: "Determine selected patch from supplied version: {{ sso_patch_version }}"
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
rhn_filtered_products: "{{ rhn_products.results | selectattr('file_path', 'match', '[^/]*/' + sso_patch_bundle + '$') }}"
|
||||
patch_bundle: "{{ sso_patch_bundle }}"
|
||||
patch_version: "{{ sso_patch_version }}"
|
||||
|
||||
@@ -10,14 +10,9 @@
|
||||
notify:
|
||||
- restart keycloak
|
||||
|
||||
- name: Determine JAVA_HOME for selected JVM RPM # noqa blocked_modules
|
||||
ansible.builtin.shell: |
|
||||
set -o pipefail
|
||||
rpm -ql {{ keycloak_jvm_package }} | grep -Po '/usr/lib/jvm/.*(?=/bin/java$)'
|
||||
args:
|
||||
executable: /bin/bash
|
||||
changed_when: False
|
||||
register: rpm_java_home
|
||||
- name: Determine JAVA_HOME for selected JVM RPM
|
||||
ansible.builtin.set_fact:
|
||||
rpm_java_home: "/etc/alternatives/jre_{{ keycloak_jvm_package | regex_search('(?<=java-)[0-9.]+') }}"
|
||||
|
||||
- name: "Configure sysconfig file for {{ keycloak.service_name }} service"
|
||||
become: yes
|
||||
@@ -28,7 +23,7 @@
|
||||
group: root
|
||||
mode: 0644
|
||||
vars:
|
||||
keycloak_rpm_java_home: "{{ rpm_java_home.stdout }}"
|
||||
keycloak_rpm_java_home: "{{ rpm_java_home }}"
|
||||
notify:
|
||||
- restart keycloak
|
||||
|
||||
|
||||
@@ -631,7 +631,7 @@
|
||||
</mail-session>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:metrics:1.0" security-enabled="false" exposed-subsystems="*" prefix="${wildfly.metrics.prefix:jboss}"/>
|
||||
{% if keycloak_modcluster.enabled %}
|
||||
{% if keycloak_modcluster.enabled %}
|
||||
<subsystem xmlns="urn:jboss:domain:modcluster:5.0">
|
||||
<proxy name="default" advertise="false" listener="ajp" proxies="proxy1">
|
||||
<dynamic-load-provider>
|
||||
@@ -639,7 +639,7 @@
|
||||
</dynamic-load-provider>
|
||||
</proxy>
|
||||
</subsystem>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<subsystem xmlns="urn:jboss:domain:naming:2.0">
|
||||
<remote-naming/>
|
||||
</subsystem>
|
||||
@@ -728,7 +728,7 @@
|
||||
</interface>
|
||||
<interface name="jgroups">
|
||||
{% if ansible_default_ipv4 is defined %}
|
||||
<subnet-match value="{{ (ansible_default_ipv4.network + '/' + ansible_default_ipv4.netmask) | ipaddr('net') }}"/>
|
||||
<subnet-match value="{{ (ansible_default_ipv4.network + '/' + ansible_default_ipv4.netmask) | ansible.utils.ipaddr('net') }}"/>
|
||||
{% else %}
|
||||
<any-address />
|
||||
{% endif %}
|
||||
|
||||
@@ -725,7 +725,7 @@
|
||||
</interface>
|
||||
<interface name="jgroups">
|
||||
{% if ansible_default_ipv4 is defined %}
|
||||
<subnet-match value="{{ (ansible_default_ipv4.network + '/' + ansible_default_ipv4.netmask) | ipaddr('net') }}"/>
|
||||
<subnet-match value="{{ (ansible_default_ipv4.network + '/' + ansible_default_ipv4.netmask) | ansible.utils.ipaddr('net') }}"/>
|
||||
{% else %}
|
||||
<any-address />
|
||||
{% endif %}
|
||||
|
||||
3
roles/keycloak/templates/keycloak-profile.properties.j2
Normal file
3
roles/keycloak/templates/keycloak-profile.properties.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
{% for feature in keycloak.features %}
|
||||
feature.{{ feature.name }}={{ feature.status | default('enabled') }}
|
||||
{% endfor %}
|
||||
@@ -8,4 +8,12 @@ KEYCLOAK_HTTPS_PORT={{ keycloak_https_port }}
|
||||
KEYCLOAK_MANAGEMENT_HTTP_PORT={{ keycloak_management_http_port }}
|
||||
KEYCLOAK_MANAGEMENT_HTTPS_PORT={{ keycloak_management_https_port }}
|
||||
JBOSS_PIDFILE='{{ keycloak_service_pidfile }}'
|
||||
LAUNCH_JBOSS_IN_BACKGROUND=1
|
||||
|
||||
WILDFLY_OPTS=-Djboss.bind.address=${KEYCLOAK_BIND_ADDRESS} \
|
||||
-Djboss.http.port=${KEYCLOAK_HTTP_PORT} \
|
||||
-Djboss.https.port=${KEYCLOAK_HTTPS_PORT} \
|
||||
-Djboss.management.http.port=${KEYCLOAK_MANAGEMENT_HTTP_PORT} \
|
||||
-Djboss.management.https.port=${KEYCLOAK_MANAGEMENT_HTTPS_PORT} \
|
||||
-Djboss.node.name={{ inventory_hostname }} \
|
||||
{% if keycloak_prefer_ipv4 %}-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true {% endif %}\
|
||||
{% if keycloak_config_standalone_xml is defined %}--server-config={{ keycloak_config_standalone_xml }}{% endif %}
|
||||
|
||||
@@ -2,16 +2,28 @@
|
||||
[Unit]
|
||||
Description={{ keycloak.service_name }} Server
|
||||
After=network.target
|
||||
StartLimitIntervalSec={{ keycloak_service_startlimitintervalsec }}
|
||||
StartLimitBurst={{ keycloak_service_startlimitburst }}
|
||||
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
{% if keycloak_service_runas %}
|
||||
User={{ keycloak_service_user }}
|
||||
Group={{ keycloak_service_group }}
|
||||
{% endif -%}
|
||||
EnvironmentFile=-/etc/sysconfig/keycloak
|
||||
PIDFile={{ keycloak_service_pidfile }}
|
||||
ExecStart={{ keycloak_dest }}/keycloak-service.sh start
|
||||
ExecStop={{ keycloak_dest }}/keycloak-service.sh stop
|
||||
ExecStart={{ keycloak.home }}/bin/standalone.sh $WILDFLY_OPTS
|
||||
WorkingDirectory={{ keycloak.home }}
|
||||
TimeoutStartSec=30
|
||||
TimeoutStopSec=30
|
||||
LimitNOFILE=102642
|
||||
{% if keycloak_service_restart_always %}
|
||||
Restart=always
|
||||
{% elif keycloak_service_restart_on_failure %}
|
||||
Restart=on-failure
|
||||
{% endif %}
|
||||
RestartSec={{ keycloak_service_restartsec }}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
707
roles/keycloak/templates/standalone-ha.xml.j2
Normal file
707
roles/keycloak/templates/standalone-ha.xml.j2
Normal file
@@ -0,0 +1,707 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- {{ ansible_managed }} -->
|
||||
<server xmlns="urn:jboss:domain:16.0">
|
||||
<extensions>
|
||||
<extension module="org.jboss.as.clustering.infinispan"/>
|
||||
<extension module="org.jboss.as.clustering.jgroups"/>
|
||||
<extension module="org.jboss.as.connector"/>
|
||||
<extension module="org.jboss.as.deployment-scanner"/>
|
||||
<extension module="org.jboss.as.ee"/>
|
||||
<extension module="org.jboss.as.ejb3"/>
|
||||
<extension module="org.jboss.as.jaxrs"/>
|
||||
<extension module="org.jboss.as.jmx"/>
|
||||
<extension module="org.jboss.as.jpa"/>
|
||||
<extension module="org.jboss.as.logging"/>
|
||||
<extension module="org.jboss.as.mail"/>
|
||||
<extension module="org.jboss.as.modcluster"/>
|
||||
<extension module="org.jboss.as.naming"/>
|
||||
<extension module="org.jboss.as.remoting"/>
|
||||
<extension module="org.jboss.as.transactions"/>
|
||||
<extension module="org.jboss.as.weld"/>
|
||||
<extension module="org.keycloak.keycloak-server-subsystem"/>
|
||||
<extension module="org.wildfly.extension.bean-validation"/>
|
||||
<extension module="org.wildfly.extension.core-management"/>
|
||||
<extension module="org.wildfly.extension.elytron"/>
|
||||
<extension module="org.wildfly.extension.health"/>
|
||||
<extension module="org.wildfly.extension.io"/>
|
||||
<extension module="org.wildfly.extension.metrics"/>
|
||||
<extension module="org.wildfly.extension.request-controller"/>
|
||||
<extension module="org.wildfly.extension.security.manager"/>
|
||||
<extension module="org.wildfly.extension.undertow"/>
|
||||
</extensions>
|
||||
<management>
|
||||
<audit-log>
|
||||
<formatters>
|
||||
<json-formatter name="json-formatter"/>
|
||||
</formatters>
|
||||
<handlers>
|
||||
<file-handler name="file" formatter="json-formatter" path="audit-log.log" relative-to="jboss.server.data.dir"/>
|
||||
</handlers>
|
||||
<logger log-boot="true" log-read-only="false" enabled="false">
|
||||
<handlers>
|
||||
<handler name="file"/>
|
||||
</handlers>
|
||||
</logger>
|
||||
</audit-log>
|
||||
<management-interfaces>
|
||||
<http-interface http-authentication-factory="management-http-authentication">
|
||||
<http-upgrade enabled="true" sasl-authentication-factory="management-sasl-authentication"/>
|
||||
<socket-binding http="management-http"/>
|
||||
</http-interface>
|
||||
</management-interfaces>
|
||||
<access-control provider="simple">
|
||||
<role-mapping>
|
||||
<role name="SuperUser">
|
||||
<include>
|
||||
<user name="$local"/>
|
||||
</include>
|
||||
</role>
|
||||
</role-mapping>
|
||||
</access-control>
|
||||
</management>
|
||||
<profile>
|
||||
<subsystem xmlns="urn:jboss:domain:logging:8.0">
|
||||
<console-handler name="CONSOLE">
|
||||
<level name="INFO"/>
|
||||
<formatter>
|
||||
<named-formatter name="COLOR-PATTERN"/>
|
||||
</formatter>
|
||||
</console-handler>
|
||||
<periodic-rotating-file-handler name="FILE" autoflush="true">
|
||||
<formatter>
|
||||
<named-formatter name="PATTERN"/>
|
||||
</formatter>
|
||||
<file relative-to="jboss.server.log.dir" path="server.log"/>
|
||||
<suffix value=".yyyy-MM-dd"/>
|
||||
<append value="true"/>
|
||||
</periodic-rotating-file-handler>
|
||||
<logger category="com.arjuna">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="io.jaegertracing.Configuration">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="org.jboss.as.config">
|
||||
<level name="DEBUG"/>
|
||||
</logger>
|
||||
<logger category="sun.rmi">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="org.keycloak.cluster.infinispan">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.keycloak.connections.infinispan">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.keycloak.models.cache.infinispan">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.keycloak.models.sessions.infinispan">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<root-logger>
|
||||
<level name="INFO"/>
|
||||
<handlers>
|
||||
<handler name="CONSOLE"/>
|
||||
<handler name="FILE"/>
|
||||
</handlers>
|
||||
</root-logger>
|
||||
<formatter name="PATTERN">
|
||||
<pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
|
||||
</formatter>
|
||||
<formatter name="COLOR-PATTERN">
|
||||
<pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
|
||||
</formatter>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:bean-validation:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:core-management:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:datasources:6.0">
|
||||
<datasources>
|
||||
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
|
||||
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
|
||||
<driver>h2</driver>
|
||||
<security>
|
||||
<user-name>sa</user-name>
|
||||
<password>sa</password>
|
||||
</security>
|
||||
</datasource>
|
||||
<datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
|
||||
{% if keycloak_jdbc[keycloak_jdbc_engine].enabled %}
|
||||
<connection-url>{{ keycloak_jdbc[keycloak_jdbc_engine].connection_url }}</connection-url>
|
||||
<driver>{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_name }}</driver>
|
||||
<pool>
|
||||
<max-pool-size>20</max-pool-size>
|
||||
</pool>
|
||||
<security>
|
||||
<user-name>{{ keycloak_jdbc[keycloak_jdbc_engine].db_user }}</user-name>
|
||||
<password>{{ keycloak_jdbc[keycloak_jdbc_engine].db_password }}</password>
|
||||
</security>
|
||||
<validation>
|
||||
<check-valid-connection-sql>{{ keycloak_jdbc[keycloak_jdbc_engine].validate_query }}</check-valid-connection-sql>
|
||||
<validate-on-match>{{ keycloak_db_background_validate_on_match }}</validate-on-match>
|
||||
{% if keycloak_db_background_validation_millis | int > 0 or keycloak_db_background_validation %}
|
||||
<background-validation>{{ keycloak_db_background_validation }}</background-validation>
|
||||
<background-validation-millis>{{ keycloak_db_background_validation_millis }}</background-validation-millis>
|
||||
{% endif %}
|
||||
</validation>
|
||||
{% else %}
|
||||
<connection-url>jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE</connection-url>
|
||||
<driver>h2</driver>
|
||||
<security>
|
||||
<user-name>sa</user-name>
|
||||
<password>sa</password>
|
||||
</security>
|
||||
{% endif %}
|
||||
</datasource>
|
||||
<drivers>
|
||||
{% if keycloak_jdbc[keycloak_jdbc_engine].enabled %}
|
||||
<driver name="{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_name }}" module="{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_name }}">
|
||||
<driver-class>{{ keycloak_jdbc[keycloak_jdbc_engine].driver_class }}</driver-class>
|
||||
<xa-datasource-class>{{ keycloak_jdbc[keycloak_jdbc_engine].xa_datasource_class }}</xa-datasource-class>
|
||||
</driver>
|
||||
{% endif %}
|
||||
<driver name="h2" module="com.h2database.h2">
|
||||
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
|
||||
</driver>
|
||||
</drivers>
|
||||
</datasources>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
|
||||
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:ee:6.0">
|
||||
<spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
|
||||
<concurrent>
|
||||
<context-services>
|
||||
<context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default" use-transaction-setup-provider="true"/>
|
||||
</context-services>
|
||||
<managed-thread-factories>
|
||||
<managed-thread-factory name="default" jndi-name="java:jboss/ee/concurrency/factory/default" context-service="default"/>
|
||||
</managed-thread-factories>
|
||||
<managed-executor-services>
|
||||
<managed-executor-service name="default" jndi-name="java:jboss/ee/concurrency/executor/default" context-service="default" hung-task-termination-period="0" hung-task-threshold="60000" keepalive-time="5000"/>
|
||||
</managed-executor-services>
|
||||
<managed-scheduled-executor-services>
|
||||
<managed-scheduled-executor-service name="default" jndi-name="java:jboss/ee/concurrency/scheduler/default" context-service="default" hung-task-termination-period="0" hung-task-threshold="60000" keepalive-time="3000"/>
|
||||
</managed-scheduled-executor-services>
|
||||
</concurrent>
|
||||
<default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/ExampleDS" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:ejb3:9.0">
|
||||
<session-bean>
|
||||
<stateless>
|
||||
<bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
|
||||
</stateless>
|
||||
<stateful default-access-timeout="5000" cache-ref="distributable" passivation-disabled-cache-ref="simple"/>
|
||||
<singleton default-access-timeout="5000"/>
|
||||
</session-bean>
|
||||
<pools>
|
||||
<bean-instance-pools>
|
||||
<strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
|
||||
<strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
|
||||
</bean-instance-pools>
|
||||
</pools>
|
||||
<caches>
|
||||
<cache name="simple"/>
|
||||
<cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/>
|
||||
</caches>
|
||||
<passivation-stores>
|
||||
<passivation-store name="infinispan" cache-container="ejb" max-size="10000"/>
|
||||
</passivation-stores>
|
||||
<async thread-pool-name="default"/>
|
||||
<timer-service thread-pool-name="default" default-data-store="default-file-store">
|
||||
<data-stores>
|
||||
<file-data-store name="default-file-store" path="timer-service-data" relative-to="jboss.server.data.dir"/>
|
||||
</data-stores>
|
||||
</timer-service>
|
||||
<remote cluster="ejb" connectors="http-remoting-connector" thread-pool-name="default">
|
||||
<channel-creation-options>
|
||||
<option name="MAX_OUTBOUND_MESSAGES" value="1234" type="remoting"/>
|
||||
</channel-creation-options>
|
||||
</remote>
|
||||
<thread-pools>
|
||||
<thread-pool name="default">
|
||||
<max-threads count="10"/>
|
||||
<keepalive-time time="60" unit="seconds"/>
|
||||
</thread-pool>
|
||||
</thread-pools>
|
||||
<default-security-domain value="other"/>
|
||||
<application-security-domains>
|
||||
<application-security-domain name="other" security-domain="ApplicationDomain"/>
|
||||
</application-security-domains>
|
||||
<default-missing-method-permissions-deny-access value="true"/>
|
||||
<statistics enabled="${wildfly.ejb3.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
|
||||
<log-system-exceptions value="true"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:elytron:13.0" final-providers="combined-providers" disallowed-providers="OracleUcrypto">
|
||||
<providers>
|
||||
<aggregate-providers name="combined-providers">
|
||||
<providers name="elytron"/>
|
||||
<providers name="openssl"/>
|
||||
</aggregate-providers>
|
||||
<provider-loader name="elytron" module="org.wildfly.security.elytron"/>
|
||||
<provider-loader name="openssl" module="org.wildfly.openssl"/>
|
||||
</providers>
|
||||
<audit-logging>
|
||||
<file-audit-log name="local-audit" path="audit.log" relative-to="jboss.server.log.dir" format="JSON"/>
|
||||
</audit-logging>
|
||||
<security-domains>
|
||||
<security-domain name="ApplicationDomain" default-realm="ApplicationRealm" permission-mapper="default-permission-mapper">
|
||||
<realm name="ApplicationRealm" role-decoder="groups-to-roles"/>
|
||||
<realm name="local"/>
|
||||
</security-domain>
|
||||
<security-domain name="ManagementDomain" default-realm="ManagementRealm" permission-mapper="default-permission-mapper">
|
||||
<realm name="ManagementRealm" role-decoder="groups-to-roles"/>
|
||||
<realm name="local" role-mapper="super-user-mapper"/>
|
||||
</security-domain>
|
||||
</security-domains>
|
||||
<security-realms>
|
||||
<identity-realm name="local" identity="$local"/>
|
||||
<properties-realm name="ApplicationRealm">
|
||||
<users-properties path="application-users.properties" relative-to="jboss.server.config.dir" digest-realm-name="ApplicationRealm"/>
|
||||
<groups-properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
|
||||
</properties-realm>
|
||||
<properties-realm name="ManagementRealm">
|
||||
<users-properties path="mgmt-users.properties" relative-to="jboss.server.config.dir" digest-realm-name="ManagementRealm"/>
|
||||
<groups-properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
|
||||
</properties-realm>
|
||||
</security-realms>
|
||||
<mappers>
|
||||
<simple-permission-mapper name="default-permission-mapper" mapping-mode="first">
|
||||
<permission-mapping>
|
||||
<principal name="anonymous"/>
|
||||
<permission-set name="default-permissions"/>
|
||||
</permission-mapping>
|
||||
<permission-mapping match-all="true">
|
||||
<permission-set name="login-permission"/>
|
||||
<permission-set name="default-permissions"/>
|
||||
</permission-mapping>
|
||||
</simple-permission-mapper>
|
||||
<constant-realm-mapper name="local" realm-name="local"/>
|
||||
<simple-role-decoder name="groups-to-roles" attribute="groups"/>
|
||||
<constant-role-mapper name="super-user-mapper">
|
||||
<role name="SuperUser"/>
|
||||
</constant-role-mapper>
|
||||
</mappers>
|
||||
<permission-sets>
|
||||
<permission-set name="login-permission">
|
||||
<permission class-name="org.wildfly.security.auth.permission.LoginPermission"/>
|
||||
</permission-set>
|
||||
<permission-set name="default-permissions">
|
||||
<permission class-name="org.wildfly.extension.batch.jberet.deployment.BatchPermission" module="org.wildfly.extension.batch.jberet" target-name="*"/>
|
||||
<permission class-name="org.wildfly.transaction.client.RemoteTransactionPermission" module="org.wildfly.transaction.client"/>
|
||||
<permission class-name="org.jboss.ejb.client.RemoteEJBPermission" module="org.jboss.ejb-client"/>
|
||||
<permission class-name="org.jboss.ejb.client.RemoteEJBPermission" module="org.jboss.ejb-client"/>
|
||||
</permission-set>
|
||||
</permission-sets>
|
||||
<http>
|
||||
<http-authentication-factory name="management-http-authentication" security-domain="ManagementDomain" http-server-mechanism-factory="global">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="DIGEST">
|
||||
<mechanism-realm realm-name="ManagementRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</http-authentication-factory>
|
||||
<http-authentication-factory name="application-http-authentication" security-domain="ApplicationDomain" http-server-mechanism-factory="global">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="BASIC">
|
||||
<mechanism-realm realm-name="ApplicationRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</http-authentication-factory>
|
||||
<provider-http-server-mechanism-factory name="global"/>
|
||||
</http>
|
||||
<sasl>
|
||||
<sasl-authentication-factory name="application-sasl-authentication" sasl-server-factory="configured" security-domain="ApplicationDomain">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="JBOSS-LOCAL-USER" realm-mapper="local"/>
|
||||
<mechanism mechanism-name="DIGEST-MD5">
|
||||
<mechanism-realm realm-name="ApplicationRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</sasl-authentication-factory>
|
||||
<sasl-authentication-factory name="management-sasl-authentication" sasl-server-factory="configured" security-domain="ManagementDomain">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="JBOSS-LOCAL-USER" realm-mapper="local"/>
|
||||
<mechanism mechanism-name="DIGEST-MD5">
|
||||
<mechanism-realm realm-name="ManagementRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</sasl-authentication-factory>
|
||||
<configurable-sasl-server-factory name="configured" sasl-server-factory="elytron">
|
||||
<properties>
|
||||
<property name="wildfly.sasl.local-user.default-user" value="$local"/>
|
||||
</properties>
|
||||
</configurable-sasl-server-factory>
|
||||
<mechanism-provider-filtering-sasl-server-factory name="elytron" sasl-server-factory="global">
|
||||
<filters>
|
||||
<filter provider-name="WildFlyElytron"/>
|
||||
</filters>
|
||||
</mechanism-provider-filtering-sasl-server-factory>
|
||||
<provider-sasl-server-factory name="global"/>
|
||||
</sasl>
|
||||
<tls>
|
||||
<key-stores>
|
||||
<key-store name="applicationKS">
|
||||
<credential-reference clear-text="password"/>
|
||||
<implementation type="JKS"/>
|
||||
<file path="application.keystore" relative-to="jboss.server.config.dir"/>
|
||||
</key-store>
|
||||
</key-stores>
|
||||
<key-managers>
|
||||
<key-manager name="applicationKM" key-store="applicationKS" generate-self-signed-certificate-host="localhost">
|
||||
<credential-reference clear-text="password"/>
|
||||
</key-manager>
|
||||
</key-managers>
|
||||
<server-ssl-contexts>
|
||||
<server-ssl-context name="applicationSSC" key-manager="applicationKM"/>
|
||||
</server-ssl-contexts>
|
||||
</tls>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:health:1.0" security-enabled="false"/>
|
||||
<subsystem xmlns="urn:jboss:domain:infinispan:12.0">
|
||||
<cache-container name="ejb" default-cache="dist" aliases="sfsb" modules="org.wildfly.clustering.ejb.infinispan">
|
||||
<transport lock-timeout="60000"/>
|
||||
<distributed-cache name="dist">
|
||||
<locking isolation="REPEATABLE_READ"/>
|
||||
<transaction mode="BATCH"/>
|
||||
<file-store/>
|
||||
</distributed-cache>
|
||||
</cache-container>
|
||||
<cache-container name="keycloak">
|
||||
<transport lock-timeout="60000"/>
|
||||
<local-cache name="realms">
|
||||
<heap-memory size="10000"/>
|
||||
</local-cache>
|
||||
<local-cache name="users">
|
||||
<heap-memory size="10000"/>
|
||||
</local-cache>
|
||||
<replicated-cache name="work"/>
|
||||
<distributed-cache name="sessions" owners="2"/>
|
||||
<distributed-cache name="authenticationSessions" owners="2"/>
|
||||
<distributed-cache name="offlineSessions" owners="2"/>
|
||||
<distributed-cache name="clientSessions" owners="2"/>
|
||||
<distributed-cache name="offlineClientSessions" owners="2"/>
|
||||
<distributed-cache name="loginFailures" owners="2"/>
|
||||
<distributed-cache name="actionTokens" owners="2">
|
||||
<expiration interval="300000" max-idle="-1"/>
|
||||
</distributed-cache>
|
||||
<local-cache name="authorization">
|
||||
<heap-memory size="10000"/>
|
||||
</local-cache>
|
||||
<local-cache name="keys">
|
||||
<heap-memory size="1000"/>
|
||||
<expiration max-idle="3600000"/>
|
||||
</local-cache>
|
||||
</cache-container>
|
||||
<cache-container name="server" default-cache="default" aliases="singleton cluster" modules="org.wildfly.clustering.server">
|
||||
<transport lock-timeout="60000"/>
|
||||
<replicated-cache name="default">
|
||||
<transaction mode="BATCH"/>
|
||||
</replicated-cache>
|
||||
</cache-container>
|
||||
<cache-container name="web" default-cache="dist" modules="org.wildfly.clustering.web.infinispan">
|
||||
<transport lock-timeout="60000"/>
|
||||
<replicated-cache name="sso">
|
||||
<locking isolation="REPEATABLE_READ"/>
|
||||
<transaction mode="BATCH"/>
|
||||
</replicated-cache>
|
||||
<distributed-cache name="dist">
|
||||
<locking isolation="REPEATABLE_READ"/>
|
||||
<transaction mode="BATCH"/>
|
||||
<file-store/>
|
||||
</distributed-cache>
|
||||
<distributed-cache name="routing"/>
|
||||
</cache-container>
|
||||
<cache-container name="hibernate" modules="org.infinispan.hibernate-cache">
|
||||
<transport lock-timeout="60000"/>
|
||||
<local-cache name="local-query">
|
||||
<heap-memory size="10000"/>
|
||||
<expiration max-idle="100000"/>
|
||||
</local-cache>
|
||||
<invalidation-cache name="entity">
|
||||
<transaction mode="NON_XA"/>
|
||||
<heap-memory size="10000"/>
|
||||
<expiration max-idle="100000"/>
|
||||
</invalidation-cache>
|
||||
<replicated-cache name="timestamps"/>
|
||||
</cache-container>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:io:3.0">
|
||||
<worker name="default"/>
|
||||
<buffer-pool name="default"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jaxrs:2.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:jca:5.0">
|
||||
<archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
|
||||
<bean-validation enabled="true"/>
|
||||
<default-workmanager>
|
||||
<short-running-threads>
|
||||
<core-threads count="50"/>
|
||||
<queue-length count="50"/>
|
||||
<max-threads count="50"/>
|
||||
<keepalive-time time="10" unit="seconds"/>
|
||||
</short-running-threads>
|
||||
<long-running-threads>
|
||||
<core-threads count="50"/>
|
||||
<queue-length count="50"/>
|
||||
<max-threads count="50"/>
|
||||
<keepalive-time time="10" unit="seconds"/>
|
||||
</long-running-threads>
|
||||
</default-workmanager>
|
||||
<cached-connection-manager/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jgroups:8.0">
|
||||
<channels default="ee">
|
||||
<channel name="ee" stack="tcp" cluster="ejb"/>
|
||||
</channels>
|
||||
<stacks>
|
||||
<stack name="tcp">
|
||||
<transport site="${jboss.node.name}" type="TCP" socket-binding="jgroups-tcp"/>
|
||||
{% if keycloak_ha_discovery == 'JDBC_PING' and keycloak_jdbc[keycloak_jdbc_engine].enabled %}
|
||||
<protocol type="JDBC_PING">
|
||||
<property name="datasource_jndi_name">java:jboss/datasources/KeycloakDS</property>
|
||||
<property name="initialize_sql">{{ keycloak_jdbc[keycloak_jdbc_engine].initialize_db }}</property>
|
||||
<property name="insert_single_sql">INSERT INTO JGROUPSPING (own_addr, cluster_name, ping_data) values (?, ?, ?)</property>
|
||||
<property name="delete_single_sql">DELETE FROM JGROUPSPING WHERE own_addr=? AND cluster_name=?</property>
|
||||
<property name="select_all_pingdata_sql">SELECT ping_data FROM JGROUPSPING WHERE cluster_name=?</property>
|
||||
</protocol>
|
||||
{% elif keycloak_ha_discovery == 'TCPPING' %}
|
||||
<protocol type="TCPPING">
|
||||
<property name="initial_hosts">{{ keycloak_cluster_nodes | map(attribute='inventory_host') | join (',') }}</property>
|
||||
<property name="port_range">0</property>
|
||||
<property name="timeout">3000</property>
|
||||
<property name="num_initial_members">2</property>
|
||||
</protocol>
|
||||
{% endif %}
|
||||
<protocol type="MERGE3"/>
|
||||
<protocol type="FD_SOCK"/>
|
||||
<protocol type="FD_ALL"/>
|
||||
<protocol type="VERIFY_SUSPECT"/>
|
||||
<protocol type="pbcast.NAKACK2"/>
|
||||
<protocol type="UNICAST3"/>
|
||||
<protocol type="pbcast.STABLE"/>
|
||||
<protocol type="pbcast.GMS">
|
||||
<property name="join_timeout">30000</property>
|
||||
</protocol>
|
||||
<protocol type="MFC"/>
|
||||
<protocol type="FRAG2"/>
|
||||
</stack>
|
||||
</stacks>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jmx:1.3">
|
||||
<expose-resolved-model/>
|
||||
<expose-expression-model/>
|
||||
<remoting-connector/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jpa:1.1">
|
||||
<jpa default-extended-persistence-inheritance="DEEP"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:keycloak-server:1.1">
|
||||
<web-context>auth</web-context>
|
||||
<providers>
|
||||
<provider>
|
||||
classpath:${jboss.home.dir}/providers/*
|
||||
</provider>
|
||||
</providers>
|
||||
<master-realm-name>master</master-realm-name>
|
||||
<scheduled-task-interval>900</scheduled-task-interval>
|
||||
<theme>
|
||||
<staticMaxAge>2592000</staticMaxAge>
|
||||
<cacheThemes>true</cacheThemes>
|
||||
<cacheTemplates>true</cacheTemplates>
|
||||
<dir>${jboss.home.dir}/themes</dir>
|
||||
</theme>
|
||||
{% if keycloak_ha_enabled %}
|
||||
<spi name="dblock">
|
||||
<provider name="jpa" enabled="true">
|
||||
<properties>
|
||||
<property name="lockWaitTimeout" value="900"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
{% endif %}
|
||||
<spi name="eventsStore">
|
||||
<provider name="jpa" enabled="true">
|
||||
<properties>
|
||||
<property name="exclude-events" value="["REFRESH_TOKEN"]"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
<spi name="userCache">
|
||||
<provider name="default" enabled="true"/>
|
||||
</spi>
|
||||
<spi name="userSessionPersister">
|
||||
<default-provider>jpa</default-provider>
|
||||
</spi>
|
||||
<spi name="timer">
|
||||
<default-provider>basic</default-provider>
|
||||
</spi>
|
||||
<spi name="connectionsHttpClient">
|
||||
<provider name="default" enabled="true"/>
|
||||
</spi>
|
||||
<spi name="connectionsJpa">
|
||||
<provider name="default" enabled="true">
|
||||
<properties>
|
||||
<property name="dataSource" value="java:jboss/datasources/KeycloakDS"/>
|
||||
<property name="initializeEmpty" value="true"/>
|
||||
<property name="migrationStrategy" value="update"/>
|
||||
<property name="migrationExport" value="${jboss.home.dir}/keycloak-database-update.sql"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
<spi name="realmCache">
|
||||
<provider name="default" enabled="true"/>
|
||||
</spi>
|
||||
<spi name="connectionsInfinispan">
|
||||
<default-provider>default</default-provider>
|
||||
<provider name="default" enabled="true">
|
||||
<properties>
|
||||
<property name="cacheContainer" value="java:jboss/infinispan/container/keycloak"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
<spi name="jta-lookup">
|
||||
<default-provider>${keycloak.jta.lookup.provider:jboss}</default-provider>
|
||||
<provider name="jboss" enabled="true"/>
|
||||
</spi>
|
||||
<spi name="publicKeyStorage">
|
||||
<provider name="infinispan" enabled="true">
|
||||
<properties>
|
||||
<property name="minTimeBetweenRequests" value="10"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
<spi name="x509cert-lookup">
|
||||
<default-provider>${keycloak.x509cert.lookup.provider:default}</default-provider>
|
||||
<provider name="default" enabled="true"/>
|
||||
</spi>
|
||||
<spi name="hostname">
|
||||
<default-provider>default</default-provider>
|
||||
<provider name="default" enabled="true">
|
||||
<properties>
|
||||
<property name="frontendUrl" value="{{ keycloak_modcluster.frontend_url }}"/>
|
||||
<property name="forceBackendUrlToFrontendUrl" value="{{ keycloak_modcluster.force_frontend_url }}"/>
|
||||
{% if keycloak_modcluster.admin_url | length > 0 %}
|
||||
<property name="adminUrl" value="{{ keycloak_modcluster.admin_url }}" />
|
||||
{% endif %}
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:mail:4.0">
|
||||
<mail-session name="default" jndi-name="java:jboss/mail/Default">
|
||||
<smtp-server outbound-socket-binding-ref="mail-smtp"/>
|
||||
</mail-session>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:metrics:1.0" security-enabled="false" exposed-subsystems="*" prefix="${wildfly.metrics.prefix:jboss}"/>
|
||||
{% if keycloak_modcluster.enabled %}
|
||||
<subsystem xmlns="urn:jboss:domain:modcluster:5.0">
|
||||
<proxy name="default" advertise="false" listener="ajp" proxies="{{ ['proxy_'] | product(keycloak_modcluster.reverse_proxy_urls | map(attribute='host')) | map('join') | list | join(' ') }}">
|
||||
<dynamic-load-provider>
|
||||
<load-metric type="cpu"/>
|
||||
</dynamic-load-provider>
|
||||
</proxy>
|
||||
</subsystem>
|
||||
{% endif %}
|
||||
<subsystem xmlns="urn:jboss:domain:naming:2.0">
|
||||
<remote-naming/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:remoting:4.0">
|
||||
<http-connector name="http-remoting-connector" connector-ref="default" sasl-authentication-factory="application-sasl-authentication"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:request-controller:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:security-manager:1.0">
|
||||
<deployment-permissions>
|
||||
<maximum-set>
|
||||
<permission class="java.security.AllPermission"/>
|
||||
</maximum-set>
|
||||
</deployment-permissions>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:transactions:6.0">
|
||||
<core-environment node-identifier="{{ inventory_hostname | default('${jboss.tx.node.id:1}') }}">
|
||||
<process-id>
|
||||
<uuid/>
|
||||
</process-id>
|
||||
</core-environment>
|
||||
<recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
|
||||
<coordinator-environment statistics-enabled="${wildfly.transactions.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
|
||||
<object-store path="tx-object-store" relative-to="jboss.server.data.dir"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:undertow:12.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}">
|
||||
<buffer-cache name="default"/>
|
||||
<server name="default-server">
|
||||
<ajp-listener name="ajp" socket-binding="ajp"/>
|
||||
<http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true" proxy-address-forwarding="true"/>
|
||||
<https-listener name="https" socket-binding="https" ssl-context="applicationSSC" enable-http2="true"/>
|
||||
<host name="default-host" alias="localhost">
|
||||
<location name="/" handler="welcome-content"/>
|
||||
<http-invoker http-authentication-factory="application-http-authentication"/>
|
||||
<filter-ref name="proxy-peer"/>
|
||||
</host>
|
||||
</server>
|
||||
<servlet-container name="default">
|
||||
<jsp-config/>
|
||||
<websockets/>
|
||||
</servlet-container>
|
||||
<handlers>
|
||||
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
|
||||
</handlers>
|
||||
<application-security-domains>
|
||||
<application-security-domain name="other" security-domain="ApplicationDomain"/>
|
||||
</application-security-domains>
|
||||
<filters>
|
||||
<filter name="proxy-peer" module="io.undertow.core"
|
||||
class-name="io.undertow.server.handlers.ProxyPeerAddressHandler"/>
|
||||
</filters>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:weld:4.0"/>
|
||||
</profile>
|
||||
<interfaces>
|
||||
<interface name="management">
|
||||
<inet-address value="{{ keycloak_management_port_bind_address }}"/>
|
||||
</interface>
|
||||
<interface name="jgroups">
|
||||
{% if keycloak_jgroups_subnet is defined and keycloak_jgroups_subnet is not none and keycloak_jgroups_subnet | string | length > 0 %}
|
||||
<subnet-match value="{{ keycloak_jgroups_subnet | string }}"/>
|
||||
{% elif ansible_default_ipv4 is defined and (ansible_default_ipv4.network + '/' + ansible_default_ipv4.netmask) | ansible.utils.ipaddr('net') | length > 0 %}
|
||||
<subnet-match value="{{ (ansible_default_ipv4.network + '/' + ansible_default_ipv4.netmask) | ansible.utils.ipaddr('net') }}"/>
|
||||
{% else %}
|
||||
<any-address />
|
||||
{% endif %}
|
||||
</interface>
|
||||
<interface name="public">
|
||||
<inet-address value="{{ keycloak_bind_address }}"/>
|
||||
</interface>
|
||||
</interfaces>
|
||||
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
|
||||
<socket-binding name="ajp" port="{{ keycloak_ajp_port }}"/>
|
||||
<socket-binding name="http" port="{{ keycloak_http_port }}"/>
|
||||
<socket-binding name="https" port="{{ keycloak_https_port }}"/>
|
||||
<socket-binding name="management-http" interface="management" port="{{ keycloak_management_http_port }}"/>
|
||||
<socket-binding name="management-https" interface="management" port="{{ keycloak_management_https_port }}"/>
|
||||
<socket-binding name="jgroups-tcp" interface="jgroups" port="{{ keycloak_jgroups_port }}"/>
|
||||
<socket-binding name="txn-recovery-environment" port="4712"/>
|
||||
<socket-binding name="txn-status-manager" port="4713"/>
|
||||
<outbound-socket-binding name="mail-smtp">
|
||||
<remote-destination host="${jboss.mail.server.host:localhost}" port="${jboss.mail.server.port:25}"/>
|
||||
</outbound-socket-binding>
|
||||
{% if keycloak_modcluster.enabled %}
|
||||
{% for modcluster in keycloak_modcluster.reverse_proxy_urls %}
|
||||
<outbound-socket-binding name="proxy_{{ modcluster.host }}">
|
||||
<remote-destination host="{{ modcluster.host }}" port="{{ modcluster.port }}"/>
|
||||
</outbound-socket-binding>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if keycloak_ha_discovery == 'TCPPING' %}
|
||||
{% for node in keycloak_cluster_nodes %}
|
||||
<outbound-socket-binding name="jgroups_{{ node.address }}">
|
||||
<remote-destination host="{{ node.value }}" port="{{ keycloak_jgroups_port }}"/>
|
||||
</outbound-socket-binding>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<outbound-socket-binding name="remote-cache">
|
||||
<remote-destination host="{{ keycloak_remotecache.server_name | default('localhost') }}" port="${remote.cache.port:11222}"/>
|
||||
</outbound-socket-binding>
|
||||
</socket-binding-group>
|
||||
</server>
|
||||
@@ -136,6 +136,14 @@
|
||||
<user-name>{{ keycloak_jdbc[keycloak_jdbc_engine].db_user }}</user-name>
|
||||
<password>{{ keycloak_jdbc[keycloak_jdbc_engine].db_password }}</password>
|
||||
</security>
|
||||
<validation>
|
||||
<check-valid-connection-sql>{{ keycloak_jdbc[keycloak_jdbc_engine].validate_query }}</check-valid-connection-sql>
|
||||
<validate-on-match>{{ keycloak_db_background_validate_on_match }}</validate-on-match>
|
||||
{% if keycloak_db_background_validation_millis | int > 0 or keycloak_db_background_validation %}
|
||||
<background-validation>{{ keycloak_db_background_validation }}</background-validation>
|
||||
<background-validation-millis>{{ keycloak_db_background_validation_millis }}</background-validation-millis>
|
||||
{% endif %}
|
||||
</validation>
|
||||
{% else %}
|
||||
<connection-url>jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE</connection-url>
|
||||
<driver>h2</driver>
|
||||
@@ -611,7 +619,10 @@
|
||||
<provider name="default" enabled="true">
|
||||
<properties>
|
||||
<property name="frontendUrl" value="{{ keycloak_modcluster.frontend_url }}"/>
|
||||
<property name="forceBackendUrlToFrontendUrl" value="true"/>
|
||||
<property name="forceBackendUrlToFrontendUrl" value="{{ keycloak_modcluster.force_frontend_url }}"/>
|
||||
{% if keycloak_modcluster.admin_url | length > 0 %}
|
||||
<property name="adminUrl" value="{{ keycloak_modcluster.admin_url }}" />
|
||||
{% endif %}
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
@@ -622,7 +633,7 @@
|
||||
</mail-session>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:metrics:1.0" security-enabled="false" exposed-subsystems="*" prefix="${wildfly.metrics.prefix:jboss}"/>
|
||||
{% if keycloak_modcluster.enabled %}
|
||||
{% if keycloak_modcluster.enabled %}
|
||||
<subsystem xmlns="urn:jboss:domain:modcluster:5.0">
|
||||
<proxy name="default" advertise="false" listener="ajp" proxies="{{ ['proxy_'] | product(keycloak_modcluster.reverse_proxy_urls | map(attribute='host')) | map('join') | list | join(' ') }}">
|
||||
<dynamic-load-provider>
|
||||
@@ -630,7 +641,7 @@
|
||||
</dynamic-load-provider>
|
||||
</proxy>
|
||||
</subsystem>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<subsystem xmlns="urn:jboss:domain:naming:2.0">
|
||||
<remote-naming/>
|
||||
</subsystem>
|
||||
@@ -676,7 +687,7 @@
|
||||
</handlers>
|
||||
<application-security-domains>
|
||||
<application-security-domain name="other" security-domain="ApplicationDomain"/>
|
||||
</application-security-domains>
|
||||
</application-security-domains>
|
||||
<filters>
|
||||
<filter name="proxy-peer" module="io.undertow.core"
|
||||
class-name="io.undertow.server.handlers.ProxyPeerAddressHandler"/>
|
||||
@@ -689,8 +700,10 @@
|
||||
<inet-address value="{{ keycloak_management_port_bind_address }}"/>
|
||||
</interface>
|
||||
<interface name="jgroups">
|
||||
{% if ansible_default_ipv4 is defined %}
|
||||
<subnet-match value="{{ (ansible_default_ipv4.network + '/' + ansible_default_ipv4.netmask) | ipaddr('net') }}"/>
|
||||
{% if keycloak_jgroups_subnet is defined and keycloak_jgroups_subnet is not none and keycloak_jgroups_subnet | string | length > 0 %}
|
||||
<subnet-match value="{{ keycloak_jgroups_subnet | string }}"/>
|
||||
{% elif ansible_default_ipv4 is defined and (ansible_default_ipv4.network + '/' + ansible_default_ipv4.netmask) | ansible.utils.ipaddr('net') | length > 0 %}
|
||||
<subnet-match value="{{ (ansible_default_ipv4.network + '/' + ansible_default_ipv4.netmask) | ansible.utils.ipaddr('net') }}"/>
|
||||
{% else %}
|
||||
<any-address />
|
||||
{% endif %}
|
||||
|
||||
@@ -123,6 +123,14 @@
|
||||
<user-name>{{ keycloak_jdbc[keycloak_jdbc_engine].db_user }}</user-name>
|
||||
<password>{{ keycloak_jdbc[keycloak_jdbc_engine].db_password }}</password>
|
||||
</security>
|
||||
<validation>
|
||||
<check-valid-connection-sql>{{ keycloak_jdbc[keycloak_jdbc_engine].validate_query }}</check-valid-connection-sql>
|
||||
<validate-on-match>{{ keycloak_db_background_validate_on_match }}</validate-on-match>
|
||||
{% if keycloak_db_background_validation_millis | int > 0 or keycloak_db_background_validation %}
|
||||
<background-validation>{{ keycloak_db_background_validation }}</background-validation>
|
||||
<background-validation-millis>{{ keycloak_db_background_validation_millis }}</background-validation-millis>
|
||||
{% endif %}
|
||||
</validation>
|
||||
{% else %}
|
||||
<connection-url>jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE</connection-url>
|
||||
<driver>h2</driver>
|
||||
@@ -517,7 +525,10 @@
|
||||
<provider name="default" enabled="true">
|
||||
<properties>
|
||||
<property name="frontendUrl" value="{{ keycloak_modcluster.frontend_url }}"/>
|
||||
<property name="forceBackendUrlToFrontendUrl" value="true"/>
|
||||
<property name="forceBackendUrlToFrontendUrl" value="{{ keycloak_modcluster.force_frontend_url }}"/>
|
||||
{% if keycloak_modcluster.admin_url | length > 0 %}
|
||||
<property name="adminUrl" value="{{ keycloak_modcluster.admin_url }}" />
|
||||
{% endif %}
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
|
||||
@@ -13,7 +13,8 @@ keycloak:
|
||||
service_name: "{{ keycloak_service_name }}"
|
||||
health_url: "{{ keycloak_management_url }}/health"
|
||||
cli_path: "{{ keycloak_jboss_home }}/bin/jboss-cli.sh"
|
||||
config_template_source: "{{ keycloak_config_override_template if keycloak_config_override_template | length > 0 else 'standalone.xml.j2' }}"
|
||||
config_template_source: "{{ keycloak_config_override_template if keycloak_config_override_template | length > 0 else 'standalone-ha.xml.j2' if keycloak_remote_cache_enabled else 'standalone.xml.j2' }}"
|
||||
features: "{{ keycloak_features }}"
|
||||
|
||||
# database
|
||||
keycloak_jdbc:
|
||||
@@ -29,6 +30,7 @@ keycloak_jdbc:
|
||||
connection_url: "{{ keycloak_jdbc_url }}"
|
||||
db_user: "{{ keycloak_db_user }}"
|
||||
db_password: "{{ keycloak_db_pass }}"
|
||||
validate_query: "{{ keycloak_db_valid_conn_sql | default('select 1') }}"
|
||||
initialize_db: >
|
||||
CREATE TABLE IF NOT EXISTS JGROUPSPING (
|
||||
own_addr varchar(200) NOT NULL,
|
||||
@@ -39,7 +41,7 @@ keycloak_jdbc:
|
||||
mariadb:
|
||||
enabled: "{{ (keycloak_ha_enabled or keycloak_db_enabled) and keycloak_jdbc_engine == 'mariadb' }}"
|
||||
driver_class: org.mariadb.jdbc.Driver
|
||||
xa_datasource_class: org.mariadb.jdbc.MySQLDataSource
|
||||
xa_datasource_class: org.mariadb.jdbc.MariaDbDataSource
|
||||
driver_module_name: "org.mariadb"
|
||||
driver_module_dir: "{{ keycloak_jboss_home }}/modules/org/mariadb/main"
|
||||
driver_version: "{{ keycloak_jdbc_driver_version }}"
|
||||
@@ -48,6 +50,7 @@ keycloak_jdbc:
|
||||
connection_url: "{{ keycloak_jdbc_url }}"
|
||||
db_user: "{{ keycloak_db_user }}"
|
||||
db_password: "{{ keycloak_db_pass }}"
|
||||
validate_query: "{{ keycloak_db_valid_conn_sql | default('select 1') }}"
|
||||
initialize_db: >
|
||||
CREATE TABLE IF NOT EXISTS JGROUPSPING (
|
||||
own_addr varchar(200) NOT NULL,
|
||||
@@ -56,12 +59,37 @@ keycloak_jdbc:
|
||||
ping_data varbinary(5000) DEFAULT NULL,
|
||||
PRIMARY KEY (own_addr, cluster_name))
|
||||
ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
|
||||
sqlserver:
|
||||
enabled: "{{ (keycloak_ha_enabled or keycloak_db_enabled) and keycloak_jdbc_engine == 'sqlserver' }}"
|
||||
driver_class: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
xa_datasource_class: com.microsoft.sqlserver.jdbc.SQLServerXADataSource
|
||||
driver_module_name: "com.microsoft.sqlserver"
|
||||
driver_module_dir: "{{ keycloak_jboss_home }}/modules/com/microsoft/sqlserver/main"
|
||||
driver_version: "{{ keycloak_jdbc_driver_version }}"
|
||||
driver_jar_filename: "mssql-java-client-{{ keycloak_jdbc_driver_version }}.jar"
|
||||
driver_jar_url: "https://repo1.maven.org/maven2/com/microsoft/sqlserver/mssql-jdbc/{{ keycloak_jdbc_driver_version }}.jre11/mssql-jdbc-{{ keycloak_jdbc_driver_version }}.jre11.jar" # e.g., https://repo1.maven.org/maven2/com/microsoft/sqlserver/mssql-jdbc/12.2.0.jre11/mssql-jdbc-12.2.0.jre11.jar
|
||||
connection_url: "{{ keycloak_jdbc_url }}"
|
||||
db_user: "{{ keycloak_db_user }}"
|
||||
db_password: "{{ keycloak_db_pass }}"
|
||||
validate_query: "{{ keycloak_db_valid_conn_sql | default('select 1') }}"
|
||||
initialize_db: >
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JGROUPSPING]') AND type in (N'U'))
|
||||
BEGIN
|
||||
CREATE TABLE JGROUPSPING (
|
||||
own_addr varchar(200) NOT NULL,
|
||||
cluster_name varchar(200) NOT NULL,
|
||||
updated DATETIME2 DEFAULT SYSUTCDATETIME(),
|
||||
ping_data varbinary(5000) DEFAULT NULL,
|
||||
PRIMARY KEY (own_addr, cluster_name))
|
||||
END
|
||||
|
||||
# reverse proxy mod_cluster
|
||||
keycloak_modcluster:
|
||||
enabled: "{{ keycloak_ha_enabled or keycloak_modcluster_enabled }}"
|
||||
reverse_proxy_urls: "{{ keycloak_modcluster_urls }}"
|
||||
frontend_url: "{{ keycloak_frontend_url }}"
|
||||
force_frontend_url: "{{ keycloak_frontend_url_force }}"
|
||||
admin_url: "{{ keycloak_admin_url | default('') }}"
|
||||
|
||||
# infinispan
|
||||
keycloak_remotecache:
|
||||
@@ -73,4 +101,4 @@ keycloak_remotecache:
|
||||
server_name: "{{ keycloak_infinispan_url }}"
|
||||
use_ssl: "{{ keycloak_infinispan_use_ssl }}"
|
||||
trust_store_path: "{{ keycloak_infinispan_trust_store_path }}"
|
||||
trust_store_password: "{{ keycloak_infinispan_trust_store_password }}"
|
||||
trust_store_password: "{{ keycloak_infinispan_trust_store_password }}"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
keycloak_quarkus
|
||||
================
|
||||
|
||||
Install [keycloak](https://keycloak.org/) >= 17.0.0 (quarkus) server configurations.
|
||||
Install [keycloak](https://keycloak.org/) >= 20.0.0 (quarkus) server configurations.
|
||||
|
||||
|
||||
Role Defaults
|
||||
@@ -11,7 +11,7 @@ Role Defaults
|
||||
|
||||
| Variable | Description | Default |
|
||||
|:---------|:------------|:--------|
|
||||
|`keycloak_quarkus_version`| keycloak.org package version | `17.0.1` |
|
||||
|`keycloak_quarkus_version`| keycloak.org package version | `22.0.3` |
|
||||
|
||||
|
||||
* Service configuration
|
||||
@@ -22,15 +22,16 @@ Role Defaults
|
||||
|`keycloak_quarkus_db_enabled`| Enable auto configuration for database backend | `True` if `keycloak_quarkus_ha_enabled` is True, else `False` |
|
||||
|`keycloak_quarkus_admin_user`| Administration console user account | `admin` |
|
||||
|`keycloak_quarkus_bind_address`| Address for binding service ports | `0.0.0.0` |
|
||||
|`keycloak_quarkus_host`| hostname | `localhost` |
|
||||
|`keycloak_quarkus_http_port`| HTTP port | `8080` |
|
||||
|`keycloak_quarkus_https_port`| TLS HTTP port | `8443` |
|
||||
|`keycloak_quarkus_host`| Hostname for the Keycloak server | `localhost` |
|
||||
|`keycloak_quarkus_port`| The port used by the proxy when exposing the hostname | `-1` |
|
||||
|`keycloak_quarkus_http_port`| HTTP listening port | `8080` |
|
||||
|`keycloak_quarkus_https_port`| TLS HTTP listening port | `8443` |
|
||||
|`keycloak_quarkus_ajp_port`| AJP port | `8009` |
|
||||
|`keycloak_quarkus_jgroups_port`| jgroups cluster tcp port | `7600` |
|
||||
|`keycloak_quarkus_service_user`| Posix account username | `keycloak` |
|
||||
|`keycloak_quarkus_service_group`| Posix account group | `keycloak` |
|
||||
|`keycloak_quarkus_service_pidfile`| Pid file path for service | `/run/keycloak.pid` |
|
||||
|`keycloak_quarkus_jvm_package`| RHEL java package runtime | `java-11-openjdk-headless` |
|
||||
|`keycloak_quarkus_jvm_package`| RHEL java package runtime | `java-17-openjdk-headless` |
|
||||
|`keycloak_quarkus_java_home`| JAVA_HOME of installed JRE, leave empty for using specified keycloak_quarkus_jvm_package RPM path | `None` |
|
||||
|`keycloak_quarkus_java_opts`| Additional JVM options | `-Xms1024m -Xmx2048m` |
|
||||
|`keycloak_quarkus_frontend_url`| Service public URL | `http://localhost:8080/auth` |
|
||||
@@ -71,7 +72,7 @@ Role Defaults
|
||||
|:---------|:------------|:---------|
|
||||
|`keycloak_quarkus_offline_install` | Perform an offline install | `False`|
|
||||
|`keycloak_quarkus_download_url`| Download URL for keycloak | `https://github.com/keycloak/keycloak/releases/download/<version>/<archive>`|
|
||||
|`keycloak_quarkus_version`| keycloak.org package version | `17.0.1` |
|
||||
|`keycloak_quarkus_version`| keycloak.org package version | `22.0.3` |
|
||||
|`keycloak_quarkus_dest`| Installation root path | `/opt/keycloak` |
|
||||
|`keycloak_quarkus_download_url` | Download URL for keycloak | `https://github.com/keycloak/keycloak/releases/download/{{ keycloak_quarkus_version }}/{{ keycloak_quarkus_archive }}` |
|
||||
|`keycloak_quarkus_configure_firewalld` | Ensure firewalld is running and configure keycloak ports | `False` |
|
||||
@@ -98,6 +99,7 @@ Role Defaults
|
||||
|`keycloak_quarkus_log_format`| Set a format specific to file log entries | `%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n` |
|
||||
|`keycloak_quarkus_proxy_mode`| The proxy address forwarding mode if the server is behind a reverse proxy | `edge` |
|
||||
|`keycloak_quarkus_start_dev`| Whether to start the service in development mode (start-dev) | `False` |
|
||||
|`keycloak_quarkus_transaction_xa_enabled`| Whether to use XA transactions | `True` |
|
||||
|
||||
|
||||
Role Variables
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
### Configuration specific to keycloak
|
||||
keycloak_quarkus_version: 18.0.0
|
||||
keycloak_quarkus_version: 22.0.3
|
||||
keycloak_quarkus_archive: "keycloak-{{ keycloak_quarkus_version }}.zip"
|
||||
keycloak_quarkus_download_url: "https://github.com/keycloak/keycloak/releases/download/{{ keycloak_quarkus_version }}/{{ keycloak_quarkus_archive }}"
|
||||
keycloak_quarkus_installdir: "{{ keycloak_quarkus_dest }}/keycloak-{{ keycloak_quarkus_version }}"
|
||||
@@ -9,7 +9,7 @@ keycloak_quarkus_installdir: "{{ keycloak_quarkus_dest }}/keycloak-{{ keycloak_q
|
||||
keycloak_quarkus_offline_install: False
|
||||
|
||||
### Install location and service settings
|
||||
keycloak_quarkus_jvm_package: java-11-openjdk-headless
|
||||
keycloak_quarkus_jvm_package: java-17-openjdk-headless
|
||||
keycloak_quarkus_java_home:
|
||||
keycloak_quarkus_dest: /opt/keycloak
|
||||
keycloak_quarkus_home: "{{ keycloak_quarkus_installdir }}"
|
||||
@@ -17,7 +17,7 @@ keycloak_quarkus_config_dir: "{{ keycloak_quarkus_home }}/conf"
|
||||
keycloak_quarkus_start_dev: False
|
||||
keycloak_quarkus_service_user: keycloak
|
||||
keycloak_quarkus_service_group: keycloak
|
||||
keycloak_quarkus_service_pidfile: "/run/keycloak.pid"
|
||||
keycloak_quarkus_service_pidfile: "/run/keycloak/keycloak.pid"
|
||||
keycloak_quarkus_configure_firewalld: False
|
||||
|
||||
### administrator console password
|
||||
@@ -28,6 +28,7 @@ keycloak_quarkus_master_realm: master
|
||||
### Configuration settings
|
||||
keycloak_quarkus_bind_address: 0.0.0.0
|
||||
keycloak_quarkus_host: localhost
|
||||
keycloak_quarkus_port: -1
|
||||
keycloak_quarkus_http_enabled: True
|
||||
keycloak_quarkus_http_port: 8080
|
||||
keycloak_quarkus_https_port: 8443
|
||||
@@ -49,9 +50,12 @@ keycloak_quarkus_db_enabled: "{{ True if keycloak_quarkus_ha_enabled else False
|
||||
keycloak_quarkus_http_relative_path: auth
|
||||
keycloak_quarkus_frontend_url: http://localhost:8080/auth
|
||||
|
||||
# proxy address forwarding mode if the server is behind a reverse proxy. [edge, reencrypt, passthrough]
|
||||
# proxy address forwarding mode if the server is behind a reverse proxy. [none, edge, reencrypt, passthrough]
|
||||
keycloak_quarkus_proxy_mode: edge
|
||||
|
||||
# disable xa transactions
|
||||
keycloak_quarkus_transaction_xa_enabled: True
|
||||
|
||||
keycloak_quarkus_metrics_enabled: False
|
||||
keycloak_quarkus_health_enabled: True
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ argument_specs:
|
||||
type: "str"
|
||||
keycloak_quarkus_service_pidfile:
|
||||
# line 18 of defaults/main.yml
|
||||
default: "/run/keycloak.pid"
|
||||
default: "/run/keycloak/keycloak.pid"
|
||||
description: "Pid file path for service"
|
||||
type: "str"
|
||||
keycloak_quarkus_configure_firewalld:
|
||||
@@ -90,10 +90,13 @@ argument_specs:
|
||||
description: "Address for binding service ports"
|
||||
type: "str"
|
||||
keycloak_quarkus_host:
|
||||
# line 28 of defaults/main.yml
|
||||
default: "localhost"
|
||||
description: "hostname"
|
||||
description: "Hostname for the Keycloak server"
|
||||
type: "str"
|
||||
keycloak_quarkus_port:
|
||||
default: -1
|
||||
description: "The port used by the proxy when exposing the hostname"
|
||||
type: "int"
|
||||
keycloak_quarkus_http_enabled:
|
||||
default: true
|
||||
description: "Enable listener on HTTP port"
|
||||
@@ -243,8 +246,12 @@ argument_specs:
|
||||
keycloak_quarkus_proxy_mode:
|
||||
default: 'edge'
|
||||
type: "str"
|
||||
description: "The proxy address forwarding mode if the server is behind a reverse proxy"
|
||||
description: "The proxy address forwarding mode if the server is behind a reverse proxy. Set to 'none' if not using a proxy"
|
||||
keycloak_quarkus_start_dev:
|
||||
default: False
|
||||
type: "bool"
|
||||
description: "Whether to start the service in development mode (start-dev)"
|
||||
keycloak_quarkus_transaction_xa_enabled:
|
||||
default: True
|
||||
type: "bool"
|
||||
description: "Enable or disable XA transactions which may not be supported by some DBMS"
|
||||
|
||||
@@ -52,6 +52,9 @@
|
||||
mode: 0775
|
||||
become: yes
|
||||
|
||||
- name: Flush pending handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
||||
- name: "Start and wait for keycloak service"
|
||||
ansible.builtin.include_tasks: start.yml
|
||||
|
||||
|
||||
@@ -22,4 +22,5 @@
|
||||
- "{{ keycloak_quarkus_jvm_package }}"
|
||||
- unzip
|
||||
- procps-ng
|
||||
- initscripts
|
||||
- initscripts
|
||||
- tzdata-java
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
---
|
||||
- name: Determine JAVA_HOME for selected JVM RPM # noqa blocked_modules
|
||||
ansible.builtin.shell: |
|
||||
set -o pipefail
|
||||
rpm -ql {{ keycloak_quarkus_jvm_package }} | grep -Po '/usr/lib/jvm/.*(?=/bin/java$)'
|
||||
args:
|
||||
executable: /bin/bash
|
||||
changed_when: False
|
||||
register: rpm_java_home
|
||||
- name: Determine JAVA_HOME for selected JVM RPM
|
||||
ansible.builtin.set_fact:
|
||||
rpm_java_home: "/etc/alternatives/jre_{{ keycloak_quarkus_jvm_package | regex_search('(?<=java-)[0-9.]+') }}"
|
||||
|
||||
- name: "Configure sysconfig file for keycloak service"
|
||||
become: yes
|
||||
@@ -17,7 +12,7 @@
|
||||
group: root
|
||||
mode: 0644
|
||||
vars:
|
||||
keycloak_rpm_java_home: "{{ rpm_java_home.stdout }}"
|
||||
keycloak_rpm_java_home: "{{ rpm_java_home }}"
|
||||
notify:
|
||||
- restart keycloak
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ https-certificate-key-file={{ keycloak_quarkus_key_file }}
|
||||
|
||||
# Hostname for the Keycloak server.
|
||||
hostname={{ keycloak_quarkus_host }}
|
||||
hostname-port={{ keycloak_quarkus_port }}
|
||||
hostname-path={{ keycloak_quarkus_http_relative_path }}
|
||||
|
||||
# Cluster
|
||||
@@ -34,11 +35,16 @@ cache-config-file=cache-ispn.xml
|
||||
cache-stack=tcp
|
||||
{% endif %}
|
||||
|
||||
{% if keycloak_quarkus_proxy_mode is defined and keycloak_quarkus_proxy_mode != "none" %}
|
||||
# Proxy
|
||||
proxy={{ keycloak_quarkus_proxy_mode }}
|
||||
{% endif %}
|
||||
# Do not attach route to cookies and rely on the session affinity capabilities from reverse proxy
|
||||
#spi-sticky-session-encoder-infinispan-should-attach-route=false
|
||||
|
||||
# Transaction
|
||||
transaction-xa-enabled={{ keycloak_quarkus_transaction_xa_enabled }}
|
||||
|
||||
# Logging
|
||||
#log-format=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n
|
||||
log={{ keycloak_quarkus_log }}
|
||||
|
||||
@@ -10,7 +10,7 @@ PIDFile={{ keycloak_quarkus_service_pidfile }}
|
||||
{% if keycloak_quarkus_start_dev %}
|
||||
ExecStart={{ keycloak.home }}/bin/kc.sh start-dev
|
||||
{% else %}
|
||||
ExecStart={{ keycloak.home }}/bin/kc.sh start --auto-build --log={{ keycloak_quarkus_log }}
|
||||
ExecStart={{ keycloak.home }}/bin/kc.sh start --log={{ keycloak_quarkus_log }}
|
||||
{% endif %}
|
||||
User={{ keycloak.service_user }}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ keycloak_admin_password: ''
|
||||
# realm: "{{ keycloak_realm }}"
|
||||
# public_client: "{{ keycloak_client_public }}"
|
||||
# web_origins: "{{ keycloak_client_web_origins }}"
|
||||
# redirect_uris: "{{ keycloak_client_redirect_uris }}"
|
||||
# users: "{{ keycloak_client_users }}"
|
||||
keycloak_clients: []
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@
|
||||
service_accounts_enabled: "{{ item.service_accounts_enabled | default(omit) }}"
|
||||
public_client: "{{ item.public_client | default(False) }}"
|
||||
protocol: "{{ item.protocol | default(omit) }}"
|
||||
attributes: "{{ item.attributes | default(omit) }}"
|
||||
state: present
|
||||
no_log: "{{ keycloak_no_log | default('True') }}"
|
||||
register: create_client_result
|
||||
|
||||
Reference in New Issue
Block a user