common.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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
  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. notify:
  30. - restart sensu-server service
  31. - restart sensu-api service
  32. - restart sensu-enterprise service
  33. - restart sensu-client service
  34. - name: Deploy Sensu transport configuration
  35. template:
  36. dest: "{{ sensu_config_path }}/conf.d/transport.json"
  37. owner: "{{ sensu_user_name }}"
  38. group: "{{ sensu_group_name }}"
  39. src: transport.json.j2
  40. notify:
  41. - restart sensu-server service
  42. - restart sensu-api service
  43. - restart sensu-enterprise service
  44. - restart sensu-client service