Ansible/roles/sensu.sensu/tasks/server.yml

45 lines
1.1 KiB
YAML
Raw Normal View History

---
# tasks/server.yml: Deploy Sensu Server/API
- name: Include ansible_distribution vars
include_vars:
file: "{{ ansible_distribution }}.yml"
tags: server
- name: Deploy Sensu server API configuration
tags: server
template:
dest: "{{ sensu_config_path }}/conf.d/api.json"
owner: "{{ sensu_user_name }}"
group: "{{ sensu_group_name }}"
src: sensu-api.json.j2
notify: restart sensu-api service
- name: Deploy Tessen server configuratiuon
tags: server
template:
dest: "{{ sensu_config_path }}/conf.d/tessen.json"
owner: "{{ sensu_user_name }}"
group: "{{ sensu_group_name }}"
src: sensu-tessen.json.j2
notify: restart sensu-server service
- include_tasks: "{{ role_path }}/tasks/SmartOS/server.yml"
tags: server
when: ansible_distribution == "SmartOS"
- name: Ensure Sensu server service is running
tags: server
service:
name: "{{ sensu_server_service_name if not se_enterprise else sensu_enterprise_service_name }}"
state: started
enabled: yes
- name: Ensure Sensu API service is running
tags: server
service:
name: sensu-api
state: started
enabled: yes
when: not se_enterprise