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

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


runit/tasks/main.yml

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


runit/tasks/install-service.yml

- 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

dependencies:
  - runit


graphite/tasks/main.yml

- 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

 

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/058243e2-3b0c-4191-ad48-851da4d47ca6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to