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
809c9513
Commit
809c9513
authored
Jul 11, 2014
by
Han Su Kim
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1275 from edx/han/aws-t2-instances
Adding vpc_subnet_id to allow for t2 instances
parents
21f5f78e
d4dc2aac
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
95 deletions
+30
-95
playbooks/edx-east/connect_sandbox.yml
+11
-85
playbooks/edx-east/edx_provision.yml
+7
-4
playbooks/roles/launch_ec2/tasks/main.yml
+2
-0
util/jenkins/ansible-provision.sh
+10
-6
No files found.
playbooks/edx-east/connect_sandbox.yml
View file @
809c9513
...
...
@@ -4,91 +4,6 @@
sudo
:
True
tasks
:
-
name
:
Switch the mongo db to use ephemeral
file
:
>
name=/mnt/mongodb
state=directory
owner=mongodb
group=mongodb
tags
:
update_mongo_data
-
name
:
update the mongo config to use the new mongo dir
shell
:
>
sed -i 's#^dbpath=.*#dbpath=/mnt/mongodb#' /etc/mongodb.conf
tags
:
update_mongo_data
-
name
:
restart mongodb
service
:
>
name=mongodb
state=restarted
tags
:
update_mongo_data
-
name
:
grab the most recent backup from s3 for forums
shell
:
>
/edx/bin/s3cmd ls s3://edx-mongohq/mongohq_backups/ | grep comment | sort | tail -1 | awk '{ print $4 }'
register
:
s3cmd_out_forum
tags
:
update_mongo_data
-
name
:
grab the most recent backup from s3 for forums
shell
:
>
/edx/bin/s3cmd get {{ s3cmd_out_forum.stdout }} --skip-existing
chdir=/mnt
tags
:
update_mongo_data
when
:
s3cmd_out_forum.stdout is defined
-
name
:
untar the s3 backup
shell
:
>
tar zxf {{ s3cmd_out_forum.stdout|basename }}
chdir=/mnt
when
:
s3cmd_out_forum.stdout is defined
tags
:
update_mongo_data
-
name
:
grab the most recent backup from s3 for prod-edx
shell
:
>
/edx/bin/s3cmd ls s3://edx-mongohq/mongohq_backups/ | grep prod-edx | sort | tail -1 | awk '{ print $4 }'
register
:
s3cmd_out_modulestore
tags
:
update_mongo_data
-
name
:
grab the most recent backup from s3 for prod-edx
shell
:
>
/edx/bin/s3cmd get {{ s3cmd_out_modulestore.stdout }} --skip-existing
chdir=/mnt
tags
:
update_mongo_data
when
:
s3cmd_out_modulestore.stdout is defined
-
name
:
untar the s3 backup
shell
:
>
tar zxf {{ s3cmd_out_modulestore.stdout|basename }}
chdir=/mnt
tags
:
update_mongo_data
when
:
s3cmd_out_modulestore.stdout is defined
-
name
:
Restore the mongo data for the forums
shell
:
>
mongorestore --drop -d cs_comments_service /mnt/comments-prod
tags
:
update_mongo_data
-
name
:
Restore the mongo data for the modulestore
shell
:
>
mongorestore --drop -d edxapp /mnt/prod-edx
tags
:
update_mongo_data
# recreate users after the restore
-
name
:
create a mongodb users
mongodb_user
:
>
database={{ item.database }}
name={{ item.user }}
password={{ item.password }}
state=present
with_items
:
-
user
:
cs_comments_service
password
:
password
database
:
cs_comments_service
-
user
:
exdapp
password
:
password
database
:
edxapp
# WARNING - calling lineinfile on a symlink
# will convert the symlink to a file!
# don't use /edx/etc/server-vars.yml here
...
...
@@ -108,6 +23,17 @@
-
"
EDXAPP_MYSQL_PASSWORD:
{{
EDXAPP_MYSQL_PASSWORD
}}"
tags
:
update_edxapp_mysql_host
-
name
:
Update mongo to point to the sandbox mongo clone
lineinfile
:
>
dest=/edx/app/edx_ansible/server-vars.yml
line="{{ item }}"
with_items
:
-
"
EDXAPP_MONGO_HOSTS:
{{
EDXAPP_MONGO_HOSTS
}}"
-
"
EDXAPP_MONGO_DB_NAME:
{{
EDXAPP_MONGO_DB_NAME
}}"
-
"
EDXAPP_MONGO_USER:
{{
EDXAPP_MONGO_USER
}}"
-
"
EDXAPP_MONGO_PASS:
{{
EDXAPP_MONGO_PASS
}}"
tags
:
update_edxapp_mysql_host
-
name
:
call update on edx-platform
shell
:
>
/edx/bin/update edx-platform master
...
...
playbooks/edx-east/edx_provision.yml
View file @
809c9513
...
...
@@ -4,12 +4,12 @@
gather_facts
:
False
vars
:
keypair
:
continuous-integration
instance_type
:
m1
.medium
security_group
:
sandbox
instance_type
:
t2
.medium
security_group
:
sandbox
-vpc
# ubuntu 12.04
ami
:
ami-
d0f89fb9
ami
:
ami-
f478849c
region
:
us-east-1
zone
:
us-east-1
b
zone
:
us-east-1
c
instance_tags
:
environment
:
sandbox
github_username
:
temp
...
...
@@ -21,6 +21,7 @@
dns_zone
:
m.sandbox.edx.org
name_tag
:
sandbox-temp
elb
:
false
vpc_subnet_id
:
subnet-cd867aba
roles
:
-
role
:
launch_ec2
keypair
:
"
{{
keypair
}}"
...
...
@@ -33,6 +34,8 @@
dns_name
:
"
{{
dns_name
}}"
dns_zone
:
"
{{
dns_zone
}}"
zone
:
"
{{
zone
}}"
vpc_subnet_id
:
"
{{
vpc_subnet_id
}}"
assign_public_ip
:
yes
terminate_instance
:
true
instance_profile_name
:
sandbox
...
...
playbooks/roles/launch_ec2/tasks/main.yml
View file @
809c9513
...
...
@@ -41,6 +41,8 @@
group
:
"
{{
security_group
}}"
instance_type
:
"
{{
instance_type
}}"
image
:
"
{{
ami
}}"
vpc_subnet_id
:
"
{{
vpc_subnet_id
}}"
assign_public_ip
:
yes
wait
:
true
region
:
"
{{
region
}}"
instance_tags
:
"
{{instance_tags}}"
...
...
util/jenkins/ansible-provision.sh
View file @
809c9513
...
...
@@ -64,7 +64,11 @@ if [[ -z $region ]]; then
fi
if
[[
-z
$zone
]]
;
then
zone
=
"us-east-1b"
zone
=
"us-east-1c"
fi
if
[[
-z
$vpc_subnet_id
]]
;
then
vpc_subnet_id
=
"subnet-cd867aba"
fi
if
[[
-z
$elb
]]
;
then
...
...
@@ -81,16 +85,16 @@ fi
if
[[
-z
$ami
]]
;
then
if
[[
$server_type
==
"full_edx_installation"
]]
;
then
ami
=
"ami-f
0814498
"
ami
=
"ami-f
287419a
"
elif
[[
$server_type
==
"ubuntu_12.04"
||
$server_type
==
"full_edx_installation_from_scratch"
]]
;
then
ami
=
"ami-
59a4a230
"
ami
=
"ami-
f478849c
"
elif
[[
$server_type
==
"ubuntu_14.04(experimental)"
]]
;
then
ami
=
"ami-
408c7f28
"
ami
=
"ami-
a6926dce
"
fi
fi
if
[[
-z
$instance_type
]]
;
then
instance_type
=
"
m1
.medium"
instance_type
=
"
t2
.medium"
fi
if
[[
-z
$enable_monitoring
]]
;
then
...
...
@@ -201,7 +205,7 @@ EOF
# run the tasks to launch an ec2 instance from AMI
cat
$extra_vars_file
ansible-playbook edx_provision.yml
-i
inventory.ini
$extra_var_arg
--user
ubuntu
ansible-playbook edx_provision.yml
-i
inventory.ini
$extra_var_arg
--user
ubuntu
if
[[
$server_type
==
"full_edx_installation"
]]
;
then
# additional tasks that need to be run if the
...
...
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