client.yml 1.1 KB

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