diff --git a/roles/logging/README.md b/roles/logging/README.md new file mode 100644 index 0000000..8ae49e2 --- /dev/null +++ b/roles/logging/README.md @@ -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/ diff --git a/roles/logging/defaults/main.yml b/roles/logging/defaults/main.yml new file mode 100644 index 0000000..8b7141c --- /dev/null +++ b/roles/logging/defaults/main.yml @@ -0,0 +1,5 @@ +--- +# defaults file for openwrt-logging +system: + log_ip: [] + conloglevel: [] diff --git a/roles/logging/handlers/main.yml b/roles/logging/handlers/main.yml new file mode 100644 index 0000000..a7c6bec --- /dev/null +++ b/roles/logging/handlers/main.yml @@ -0,0 +1,4 @@ +--- +# handlers file for openwrt-logging +- name: reload log + raw: /etc/init.d/log reload diff --git a/roles/logging/meta/main.yml b/roles/logging/meta/main.yml new file mode 100644 index 0000000..d2e26f1 --- /dev/null +++ b/roles/logging/meta/main.yml @@ -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 } diff --git a/roles/logging/tasks/main.yml b/roles/logging/tasks/main.yml new file mode 100644 index 0000000..082eb73 --- /dev/null +++ b/roles/logging/tasks/main.yml @@ -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