Commit f18833c7 by John Jarvis

Merge branch 'master' into release

parents b56ffe09 ba0fd895
...@@ -631,7 +631,7 @@ ...@@ -631,7 +631,7 @@
}, },
"Tags":[ "Tags":[
{ {
"Key":"Application", "Key":"play",
"Value":"edxapp" "Value":"edxapp"
}, },
{ {
...@@ -676,7 +676,7 @@ ...@@ -676,7 +676,7 @@
}, },
"Tags":[ "Tags":[
{ {
"Key":"Application", "Key":"play",
"Value":"edxapp" "Value":"edxapp"
}, },
{ {
...@@ -721,7 +721,7 @@ ...@@ -721,7 +721,7 @@
}, },
"Tags":[ "Tags":[
{ {
"Key":"Application", "Key":"play",
"Value":"xqueue" "Value":"xqueue"
}, },
{ {
...@@ -766,7 +766,7 @@ ...@@ -766,7 +766,7 @@
}, },
"Tags":[ "Tags":[
{ {
"Key":"Application", "Key":"play",
"Value":"xqueue" "Value":"xqueue"
}, },
{ {
...@@ -811,8 +811,8 @@ ...@@ -811,8 +811,8 @@
}, },
"Tags":[ "Tags":[
{ {
"Key":"Application", "Key":"play",
"Value":"RabbitMQ" "Value":"rabbitmq"
}, },
{ {
"Key":"Network", "Key":"Network",
...@@ -856,8 +856,8 @@ ...@@ -856,8 +856,8 @@
}, },
"Tags":[ "Tags":[
{ {
"Key":"Application", "Key":"play",
"Value":"RabbitMQ" "Value":"rabbitmq"
}, },
{ {
"Key":"Network", "Key":"Network",
...@@ -901,7 +901,7 @@ ...@@ -901,7 +901,7 @@
}, },
"Tags":[ "Tags":[
{ {
"Key":"Application", "Key":"play",
"Value":"xserver" "Value":"xserver"
}, },
{ {
...@@ -946,7 +946,7 @@ ...@@ -946,7 +946,7 @@
}, },
"Tags":[ "Tags":[
{ {
"Key":"Application", "Key":"play",
"Value":"xserver" "Value":"xserver"
}, },
{ {
...@@ -1119,7 +1119,7 @@ ...@@ -1119,7 +1119,7 @@
}, },
"Tags":[ "Tags":[
{ {
"Key":"Application", "Key":"play",
"Value":"worker" "Value":"worker"
}, },
{ {
...@@ -1164,7 +1164,7 @@ ...@@ -1164,7 +1164,7 @@
}, },
"Tags":[ "Tags":[
{ {
"Key":"Application", "Key":"play",
"Value":"worker" "Value":"worker"
}, },
{ {
...@@ -1210,7 +1210,7 @@ ...@@ -1210,7 +1210,7 @@
"Tags":[ "Tags":[
{ {
"Key":"Application", "Key":"Application",
"Value":"forum" "Value":"elasticsearch"
}, },
{ {
"Key":"Network", "Key":"Network",
...@@ -1255,7 +1255,7 @@ ...@@ -1255,7 +1255,7 @@
"Tags":[ "Tags":[
{ {
"Key":"Application", "Key":"Application",
"Value":"forum" "Value":"elasticsearch"
}, },
{ {
"Key":"Network", "Key":"Network",
...@@ -1299,7 +1299,7 @@ ...@@ -1299,7 +1299,7 @@
}, },
"Tags":[ "Tags":[
{ {
"Key":"Application", "Key":"play",
"Value":"forum" "Value":"forum"
}, },
{ {
...@@ -1344,7 +1344,7 @@ ...@@ -1344,7 +1344,7 @@
}, },
"Tags":[ "Tags":[
{ {
"Key":"Application", "Key":"play",
"Value":"forum" "Value":"forum"
}, },
{ {
...@@ -3262,6 +3262,24 @@ ...@@ -3262,6 +3262,24 @@
}, },
"CidrIp":"0.0.0.0/0" "CidrIp":"0.0.0.0/0"
} }
],
"Tags":[
{
"Key":"play",
"Value":"edxapp"
},
{
"Key":"environment",
"Value":{
"Ref":"EnvironmentTag"
}
},
{
"Key":"deployment",
"Value":{
"Ref":"DeploymentTag"
}
}
] ]
} }
}, },
...@@ -3597,6 +3615,24 @@ ...@@ -3597,6 +3615,24 @@
"ToPort": { "Ref": "XqueueServerPort" }, "ToPort": { "Ref": "XqueueServerPort" },
"CidrIp":"0.0.0.0/0" "CidrIp":"0.0.0.0/0"
} }
],
"Tags":[
{
"Key":"play",
"Value":"xqueue"
},
{
"Key":"environment",
"Value":{
"Ref":"EnvironmentTag"
}
},
{
"Key":"deployment",
"Value":{
"Ref":"DeploymentTag"
}
}
] ]
} }
}, },
...@@ -3966,6 +4002,24 @@ ...@@ -3966,6 +4002,24 @@
"Ref" : "BastionSecurityGroup" "Ref" : "BastionSecurityGroup"
} }
} }
],
"Tags":[
{
"Key":"play",
"Value":"rabbitmq"
},
{
"Key":"environment",
"Value":{
"Ref":"EnvironmentTag"
}
},
{
"Key":"deployment",
"Value":{
"Ref":"DeploymentTag"
}
}
] ]
} }
}, },
...@@ -4293,6 +4347,24 @@ ...@@ -4293,6 +4347,24 @@
"Ref" : "XServerELBSecurityGroup" "Ref" : "XServerELBSecurityGroup"
} }
} }
],
"Tags":[
{
"Key":"play",
"Value":"xserver"
},
{
"Key":"environment",
"Value":{
"Ref":"EnvironmentTag"
}
},
{
"Key":"deployment",
"Value":{
"Ref":"DeploymentTag"
}
}
] ]
} }
}, },
...@@ -4675,6 +4747,24 @@ ...@@ -4675,6 +4747,24 @@
"Ref":"SSHLocation" "Ref":"SSHLocation"
} }
} }
],
"Tags":[
{
"Key":"play",
"Value":"worker"
},
{
"Key":"environment",
"Value":{
"Ref":"EnvironmentTag"
}
},
{
"Key":"deployment",
"Value":{
"Ref":"DeploymentTag"
}
}
] ]
} }
}, },
...@@ -5266,6 +5356,24 @@ ...@@ -5266,6 +5356,24 @@
"Ref" : "ForumELBSecurityGroup" "Ref" : "ForumELBSecurityGroup"
} }
} }
],
"Tags":[
{
"Key":"play",
"Value":"forum"
},
{
"Key":"environment",
"Value":{
"Ref":"EnvironmentTag"
}
},
{
"Key":"deployment",
"Value":{
"Ref":"DeploymentTag"
}
}
] ]
} }
}, },
...@@ -5609,6 +5717,24 @@ ...@@ -5609,6 +5717,24 @@
] ]
} }
} }
],
"Tags":[
{
"Key":"play",
"Value":"mongo"
},
{
"Key":"environment",
"Value":{
"Ref":"EnvironmentTag"
}
},
{
"Key":"deployment",
"Value":{
"Ref":"DeploymentTag"
}
}
] ]
} }
}, },
......
...@@ -172,8 +172,6 @@ def parse_args(): ...@@ -172,8 +172,6 @@ def parse_args():
parser.add_argument('-t', '--instance-type', required=False, parser.add_argument('-t', '--instance-type', required=False,
default="m1.large", default="m1.large",
help="instance type to launch") help="instance type to launch")
parser.add_argument("--security-group", required=False,
default="abbey", help="Security group to use")
parser.add_argument("--role-name", required=False, parser.add_argument("--role-name", required=False,
default="abbey", default="abbey",
help="IAM role name to use (must exist)") help="IAM role name to use (must exist)")
...@@ -198,27 +196,22 @@ def parse_args(): ...@@ -198,27 +196,22 @@ def parse_args():
return parser.parse_args() return parser.parse_args()
def get_instance_sec_group(vpc_id, security_group): def get_instance_sec_group(vpc_id):
security_group_id = None security_group_id = None
grp_details = ec2.get_all_security_groups( grp_details = ec2.get_all_security_groups(
filters={ filters={
'vpc_id':vpc_id 'vpc_id':vpc_id,
'tag:play': args.play
} }
) )
for grp in grp_details: if len(grp_details) < 1:
if grp.name == security_group: sys.stderr.write("ERROR: Expected atleast one security group, got {}\n".format(
security_group_id = grp.id len(grp_details)))
break
if not security_group_id:
print "Unable to lookup id for security group {}".format(
security_group)
sys.exit(1)
return security_group_id return grp_details[0].id
def create_instance_args(): def create_instance_args():
...@@ -233,16 +226,16 @@ def create_instance_args(): ...@@ -233,16 +226,16 @@ def create_instance_args():
subnet = vpc.get_all_subnets( subnet = vpc.get_all_subnets(
filters={ filters={
'tag:aws:cloudformation:stack-name': stack_name, 'tag:aws:cloudformation:stack-name': stack_name,
'tag:Application': args.application} 'tag:play': args.play}
) )
if len(subnet) != 1: if len(subnet) < 1:
sys.stderr.write("ERROR: Expected 1 admin subnet, got {}\n".format( sys.stderr.write("ERROR: Expected at least one subnet, got {}\n".format(
len(subnet))) len(subnet)))
sys.exit(1) sys.exit(1)
subnet_id = subnet[0].id subnet_id = subnet[0].id
vpc_id = subnet[0].vpc_id vpc_id = subnet[0].vpc_id
security_group_id = get_instance_sec_group(vpc_id, args.security_group) security_group_id = get_instance_sec_group(vpc_id)
if args.identity: if args.identity:
config_secure = 'true' config_secure = 'true'
...@@ -271,7 +264,6 @@ git_repo="https://github.com/edx/$git_repo_name" ...@@ -271,7 +264,6 @@ git_repo="https://github.com/edx/$git_repo_name"
git_repo_secure="{configuration_secure_repo}" git_repo_secure="{configuration_secure_repo}"
git_repo_secure_name="{configuration_secure_repo_basename}" git_repo_secure_name="{configuration_secure_repo_basename}"
secure_vars_file="$base_dir/$git_repo_secure_name/{secure_vars}" secure_vars_file="$base_dir/$git_repo_secure_name/{secure_vars}"
common_vars_file="$base_dir/$git_repo_secure_name/ansible/vars/common/common.yml"
instance_id=\\ instance_id=\\
$(curl http://169.254.169.254/latest/meta-data/instance-id 2>/dev/null) $(curl http://169.254.169.254/latest/meta-data/instance-id 2>/dev/null)
instance_ip=\\ instance_ip=\\
...@@ -345,8 +337,8 @@ sudo pip install -r requirements.txt ...@@ -345,8 +337,8 @@ sudo pip install -r requirements.txt
cd $playbook_dir cd $playbook_dir
ansible-playbook -vvvv -c local -i "localhost," $play.yml -e@$extra_vars -e@$common_vars_file ansible-playbook -vvvv -c local -i "localhost," $play.yml -e@$extra_vars
ansible-playbook -vvvv -c local -i "localhost," stop_all_edx_services.yml -e@$extra_vars -e@$common_vars_file ansible-playbook -vvvv -c local -i "localhost," stop_all_edx_services.yml -e@$extra_vars
rm -rf $base_dir rm -rf $base_dir
......
...@@ -34,7 +34,7 @@ end ...@@ -34,7 +34,7 @@ end
Vagrant.configure("2") do |config| Vagrant.configure("2") do |config|
# Creates an edX devstack VM from an official release # Creates an edX devstack VM from an official release
config.vm.box = "empanada-devstack" config.vm.box = "focaccia-devstack"
config.vm.box_url = "http://files.edx.org/vagrant-images/20140130-focaccia-devstack.box" config.vm.box_url = "http://files.edx.org/vagrant-images/20140130-focaccia-devstack.box"
config.vm.network :private_network, ip: "192.168.33.10" config.vm.network :private_network, ip: "192.168.33.10"
......
...@@ -4,7 +4,7 @@ CPU_COUNT = 2 ...@@ -4,7 +4,7 @@ CPU_COUNT = 2
Vagrant.configure("2") do |config| Vagrant.configure("2") do |config|
# Creates an edX fullstack VM from an official release # Creates an edX fullstack VM from an official release
config.vm.box = "empanada" config.vm.box = "facaccia"
config.vm.box_url = "http://files.edx.org/vagrant-images/20140130-focaccia-fullstack.box" config.vm.box_url = "http://files.edx.org/vagrant-images/20140130-focaccia-fullstack.box"
config.vm.network :private_network, ip: "192.168.33.10" config.vm.network :private_network, ip: "192.168.33.10"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment