common.yml 1.6 KB

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