-
Notifications
You must be signed in to change notification settings - Fork 23
add wazuh purge playbook #2001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
add wazuh purge playbook #2001
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5d87d37
add wazuh purge playbook and update docs
g0rgamesh cb7f4ea
Update doc/source/configuration/wazuh.rst
g0rgamesh 60ece59
add idempotence
g0rgamesh 28e3f8e
change module name for consistency
g0rgamesh 7362850
improve code idempotency
g0rgamesh 5195b08
renamed playbook file, clarified the documentation
g0rgamesh aa720fb
typo fix
g0rgamesh 0385dc9
Merge branch 'stackhpc/2025.1' into wazuh_purge
g0rgamesh 53b0289
Merge branch 'stackhpc/2025.1' into wazuh_purge
g0rgamesh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,105 @@ | ||
| --- | ||
| # This is the playbook version of the wazuh purge tool from: | ||
| # https://github.com/stackhpc/wazuh-server-purge | ||
|
|
||
| - name: Purge Wazuh Server Components | ||
| hosts: wazuh-manager | ||
| become: true | ||
| become_user: root | ||
| tasks: | ||
| # Dashboard | ||
| - name: Disable and stop wazuh-dashboard service | ||
| ansible.builtin.systemd_service: | ||
| name: wazuh-dashboard | ||
| state: stopped | ||
| enabled: no | ||
| daemon_reload: true | ||
| register: svc_result | ||
| failed_when: | ||
| - svc_result.failed | ||
| - "'Could not find the requested service' not in svc_result.msg" | ||
|
|
||
| - name: Remove wazuh-dashboard and files | ||
| ansible.builtin.package: | ||
| name: wazuh-dashboard | ||
| state: absent | ||
|
|
||
| - name: Remove wazuh-dashboard directories | ||
| ansible.builtin.file: | ||
| path: "{{ item }}" | ||
| state: absent | ||
| loop: | ||
| - /var/lib/wazuh-dashboard | ||
| - /usr/share/wazuh-dashboard | ||
| - /etc/wazuh-dashboard | ||
| # Manager | ||
| - name: Remove wazuh-manager service | ||
| ansible.builtin.systemd_service: | ||
| name: wazuh-manager | ||
| state: stopped | ||
| enabled: no | ||
| daemon_reload: true | ||
| register: svc_result | ||
| failed_when: | ||
| - svc_result.failed | ||
| - "'Could not find the requested service' not in svc_result.msg" | ||
|
|
||
| - name: Remove wazuh-manager and files | ||
| ansible.builtin.package: | ||
| name: wazuh-manager | ||
| state: absent | ||
|
|
||
| - name: Remove wazuh-manager directories | ||
| ansible.builtin.file: | ||
| path: /var/ossec | ||
| state: absent | ||
| # Filebeat | ||
| - name: Disable and stop filebeat service | ||
| ansible.builtin.systemd_service: | ||
| name: filebeat | ||
| state: stopped | ||
| enabled: no | ||
| daemon_reload: true | ||
| register: svc_result | ||
| failed_when: | ||
| - svc_result.failed | ||
| - "'Could not find the requested service' not in svc_result.msg" | ||
|
|
||
| - name: Remove filebeat and files | ||
| ansible.builtin.package: | ||
| name: filebeat | ||
| state: absent | ||
|
|
||
| - name: Remove filebeat directories | ||
| ansible.builtin.file: | ||
| path: "{{ item }}" | ||
| state: absent | ||
| loop: | ||
| - /var/lib/filebeat | ||
| - /usr/share/filebeat | ||
| - /etc/filebeat | ||
| # Indexer | ||
| - name: Disable and stop wazuh-indexer service | ||
| ansible.builtin.systemd_service: | ||
| name: wazuh-indexer | ||
| state: stopped | ||
| enabled: no | ||
| daemon_reload: true | ||
| register: svc_result | ||
| failed_when: | ||
| - svc_result.failed | ||
| - "'Could not find the requested service' not in svc_result.msg" | ||
|
|
||
| - name: Remove wazuh-indexer and files | ||
| ansible.builtin.package: | ||
| name: wazuh-indexer | ||
| state: absent | ||
|
|
||
| - name: Remove wazuh-indexer directories | ||
| ansible.builtin.file: | ||
| path: "{{ item }}" | ||
| state: absent | ||
| loop: | ||
| - /var/lib/wazuh-indexer | ||
| - /usr/share/wazuh-indexer | ||
| - /etc/wazuh-indexer | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.