Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
b1e4e9e6
Commit
b1e4e9e6
authored
Feb 06, 2014
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds a play to create the dbs in a vpc stack
parent
2b807592
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
playbooks/edx-east/create_db_users.yml
+69
-0
No files found.
playbooks/edx-east/create_db_users.yml
0 → 100644
View file @
b1e4e9e6
# This is a utility play to initialize the mysql dbs for the following
# roles:
# - edxapp
# - xqueue
# - ora
# - discern
#
# The mysql root user and password must be passed in as extra vars for
# at least one of the databases.
#
# the environment and deployment must be passed in as COMMON_ENVIRONMENT
# and COMMON_DEPLOYMENT. These two vars should be set in the secret
# var file for the corresponding vpc stack
#
# Example invocation:
#
# Create the databases for edxapp and xqueue:
#
# ansible-playbook -i localhost, create_db_users.yml -e@/path/to/secrets.yml -e "edxapp_db_root_user=root edxapp_db_root_pass=pass xqueue_db_root_user=root xqueue_db_root_pass=pass "
#
#
-
name
:
Create all db users on the edx-stack
hosts
:
all
connection
:
local
gather_facts
:
False
vars
:
edxapp_db_root_user
:
'
None'
edxapp_db_root_pass
:
'
None'
xqueue_db_root_user
:
'
None'
xqueue_db_root_pass
:
'
None'
ora_db_root_user
:
'
None'
ora_db_root_pass
:
'
None'
discern_db_root_user
:
'
None'
discern_db_root_pass
:
'
None'
tasks
:
-
fail
:
msg="COMMON_ENVIRONMENT and COMMON_DEPLOYMENT need to be defined to use this play"
when
:
COMMON_ENVIRONMENT is not defined or COMMON_DEPLOYMENT is not defined
-
name
:
create mysql databases for the edX stack
mysql_db
:
>
db={{ item[0] }}{{ item[1].db_name }}
state=present
login_host={{ item[1].db_host }}
login_user={{ item[1].db_user }}
login_password={{ item[1].db_pass }}
encoding=utf8
when
:
item[1].db_user != 'None'
with_nested
:
-
[
'
{{
COMMON_ENVIRONMENT
}}_{{
COMMON_DEPLOYMENT
}}_test_'
,
'
'
]
-
# These defaults are needed, otherwise ansible will throw
# variable undefined errors for when they are not defined
# in secret vars
-
db_name
:
"
{{
EDXAPP_MYSQL_DB_NAME|default('None')
}}"
db_host
:
"
{{
EDXAPP_MYSQL_HOST|default('None')
}}"
db_user
:
"
{{
edxapp_db_root_user
}}"
db_pass
:
"
{{
edxapp_db_root_pass
}}"
-
db_name
:
"
{{
XQUEUE_MYSQL_DB_NAME|default('None')
}}"
db_host
:
"
{{
XQUEUE_MYSQL_HOST|default('None')
}}"
db_user
:
"
{{
xqueue_db_root_user
}}"
db_pass
:
"
{{
xqueue_db_root_pass
}}"
-
db_name
:
"
{{
ORA_MYSQL_DB_NAME|default('None')
}}"
db_host
:
"
{{
ORA_MYSQL_HOST|default('None')
}}"
db_user
:
"
{{
ora_db_root_user
}}"
db_pass
:
"
{{
ora_db_root_pass
}}"
-
db_name
:
"
{{
DISCERN_MYSQL_DB_NAME|default('None')
}}"
db_host
:
"
{{
DISCERN_MYSQL_HOST|default('None')
}}"
db_user
:
"
{{
discern_db_root_user
}}"
db_pass
:
"
{{
discern_db_root_pass
}}"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment