Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
keycloak
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
FSI Ansible
keycloak
Commits
4cb2eb69
Verified
Commit
4cb2eb69
authored
4 years ago
by
David Mehren
Browse files
Options
Downloads
Patches
Plain Diff
Add connection validation and setup DB before using it
parent
87547e56
No related branches found
No related tags found
No related merge requests found
Pipeline
#13187
failed
4 years ago
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tasks/main.yml
+15
-15
15 additions, 15 deletions
tasks/main.yml
with
15 additions
and
15 deletions
tasks/main.yml
+
15
−
15
View file @
4cb2eb69
---
-
name
:
Gather facts about db host
gather_facts
:
delegate_to
:
"
{{
keycloak_pgdb_host
}}"
delegate_facts
:
True
when
:
"
'ansible_default_ipv4'
not
in
hostvars[keycloak_pgdb_host]"
-
name
:
Import Azul public key (for Zulu JRE)
apt_key
:
id
:
B1998361219BD9C9
...
...
@@ -107,6 +101,15 @@
notify
:
restart keycloak
when
:
keycloak_postgresql_module_installed.count ==
0
-
name
:
Create user and db on server
import_role
:
name
:
postgresql_client
vars
:
db_user
:
name
:
"
{{
keycloak_pgdb_user
}}"
password
:
"
{{
keycloak_pgdb_pass
}}"
db_host
:
"
{{
keycloak_pgdb_host
}}"
-
name
:
Add postgresql config in JBoss
xml
:
path
:
"
{{
keycloak_jboss_home
}}/standalone/configuration/standalone.xml"
...
...
@@ -116,6 +119,12 @@
-
<driver>postgresql</driver>
-
<pool><max-pool-size>10</max-pool-size></pool>
-
"
<security><user-name>{{
keycloak_pgdb_user
}}</user-name><password>{{
keycloak_pgdb_pass
}}</password></security>"
-
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"></valid-connection-checker>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/>
</validation>
input_type
:
xml
namespaces
:
x
:
urn:jboss:domain:10.0
...
...
@@ -133,15 +142,6 @@
y
:
urn:jboss:domain:undertow:10.0
notify
:
restart keycloak
-
name
:
Create user and db on server
import_role
:
name
:
postgresql_client
vars
:
db_user
:
name
:
"
{{
keycloak_pgdb_user
}}"
password
:
"
{{
keycloak_pgdb_pass
}}"
db_host
:
"
{{
keycloak_pgdb_host
}}"
-
name
:
Install systemd unit file
template
:
src
:
keycloak.service.j2
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment