Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Rename the handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
ktibi committed Nov 26, 2019
1 parent 7363a98 commit 1a84da0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
7 changes: 5 additions & 2 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
# handlers file for beats

- name: restart {{ beat }}
service: name={{ beat }} state=restarted enabled=yes
- name: restart the service
service:
name: "{{ beat_product }}"
state: restarted
enabled: true
when: start_service and restart_on_change and not beats_started.changed
4 changes: 2 additions & 2 deletions tasks/beats-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
force: true
owner: root
group: root
notify: restart {{ beat }}
notify: restart the service

#Copy templated config file
- name: Copy Configuration File for {{ beat }}
Expand All @@ -58,4 +58,4 @@
force: true
owner: root
group: root
notify: restart {{ beat }}
notify: restart the service
6 changes: 3 additions & 3 deletions tasks/beats-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
when: use_repository | bool
register: beat_install
until: beat_install is succeeded
notify: restart {{ beat }}
notify: restart the service

- name: Debian - Ensure python-urllib3, python-openssl, python-pyasn1 & python-pip are installed
apt:
Expand Down Expand Up @@ -63,7 +63,7 @@
register: beat_install
until: beat_install is succeeded
when: use_repository | bool
notify: restart {{ beat }}
notify: restart the service

- name: Debian - hold {{ beat }} version
command: apt-mark hold {{ beat }}
Expand All @@ -88,4 +88,4 @@
apt:
deb: '/tmp/{{ beat }}_{{ beats_version }}_{{ os_arch }}.deb'
when: not use_repository | bool
notify: restart {{ beat }}
notify: restart the service
4 changes: 2 additions & 2 deletions tasks/beats-redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
register: beat_install
until: beat_install is succeeded
when: use_repository
notify: restart {{ beat }}
notify: restart the service

- name: RedHat - lock {{ beat }} version
shell: >-
Expand All @@ -59,4 +59,4 @@
register: beat_install
until: beat_install is succeeded
when: not use_repository
notify: restart {{ beat }}
notify: restart the service
2 changes: 1 addition & 1 deletion tasks/beats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
include_tasks: beats-config.yml

# Make sure the service is started, and restart if necessary
- name: Start {{ beat }} service
- name: Start {{ beat_product }} service
service:
name: '{{ beat }}'
state: started
Expand Down
6 changes: 6 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
- name: check-parameters
include_tasks: beats-param-check.yml

- set_fact:
beat_product: "{{ beat }}"

- name: os-specific vars
include_vars: '{{ ansible_os_family }}.yml'

- include_tasks: beats.yml

- name: Force all notified handlers to run at this point, not waiting for normal sync points
meta: flush_handlers

0 comments on commit 1a84da0

Please sign in to comment.