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
edx
configuration
Commits
a6d8da22
Commit
a6d8da22
authored
Apr 05, 2016
by
Brian Beggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup playbook to be used in the continuous delivery pipeline
parent
6d8f3007
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
playbooks/continuous_delivery/cleanup.yml
+58
-0
No files found.
playbooks/continuous_delivery/cleanup.yml
0 → 100644
View file @
a6d8da22
# This playbook will clean up the work done in the create_ami and launch_instance playbooks consisting of the following work:
# - delete the key used to bring up the instance
# - terminate the instance used to create the AMI
# - delete the ansible-runtime/<run identifer directory>
#
# Required variables for this playbook:
#
# - instance_id - the ec2 instance ID use to create the AMI
# - keypair_id - the keypair used to launch the instance.
#
# Other variables
# - ec2_region - The region used to create the AMI
# - hipchat_token - API token to send messages to hipchat
# - hipchat_room - ID or name of the room to send the notification
# - hipchat_url - URL of the hipchat API (defaults to v1 of the api)
#
# Example command line to run this playbook:
# ansible-playbook -vvvv -i "localhost," -c local \
# -e @overrides.yml \
# -e @/tmp/ansible-runtime/d057a5d9-4fc5-4a21-9646-4c135be0b7c8/launch_info.yml \
# cleanup.yml
#
-
hosts
:
all
vars
:
ec2_region
:
us-east-1
ec2_timeout
:
300
artifact_path
:
/tmp/ansible-runtime
hipchat_url
:
https://api.hipchat.com/v2/
gather_facts
:
False
connection
:
local
tasks
:
-
name
:
Delete keypair
ec2_key
:
state
:
absent
region
:
"
{{
ec2_region
}}"
name
:
"
{{
keypair_id
}}"
-
name
:
Terminate Instance
ec2
:
region
:
"
{{
ec2_region
}}"
state
:
absent
instance_ids
:
"
{{
instance_id
}}"
-
name
:
cleanup local file system
file
:
path
:
"
{{
artifact_path
}}/{{
keypair_id
}}"
state
:
absent
-
name
:
Send Hipchat notification cleanup has finished
hipchat
:
api
:
"
{{
hipchat_url
}}"
token
:
"
{{
hipchat_token
}}"
room
:
"
{{
hipchat_room
}}"
msg
:
"
Cleanup
for
run
id:
{{
keypair_id
}}
complete."
when
:
hipchat_token is defined
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