From 16ea698b989a6b8ae1a390751b5ded98af502c99 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 1 Jun 2017 19:32:42 +0000 Subject: [PATCH] fix loopabull template, add systemd template unit Signed-off-by: Adam Miller --- playbooks/groups/loopabull.yml | 17 +++++++++++ roles/loopabull/tasks/main.yml | 6 ---- roles/loopabull/templates/loopabull.yml.j2 | 34 +++++++++++++++++++--- 3 files changed, 47 insertions(+), 10 deletions(-) diff --git a/playbooks/groups/loopabull.yml b/playbooks/groups/loopabull.yml index 701d1ae725..478b75a42e 100644 --- a/playbooks/groups/loopabull.yml +++ b/playbooks/groups/loopabull.yml @@ -67,6 +67,7 @@ - fedmsg/base - { role: loopabull, + loglevel: info, plugin: fedmsg, routing_keys: [ "org.fedoraproject.prod.buildsys.build.state.change" @@ -95,3 +96,19 @@ copy: src: "{{files}}/loopabull/serializer.py" dest: "/etc/fedmsg.d/serializer.py" + - name: Install the loopabull@.service template + copy: + src: "{{files}}/loopabull/loopabull@.service" + dest: "/usr/lib/systemd/system/loopabull@.service" + - name: start and enable loopabull@ + service: + name: "{{ item }}" + state: started + enabled: yes + with_items: + - loopabull@1 + - loopabull@2 + - loopabull@3 + - loopabull@4 + - loopabull@5 + diff --git a/roles/loopabull/tasks/main.yml b/roles/loopabull/tasks/main.yml index a38513b9d9..ce911d9e89 100644 --- a/roles/loopabull/tasks/main.yml +++ b/roles/loopabull/tasks/main.yml @@ -17,9 +17,3 @@ repo: "https://pagure.io/releng-automation.git" dest: "{{playbooks_dir}}" -- name: start and enable loopabull - service: - name: loopabull - state: started - enabled: yes - diff --git a/roles/loopabull/templates/loopabull.yml.j2 b/roles/loopabull/templates/loopabull.yml.j2 index c93198afe9..fc3f02ead5 100644 --- a/roles/loopabull/templates/loopabull.yml.j2 +++ b/roles/loopabull/templates/loopabull.yml.j2 @@ -3,11 +3,37 @@ # There are three main definitions: ansible, routing_keys, plugin. These will be # explained in comments above each section below. -# plugin +# loglevel # -# This is the selected plugin that will interface with your prefered origin of -# events (message bus or otherwise). -plugin: {{plugin}} +# The defaul loglevel is "info" but the following log levels are available +# - info +# - warn +# - error +# - debug +{% if loglevel is defined %} + loglevel: {{ loglevel }} +{% else %} + loglevel: info +{% endif %} + +# plugin section +# +# loopabull has two types of plugins: +# +# looper: message bus python generator plugin that will interface with your +# prefered origin of events (message bus or otherwise). +# +# translator: routing key translator which allows for alternative layouts +# on-disk for routing_key mappings to playbooks the default of +# "rkname" simple means that your playbooks share the same parent +# dir and are all named after the routing_key they correspond to +# in the message bus. +# +plugins: + looper: + name: {{ plugin }} + translator: + name: rkname # routing_keys #