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
eb01a99f
Commit
eb01a99f
authored
Feb 27, 2016
by
Sven Marnach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to provide S3 IAM credentials for log syncing.
parent
c21deb73
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
playbooks/roles/aws/defaults/main.yml
+5
-1
playbooks/roles/aws/templates/send-logs-to-s3.j2
+7
-1
No files found.
playbooks/roles/aws/defaults/main.yml
View file @
eb01a99f
...
...
@@ -16,13 +16,17 @@
# logs by security group.
# !! The buckets defined below MUST exist prior to enabling !!
# this feature and the instance IAM role must have write permissions
# to the buckets
# to the buckets
, or you must specify the access and secret keys below.
AWS_S3_LOGS
:
false
# If there are any issues with the s3 sync an error
# log will be sent to the following address.
# This relies on your server being able to send mail
AWS_S3_LOGS_NOTIFY_EMAIL
:
dummy@example.com
AWS_S3_LOGS_FROM_EMAIL
:
dummy@example.com
# Credentials for S3 access in case the instance role doesn't have write
# permissions to S3
AWS_S3_LOGS_ACCESS_KEY_ID
:
"
"
AWS_S3_LOGS_SECRET_KEY
:
"
"
#
# vars are namespace with the module name.
...
...
playbooks/roles/aws/templates/send-logs-to-s3.j2
View file @
eb01a99f
...
...
@@ -116,5 +116,11 @@ availability_zone=$(ec2metadata --availability-zone)
# region isn't available via the metadata service
region=${availability_zone:0:${{ lb }}#availability_zone{{ rb }} - 1}
{% if AWS_S3_LOGS_ACCESS_KEY_ID %}
auth_opts="--access_key {{ AWS_S3_LOGS_ACCESS_KEY_ID }} --secret_key {{ AWS_S3_LOGS_SECRET_KEY }}"
{% else %}
auth_opts=""
{% endif %}
s3_path="${2}/$sec_grp/"
$noop {{ aws_s3cmd }} --multipart-chunk-size-mb 5120 --disable-multipart sync $directory "s3://${bucket_path}/${sec_grp}/${instance_id}-${ip}/"
$noop {{ aws_s3cmd }}
$auth_opts
--multipart-chunk-size-mb 5120 --disable-multipart sync $directory "s3://${bucket_path}/${sec_grp}/${instance_id}-${ip}/"
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