# Paramaterized handlers

**URL:** <https://forum.ansible.com/t/paramaterized-handlers/17768>\
**Category:** Ansible Project\
**Created:** [March 17, 2015, 9:07pm UTC](https://forum.ansible.com/t/paramaterized-handlers/17768 "2015-03-17T21:07:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nebular.wolf](https://avatars.discourse-cdn.com/v4/letter/n/f4b2a3/32.png) [@nebular.wolf](https://forum.ansible.com/u/nebular.wolf)\
**Post date:** [March 17, 2015, 9:07pm UTC](https://forum.ansible.com/t/paramaterized-handlers/17768/1 "2015-03-17T21:07:46Z")

</div>

I have a playbook I created to deploy graphite.  
It has a role dependency on runit (service is responsible to keep the carbon-relays and the carbon-caches up and running)

how do I set up the project so I can reuse the install service tasks and make sure the handlers are called for each installed service.

Should I structure the playbook differently? I can’t think of how to get this to work with out having parametrized handlers. So is this a feature request?

runit/handlers/main.yml

```auto
- name: reload runit logging config
  shell: sv reload {{ runit_service_name }}/log

```

runit/tasks/main.yml

```auto
- name: Install Runit
  action: apt pkg=runit state=present

```

runit/tasks/install-service.yml

```auto
- name: Create Runit service directory
  action: file path=/etc/sv/{{ runit_service_name }}
          owner=root group=root mode=0755
          state=directory

- name: Create Runit logging script directory
  action: file
          path=/etc/sv/{{ runit_service_name }}/log
          owner=root group=root mode=0755
          state=directory

- name: Configure Runit logging daemon, svlogd
  action: template
          src=runit-log-config.j2
          dest=/sitelogs/{{ runit_service_name }}/config
          owner=root group=root mode=0644
  notify:
    - reload runit logging config

```

graphite/meta/main.yml

```auto
dependencies:
  - runit

```

graphite/tasks/main.yml

```auto
- include: ../../runit/tasks/install-service.yml
  vars:
      runit_service_name: carbon-cache
      runit_log_file_size: 104857600
      runit_log_file_num: 10

- include: ../../runit/tasks/install-service.yml
  vars:
      runit_service_name: carbon-relay
      runit_log_file_size: 104857600
      runit_log_file_num: 10

```
