common.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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.json.j2
  17. when: sensu_deploy_redis
  18. notify:
  19. - restart sensu-server service
  20. - restart sensu-api 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-client service
  33. - name: Deploy Sensu transport configuration
  34. template:
  35. dest: "{{ sensu_config_path }}/conf.d/transport.json"
  36. owner: "{{ sensu_user_name }}"
  37. group: "{{ sensu_group_name }}"
  38. src: transport.json.j2
  39. notify:
  40. - restart sensu-server service
  41. - restart sensu-api service
  42. - restart sensu-client service