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
53b7baa0
Commit
53b7baa0
authored
Nov 14, 2013
by
John Jarvis
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #452 from edx/jarv/provision-elb
Jarv/provision elb
parents
5107992b
c6151615
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
2 deletions
+45
-2
playbooks/edx-east/edx_provision.yml
+20
-0
playbooks/roles/launch_ec2/tasks/main.yml
+11
-2
util/jenkins/ansible-provision.sh
+14
-0
No files found.
playbooks/edx-east/edx_provision.yml
View file @
53b7baa0
...
...
@@ -32,3 +32,23 @@
# gh_users hash must be passed
# in as a -e variable
-
gh_users
post_tasks
:
-
name
:
get instance id for elb registration
local_action
:
module
:
ec2_lookup
region
:
us-east-1
tags
:
Name
:
"
{{
name_tag
}}"
register
:
ec2_info
when
:
elb
sudo
:
False
-
name
:
register instance into an elb if one was provided
local_action
:
module
:
ec2_elb
region
:
"
{{
region
}}"
instance_id
:
"
{{
ec2_info.instance_ids[0]
}}"
state
:
present
ec2_elbs
:
-
"
{{
elb
}}"
when
:
elb
sudo
:
False
playbooks/roles/launch_ec2/tasks/main.yml
View file @
53b7baa0
...
...
@@ -24,6 +24,16 @@
instance_ids
:
${tag_lookup.instance_ids}
when
:
terminate_instance ==
true
and tag_lookup.instance_ids|length == 1
-
name
:
deregister instance from an an elb if it was in one
local_action
:
module
:
ec2_elb
region
:
"
{{
region
}}"
instance_id
:
"
{{
tag_lookup.instance_ids[0]
}}"
ec2_elbs
:
-
"
{{
elb
}}"
state
:
absent
when
:
terminate_instance ==
true
and elb and tag_lookup.instance_ids|length == 1
-
name
:
launch_ec2 | Launch ec2 instance
local_action
:
module
:
ec2
...
...
@@ -35,6 +45,7 @@
region
:
"
{{
region
}}"
instance_tags
:
"
{{instance_tags}}"
root_ebs_size
:
"
{{
root_ebs_size
}}"
zone
:
"
{{
zone
}}"
register
:
ec2
-
name
:
launch_ec2 | Add DNS name
...
...
@@ -90,5 +101,3 @@
delay=60
timeout=320
with_items
:
"
{{
ec2.instances
}}"
util/jenkins/ansible-provision.sh
View file @
53b7baa0
...
...
@@ -38,6 +38,18 @@ fi
extra_vars
=
"/var/tmp/extra-vars-
$$
.yml"
if
[[
-z
$region
]]
;
then
region
=
"us-east1"
fi
if
[[
-z
$zone
]]
;
then
zone
=
"us-east-1b"
fi
if
[[
-z
$elb
]]
;
then
elb
=
"!!null"
fi
if
[[
-z
$dns_name
]]
;
then
dns_name
=
$github_username
fi
...
...
@@ -84,6 +96,7 @@ instance_type: $instance_type
security_group:
$security_group
ami:
$ami
region:
$region
zone:
$zone
instance_tags: '{"environment": "
$environment
", "github_username": "
$github_username
", "Name": "
$name_tag
", "source": "jenkins", "owner": "
$BUILD_USER
"}'
root_ebs_size:
$root_ebs_size
name_tag:
$name_tag
...
...
@@ -92,6 +105,7 @@ gh_users:
dns_zone:
$dns_zone
rabbitmq_refresh: True
GH_USERS_PROMPT: '[
$name_tag
] '
elb: "
$elb
"
EOF
cat
$extra_vars
# run the tasks to launch an ec2 instance from AMI
...
...
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