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
532c62f9
Commit
532c62f9
authored
Nov 14, 2013
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deregistering instance along with termination
parent
d239cb27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
playbooks/edx-east/edx_provision.yml
+10
-4
playbooks/roles/launch_ec2/tasks/main.yml
+8
-9
No files found.
playbooks/edx-east/edx_provision.yml
View file @
532c62f9
...
...
@@ -33,16 +33,22 @@
# in as a -e variable
-
gh_users
post_tasks
:
-
debug
:
msg={{ launch_ids }}
-
debug
:
msg={{ termination_ids }}
-
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
:
"
{{
item
}}"
instance_id
:
"
{{
ec2_info.instance_ids[0]
}}"
state
:
present
ec2_elbs
:
-
"
{{
elb
}}"
when
:
elb
sudo
:
False
with_items
:
"
{{
launch_ids
}}"
playbooks/roles/launch_ec2/tasks/main.yml
View file @
532c62f9
...
...
@@ -16,11 +16,6 @@
debug
:
msg="Too many results returned, not terminating!"
when
:
terminate_instance ==
true
and tag_lookup.instance_ids|length > 1
-
name
:
launch_ec2 | remember the instance id of the terminated instance
set_fact
:
termination_ids
:
${tag_lookup.instance_ids}
when
:
terminate_instance ==
true
-
name
:
terminating single instance
local_action
:
module
:
ec2
...
...
@@ -29,6 +24,14 @@
instance_ids
:
${tag_lookup.instance_ids}
when
:
terminate_instance ==
true
and tag_lookup.instance_ids|length == 1
-
name
:
deregister instance from any elb it was previously in
local_action
:
module
:
ec2_elb
region
:
"
{{
region
}}"
instance_id
:
"
{{
tag_lookup.instance_ids[0]
}}"
state
:
absent
when
:
terminate_instance ==
true
and elb
-
name
:
launch_ec2 | Launch ec2 instance
local_action
:
module
:
ec2
...
...
@@ -43,10 +46,6 @@
zone
:
"
{{
zone
}}"
register
:
ec2
-
name
:
launch_ec2 | remember the instance id of the launched instances
set_fact
:
launch_ids
:
${ec2.instances}
-
name
:
launch_ec2 | Add DNS name
local_action
:
module
:
route53
...
...
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