-
Notifications
You must be signed in to change notification settings - Fork 32
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
DTT1 - Iteration 3 - Provision module - Install required dependencies on each supported OS #4859
Comments
Update reportTo correctly configure "the same" environment on each system it was decided to install python from source code, and then the python based dependencies (pip, venv, etc..) on top of that. To do so, some other steps are required on the dependencies playbook:
|
Update reportRestructured the playbooks renaming generic to package (as that's the provisioning method), this way we have a more accurate definition of the provisioning methods. The wazuh related playbooks will be kept under the ├── playbooks
│ ├── deps/
│ ├── package/
│ │ ├── install/
│ │ └── uninstall/
│ ├── sources/
│ │ └── install/
│ └── wazuh/
│ ├── aio/
│ └── package/ Replaced the class ProvisionHandler:
_base_templates_path = Path(__file__).parent / 'playbooks'
_actions = ['install', 'uninstall']
_methods = ['package', 'aio', 'dependencies', 'sources']
def __init__(self, component_info: ComponentInfo, action: str, method: str) -> None:
if not action in self._actions:
raise ValueError(f"Unsupported action: {action}")
if not method in self._methods:
raise ValueError(f"Unsupported method: {method}")
if not "wazuh" in component_info.component and method.lower() == 'aio':
raise ValueError(f"AIO actions is only supported for Wazuh components.")
# We cant uninstall from sources.
if action == "uninstall" and method.lower() == "sources":
logger.debug(f"Uninstall from sources not supported. Using package.")
method = "package"
self.action = action.lower()
self.method = method.lower()
self.component_info = component_info
self.templates_path = self._get_templates_path()
self.templates_order = self._get_templates_order()
self.variables_dict = self._generate_dict()
def _get_templates_path(self) -> str:
# If the component is wazuh, we need to change the templates path.
if "wazuh" in self.component_info.component:
self._base_templates_path = f'{self._base_templates_path}/wazuh'
return f"{self._base_templates_path}/{self.method}/{self.action}"
def _get_templates_order(self) -> list[str]:
"""
Get the order of the templates to be executed.
Returns:
list[str]: List of templates to be executed.
"""
if self.method == 'package' and self.action == "install":
return ["set_repo.j2", "install.j2", "register.j2", "service.j2"]
elif self.method == 'aio':
return ["download.j2", f"{self.action}.j2"]
return []
def _generate_dict(self) -> dict:
variables = {
'component': self.component_info.component,
'version': self.component_info.version,
'type': self.component_info.type,
'dependencies': self.component_info.dependencies or None,
'templates_path': self.templates_path,
'templates_order': self.templates_order or None
}
return variables |
On holdThis issue will remain on hold until the release testing is finished |
Update reportThe new structure seems to work properly, now I´m facing an error at the python installation from sources, punctually at the "set default python version" step TASK [Set default python to 3.10.0] ********************************************
fatal: [192.168.57.2]: FAILED! => changed=true
cmd: |-
update-alternatives --install /usr/local/bin/python3 python3 /usr/bin/python3.10.0 1
update-alternatives --install /usr/local/bin/pip3 pip3 /usr/bin/pip3.10.0 1
delta: '0:00:00.014980'
end: '2024-03-01 17:15:51.401133'
msg: non-zero return code
rc: 2
start: '2024-03-01 17:15:51.386153'
stderr: |-
update-alternatives: error: alternative path /usr/bin/python3.10.0 doesn't exist
update-alternatives: error: alternative path /usr/bin/pip3.10.0 doesn't exist
stderr_lines: <omitted>
stdout: ''
stdout_lines: <omitted> |
Update report
|
Update progess
|
The implementation of the sources installation method and the personalized python version brought some problems with several linux distros that uses an specific python version by default. It was discussed with @fcaffieri and @pro-akim who faced a similar issue, we decided to give up that installation method and only support (at least for this iteration) the installation by package manager for the non-wazuh packages. Packages installation on supported OS status
|
Update reportUpdate the provision module to support all the required systems.
|
Completed the executions of all the required OS,
|
Rename AIO installation to Assistant for clarity. |
On holdThis issue will remain in On Hold status until we discuss about changes on the allocator module that are now allowing us to initialize AWS machines without some labels. |
Meet defined: |
Meet resume
|
Issue resumedUntil the DevOps teams develops the final solution mentioned in the previous comment, we will work on this issue by using a workarround that let us use the |
Update reportAWS ExecutionSome fixes were applied in order to ensure the correct functionality in AWS provided VMs
|
LGTM |
Description
The objective of this issue is to ensure the installation of dependencies on each system is correct and the version is the same across all the supported OS to execute the tests.
OS to validate:
Fedora38agentsx86_64, aarch64Windows10agentsx86_64, aarch64Windows11agentsx86_64, aarch64WindowsServer 2012agentsx86_64, aarch64WindowsServer 2012 R2agentsx86_64, aarch64WindowsServer 2016agentsx86_64, aarch64WindowsServer 2019agentsx86_64, aarch64WindowsServer 2022agentsx86_64, aarch64Tasks
The text was updated successfully, but these errors were encountered: