Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging role #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions roles/logging/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
openwrt-logging
==============

configure logging aspects of your openwrt system.
compare: [http://wiki.openwrt.org/doc/uci/system]


Role Variables
--------------


Dependencies
------------

[lefant.openwrt-uci]

Example Playbook
----------------

[https://github.com/lefant/ansible-openwrt/blob/master/openwrt.yml]

Requirements
------------

must be kept minimal as this is supposed to run on openwrt embedded
systems. in particular we try get by with plain POSIX shell, using
neither python nor bash in any way. lua could be an option as that
seems to be the openwrt scripting language of choice.

License
-------

BSD

Author Information
------------------

Jan Wagner, [http://blog.waja.info/]



[http://wiki.openwrt.org/doc/uci/system]: http://wiki.openwrt.org/doc/uci/system
[lefant.openwrt-uci]: https://galaxy.ansible.com/list#/roles/1645
[https://github.com/lefant/ansible-openwrt/blob/master/openwrt.yml]: https://github.com/lefant/ansible-openwrt/blob/master/openwrt.yml
[http://e.lefant.net/]: http://e.lefant.net/
5 changes: 5 additions & 0 deletions roles/logging/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# defaults file for openwrt-logging
system:
log_ip: []
conloglevel: []
4 changes: 4 additions & 0 deletions roles/logging/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
# handlers file for openwrt-logging
- name: reload log
raw: /etc/init.d/log reload
14 changes: 14 additions & 0 deletions roles/logging/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
galaxy_info:
author: Jan Wagner
description: configure logging aspects of your openwrt system.
license: BSD
min_ansible_version: 1.7
platforms: []
# - Openwrt
# versions:
# - 14.07
categories:
- system
dependencies:
- { role: lefant.openwrt-uci }
10 changes: 10 additions & 0 deletions roles/logging/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# tasks file for openwrt-logging
- name: set system logging parameters
uci: command=set key="system.@system[0].{{ item.key }}" value="{{ item.value }}"
with_dict:
system
when: (item.key | match("log_.*") or item.key | match(".*loglevel") or item.key == "buffersize") and item.value is defined
notify:
- uci commit
- reload log