Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PEDASI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Research Software Group
PEDASI
Commits
80cb0645
Commit
80cb0645
authored
6 years ago
by
James Graham
Browse files
Options
Downloads
Patches
Plain Diff
Set DB password in Ansible script from .env file -
#19
parent
bfcd9884
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pedasi/settings.py
+5
-0
5 additions, 0 deletions
pedasi/settings.py
playbook.yml
+12
-4
12 additions, 4 deletions
playbook.yml
with
17 additions
and
4 deletions
pedasi/settings.py
+
5
−
0
View file @
80cb0645
...
@@ -139,6 +139,11 @@ DATABASES = {
...
@@ -139,6 +139,11 @@ DATABASES = {
),
),
}
}
DATABASES
[
'
default
'
].
update
({
'
USER
'
:
config
(
'
DATABASE_USER
'
),
'
PASSWORD
'
:
config
(
'
DATABASE_PASSWORD
'
),
})
mongoengine
.
register_connection
(
mongoengine
.
register_connection
(
host
=
config
(
host
=
config
(
'
PROV_DATABASE_URL
'
,
'
PROV_DATABASE_URL
'
,
...
...
This diff is collapsed.
Click to expand it.
playbook.yml
+
12
−
4
View file @
80cb0645
...
@@ -140,13 +140,21 @@
...
@@ -140,13 +140,21 @@
name
:
'
pedasi'
name
:
'
pedasi'
state
:
present
state
:
present
-
name
:
Create DB user
-
name
:
Create DB user
- dev settings
mysql_user
:
mysql_user
:
name
:
'
pedasi'
name
:
"
{{
lookup('ini',
'DATABASE_USER
type=properties
file=deploy/.env.dev')
}}"
# TODO generate a real password
password
:
"
{{
lookup('ini',
'DATABASE_PASSWORD
type=properties
file=deploy/.env.dev')
}}"
password
:
'
pedasi'
state
:
present
state
:
present
priv
:
'
pedasi.*:ALL'
priv
:
'
pedasi.*:ALL'
when
:
production is not defined
-
name
:
Create DB user - prod settings
mysql_user
:
name
:
"
{{
lookup('ini',
'DATABASE_USER
type=properties
file=deploy/.env.prod')
}}"
password
:
"
{{
lookup('ini',
'DATABASE_PASSWORD
type=properties
file=deploy/.env.prod')
}}"
state
:
present
priv
:
'
pedasi.*:ALL'
when
:
production is defined
-
name
:
Set permissions on project directory
-
name
:
Set permissions on project directory
file
:
file
:
...
...
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