Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ippidb-web
Manage
Activity
Members
Labels
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iPPIDB
ippidb-web
Commits
10066189
Commit
10066189
authored
6 years ago
by
Hervé MENAGER
Browse files
Options
Downloads
Patches
Plain Diff
more postgreSQL ansible WIP
Former-commit-id: 70427797cdda9c19a8386a9425f40aa162dd1a2e
parent
3fc75696
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ansible/deploy.yaml
+12
-16
12 additions, 16 deletions
ansible/deploy.yaml
with
12 additions
and
16 deletions
ansible/deploy.yaml
+
12
−
16
View file @
10066189
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
-
hosts
:
all
-
hosts
:
all
become
:
yes
become
:
yes
gather_facts
:
yes
gather_facts
:
yes
vars
:
dbname
:
ippidb
dbuser
:
ippidb
dbpassword
:
'
LeroyMerlin'
tasks
:
tasks
:
#
#
# Install basic non-virtualenv requirements
# Install basic non-virtualenv requirements
...
@@ -72,22 +76,14 @@
...
@@ -72,22 +76,14 @@
insertbefore=BOF
insertbefore=BOF
-
name
:
restart postgresql service
-
name
:
restart postgresql service
systemd
:
state=restarted name=postgresql enabled=yes
systemd
:
state=restarted name=postgresql enabled=yes
-
become
:
yes
-
name
:
ensure database is created
become_user
:
ippidb
postgresql_db
:
name={{dbname}}
gather_facts
:
no
-
name
:
ensure user has access to database
vars
:
postgresql_user
:
db={{dbname}} name={{dbuser}} password={{dbpassword}} priv=ALL
dbname
:
ippidb
-
name
:
ensure user does not have unnecessary privilege
dbuser
:
ippidb
postgresql_user
:
name={{dbuser}} role_attr_flags=NOSUPERUSER,NOCREATEDB
dbpassword
:
'
LeroyMerlin'
-
name
:
ensure no other user can access the database
tasks
:
postgresql_privs
:
db={{dbname}} role=PUBLIC type=database priv=ALL state=absent
-
name
:
ensure database is created
postgresql_db
:
name={{dbname}}
-
name
:
ensure user has access to database
postgresql_user
:
db={{dbname}} name={{dbuser}} password={{dbpassword}} priv=ALL
-
name
:
ensure user does not have unnecessary privilege
postgresql_user
:
name={{dbuser}} role_attr_flags=NOSUPERUSER,NOCREATEDB
-
name
:
ensure no other user can access the database
postgresql_privs
:
db={{dbname}} role=PUBLIC type=database priv=ALL state=absent
#
#
# Stop web server(s)
# Stop web server(s)
#
#
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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