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
OpenEdx
configuration
Commits
d752401d
Commit
d752401d
authored
Nov 25, 2015
by
Max Rothman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OPS-1158: Add CSMH DB provisioning automation
parent
ef34b8c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
0 deletions
+97
-0
playbooks/edx-east/create_rds_secondary.yml
+34
-0
playbooks/edx-east/promote_rds_secondary.yml
+63
-0
No files found.
playbooks/edx-east/create_rds_secondary.yml
0 → 100644
View file @
d752401d
# Usage: AWS_PROFILE=myprofile ansible-playbook create_csmh_db.yml -i localhost, -e 'from_db=my-rds-identifier rds_name=env-dep-edxapphistory'
-
name
:
Create new edxapp history RDS instance
hosts
:
all
connection
:
local
gather_facts
:
false
vars
:
from_db
:
null
rds_name
:
null
region
:
us-east-1
instance_type
:
db.m4.large
env
:
null
app
:
edxapp
tasks
:
-
name
:
Validate arguments
fail
:
msg
:
"
One
or
more
arguments
were
not
set
correctly:
{{
item
}}"
when
:
not {{ item }}
with_items
:
-
from_db
-
rds_name
-
name
:
Create edxapp history RDS instance
rds
:
command
:
replicate
instance_name
:
"
{{
rds_name
}}"
source_instance
:
"
{{
from_db
}}"
region
:
"
{{
region
}}"
instance_type
:
"
{{
instance_type
}}"
publicly_accessible
:
no
wait
:
yes
wait_timeout
:
900
register
:
created_db
playbooks/edx-east/promote_rds_secondary.yml
0 → 100644
View file @
d752401d
# Step 2 of migrating to the MySQL separate-database StudentModuleHistory backend
# Step 1 is in create_edxapp_history_db.yml
#
# Usage: AWS_PROFILE=myprofile ansible-playbook promote_csmh_db.yml -i localhost, -e 'rds_name=env-dep-csm admin_password=SUPERSECRET'
#NB: should this do tags?
-
name
:
Promote new edxapp history RDS instance
hosts
:
all
connection
:
local
gather_facts
:
false
vars
:
rds_name
:
region
:
us-east-1
admin_password
:
backup_retention_days
:
30
backup_window
:
02:00-03:00
maint_window
:
Mon:00:00-Mon:01:15
tasks
:
-
name
:
Validate arguments
fail
:
msg
:
"
One
or
more
arguments
were
not
set
correctly:
{{
item
}}"
when
:
not {{ item }}
with_items
:
-
rds_name
-
admin_password
-
name
:
Validate boto version >= 1.9.9
shell
:
|
version=$(aws --version 2>&1 | sed -r 's|.*aws-cli/([0-9]+\.[0-9]+\.[0-9]).*|\1|')
if [ $version != '1.9.9' ]; then
cmp=$(echo -e "$version\n1.9.9" | sort -rV | head -n1)
[ $cmp = "1.9.9" ] && exit 1 || exit 0
fi
changed_when
:
False
-
name
:
Promote edxapp history RDS to primary instance
#Use local module for promoting only because of this issue:
#<https://github.com/ansible/ansible-modules-core/issues/2150>
rds_local
:
command
:
promote
instance_name
:
"
{{
rds_name
}}"
region
:
"
{{
region
}}"
wait
:
yes
wait_timeout
:
900
#Can't use the module if you want to be able to set storage types until this PR lands:
#<https://github.com/ansible/ansible-modules-core/issues/633>
#The StorageType option isn't in boto, but it is in boto3
#Requires awscli>=1.9.9
-
name
:
Modify edxapp history RDS
shell
:
>
aws rds modify-db-instance
--db-instance-identifier {{ rds_name }}
--apply-immediately
--multi-az
--master-user-password {{ admin_password }}
--publicly-accessible
--backup-retention-period {{ backup_retention_days }}
--preferred-backup-window {{ backup_window }}
--preferred-maintenance-window {{ maint_window }}
--storage-type gp2
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