-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathactions.cli
63 lines (49 loc) · 3.74 KB
/
actions.cli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
## admin cli commands to edit the configuration
embed-server --std-out=echo --server-config=standalone-openshift.xml
## Check already created components
## Add Oracle driver
if (outcome != success) of /subsystem=datasources/jdbc-driver=oracle:read-resource
echo "installing com.oracle ..."
module add --name=com.oracle --resources=/extensions/ojdbc7.jar --dependencies=javax.api,javax.resource.api
/subsystem=datasources/jdbc-driver=oracle:add(driver-name=oracle,driver-module-name=com.oracle,driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource)
end-if
if (outcome == success) of /subsystem=datasources/data-source=KeycloakDS:read-resource
echo "Removing KeycloakDS"
/subsystem=datasources/data-source=KeycloakDS:remove()
end-if
if (outcome == success) of /subsystem=keycloak-server/spi=truststore:read-resource
echo "Removing truststore if exists"
/subsystem=keycloak-server/spi=truststore:remove()
end-if
## Start batch mode
batch
## Replace this connection-url Line if you have an oracle cluster
## connection-url="jdbc\:oracle\:thin\:@(DESCRIPTION\=(LOAD_BALANCE\=on)(ADDRESS\=(PROTOCOL\=TCP)(HOST\=${env.ORACLE_SERVICE_HOST})(PORT\=${env.ORACLE_SERVICE_PORT}))(ADDRESS\=(PROTOCOL\=TCP)(HOST\=${env.ORACLE_SERVICE_HOST_2})(PORT\=${env.ORACLE_SERVICE_PORT_2}))(CONNECT_DATA\=(SERVICE_NAME\=${env.ORACLE_SERVICE_NAME})))"
## Replace this connection-url Line if you have an oracle single instance
## connection-url="jdbc:oracle:thin:@//${env.ORACLE_SERVICE_HOST}:${env.ORACLE_SERVICE_PORT}/${env.ORACLE_SERVICE_NAME}"
/subsystem=datasources/data-source=KeycloakDS:add(min-pool-size=2, \
max-pool-size=20, \
jndi-name=java:jboss/datasources/KeycloakDS, \
enabled=true,use-java-context=true, \
connection-url="jdbc:oracle:thin:@//${env.ORACLE_SERVICE_HOST}:${env.ORACLE_SERVICE_PORT}/${env.ORACLE_SERVICE_NAME}", \
driver-name=oracle, \
user-name=${env.ORACLE_USERNAME}, \
password=${env.ORACLE_PASSWORD}, \
validate-on-match=false, \
background-validation=true, \
background-validation-millis=60000, \
idle-timeout-minutes=5, \
valid-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker, \
exception-sorter-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter, \
stale-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker \
)
## Add truststore
/subsystem=keycloak-server/spi=truststore:add()
/subsystem=keycloak-server/spi=truststore/provider=file:add(enabled=true)
/subsystem=keycloak-server/spi=truststore/provider=file/:map-put(name=properties,key=file, value="/extensions/truststore.jks")
/subsystem=keycloak-server/spi=truststore/provider=file/:map-put(name=properties,key=password, value="trust123")
/subsystem=keycloak-server/spi=truststore/provider=file/:map-put(name=properties,key=hostname-verification-policy, value="WILDCARD")
/subsystem=keycloak-server/spi=truststore/provider=file/:map-put(name=properties,key=disabled, value="false")
run-batch
quit