Skip to content

Commit

Permalink
Merge pull request #93 from guidograzioli/override_jgroups_subnet_match
Browse files Browse the repository at this point in the history
Allow to override jgroups subnet
  • Loading branch information
guidograzioli authored Jun 10, 2023
2 parents 8f697f6 + 1dd579a commit 832432b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion roles/keycloak/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ The following variables are _optional_:
|:---------|:------------|
|`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
-----------------
Expand Down
1 change: 1 addition & 0 deletions roles/keycloak/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ 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
Expand Down
4 changes: 4 additions & 0 deletions roles/keycloak/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ argument_specs:
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:
Expand Down
4 changes: 3 additions & 1 deletion roles/keycloak/templates/standalone-ha.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,9 @@
<inet-address value="{{ keycloak_management_port_bind_address }}"/>
</interface>
<interface name="jgroups">
{% if ansible_default_ipv4 is defined %}
{% keycloak_jgroups_subnet is defined and keycloak_jgroups_subnet | length > 0 %}
<subnet-match value="{{ keycloak_jgroups_subnet }}"/>
{% 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 />
Expand Down
4 changes: 3 additions & 1 deletion roles/keycloak/templates/standalone-infinispan.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,9 @@
<inet-address value="{{ keycloak_management_port_bind_address }}"/>
</interface>
<interface name="jgroups">
{% if ansible_default_ipv4 is defined %}
{% keycloak_jgroups_subnet is defined and keycloak_jgroups_subnet | length > 0 %}
<subnet-match value="{{ keycloak_jgroups_subnet }}"/>
{% 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 />
Expand Down

0 comments on commit 832432b

Please sign in to comment.