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 5, 2019
1 parent a1c2b39 commit fa8ceec
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 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 }}"
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 @@ -33,9 +33,9 @@
#Copy the default file
- name: Copy Default File for Instance
template: src=beat.j2 dest={{instance_default_file}} mode=0644 force=yes owner=root group=root
notify: restart {{beat}}
notify: restart the service

#Copy templated config file
- name: Copy Configuration File for {{beat}}
template: src=beat.yml.j2 dest={{conf_file}} mode=0644 force=yes 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 @@ -4,7 +4,7 @@
apt: name=apt-transport-https state=present cache_valid_time=86400
when: use_repository
register: beat_install
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 @@ -35,7 +35,7 @@
- name: Debian - Ensure {{beat}} is installed
apt: name={{beat}}{% if beats_version is defined and beats_version != "" %}={{ beats_version }}{% endif %} state=present cache_valid_time=86400
when: use_repository
notify: restart {{beat}}
notify: restart the service

- name: Debian - hold {{beat}} version
command: apt-mark hold {{beat}}
Expand All @@ -54,4 +54,4 @@
- name: Debian - Ensure {{beat}} is installed from downloaded package
apt: deb=/tmp/{{beat}}_{{ beats_version }}_{{os_arch}}.deb
when: not use_repository
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 @@ -18,7 +18,7 @@
- name: RedHat - Ensure {{beat}} is installed
yum: name={{beat}}{% if beats_version is defined and beats_version != "" %}-{{ beats_version }}{% endif %} state=present update_cache=yes
when: use_repository
notify: restart {{beat}}
notify: restart the service

- name: RedHat - lock {{beat}} version
shell: yum versionlock add {{beat}}{% if beats_version is defined and beats_version != "" %}-{{ beats_version }}{% endif %}
Expand All @@ -28,4 +28,4 @@
- name: RedHat - Install {{beat}} from url
yum: name={% if custom_package_url is defined %}{{ custom_package_url }}{% else %}{{ beats_package_url }}/{{beat}}-{{ beats_version }}-{{ansible_architecture}}.rpm{% endif %} state=present
when: not use_repository
notify: restart {{beat}}
notify: restart the service

0 comments on commit fa8ceec

Please sign in to comment.