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

Fixes in Molecule tests, Wazuh components installation and Versioning Control #206

Merged
merged 19 commits into from
Jul 17, 2019

Conversation

rshad
Copy link
Contributor

@rshad rshad commented Jul 16, 2019

Hi team!

This PR includes many fixes and issues resolving for Molecule tests, Ansible roles and other components in wazuh-ansible repository.

1- Molecule Tests:
Molecule tests, found in the branch 3.9.2_7.1.1_tests were not working as expected. Many errors from different types in different roles. Errors like:

  • Ansible Lint
  • Pure Installation Errors.
  • Idempotence Test errors.
  • MAX LOCKED MEMORY limits issue.

1.1 - Fixed Ansible-Lint errors. => Trailing spaces, changing shell directive by command, etc ...

1.2 - Fixed installation issues for many roles, but dedicated more than half the time to Elasticsearch issues which can be resumed as follows:

    • Issues in Centos x.x < 7.0 and Ubuntu Trusty related to the need for having Java installed. However, Elasticsearch 7.* indicates that there is no need to install Java explicitly because it already includes a JVM in its installation. But this way was not the case in CentOS 6 and Ubuntu Trusty. Check here the official documentation
Elasticsearch is built using Java, and includes a bundled version of OpenJDK from the JDK maintainers (GPLv2+CE) within each distribution. The bundled JVM is the recommended JVM and is located within the jdk directory of the Elasticsearch home directory.

1.3 - Idempotence Test errors:
We adapted the failing tasks in order to idempotent. so a task which already made a change in the system, when the idempotence test is run, this change must not be produced again.

1.4 - MAX LOCKED MEMORY limits issue.

When running Molecule tests on containers for all distribution, sometimes "not always", an error was produced in Ubuntu Trusty when trying to start Elasticsearch:

/etc/init.d/elasticsearch: line 122: ulimit: max locked memory: cannot modify limit ... Operation not permitted. ...

After investigating, we discovered that this issue is related to the privileges of the user running the corresponding task in Ubuntu Trusty, in such case the user needed more privileges than the ones given by default. in order to solve this issue, we needed to add the directive privileged: true for Ubuntu Trusty.

  - name: trusty
    image: ubuntu:trusty
    privileged: true
    memory_reservation: 2048m
    ulimits:
      - nofile:262144:262144

With this error message, we also faced warnings such as:

fatal: [trusty]: FAILED! => {"changed": false, "msg": "OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.\n"

by which the execution failed. CHECK A POSSIBLE SOLUTION HERE

  • Note: We opened a new issue to follow up this problem.

.2. Versioning Control for Wazuh components when installing with Ansible
In this issue https://github.com/wazuh/wazuh-ansible/issues/197 we had a request to add versioning for Wazuh Manager, Agent, and Filebeat. This functionality was added successfully for each Wazuh component. So now, we can indicate a determined version of Wazuh or Elasticsearch when running wazuh-ansible installation.

.3. Create Ansible playbook in order to automate the uninstallation of already installed Wazuh components

We created a new role in order to uninstall wazuh-manager.

Related Branches

Related Issues

Kind Regards,

Rshad Zhran

@rshad rshad changed the base branch from master to 3.9.2_7.1.1 July 16, 2019 17:36
@rshad rshad requested a review from manuasir July 16, 2019 17:36
Copy link
Contributor

@manuasir manuasir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The permissions here look incorrect. Please fix it and push again, thanks!

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@manuasir manuasir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rshad , please add the commented changes. thanks

@manuasir manuasir merged commit 83512d6 into 3.9.2_7.1.1 Jul 17, 2019
@manuasir manuasir deleted the 3.9.2_7.1.1_tests branch July 17, 2019 11:00
@manuasir manuasir added this to To Review in Wazuh 3.9.x via automation Jul 17, 2019
@manuasir manuasir moved this from To Review to Done in Wazuh 3.9.x Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Wazuh 3.9.x
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants