mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2025-07-29 08:01:33 -07:00
linter fixes
This commit is contained in:
parent
5e8e8c67e8
commit
d6f020ab44
40 changed files with 212 additions and 220 deletions
|
@ -6,7 +6,7 @@ keycloak_quarkus_download_url: "https://github.com/keycloak/keycloak/releases/do
|
|||
keycloak_quarkus_installdir: "{{ keycloak_quarkus_dest }}/keycloak-{{ keycloak_quarkus_version }}"
|
||||
|
||||
# whether to install from local archive
|
||||
keycloak_quarkus_offline_install: False
|
||||
keycloak_quarkus_offline_install: false
|
||||
|
||||
### Install location and service settings
|
||||
keycloak_quarkus_jvm_package: java-17-openjdk-headless
|
||||
|
@ -14,11 +14,11 @@ keycloak_quarkus_java_home:
|
|||
keycloak_quarkus_dest: /opt/keycloak
|
||||
keycloak_quarkus_home: "{{ keycloak_quarkus_installdir }}"
|
||||
keycloak_quarkus_config_dir: "{{ keycloak_quarkus_home }}/conf"
|
||||
keycloak_quarkus_start_dev: False
|
||||
keycloak_quarkus_start_dev: false
|
||||
keycloak_quarkus_service_user: keycloak
|
||||
keycloak_quarkus_service_group: keycloak
|
||||
keycloak_quarkus_service_pidfile: "/run/keycloak/keycloak.pid"
|
||||
keycloak_quarkus_configure_firewalld: False
|
||||
keycloak_quarkus_configure_firewalld: false
|
||||
|
||||
### administrator console password
|
||||
keycloak_quarkus_admin_user: admin
|
||||
|
@ -30,7 +30,7 @@ keycloak_quarkus_bind_address: 0.0.0.0
|
|||
keycloak_quarkus_host: localhost
|
||||
keycloak_quarkus_port: -1
|
||||
keycloak_quarkus_path:
|
||||
keycloak_quarkus_http_enabled: True
|
||||
keycloak_quarkus_http_enabled: true
|
||||
keycloak_quarkus_http_port: 8080
|
||||
keycloak_quarkus_https_port: 8443
|
||||
keycloak_quarkus_ajp_port: 8009
|
||||
|
@ -38,20 +38,20 @@ keycloak_quarkus_jgroups_port: 7600
|
|||
keycloak_quarkus_java_opts: "-Xms1024m -Xmx2048m"
|
||||
|
||||
### TLS/HTTPS configuration
|
||||
keycloak_quarkus_https_key_file_enabled: False
|
||||
keycloak_quarkus_https_key_file_enabled: false
|
||||
keycloak_quarkus_key_file: "{{ keycloak.home }}/conf/server.key.pem"
|
||||
keycloak_quarkus_cert_file: "{{ keycloak.home }}/conf/server.crt.pem"
|
||||
#### key store configuration
|
||||
keycloak_quarkus_https_key_store_enabled: False
|
||||
keycloak_quarkus_https_key_store_enabled: false
|
||||
keycloak_quarkus_key_store_file: "{{ keycloak.home }}/conf/key_store.p12"
|
||||
keycloak_quarkus_key_store_password: ''
|
||||
##### trust store configuration
|
||||
keycloak_quarkus_https_trust_store_enabled: False
|
||||
keycloak_quarkus_https_trust_store_enabled: false
|
||||
keycloak_quarkus_trust_store_file: "{{ keycloak.home }}/conf/trust_store.p12"
|
||||
keycloak_quarkus_trust_store_password: ''
|
||||
|
||||
### Enable configuration for database backend, clustering and remote caches on infinispan
|
||||
keycloak_quarkus_ha_enabled: False
|
||||
keycloak_quarkus_ha_enabled: false
|
||||
### Enable database configuration, must be enabled when HA is configured
|
||||
keycloak_quarkus_db_enabled: "{{ True if keycloak_quarkus_ha_enabled else False }}"
|
||||
|
||||
|
@ -67,17 +67,17 @@ keycloak_quarkus_http_relative_path: /
|
|||
keycloak_quarkus_proxy_mode: edge
|
||||
|
||||
# disable xa transactions
|
||||
keycloak_quarkus_transaction_xa_enabled: True
|
||||
keycloak_quarkus_transaction_xa_enabled: true
|
||||
|
||||
keycloak_quarkus_metrics_enabled: False
|
||||
keycloak_quarkus_health_enabled: True
|
||||
keycloak_quarkus_metrics_enabled: false
|
||||
keycloak_quarkus_health_enabled: true
|
||||
|
||||
### infinispan remote caches access (hotrod)
|
||||
keycloak_quarkus_ispn_user: supervisor
|
||||
keycloak_quarkus_ispn_pass: supervisor
|
||||
keycloak_quarkus_ispn_url: localhost
|
||||
keycloak_quarkus_ispn_sasl_mechanism: SCRAM-SHA-512
|
||||
keycloak_quarkus_ispn_use_ssl: False
|
||||
keycloak_quarkus_ispn_use_ssl: false
|
||||
# if ssl is enabled, import ispn server certificate here
|
||||
keycloak_quarkus_ispn_trust_store_path: /etc/pki/java/cacerts
|
||||
keycloak_quarkus_ispn_trust_store_password: changeit
|
||||
|
|
|
@ -138,12 +138,12 @@ argument_specs:
|
|||
type: "bool"
|
||||
keycloak_quarkus_trust_store_file:
|
||||
default: "{{ keycloak.home }}/conf/trust_store.p12"
|
||||
description: "The file pat to the trust store"
|
||||
description: "The file path to the trust store"
|
||||
type: "str"
|
||||
keycloak_quarkus_trust_store_password:
|
||||
default: ""
|
||||
description: "Password for the trust store"
|
||||
type: "str"
|
||||
default: ""
|
||||
description: "Password for the trust store"
|
||||
type: "str"
|
||||
keycloak_quarkus_https_port:
|
||||
# line 30 of defaults/main.yml
|
||||
default: 8443
|
||||
|
@ -281,10 +281,10 @@ argument_specs:
|
|||
type: "str"
|
||||
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
|
||||
default: false
|
||||
type: "bool"
|
||||
description: "Whether to start the service in development mode (start-dev)"
|
||||
keycloak_quarkus_transaction_xa_enabled:
|
||||
default: True
|
||||
default: true
|
||||
type: "bool"
|
||||
description: "Enable or disable XA transactions which may not be supported by some DBMS"
|
||||
|
|
|
@ -11,9 +11,9 @@ galaxy_info:
|
|||
min_ansible_version: "2.14"
|
||||
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- "8"
|
||||
- name: EL
|
||||
versions:
|
||||
- "8"
|
||||
|
||||
galaxy_tags:
|
||||
- keycloak
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
- name: "Check if packages are already installed" # noqa command-instead-of-module this runs faster
|
||||
ansible.builtin.command: "rpm -q {{ packages_list | join(' ') }}"
|
||||
register: rpm_info
|
||||
changed_when: False
|
||||
failed_when: False
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: "Add missing packages to the yum install list"
|
||||
ansible.builtin.set_fact:
|
||||
packages_to_install: "{{ packages_to_install | default([]) + rpm_info.stdout_lines | map('regex_findall', 'package (.+) is not installed$') | default([]) | flatten }}"
|
||||
|
||||
- name: "Install packages: {{ packages_to_install }}"
|
||||
become: True
|
||||
become: true
|
||||
ansible.builtin.yum:
|
||||
name: "{{ packages_to_install }}"
|
||||
state: present
|
||||
|
|
|
@ -6,19 +6,19 @@
|
|||
- firewalld
|
||||
|
||||
- name: Enable and start the firewalld service
|
||||
become: yes
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
name: firewalld
|
||||
enabled: yes
|
||||
enabled: true
|
||||
state: started
|
||||
|
||||
- name: "Configure firewall for {{ keycloak.service_name }} ports"
|
||||
become: yes
|
||||
become: true
|
||||
ansible.posix.firewalld:
|
||||
port: "{{ item }}"
|
||||
permanent: true
|
||||
state: enabled
|
||||
immediate: yes
|
||||
immediate: true
|
||||
loop:
|
||||
- "{{ keycloak_quarkus_http_port }}/tcp"
|
||||
- "{{ keycloak_quarkus_https_port }}/tcp"
|
||||
|
|
|
@ -11,21 +11,21 @@
|
|||
quiet: true
|
||||
|
||||
- name: Check for an existing deployment
|
||||
become: yes
|
||||
become: true
|
||||
ansible.builtin.stat:
|
||||
path: "{{ keycloak.home }}"
|
||||
register: existing_deploy
|
||||
|
||||
- name: "Create {{ keycloak.service_name }} service user/group"
|
||||
become: yes
|
||||
become: true
|
||||
ansible.builtin.user:
|
||||
name: "{{ keycloak.service_user }}"
|
||||
home: /opt/keycloak
|
||||
system: yes
|
||||
system: true
|
||||
create_home: no
|
||||
|
||||
- name: "Create {{ keycloak.service_name }} install location"
|
||||
become: yes
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
dest: "{{ keycloak_quarkus_dest }}"
|
||||
state: directory
|
||||
|
@ -39,7 +39,7 @@
|
|||
archive: "{{ keycloak_quarkus_dest }}/{{ keycloak.bundle }}"
|
||||
|
||||
- name: Check download archive path
|
||||
become: yes
|
||||
become: true
|
||||
ansible.builtin.stat:
|
||||
path: "{{ archive }}"
|
||||
register: archive_path
|
||||
|
@ -82,23 +82,23 @@
|
|||
- not archive_path.stat.exists
|
||||
- local_archive_path.stat is defined
|
||||
- local_archive_path.stat.exists
|
||||
become: yes
|
||||
become: true
|
||||
|
||||
- name: "Check target directory: {{ keycloak.home }}/bin/"
|
||||
ansible.builtin.stat:
|
||||
path: "{{ keycloak.home }}/bin/"
|
||||
register: path_to_workdir
|
||||
become: yes
|
||||
become: true
|
||||
|
||||
- name: "Extract Keycloak archive on target"
|
||||
ansible.builtin.unarchive:
|
||||
remote_src: yes
|
||||
remote_src: true
|
||||
src: "{{ archive }}"
|
||||
dest: "{{ keycloak_quarkus_dest }}"
|
||||
creates: "{{ keycloak.home }}/bin/"
|
||||
owner: "{{ keycloak.service_user }}"
|
||||
group: "{{ keycloak.service_group }}"
|
||||
become: yes
|
||||
become: true
|
||||
when:
|
||||
- (not path_to_workdir.stat.exists) or new_version_downloaded.changed
|
||||
notify:
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
owner: "{{ keycloak.service_user }}"
|
||||
group: "{{ keycloak.service_group }}"
|
||||
mode: 0644
|
||||
become: yes
|
||||
become: true
|
||||
notify:
|
||||
- restart keycloak
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
|||
owner: "{{ keycloak.service_user }}"
|
||||
group: "{{ keycloak.service_group }}"
|
||||
mode: 0644
|
||||
become: yes
|
||||
become: true
|
||||
notify:
|
||||
- restart keycloak
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
|||
owner: "{{ keycloak.service_user }}"
|
||||
group: "{{ keycloak.service_group }}"
|
||||
mode: 0775
|
||||
become: yes
|
||||
become: true
|
||||
|
||||
- name: Flush pending handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
@ -61,12 +61,12 @@
|
|||
- name: Check service status
|
||||
ansible.builtin.command: "systemctl status keycloak"
|
||||
register: keycloak_service_status
|
||||
changed_when: False
|
||||
changed_when: false
|
||||
|
||||
- name: Link default logs directory
|
||||
ansible.builtin.file:
|
||||
state: link
|
||||
src: "{{ keycloak.log.file | dirname }}"
|
||||
dest: "{{ keycloak_quarkus_log_target }}"
|
||||
force: yes
|
||||
become: yes
|
||||
force: true
|
||||
become: true
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
ansible.builtin.assert:
|
||||
that:
|
||||
- keycloak_quarkus_admin_pass | length > 12
|
||||
quiet: True
|
||||
quiet: true
|
||||
fail_msg: "The console administrator password is empty or invalid. Please set the keycloak_quarkus_admin_pass variable to a 12+ char long string"
|
||||
success_msg: "{{ 'Console administrator password OK' }}"
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
|||
ansible.builtin.assert:
|
||||
that:
|
||||
- keycloak_quarkus_http_relative_path is regex('^/.*')
|
||||
quiet: True
|
||||
quiet: true
|
||||
fail_msg: "the relative path must begin with /"
|
||||
success_msg: "{{ 'relative path OK' }}"
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
|||
ansible.builtin.assert:
|
||||
that:
|
||||
- (keycloak_quarkus_ha_enabled and keycloak_quarkus_db_enabled) or (not keycloak_quarkus_ha_enabled and keycloak_quarkus_db_enabled) or (not keycloak_quarkus_ha_enabled and not keycloak_quarkus_db_enabled)
|
||||
quiet: True
|
||||
quiet: true
|
||||
fail_msg: "Cannot install HA setup without a backend database service. Check keycloak_quarkus_ha_enabled and keycloak_quarkus_db_enabled"
|
||||
success_msg: "{{ 'Configuring HA' if keycloak_quarkus_ha_enabled else 'Configuring standalone' }}"
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
- name: "Restart and enable {{ keycloak.service_name }} service"
|
||||
ansible.builtin.systemd:
|
||||
name: keycloak
|
||||
enabled: yes
|
||||
enabled: true
|
||||
state: restarted
|
||||
become: yes
|
||||
daemon_reload: true
|
||||
become: true
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
- name: "Start {{ keycloak.service_name }} service"
|
||||
ansible.builtin.systemd:
|
||||
name: keycloak
|
||||
enabled: yes
|
||||
enabled: true
|
||||
state: started
|
||||
become: yes
|
||||
daemon_reload: true
|
||||
become: true
|
||||
|
||||
- name: "Wait until {{ keycloak.service_name }} becomes active {{ keycloak.health_url }}"
|
||||
ansible.builtin.uri:
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
rpm_java_home: "/etc/alternatives/jre_{{ keycloak_quarkus_jvm_package | regex_search('(?<=java-)[0-9.]+') }}"
|
||||
|
||||
- name: "Configure sysconfig file for keycloak service"
|
||||
become: yes
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: keycloak-sysconfig.j2
|
||||
dest: /etc/sysconfig/keycloak
|
||||
|
@ -23,13 +23,7 @@
|
|||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
become: yes
|
||||
become: true
|
||||
register: systemdunit
|
||||
notify:
|
||||
- restart keycloak
|
||||
|
||||
- name: Reload systemd
|
||||
become: yes
|
||||
ansible.builtin.systemd:
|
||||
daemon_reload: yes
|
||||
when: systemdunit.changed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue