Skip to content

Commit

Permalink
syntax update and meta
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaerlocher authored Dec 11, 2018
2 parents 9e8cf41 + d91ad6d commit 7a5328e
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 20 deletions.
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ansible Role: logrotate

[![Build Status](https://travis-ci.org/arillso/ansible.logrotate.svg?branch=master)](https://travis-ci.org/arillso/ansible.logrotate) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://sbaerlo.ch/licence) [![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-logrotate-blue.svg)](https://galaxy.ansible.com/arillso/logrotate)
[![Build Status](https://img.shields.io/travis-ci/arillso/ansible.logrotate.svg?branch=master&style=popout-square)](https://travis-ci.org/arillso/ansible.logrotate) [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=popout-square)](https://sbaerlo.ch/licence) [![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-logrotate-blue.svg?style=popout-square)](https://galaxy.ansible.com/arillso/logrotate) [![Ansible Role](https://img.shields.io/ansible/role/d/23110.svg?style=popout-square)](https://galaxy.ansible.com/arillso/logrotate)

## Description

Expand Down Expand Up @@ -36,6 +36,35 @@ None
roles:
- arillso.logrotate
```
### Example
```yml
logrotate_applications:
- name: zabbix-agent
definitions:
- logs:
- '/var/log/zabbix/zabbix_agentd.log'
options:
- weekly
- rotate 13
- compress
- delaycompress
- missingok
- notifempty
- create 0640 zabbix zabbix
- name: nginx
definitions:
- logs:
- '/var/log/nginx/nginx.log'
options:
- weekly
- rotate 13
- compress
- delaycompress
- missingok
- notifempty
- create 0640 www-data adm
```
## Changelog
Expand Down Expand Up @@ -70,4 +99,4 @@ This project is under the MIT License. See the [LICENSE](https://sbaerlo.ch/lice
## Copyright
(c) 2017, Simon Bärlocher
(c) 2019, Simon Bärlocher
13 changes: 10 additions & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---

galaxy_info:
author: arillso
description: installs and configures logrotate
author: 'arillso'
company: 'arillso'
description: 'Ansible role for installs and configures logratet on RHEL/CentOS or Debian/Ubuntu'
license: MIT
min_ansible_version: 2
min_ansible_version: 2.7
platforms:
- name: Debian
versions:
Expand All @@ -19,3 +20,9 @@ galaxy_info:
versions:
- 6
- 7

galaxy_tags:
- system
- logrotate
- log
- rotate
30 changes: 15 additions & 15 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
---
# tasks file for arillso.logrotate

- name: add OS specific variables
include_vars: "{{ loop_vars }}"
- name: 'add OS specific variables'
include_vars: '{{ loop_vars }}'
with_first_found:
- files:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
- "{{ ansible_system }}.yml"
- "defaults.yml"
- '{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml'
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml'
- '{{ ansible_distribution }}.yml'
- '{{ ansible_os_family }}.yml'
- '{{ ansible_system }}.yml'
- 'defaults.yml'
paths:
- "vars"
- 'vars'
loop_control:
loop_var: loop_vars
tags:
- configuration
- packages

- name: install logrotate
- name: 'install logrotate packages'
become: true
package:
name: "{{ logrotate_package }}"
name: '{{ logrotate_package }}'
tags:
- packages

- name: Create logrotate configuration file
- name: 'create logrotate configuration file'
become: true
template:
src: logrotate.conf.j2
Expand All @@ -37,15 +37,15 @@
tags:
- configuration

- name: Create logrotate application configuration files
- name: 'create logrotate application configuration files'
become: true
template:
src: application.j2
dest: "{{ logrotate_include_dir }}/{{ item.name }}"
dest: '{{ logrotate_include_dir }}/{{ item.name }}'
owner: root
group: root
mode: 0644
with_items:
- "{{ logrotate_applications }}"
- '{{ logrotate_applications }}'
tags:
- configuration

0 comments on commit 7a5328e

Please sign in to comment.