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
cc9f3727
Commit
cc9f3727
authored
Feb 13, 2014
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switching to a single bash script instead of logrotate
parent
1428c990
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
21 deletions
+15
-21
playbooks/roles/common/defaults/main.yml
+10
-3
playbooks/roles/common/templates/edx_logrotate.j2
+0
-6
playbooks/roles/common/templates/edx_logrotate_rsyslog.j2
+0
-3
playbooks/roles/common/templates/edx_logrotate_tracking_log.j2
+0
-7
playbooks/roles/common/templates/send-logs-to-s3.j2
+5
-2
No files found.
playbooks/roles/common/defaults/main.yml
View file @
cc9f3727
...
@@ -39,9 +39,16 @@ COMMON_S3_LOGS: false
...
@@ -39,9 +39,16 @@ COMMON_S3_LOGS: false
COMMON_S3_LOGS_NOTIFY_MAIL
:
dummy@example.com
COMMON_S3_LOGS_NOTIFY_MAIL
:
dummy@example.com
# Separate buckets for tracking logs and everything else
# Separate buckets for tracking logs and everything else
# You should be overriding the environment and deployment vars
# You should be overriding the environment and deployment vars
COMMON_S3_LOGS_APP_BUCKET
:
"
{{
COMMON_ENVIRONMENT
}}-{{
COMMON_DEPLOYMENT
}}-app-logs"
COMMON_S3_LOG_PATHS
:
COMMON_S3_LOGS_TRACKING_BUCKET
:
"
{{
COMMON_ENVIRONMENT
}}-{{
COMMON_DEPLOYMENT
}}-tracking-logs"
-
bucket
:
"
{{
COMMON_S3_LOGS_APP_BUCKET
}}"
paths
:
# globs are ok, do not use brace expansion
# everything except tracking logs
-
"
{{
COMMON_LOG_DIR
}}/!(*tracking*)"
-
"
/var/log/*"
-
bucket
:
"
{{
COMMON_S3_LOGS_TRACKING_BUCKET
}}"
paths
:
-
"
{{
COMMON_LOG_DIR
}}/*tracking*"
common_debian_pkgs
:
common_debian_pkgs
:
-
ntp
-
ntp
-
ack-grep
-
ack-grep
...
...
playbooks/roles/common/templates/edx_logrotate.j2
View file @
cc9f3727
...
@@ -9,10 +9,4 @@
...
@@ -9,10 +9,4 @@
daily
daily
rotate 90
rotate 90
size 1M
size 1M
{% if COMMON_S3_LOGS -%}
sharedscripts
postrotate
{% include s3-application.j2 %}
endscript
{% endif -%}
}
}
playbooks/roles/common/templates/edx_logrotate_rsyslog.j2
View file @
cc9f3727
...
@@ -8,9 +8,6 @@
...
@@ -8,9 +8,6 @@
compress
compress
postrotate
postrotate
reload rsyslog >/dev/null 2>&1 || true
reload rsyslog >/dev/null 2>&1 || true
{% if COMMON_S3_LOGS -%}
bash /edx/bin/send-logs-to-s3 "/var/log/syslog*" s3://{{ COMMON_S3_LOGS_APP_BUCKET }}
{% endif -%}
endscript
endscript
}
}
...
...
playbooks/roles/common/templates/edx_logrotate_tracking_log.j2
View file @
cc9f3727
...
@@ -8,11 +8,4 @@
...
@@ -8,11 +8,4 @@
daily
daily
rotate 365000
rotate 365000
size 1M
size 1M
{% if COMMON_S3_LOGS -%}
sharedscripts
postrotate
{% include s3-tracking.j2 %}
endscript
{% endif -%}
}
}
playbooks/roles/common/templates/send-logs-to-s3.j2
View file @
cc9f3727
...
@@ -108,5 +108,8 @@ instance_id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
...
@@ -108,5 +108,8 @@ instance_id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
ip
=
$(
curl
-s
http://169.254.169.254/latest/meta-data/local-ipv4
)
ip
=
$(
curl
-s
http://169.254.169.254/latest/meta-data/local-ipv4
)
s3_path
=
"
${
2
}
/
$sec_grp
/"
s3_path
=
"
${
2
}
/
$sec_grp
/"
{
%
for
bucket
in
COMMON_S3_LOG_PATHS -%
}
$noop
$S3CMD
sync
$1
${
2
}
/
$sec_grp
/
${
instance_id
}
-
${
ip
}
/
{
%
for
path
in
bucket.paths -%
}
$noop
$S3CMD
sync
{{
path
}}
{{
bucket
}}
/
$sec_grp
/
${
instance_id
}
-
${
ip
}
/
{
% endfor %
}
{
% endfor %
}
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