client.yml 1.1 KB

123456789101112131415161718192021222324252627282930
  1. ---
  2. # tasks/client.yml: Deploy various client-side configurations for Sensu
  3. - include_vars: "{{ item }}"
  4. with_first_found:
  5. - "{{ ansible_distribution }}.yml"
  6. - "{{ ansible_os_family }}.yml"
  7. - default.yml
  8. - name: Ensure the Sensu config directory is present
  9. file: dest={{ sensu_config_path }}/conf.d state=directory recurse=yes
  10. owner={{ sensu_user_name }} group={{ sensu_group_name }}
  11. - name: Deploy Sensu client RabbitMQ configuration
  12. template: dest="{{ sensu_config_path }}/conf.d/rabbitmq.json"
  13. owner={{ sensu_user_name }} group={{ sensu_group_name }}
  14. src=rabbitmq.json.j2
  15. notify: restart sensu-client service
  16. - name: Deploy Sensu client service configuration
  17. template: dest="{{ sensu_config_path }}/conf.d/client.json"
  18. owner={{ sensu_user_name }} group={{ sensu_group_name }}
  19. src={{ sensu_client_config }}
  20. notify: restart sensu-client service
  21. - include: SmartOS/client.yml
  22. when: ansible_distribution == "SmartOS"
  23. - name: Ensure Sensu client service is running
  24. service: name=sensu-client state=started enabled=yes