Commit 2ff5593a by e0d

Merge pull request #1393 from edx/e0d/s3-log-refactor

path fixes
parents 92994a30 5fe61a2f
...@@ -27,11 +27,11 @@ AWS_S3_LOGS_FROM_EMAIL: dummy@example.com ...@@ -27,11 +27,11 @@ AWS_S3_LOGS_FROM_EMAIL: dummy@example.com
# You should be overriding the environment and deployment vars # You should be overriding the environment and deployment vars
# Order of precedence is left to right for exclude and include options # Order of precedence is left to right for exclude and include options
AWS_S3_LOG_PATHS: AWS_S3_LOG_PATHS:
- bucket: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-app-logs" - bucket: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}/logs/application"
path: "{{ COMMON_LOG_DIR }}/!(*tracking*)" path: "{{ COMMON_LOG_DIR }}/!(*tracking*)"
- bucket: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-app-logs" - bucket: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}/logs/system"
path: "/var/log/*" path: "/var/log/*"
- bucket: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-tracking-logs" - bucket: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}/logs/tracking"
path: "{{ COMMON_LOG_DIR }}/*tracking*" path: "{{ COMMON_LOG_DIR }}/*tracking*"
# #
...@@ -45,7 +45,8 @@ aws_s3_logfile: "{{ aws_log_dir }}/s3-log-sync.log" ...@@ -45,7 +45,8 @@ aws_s3_logfile: "{{ aws_log_dir }}/s3-log-sync.log"
aws_log_dir: "{{ COMMON_LOG_DIR }}/aws" aws_log_dir: "{{ COMMON_LOG_DIR }}/aws"
aws_region: "us-east-1" aws_region: "us-east-1"
# default path to the aws binary # default path to the aws binary
aws_cmd: "{{ COMMON_BIN_DIR }}/s3cmd" s3cmd_cmd: "{{ COMMON_BIN_DIR }}/s3cmd"
aws_cmd: "/usr/local/bin/aws"
# #
# OS packages # OS packages
# #
......
...@@ -90,5 +90,5 @@ region=${availability_zone:0:${{lb}}#availability_zone{{rb}} - 1} ...@@ -90,5 +90,5 @@ region=${availability_zone:0:${{lb}}#availability_zone{{rb}} - 1}
s3_path="${2}/$sec_grp/" s3_path="${2}/$sec_grp/"
{% for item in AWS_S3_LOG_PATHS -%} {% for item in AWS_S3_LOG_PATHS -%}
$noop {{ aws_cmd }} sync {{ item['path'] }} "s3://{{ item['bucket'] }}/$sec_grp/${instance_id}-${ip}/" $noop {{ s3cmd_cmd }} sync {{ item['path'] }} "s3://{{ item['bucket'] }}/$sec_grp/${instance_id}-${ip}/"
{% endfor %} {% endfor %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment