Skip to content

Commit

Permalink
Reworked role.
Browse files Browse the repository at this point in the history
Backup files defaults to no.
  • Loading branch information
ypid committed Jan 5, 2016
1 parent d5651c3 commit 7222772
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 30 deletions.
14 changes: 10 additions & 4 deletions README.md
@@ -1,15 +1,20 @@
## [![DebOps project](http://debops.org/images/debops-small.png)](http://debops.org) rsyslog

[![Travis CI](http://img.shields.io/travis/debops/ansible-rsyslog.svg?style=flat)](http://travis-ci.org/debops/ansible-rsyslog) [![test-suite](http://img.shields.io/badge/test--suite-ansible--rsyslog-blue.svg?style=flat)](https://github.com/debops/test-suite/tree/master/ansible-rsyslog/) [![Ansible Galaxy](http://img.shields.io/badge/galaxy-debops.rsyslog-660198.svg?style=flat)](https://galaxy.ansible.com/list#/roles/1594)
<!-- This file was generated by Ansigenome. Do not edit this file directly but
instead have a look at the files in the ./meta/ directory. -->

This role manages configuration of `rsyslog` server and makes sure that
it's installed.
[![Travis CI](http://img.shields.io/travis/debops/ansible-rsyslog.svg?style=flat)](http://travis-ci.org/debops/ansible-rsyslog) [![test-suite](http://img.shields.io/badge/test--suite-ansible--rsyslog-blue.svg?style=flat)](https://github.com/debops/test-suite/tree/master/ansible-rsyslog/) [![Ansible Galaxy](http://img.shields.io/badge/galaxy-debops.rsyslog-660198.svg?style=flat)](https://galaxy.ansible.com/detail#/role/1594)

This role manages the configuration of the `rsyslog` server and makes sure
that it's installed.

### Installation

This role requires at least Ansible `v1.7.0`. To install it, run:

ansible-galaxy install debops.rsyslog
```Shell
ansible-galaxy install debops.rsyslog
```

### Documentation

Expand All @@ -33,6 +38,7 @@ into your playbook.
### Authors and license

`rsyslog` role was written by:

- Maciej Delmanowski | [e-mail](mailto:drybjed@gmail.com) | [Twitter](https://twitter.com/drybjed) | [GitHub](https://github.com/drybjed)

License: [GPLv3](https://tldrlegal.com/license/gnu-general-public-license-v3-%28gpl-3%29)
Expand Down
29 changes: 24 additions & 5 deletions defaults/main.yml
@@ -1,16 +1,37 @@
---
# Default variables
# =================

# ----------
# Packages
# ----------

# .. envvar:: rsyslog_packages
#
# Install set of standard packages
rsyslog_packages: [ 'rsyslog', 'logrotate' ]


# --------------
# Manage pools
# --------------

# .. envvar:: rsyslog_manage_pools
#
# Should rsyslog role manage server pools?
rsyslog_manage_pools: True

# List of managed pools

# .. envvar:: rsyslog_pools
#
# List of managed pools.
rsyslog_pools: [ '{{ rsyslog_pool_cron }}' ]

# Default rsyslog pool , explanation of variables can be found
# in templates/etc/rsyslog.d/pool.conf.j2

# .. envvar:: rsyslog_pool_cron
#
# Default rsyslog pool, explanation of variables can be found
# in :file:`templates/etc/rsyslog.d/pool.conf.j2`.
# Everything commented out is optional.
rsyslog_pool_cron:
enabled: True
Expand All @@ -24,5 +45,3 @@ rsyslog_pool_cron:
:msg, contains, "pam_unix(cron:session): session closed for user" /var/log/cron.log
& stop
5 changes: 2 additions & 3 deletions meta/ansigenome.yml
Expand Up @@ -17,6 +17,5 @@ ansigenome_info:
github: 'drybjed'

synopsis: |
This role manages configuration of `rsyslog` server and makes sure that
it's installed.
This role manages the configuration of the `rsyslog` server and makes sure
that it's installed.
26 changes: 16 additions & 10 deletions meta/main.yml
Expand Up @@ -3,23 +3,29 @@
dependencies: []

galaxy_info:

company: 'DebOps'
author: 'Maciej Delmanowski'
description: 'Manage rsyslog configuration'
company: 'DebOps'
license: 'GNU General Public License v3'
min_ansible_version: '1.7.0'

platforms:

- name: Ubuntu
versions:
- precise
- quantal
- raring
- saucy
- trusty
- precise
- quantal
- raring
- saucy
- trusty

- name: Debian
versions:
- wheezy
- jessie
categories:
- system
- wheezy
- jessie

galaxy_tags:
- system
- rsyslog
- logging
1 change: 0 additions & 1 deletion tasks/main.yml
Expand Up @@ -11,4 +11,3 @@

- include: pools.yml
when: rsyslog_manage_pools is defined and rsyslog_manage_pools == True

8 changes: 3 additions & 5 deletions tasks/pools.yml
Expand Up @@ -4,9 +4,9 @@
template:
src: 'etc/rsyslog.d/pool.conf.j2'
dest: '/etc/rsyslog.d/{{ item.name }}.conf'
owner: '{{ item.owner | default("root") }}'
group: '{{ item.group | default("root") }}'
mode: '{{ item.mode | default("0644") }}'
owner: '{{ item.owner | default("root") }}'
group: '{{ item.group | default("root") }}'
mode: '{{ item.mode | default("0644") }}'
backup: '{{ item.backup | default("no") }}'
with_items: rsyslog_pools
when: ((item.name is defined and item.name) and
Expand All @@ -21,5 +21,3 @@
when: ((item.name is defined and item.name) and
(item.enabled is defined and item.enabled == False))
notify: [ 'Restart rsyslogd' ]


4 changes: 2 additions & 2 deletions templates/etc/rsyslog.d/pool.conf.j2
@@ -1,4 +1,4 @@
# This file is managed by Ansible, all changes will be lost
# {{ ansible_managed }}
{#
#
# ==== Default template for debops.rsyslog role ====
Expand All @@ -18,7 +18,7 @@
#
#
# - item.backup: no/yes
# Backup files. Default yes.
# Backup files. Default no.
#
#
# - item.options: |
Expand Down

0 comments on commit 7222772

Please sign in to comment.