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
b84c7789
Commit
b84c7789
authored
Dec 17, 2014
by
Arbab Nazar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added EBS Volumes Tagging
parent
8f897c94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
playbooks/roles/supervisor/files/pre_supervisor_checks.py
+16
-2
No files found.
playbooks/roles/supervisor/files/pre_supervisor_checks.py
View file @
b84c7789
...
@@ -53,7 +53,7 @@ if __name__ == '__main__':
...
@@ -53,7 +53,7 @@ if __name__ == '__main__':
parser
=
argparse
.
ArgumentParser
(
parser
=
argparse
.
ArgumentParser
(
description
=
"Enable all services that are in the services tag of this ec2 instance."
)
description
=
"Enable all services that are in the services tag of this ec2 instance."
)
parser
.
add_argument
(
"-a"
,
"--available"
,
parser
.
add_argument
(
"-a"
,
"--available"
,
help
=
"The location of the available services."
)
help
=
"The location of the available services."
)
parser
.
add_argument
(
"-e"
,
"--enabled"
,
parser
.
add_argument
(
"-e"
,
"--enabled"
,
help
=
"The location of the enabled services."
)
help
=
"The location of the enabled services."
)
...
@@ -114,7 +114,21 @@ if __name__ == '__main__':
...
@@ -114,7 +114,21 @@ if __name__ == '__main__':
play
=
play
,
play
=
play
,
instance_id
=
instance_id
)
instance_id
=
instance_id
)
except
:
except
:
print
(
"Failed to get EDP for {}"
.
format
(
instance_id
))
print
(
"Failed to get EDP for {}"
.
format
(
instance
=
instance_id
))
#get the hostname of the sandbox
hostname
=
socket
.
gethostname
()
#get the list of the volumes, that are attached to the instance
volumes
=
ec2
.
get_all_volumes
(
filters
=
{
'attachment.instance-id'
:
instance_id
})
for
volume
in
volumes
:
volume
.
add_tags
({
"hostname"
:
hostname
,
"environment"
:
environment
,
"deployment"
:
deployment
,
"cluster"
:
play
,
"instance-id"
:
instance_id
,
"created"
:
volume
.
create_time
})
try
:
try
:
for
service
in
services_for_instance
(
instance_id
):
for
service
in
services_for_instance
(
instance_id
):
...
...
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