Skip to content
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

MVP - Ansible - Creation of the roles: wazuh-indexer, wazuh-manager, wazuh-dashboard, and wazuh-agent #1493

Open
YisDav opened this issue Dec 20, 2024 · 1 comment
Assignees

Comments

@YisDav
Copy link
Member

YisDav commented Dec 20, 2024

Description

The objective of this task is to create Ansible roles for the Wazuh components: wazuh-indexer, wazuh-manager, wazuh-dashboard, and wazuh-agent. Each role will encapsulate the installation and configuration processes necessary for deploying these components effectively. The roles will ensure modularity, reusability, and maintainability of the Ansible codebase.

Considerations

  • Role Structure: Each role should follow the standard Ansible role structure, including tasks, handlers, variables, and defaults.
  • Package Management: The roles must support installation via common package managers (apt for Debian-based systems and yum for Red Hat-based systems), but using directly downloaded packages (previously saved in a defined directory for such purpose and with a fixed filename).
  • Idempotency: Ensure that the roles are idempotent, meaning running the same playbook multiple times will not produce unintended side effects.
  • Configuration Files: Each role should manage its configuration files and ensure they are properly templated to adapt to different environments (development, staging, production) deployments.
  • Error Handling: Implement error handling and logging to capture any issues during the installation and configuration processes.

Involved Steps

  1. Role Directory Setup

    • Create directories for each role under roles/:
      mkdir -p roles/wazuh-indexer/tasks
      mkdir -p roles/wazuh-manager/tasks
      mkdir -p roles/wazuh-dashboard/tasks
      mkdir -p roles/wazuh-agent/tasks
  2. Define Tasks for Each Role

    • wazuh-indexer:
      • Install the Wazuh indexer package.
      • Configure the indexer settings.
      • Start and enable the indexer service.
    • wazuh-manager:
      • Install the Wazuh manager package.
      • Configure the manager settings.
      • Start and enable the manager service.
    • wazuh-dashboard:
      • Install the Wazuh dashboard package.
      • Configure the dashboard settings.
      • Start and enable the dashboard service.
    • wazuh-agent:
      • Install the Wazuh agent package.
      • Configure the agent to communicate with the Wazuh manager.
      • Start and enable the agent service.
  3. Create Handlers

    • Define handlers for restarting services when configuration files change.
    • Example for wazuh-indexer:
      handlers:
        - name: restart wazuh-indexer
          service:
            name: wazuh-indexer
            state: restarted
  4. Manage Variables

    • Create defaults/main.yml for each role to define the default values for the role-specific variables such as configuration paths, and service names.
  5. Testing and Validation

    • Create a playbook to test the roles individually and ensure they perform as expected.
    • Validate that each component is installed and configured correctly by checking service statuses and configuration files.
  6. Documentation

    • Document each role, including its purpose, variables used, and any dependencies required.
@YisDav
Copy link
Member Author

YisDav commented Jan 15, 2025

DRI

@teddytpc1

@wazuhci wazuhci moved this to On hold in XDR+SIEM/Release 5.0.0 Jan 22, 2025
@wazuhci wazuhci moved this from On hold to In progress in XDR+SIEM/Release 5.0.0 Jan 22, 2025
@teddytpc1 teddytpc1 changed the title Ansible MVP - Creation of the roles: wazuh-indexer, wazuh-manager, wazuh-dashboard, and wazuh-agent MVP - Ansible - Creation of the roles: wazuh-indexer, wazuh-manager, wazuh-dashboard, and wazuh-agent Jan 27, 2025
@wazuhci wazuhci moved this from In progress to On hold in XDR+SIEM/Release 5.0.0 Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: On hold
Development

No branches or pull requests

1 participant