-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add manager and agent roles #59
Comments
I have added the manager role to the repo within
Tomorrow will try to fix this or even add a new handler that uses |
The first provisioning structure is like follows:
It is possible to install the manager both via repo or custom package. Here we have both scenarios reproduced: Install via custom pakcagesinv.ymlmanager:
hosts:
manager1:
ip: 172.31.6.27
ansible_host: 172.31.6.27
ansible_user: qa
ansible_connection: ssh
wazuh_custom_packages_installation_manager_enabled: true
wazuh_custom_packages_installation_manager_rpm_url: https://packages.wazuh.com/4.x/yum/wazuh-manager-4.4.1-1.x86_64.rpm
manager2:
ip: 172.31.10.218
ansible_host: 172.31.10.218
ansible_user: qa
ansible_connection: ssh
wazuh_custom_packages_installation_manager_enabled: true
wazuh_custom_packages_installation_manager_deb_url: https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-manager/wazuh-manager_4.3.10-1_amd64.deb
vars: {}
all:
vars:
ansible_ssh_common_args: -o StrictHostKeyChecking=no
ansible_winrm_server_cert_validation: ignore
ansible_ssh_private_key_file: /path/to/key Playbook run and installation check
pc@pc:~/qa-system-framework/provisioning/playbooks$ ansible-playbook -i /tmp/ wazuh-manager.yml
PLAY [manager] ***************************************************************************************
TASK [Gathering Facts] *******************************************************************************
ok: [manager1]
ok: [manager2]
TASK [../roles/wazuh/manager : Include vars/repo_vars.yml] *******************************************
ok: [manager1]
ok: [manager2]
TASK [../roles/wazuh/manager : Include vars/repo.yml] ************************************************
ok: [manager1]
ok: [manager2]
TASK [../roles/wazuh/manager : Include vars/repo_pre-release.yml] ************************************
skipping: [manager1]
skipping: [manager2]
TASK [../roles/wazuh/manager : Include vars/repo_staging.yml] ****************************************
skipping: [manager1]
skipping: [manager2]
TASK [../roles/wazuh/manager : Include tasks based on OS] ********************************************
included: qa-system-framework/provisioning/roles/wazuh/manager/tasks/RedHat.yml for manager1
included: qa-system-framework/provisioning/roles/wazuh/manager/tasks/Debian.yml for manager2
TASK [../roles/wazuh/manager : RedHat/CentOS 5 | Install Wazuh repo] *********************************
skipping: [manager1]
TASK [../roles/wazuh/manager : RedHat/CentOS/Fedora | Install Wazuh repo] ****************************
skipping: [manager1]
TASK [../roles/wazuh/manager : CentOS/RedHat/Amazon | Install wazuh-manager] *************************
skipping: [manager1]
TASK [../roles/wazuh/manager : Install Wazuh Manager from .rpm packages | yum] ***********************
skipping: [manager1]
TASK [../roles/wazuh/manager : Install Wazuh Manager from .rpm packages | dnf] ***********************
changed: [manager1]
TASK [../roles/wazuh/manager : run the handlers after the installation] ******************************
RUNNING HANDLER [../roles/wazuh/manager : start service] *********************************************
TASK [../roles/wazuh/manager : start service] ********************************************************
ok: [manager2]
RUNNING HANDLER [../roles/wazuh/manager : start service] *********************************************
changed: [manager1]
TASK [../roles/wazuh/manager : Debian/Ubuntu | Installing Wazuh repository key (Ubuntu 14)] **********
skipping: [manager2]
TASK [../roles/wazuh/manager : Debian/Ubuntu | Installing Wazuh repository key] **********************
skipping: [manager2]
TASK [../roles/wazuh/manager : Debian/Ubuntu | Add Wazuh repositories] *******************************
skipping: [manager2]
TASK [../roles/wazuh/manager : Debian/Ubuntu | Install wazuh-manager] ********************************
skipping: [manager2]
TASK [../roles/wazuh/manager : Install Wazuh Manager from .deb packages] *****************************
changed: [manager2]
TASK [../roles/wazuh/manager : run the handlers after the installation] ******************************
TASK [../roles/wazuh/manager : Ensure Wazuh Manager service is started and enabled.] *****************
ok: [manager1]
RUNNING HANDLER [../roles/wazuh/manager : Ensure Wazuh Manager service is started and enabled.] ******
changed: [manager2]
TASK [../roles/wazuh/manager : Ensure Wazuh Manager service is started and enabled.] *****************
ok: [manager2]
PLAY RECAP *******************************************************************************************
manager1 : ok=7 changed=2 unreachable=0 failed=0 skipped=6 rescued=0 ignored=0
manager2 : ok=8 changed=2 unreachable=0 failed=0 skipped=6 rescued=0 ignored=0
pc@pc:~/qa-system-framework/provisioning/playbooks$
Install via repoinv.ymlmanager:
hosts:
manager1:
ip: 172.31.6.27
ansible_host: 172.31.6.27
ansible_user: qa
ansible_connection: ssh
manager2:
ip: 172.31.10.218
ansible_host: 172.31.10.218
ansible_user: qa
ansible_connection: ssh
packages_version: 4.3.10
vars: {}
all:
vars:
ansible_ssh_common_args: -o StrictHostKeyChecking=no
ansible_winrm_server_cert_validation: ignore
ansible_ssh_private_key_file: /path/to/key Playbook run and installation check
pc@pc:~/qa-system-framework/provisioning/playbooks$ ansible-playbook -i /tmp/inv.yml wazuh-manager.yml
PLAY [manager] ***************************************************************************************
TASK [Gathering Facts] *******************************************************************************
ok: [manager1]
ok: [manager2]
TASK [../roles/wazuh/manager : Include vars/repo_vars.yml] *******************************************
ok: [manager1]
ok: [manager2]
TASK [../roles/wazuh/manager : Include vars/repo.yml] ************************************************
ok: [manager1]
ok: [manager2]
TASK [../roles/wazuh/manager : Include vars/repo_pre-release.yml] ************************************
skipping: [manager1]
skipping: [manager2]
TASK [../roles/wazuh/manager : Include vars/repo_staging.yml] ****************************************
skipping: [manager1]
skipping: [manager2]
TASK [../roles/wazuh/manager : Include tasks based on OS] ********************************************
included: qa-system-framework/provisioning/roles/wazuh/manager/tasks/RedHat.yml for manager1
included: qa-system-framework/provisioning/roles/wazuh/manager/tasks/Debian.yml for manager2
TASK [../roles/wazuh/manager : RedHat/CentOS 5 | Install Wazuh repo] *********************************
skipping: [manager1]
TASK [../roles/wazuh/manager : RedHat/CentOS/Fedora | Install Wazuh repo] ****************************
ok: [manager1]
TASK [../roles/wazuh/manager : CentOS/RedHat/Amazon | Install wazuh-manager] *************************
changed: [manager1]
TASK [../roles/wazuh/manager : Install Wazuh Manager from .rpm packages | yum] ***********************
skipping: [manager1]
TASK [../roles/wazuh/manager : Install Wazuh Manager from .rpm packages | dnf] ***********************
skipping: [manager1]
TASK [../roles/wazuh/manager : run the handlers after the installation] ******************************
RUNNING HANDLER [../roles/wazuh/manager : start service] *********************************************
TASK [../roles/wazuh/manager : start service] ********************************************************
ok: [manager2]
RUNNING HANDLER [../roles/wazuh/manager : start service] *********************************************
changed: [manager1]
TASK [../roles/wazuh/manager : Debian/Ubuntu | Installing Wazuh repository key (Ubuntu 14)] **********
skipping: [manager2]
TASK [../roles/wazuh/manager : Debian/Ubuntu | Installing Wazuh repository key] **********************
ok: [manager2]
TASK [../roles/wazuh/manager : Debian/Ubuntu | Add Wazuh repositories] *******************************
ok: [manager2]
TASK [../roles/wazuh/manager : Debian/Ubuntu | Install wazuh-manager] ********************************
changed: [manager2]
TASK [../roles/wazuh/manager : Install Wazuh Manager from .deb packages] *****************************
skipping: [manager2]
TASK [../roles/wazuh/manager : run the handlers after the installation] ******************************
TASK [../roles/wazuh/manager : Ensure Wazuh Manager service is started and enabled.] *****************
ok: [manager1]
RUNNING HANDLER [../roles/wazuh/manager : Ensure Wazuh Manager service is started and enabled.] ******
changed: [manager2]
TASK [../roles/wazuh/manager : Ensure Wazuh Manager service is started and enabled.] *****************
ok: [manager2]
PLAY RECAP *******************************************************************************************
manager1 : ok=8 changed=2 unreachable=0 failed=0 skipped=5 rescued=0 ignored=0
manager2 : ok=10 changed=2 unreachable=0 failed=0 skipped=4 rescued=0 ignored=0
pc@pc:~/qa-system-framework/provisioning/playbooks$
|
This commit adds the initial provisioning structure with the manager role (with its playbook, tasks, etc.). This allows to install the any manager version using custom packages or repo. Note: When using the repo it uses `4.x` gpg, we should discuss if we want to extend the support
Many OS support is getting added to the agents' provisioning. Currently it's working for Debian and RedHat. Besides, it is being added the rest of Deployer's supported OS, like Windows, Solaris, MacOS, etc. |
The following OS are currently working:
Has been added support for both ECS and EC2 instances. Also, we can use a var to define the version that we want install via repo. For MacOS it freezes during the installation task And these issues were reported during the research/dev:
|
I've been working on adding the
To achieve that I tried these workarounds:
So we'll maintain the individual becomes within the tasks that require them. Also, there is a thing about MacOS instances. Don't know if it is a coincidence but the pkg installation won't end if it is run for a second time
Solaris and MacOS instances are installed now correctly. Tomorrow will check that everything works as expected for every service and installation. |
Test environmentmanagers:
agents:
inv.ymlmanager:
hosts:
manager1:
ansible_host: 172.31.51.219
ansible_user: qa
ansible_connection: ssh
manager2:
ansible_host: 172.31.8.225
ansible_user: qa
ansible_connection: ssh
packages_version: 4.4.0
agent:
children:
linux:
hosts:
agent1:
ip: 10.10.0.251
ansible_host: 10.10.0.251
ansible_port: 13901
ansible_password: vagrant
ansible_user: vagrant
ansible_connection: ssh
manager_ip: 172.31.51.219
wazuh_custom_packages_installation_agent_macos_url: https://packages.wazuh.com/4.x/macos/wazuh-agent-4.4.4-1.pkg
wazuh_custom_packages_installation_agent_enabled: true
agent2:
ip: 10.10.0.251
ansible_host: 10.10.0.251
ansible_port: 11330
ansible_password: vagrant
ansible_user: vagrant
ansible_connection: ssh
manager_ip: 172.31.51.219
wazuh_custom_packages_installation_agent_solaris_11_url: https://packages.wazuh.com/4.x/solaris/i386/11/wazuh-agent_v4.4.4-sol11-i386.p5p
wazuh_custom_packages_installation_agent_enabled: true
ansible_ssh_common_args: -o StrictHostKeyChecking=no -oHostKeyAlgorithms=+ssh-dss
agent3:
ansible_host: 172.31.7.206
ansible_user: qa
ansible_connection: ssh
manager_ip: 172.31.51.219
agent4:
ansible_host: 172.31.4.233
ansible_user: qa
ansible_connection: ssh
manager_ip: 172.31.51.219
agent5:
ansible_host: 172.31.8.95
ansible_user: qa
ansible_connection: ssh
manager_ip: 172.31.51.219
agent6:
ansible_host: 172.31.9.206
ansible_user: qa
ansible_connection: ssh
manager_ip: 172.31.51.219
agent7:
ansible_host: 172.31.3.173
ansible_user: qa
manager_ip: 172.31.51.219
ansible_connection: winrm
ansible_password: wazuhqa
ansible_winrm_server_cert_validation: ignore
all:
vars:
ansible_ssh_common_args: -o StrictHostKeyChecking=no
ansible_winrm_server_cert_validation: ignore
ansible_ssh_private_key_file: /home/roronoasins/certs/jenkins-key.pem
Resultsmanagers
agents
|
Description
As a part of #57, we need to add a folder structure to the upcoming roles and some of them. We can start with the pair of manager-agent.
We will use the roles and playbooks from
wazuh-ansible
as a reference.The text was updated successfully, but these errors were encountered: