common.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ---
  2. # tasks/common.yml: Deploy configurations common to client and server 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. owner: "{{ sensu_user_name }}"
  9. group: "{{ sensu_group_name }}"
  10. mode: "0750"
  11. - name: Deploy Sensu Redis configuration
  12. template:
  13. dest: "{{ sensu_config_path }}/conf.d/redis.json"
  14. owner: "{{ sensu_user_name }}"
  15. group: "{{ sensu_group_name }}"
  16. src: "{{ sensu_redis_config }}"
  17. when: sensu_deploy_redis_config
  18. notify:
  19. - restart sensu-server service
  20. - restart sensu-api service
  21. - restart sensu-enterprise service
  22. - restart sensu-client service
  23. - name: Deploy Sensu RabbitMQ configuration
  24. template:
  25. dest: "{{ sensu_config_path }}/conf.d/rabbitmq.json"
  26. owner: "{{ sensu_user_name }}"
  27. group: "{{ sensu_group_name }}"
  28. src: "{{ sensu_rabbitmq_config }}"
  29. mode: "0640"
  30. when: sensu_transport == "rabbitmq"
  31. and sensu_deploy_rabbitmq_config
  32. notify:
  33. - restart sensu-server service
  34. - restart sensu-api service
  35. - restart sensu-enterprise service
  36. - restart sensu-client service
  37. - name: Deploy Sensu transport configuration
  38. template:
  39. dest: "{{ sensu_config_path }}/conf.d/transport.json"
  40. owner: "{{ sensu_user_name }}"
  41. group: "{{ sensu_group_name }}"
  42. src: transport.json.j2
  43. mode: "0640"
  44. when: sensu_deploy_transport_config
  45. notify:
  46. - restart sensu-server service
  47. - restart sensu-api service
  48. - restart sensu-enterprise service
  49. - restart sensu-client service