common.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. recurse: true
  9. owner: "{{ sensu_user_name }}"
  10. group: "{{ sensu_group_name }}"
  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
  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. when: sensu_transport == "rabbitmq"
  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. notify:
  42. - restart sensu-server service
  43. - restart sensu-api service
  44. - restart sensu-enterprise service
  45. - restart sensu-client service