commit
70239d1328
|
@ -38,7 +38,7 @@ jobs:
|
||||||
working-directory: ./ansible_collections/middleware_automation/keycloak
|
working-directory: ./ansible_collections/middleware_automation/keycloak
|
||||||
|
|
||||||
- name: Run molecule test
|
- name: Run molecule test
|
||||||
run: molecule test --all -- -vvvvv
|
run: molecule test --all
|
||||||
working-directory: ./ansible_collections/middleware_automation/keycloak
|
working-directory: ./ansible_collections/middleware_automation/keycloak
|
||||||
env:
|
env:
|
||||||
PY_COLORS: '1'
|
PY_COLORS: '1'
|
||||||
|
|
|
@ -13,8 +13,6 @@ platforms:
|
||||||
- "8080/tcp"
|
- "8080/tcp"
|
||||||
- "8443/tcp"
|
- "8443/tcp"
|
||||||
- "8009/tcp"
|
- "8009/tcp"
|
||||||
published_ports:
|
|
||||||
- 0.0.0.0:8443:8443/TCP
|
|
||||||
provisioner:
|
provisioner:
|
||||||
name: ansible
|
name: ansible
|
||||||
config_options:
|
config_options:
|
||||||
|
|
|
@ -20,7 +20,7 @@ keycloak_jboss_home: "{{ keycloak_rhsso_installdir if rhsso_rhn_id is defined el
|
||||||
keycloak_config_dir: "{{ keycloak_jboss_home }}/standalone/configuration"
|
keycloak_config_dir: "{{ keycloak_jboss_home }}/standalone/configuration"
|
||||||
keycloak_service_user: keycloak
|
keycloak_service_user: keycloak
|
||||||
keycloak_service_group: keycloak
|
keycloak_service_group: keycloak
|
||||||
keycloak_service_pidfile: "{{ keycloak_dest }}/keycloak.pid"
|
keycloak_service_pidfile: "/run/keycloak.pid"
|
||||||
keycloak_service_logfile: "{{ keycloak_dest }}/keycloak.log"
|
keycloak_service_logfile: "{{ keycloak_dest }}/keycloak.log"
|
||||||
|
|
||||||
### Keycloak configuration settings
|
### Keycloak configuration settings
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
- include_tasks: tasks/install.yml
|
- include_tasks: tasks/install.yml
|
||||||
|
|
||||||
|
## FIXME not idempotent (keyclock removes the file when it restarts)
|
||||||
- name: create Keycloak admin user
|
- name: create Keycloak admin user
|
||||||
command:
|
command:
|
||||||
args:
|
args:
|
||||||
|
|
|
@ -75,14 +75,16 @@ startKeycloak() {
|
||||||
if [ "$(isKeyCloakRunning)" -eq 1 ]; then
|
if [ "$(isKeyCloakRunning)" -eq 1 ]; then
|
||||||
statusKeycloak
|
statusKeycloak
|
||||||
else
|
else
|
||||||
${KEYCLOAK_HOME}/bin/standalone.sh \
|
LAUNCH_JBOSS_IN_BACKGROUND=1 JBOSS_PIDFILE=${KEYCLOAK_PIDFILE} ${KEYCLOAK_HOME}/bin/standalone.sh \
|
||||||
-Djboss.bind.address=${KEYCLOAK_BIND_ADDRESS} \
|
-Djboss.bind.address=${KEYCLOAK_BIND_ADDRESS} \
|
||||||
-Djboss.http.port=${KEYCLOAK_HTTP_PORT} \
|
-Djboss.http.port=${KEYCLOAK_HTTP_PORT} \
|
||||||
-Djboss.https.port=${KEYCLOAK_HTTPS_PORT} \
|
-Djboss.https.port=${KEYCLOAK_HTTPS_PORT} \
|
||||||
-Djboss.management.http.port=${KEYCLOAK_MANAGEMENT_HTTP_PORT} \
|
-Djboss.management.http.port=${KEYCLOAK_MANAGEMENT_HTTP_PORT} \
|
||||||
-Djboss.management.https.port=${KEYCLOAK_MANAGEMENT_HTTPS_PORT} \
|
-Djboss.management.https.port=${KEYCLOAK_MANAGEMENT_HTTPS_PORT} \
|
||||||
-Djboss.node.name={{ inventory_hostname }} 2>&1 >> "${KEYCLOAK_LOGFILE}" &
|
-Djboss.node.name={{ inventory_hostname }} \
|
||||||
echo "${!}" > "${KEYCLOAK_PIDFILE}"
|
{% if ansible_facts.virtualization_type in ['docker','oci','containerd'] %}-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true {% endif %}\
|
||||||
|
2>&1 >> "${KEYCLOAK_LOGFILE}" &
|
||||||
|
while [ ! -f ${KEYCLOAK_PIDFILE} ]; do sleep 1; done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,3 +5,5 @@ KEYCLOAK_HTTP_PORT={{ keycloak_http_port }}
|
||||||
KEYCLOAK_HTTPS_PORT={{ keycloak_https_port }}
|
KEYCLOAK_HTTPS_PORT={{ keycloak_https_port }}
|
||||||
KEYCLOAK_MANAGEMENT_HTTP_PORT={{ keycloak_management_http_port }}
|
KEYCLOAK_MANAGEMENT_HTTP_PORT={{ keycloak_management_http_port }}
|
||||||
KEYCLOAK_MANAGEMENT_HTTPS_PORT={{ keycloak_management_https_port }}
|
KEYCLOAK_MANAGEMENT_HTTPS_PORT={{ keycloak_management_https_port }}
|
||||||
|
JBOSS_PIDFILE='{{ keycloak_service_pidfile }}'
|
||||||
|
LAUNCH_JBOSS_IN_BACKGROUND=1
|
|
@ -5,14 +5,11 @@ After=network.target
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
EnvironmentFile=-/etc/sysconfig/keycloak
|
EnvironmentFile=-/etc/sysconfig/keycloak
|
||||||
|
|
||||||
User={{ keycloak_service_user }}
|
|
||||||
Group={{ keycloak_service_group }}
|
|
||||||
PIDFile={{ keycloak_service_pidfile }}
|
PIDFile={{ keycloak_service_pidfile }}
|
||||||
ExecStart={{ keycloak_dest }}/keycloak-service.sh start
|
ExecStart={{ keycloak_dest }}/keycloak-service.sh start
|
||||||
ExecStop={{ keycloak_dest }}/keycloak-service.sh stop
|
ExecStop={{ keycloak_dest }}/keycloak-service.sh stop
|
||||||
TimeoutStartSec=90
|
TimeoutStartSec=30
|
||||||
TimeoutStopSec=60
|
TimeoutStopSec=30
|
||||||
LimitNOFILE=102642
|
LimitNOFILE=102642
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
Loading…
Reference in New Issue