Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
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
ansible
Commits
0f5a4e21
Commit
0f5a4e21
authored
Sep 14, 2012
by
Matthew Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add logrotate config
parent
e7eab932
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
examples/playbooks/ansible_pull.yml
+7
-2
examples/playbooks/templates/etc_cron.d_ansible-pull.j2
+1
-1
examples/playbooks/templates/etc_logrotate.d_ansible-pull.j2
+7
-0
No files found.
examples/playbooks/ansible_pull.yml
View file @
0f5a4e21
...
...
@@ -20,12 +20,15 @@
vars
:
# schdule is fed directly to cron
# sch
e
dule is fed directly to cron
schedule
:
'
*/15
*
*
*
*'
# User to run ansible-pull as from cron
cron_user
:
root
# File that ansible will use for logs
logfile
:
/var/log/ansible-pull.log
# Directory to where repository will be cloned
workdir
:
/var/lib/ansible/local
...
...
@@ -47,5 +50,7 @@
owner=root group=root mode=0644
-
name
:
Create crontab entry to clone/pull git repository
action
:
template src=templates/ansible-pull.j2 dest=/etc/cron.d/ansible-pull owner=root group=root mode=0644
action
:
template src=templates/
etc_cron.d_
ansible-pull.j2 dest=/etc/cron.d/ansible-pull owner=root group=root mode=0644
-
name
:
Create logrotate entry for ansible-pull.log
action
:
template src=templates/etc_logrotate.d_ansible-pull.j2 dest=/etc/logrorate.d/ansible-pull owner=root group=root mode=0644
examples/playbooks/templates/ansible-pull.j2
→
examples/playbooks/templates/
etc_cron.d_
ansible-pull.j2
View file @
0f5a4e21
# Cron job to git clone/pull a repo and then run locally
{{ schedule }} {{ cron_user }} ansible-pull -d {{ workdir }} -U {{ repo_url }} >
/var/log/ansible-pull.log
2>&1
{{ schedule }} {{ cron_user }} ansible-pull -d {{ workdir }} -U {{ repo_url }} >
>{{ logfile }}
2>&1
examples/playbooks/templates/etc_logrotate.d_ansible-pull.j2
0 → 100644
View file @
0f5a4e21
{{ logfile }} {
rotate 7
daily
compress
missingok
notifempty
}
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