Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lu Xu
slapos.package
Commits
fcae174d
Commit
fcae174d
authored
Dec 09, 2015
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ansible: add logrotate role
parent
9a2be62c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
playbook/imt-vm-bootstrap.yml
playbook/imt-vm-bootstrap.yml
+11
-0
playbook/roles/logrotate/tasks/main.yml
playbook/roles/logrotate/tasks/main.yml
+10
-0
playbook/roles/logrotate/templates/logrotate.d.j2
playbook/roles/logrotate/templates/logrotate.d.j2
+16
-0
No files found.
playbook/imt-vm-bootstrap.yml
View file @
fcae174d
...
...
@@ -25,4 +25,15 @@
-
{
role
:
vm-disks
,
vd_disk
:
s
,
data_n
:
12
}
-
{
role
:
vm-disks
,
vd_disk
:
t
,
data_n
:
12
}
-
{
role
:
vm-disks
,
vd_disk
:
u
,
data_n
:
12
}
-
role
:
logrotate
logrotate_scripts
:
-
name
:
vm-bootstrap
path
:
/var/log/vm-bootstrap.log
options
:
-
weekly
-
compress
-
rotate
5
-
notifempty
-
create
-
dateext
playbook/roles/logrotate/tasks/main.yml
0 → 100644
View file @
fcae174d
---
-
name
:
Install logrotate
action
:
"
{{ansible_pkg_mgr}}
pkg=logrotate
state=present"
-
name
:
Configure logrotate.d scripts
template
:
src
:
logrotate.d.j2
dest
:
/etc/logrotate.d/{{ item.name }}
with_items
:
logrotate_scripts
when
:
logrotate_scripts is defined
playbook/roles/logrotate/templates/logrotate.d.j2
0 → 100644
View file @
fcae174d
# {{ ansible_managed }}
"{{ item.path }}" {
{% if item.options is defined -%}
{% for option in item.options -%}
{{ option }}
{% endfor -%}
{% endif %}
{%- if item.scripts is defined -%}
{%- for name, script in item.scripts.iteritems() -%}
{{ name }}
{{ script }}
endscript
{% endfor -%}
{% endif -%}
}
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