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

DTT1 - Iteration 3 - Provision module - Improvement support actions #4853

Closed
6 tasks done
Tracked by #4852
fcaffieri opened this issue Jan 16, 2024 · 4 comments · Fixed by #4883
Closed
6 tasks done
Tracked by #4852

DTT1 - Iteration 3 - Provision module - Improvement support actions #4853

fcaffieri opened this issue Jan 16, 2024 · 4 comments · Fixed by #4883
Assignees

Comments

@fcaffieri
Copy link
Member

fcaffieri commented Jan 16, 2024

Epic: #4852


Description

The goal of this issue is to add the uninstall action for any component sent by parameter.

Tasks

  • Add the new parameter
  • Add Jinja2 templates.
  • Add implementation of the new uninstall action
  • Add new Action class
  • Add new componentType class
  • Remove custom credentials
@fcaffieri
Copy link
Member Author

Update

Some new classes were generated to facilitate the management of actions on the provision.
A new action class that is inherited by the install and uninstall classes and gives the possibility to add more:

classAction:
     def __init__(self, component_type):
         self.component_type = component_type

     def execute(self):
         pass

class Install(Action):
     def __init__(self, component_type):
         super().__init__(component_type)

     def execute(self):
         # Logic for installation using Ansible and Jinja2 templates
         pass

class Uninstall(Action):
     def __init__(self, component_type):
         super().__init__(component_type)

     def execute(self):
         # Logic for uninstallation using Ansible and Jinja2 templates
         pass

and a new component_type class:



class ComponentType:
     def __init__(self):
         pass

     def get_template_path(self):
         # Abstract method to get the template path
         pass

class Package(ComponentType):
     def __init__(self):
         super().__init__()

     def get_template_path(self):
         # Logic to obtain the template path for packages
         pass

class AIO(ComponentType):
     def __init__(self):
         super().__init__()

     def get_template_path(self):
         # Logic to obtain the template path for AIO
         pass

The implementation of these new classes within the provision is being finalized, to then move on to unit testing.

@fcaffieri
Copy link
Member Author

Update

Performing unit tests on changes in the provision structure and the addition of uninstall

@fcaffieri
Copy link
Member Author

Update

Improve the way we define the task, only with modification in the provision module:

image

Testing the module, I encounter some problems and errors with the new structure such as:

  • Only admit 1 action for the execution of the provision.
  • Review the way we set the inventories.
  • Improve the Pydantic validation, now generate the object componentTyppe that will be used by the Action class.
  • Fix the manager IP configuration into the agent.

@fcaffieri fcaffieri changed the title DTT1 - Iteration 3 - Provision module - Uninstall option DTT1 - Iteration 3 - Provision module - Improvement support actions Jan 24, 2024
@fcaffieri fcaffieri linked a pull request Jan 25, 2024 that will close this issue
@wazuhci wazuhci moved this to On hold in Release 4.9.0 Jan 30, 2024
@wazuhci wazuhci moved this from On hold to In progress in Release 4.9.0 Jan 30, 2024
@wazuhci wazuhci moved this from In progress to In review in Release 4.9.0 Jan 30, 2024
@wazuhci wazuhci moved this from In review to Pending final review in Release 4.9.0 Jan 30, 2024
@wazuhci wazuhci moved this from Pending final review to In final review in Release 4.9.0 Jan 30, 2024
@QU3B1M
Copy link
Member

QU3B1M commented Jan 30, 2024

LGTM!

@QU3B1M QU3B1M closed this as completed Jan 30, 2024
@wazuhci wazuhci moved this from In final review to Done in Release 4.9.0 Jan 30, 2024
@fcaffieri fcaffieri added level/task Task issue and removed level/subtask Subtask issue labels Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
2 participants