common.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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: "0555"
  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. mode: "0640"
  18. when: sensu_deploy_redis_config
  19. notify:
  20. - restart sensu-server service
  21. - restart sensu-api service
  22. - restart sensu-enterprise service
  23. - restart sensu-client service
  24. - name: Deploy Sensu RabbitMQ configuration
  25. template:
  26. dest: "{{ sensu_config_path }}/conf.d/rabbitmq.json"
  27. owner: "{{ sensu_user_name }}"
  28. group: "{{ sensu_group_name }}"
  29. src: "{{ sensu_rabbitmq_config }}"
  30. mode: "0640"
  31. when: sensu_transport == "rabbitmq"
  32. and sensu_deploy_rabbitmq_config
  33. notify:
  34. - restart sensu-server service
  35. - restart sensu-api service
  36. - restart sensu-enterprise service
  37. - restart sensu-client service
  38. - name: Deploy Sensu transport configuration
  39. template:
  40. dest: "{{ sensu_config_path }}/conf.d/transport.json"
  41. owner: "{{ sensu_user_name }}"
  42. group: "{{ sensu_group_name }}"
  43. src: transport.json.j2
  44. mode: "0640"
  45. when: sensu_deploy_transport_config
  46. notify:
  47. - restart sensu-server service
  48. - restart sensu-api service
  49. - restart sensu-enterprise service
  50. - restart sensu-client service