| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- ---
- # tasks/plugins.yml: Deploy available checks/plugins/handlers/filters/mutators
- - include_vars: "{{ item }}"
- with_first_found:
- - "{{ ansible_distribution }}.yml"
- - name: Ensure Sensu plugin directory exists
- file: dest={{ sensu_config_path }}/plugins state=directory
- owner={{ sensu_user_name }} group={{ sensu_group_name }}
- - name: Register available checks
- local_action: command ls {{ static_data_store }}/sensu/checks
- register: sensu_available_checks
- changed_when: False
- - name: Deploy check plugins
- copy: src={{ static_data_store }}/sensu/checks/{{ item }}/
- dest={{ sensu_config_path }}/plugins/ mode=755
- owner={{ sensu_user_name }} group={{ sensu_group_name }}
- when: sensu_available_checks.stdout.find('{{ item }}') != -1
- with_flattened:
- - group_names
- notify: restart sensu-client service
- - name: Deploy handler plugins
- copy: src={{ static_data_store }}/sensu/handlers/
- dest={{ sensu_config_path }}/plugins/ mode=755
- owner={{ sensu_user_name }} group={{ sensu_group_name }}
- notify: restart sensu-client service
- - name: Deploy filter plugins
- copy: src={{ static_data_store }}/sensu/filters/
- dest={{ sensu_config_path }}/plugins/ mode=755
- owner={{ sensu_user_name }} group={{ sensu_group_name }}
- notify: restart sensu-client service
- - name: Deploy mutator plugins
- copy: src={{ static_data_store }}/sensu/mutators/
- dest={{ sensu_config_path }}/plugins/ mode=755
- owner={{ sensu_user_name }} group={{ sensu_group_name }}
- notify: restart sensu-client service
- - name: Deploy check/handler/filter/mutator definitions to the master
- template: src={{ static_data_store }}/sensu/definitions/{{ item }}.j2
- dest={{ sensu_config_path }}/conf.d/{{ item }}
- owner={{ sensu_user_name }} group={{ sensu_group_name }}
- when: sensu_master
- with_lines:
- - ls {{ static_data_store }}/sensu/definitions | sed 's/\.j2//'
- notify: restart sensu-api service
|