This repository has been archived by the owner on Apr 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Christopher Svensson <[email protected]>
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
- name: Disable modules | ||
become: yes | ||
file: | ||
path: "{{ beats_modules_dir }}/{{ item.key }}.yml" | ||
state: absent | ||
when: item.value.enabled is defined and not item.value.enabled | ||
notify: restart the service | ||
|
||
- name: Enable modules with default config | ||
become: yes | ||
copy: | ||
remote_src: yes | ||
src: "{{ beats_modules_dir }}/{{ item.key }}.yml.disabled" | ||
dest: "{{ beats_modules_dir }}/{{ item.key }}.yml" | ||
when: (not item.value.enabled is defined or item.value.enabled) and not item.value.config is defined | ||
notify: restart the service | ||
|
||
- name: Set up modules with custom config | ||
become: yes | ||
copy: | ||
content: "{{ item.value.config | to_nice_yaml(indent=2) }}" | ||
dest: "{{ beats_modules_dir }}/{{ item.key }}.yml" | ||
when: (not item.value.enabled is defined or item.value.enabled) and item.value.config is defined | ||
notify: restart the service |