Compare commits

..

No commits in common. "91b37a910ec29e6c2a10c94656972a986cbf116d" and "ec47a1c5a86e11215a332ab4f1c2f4c9c896c505" have entirely different histories.

9 changed files with 14 additions and 41 deletions

View File

@ -26,7 +26,6 @@ warn_list:
- jinja[spacing] - jinja[spacing]
- jinja[invalid] - jinja[invalid]
- meta-no-tags - meta-no-tags
- name[template]
skip_list: skip_list:
- vars_should_not_be_used - vars_should_not_be_used

View File

@ -52,7 +52,6 @@ Role Defaults
|`keycloak_db_enabled`| Enable auto configuration for database backend | `True` if `keycloak_ha_enabled` is True, else `False` | |`keycloak_db_enabled`| Enable auto configuration for database backend | `True` if `keycloak_ha_enabled` is True, else `False` |
|`keycloak_admin_user`| Administration console user account | `admin` | |`keycloak_admin_user`| Administration console user account | `admin` |
|`keycloak_bind_address`| Address for binding service ports | `0.0.0.0` | |`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` |
|`keycloak_host`| hostname | `localhost` | |`keycloak_host`| hostname | `localhost` |
|`keycloak_http_port`| HTTP port | `8080` | |`keycloak_http_port`| HTTP port | `8080` |
|`keycloak_https_port`| TLS HTTP port | `8443` | |`keycloak_https_port`| TLS HTTP port | `8443` |

View File

@ -8,7 +8,7 @@ keycloak_installdir: "{{ keycloak_dest }}/keycloak-{{ keycloak_version }}"
keycloak_offline_install: False keycloak_offline_install: False
### Install location and service settings ### Install location and service settings
keycloak_jvm_package: openjdk-17-jdk-headless keycloak_jvm_package: java-1.8.0-openjdk-headless
keycloak_java_home: keycloak_java_home:
keycloak_dest: /opt/keycloak keycloak_dest: /opt/keycloak
keycloak_jboss_home: "{{ keycloak_installdir }}" keycloak_jboss_home: "{{ keycloak_installdir }}"
@ -34,7 +34,6 @@ keycloak_http_port: 8080
keycloak_https_port: 8443 keycloak_https_port: 8443
keycloak_ajp_port: 8009 keycloak_ajp_port: 8009
keycloak_jgroups_port: 7600 keycloak_jgroups_port: 7600
keycloak_management_port_bind_address: 127.0.0.1
keycloak_management_http_port: 9990 keycloak_management_http_port: 9990
keycloak_management_https_port: 9993 keycloak_management_https_port: 9993
keycloak_java_opts: "-Xms1024m -Xmx2048m" keycloak_java_opts: "-Xms1024m -Xmx2048m"

View File

@ -94,10 +94,6 @@ argument_specs:
default: "0.0.0.0" default: "0.0.0.0"
description: "Address for binding service ports" description: "Address for binding service ports"
type: "str" type: "str"
keycloak_management_port_bind_address:
default: "127.0.0.1"
description: "Address for binding the managemnt ports"
type: "str"
keycloak_host: keycloak_host:
# line 35 of keycloak/defaults/main.yml # line 35 of keycloak/defaults/main.yml
default: "localhost" default: "localhost"

View File

@ -2,21 +2,21 @@
- name: Check packages to be installed - name: Check packages to be installed
block: block:
- name: "Check if packages are already installed" - name: "Check if packages are already installed"
ansible.builtin.command: "dpkg -s {{ packages_list | join(' ') }}" ansible.builtin.command: "rpm -q {{ packages_list | join(' ') }}"
args: args:
warn: no warn: no
register: dpkg_info register: rpm_info
changed_when: dpkg_info.failed changed_when: rpm_info.failed
rescue: rescue:
- name: "Add missing packages to the apt install list" - name: "Add missing packages to the yum install list"
ansible.builtin.set_fact: ansible.builtin.set_fact:
packages_to_install: "{{ packages_to_install | default([]) + dpkg_info.stdout_lines | map('regex_findall', 'package (.+) is not installed and no information is available$') | flatten }}" packages_to_install: "{{ packages_to_install | default([]) + rpm_info.stdout_lines | map('regex_findall', 'package (.+) is not installed$') | flatten }}"
when: rpm_info.failed when: rpm_info.failed
- name: Install packages - name: "Install packages: {{ packages_to_install }}"
become: yes become: yes
ansible.builtin.apt: ansible.builtin.yum:
name: "{{ packages_to_install }}" name: "{{ packages_to_install }}"
state: present state: present
when: packages_to_install | default([]) | length > 0 when: packages_to_install | default([]) | length > 0

View File

@ -18,7 +18,7 @@
- not dest_path.stat.exists - not dest_path.stat.exists
- name: "Retrieve JDBC Driver from {{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_url }}" - name: "Retrieve JDBC Driver from {{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_url }}"
ansible.builtin.get_url: ansible.builtin.uri:
url: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_url }}" url: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_url }}"
dest: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_dir }}/{{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_filename }}" dest: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_dir }}/{{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_filename }}"
group: "{{ keycloak_service_group }}" group: "{{ keycloak_service_group }}"

View File

@ -5,23 +5,3 @@
enabled: yes enabled: yes
state: restarted state: restarted
become: yes become: yes
delegate_to: "{{ ansible_play_hosts | first }}"
run_once: True
- name: "Wait until {{ keycloak.service_name }} becomes active {{ keycloak.health_url }}"
ansible.builtin.uri:
url: "{{ keycloak.health_url }}"
register: keycloak_status
until: keycloak_status.status == 200
delegate_to: "{{ ansible_play_hosts | first }}"
run_once: True
retries: 25
delay: 10
- name: "Restart and enable {{ keycloak.service_name }} service"
ansible.builtin.systemd:
name: keycloak
enabled: yes
state: restarted
become: yes
when: inventory_hostname != ansible_play_hosts | first

View File

@ -724,7 +724,7 @@
</profile> </profile>
<interfaces> <interfaces>
<interface name="management"> <interface name="management">
<inet-address value="{{ keycloak_management_port_bind_address }}"/> <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface> </interface>
<interface name="jgroups"> <interface name="jgroups">
{% if ansible_default_ipv4 is defined %} {% if ansible_default_ipv4 is defined %}
@ -734,7 +734,7 @@
{% endif %} {% endif %}
</interface> </interface>
<interface name="public"> <interface name="public">
<inet-address value="{{ keycloak_bind_address }}"/> <inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface> </interface>
</interfaces> </interfaces>
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}"> <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

View File

@ -632,10 +632,10 @@
</profile> </profile>
<interfaces> <interfaces>
<interface name="management"> <interface name="management">
<inet-address value="{{ keycloak_management_port_bind_address }}"/> <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface> </interface>
<interface name="public"> <interface name="public">
<inet-address value="{{ keycloak_bind_address }}"/> <inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface> </interface>
</interfaces> </interfaces>
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}"> <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">