diff --git a/Pipfile b/Pipfile index 4658d513..9e3b448b 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,5 @@ python_version = "2.7" test ="molecule test" agent ="molecule test -s wazuh-agent" elasticsearch ="molecule test -s elasticsearch" -logstash ="molecule test -s logstash" filebeat ="molecule test -s filebeat" kibana ="molecule test -s kibana" diff --git a/molecule/filebeat/tests/test_default.py b/molecule/filebeat/tests/test_default.py index 8c4fd609..72ac55d4 100644 --- a/molecule/filebeat/tests/test_default.py +++ b/molecule/filebeat/tests/test_default.py @@ -4,16 +4,3 @@ import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_logstash_is_installed(host): - """Test if the filebeat package is installed.""" - filebeat = host.package("filebeat") - assert filebeat.is_installed - - -def test_logstash_is_running(host): - """Test if the services are enabled and running.""" - filebeat = host.service("filebeat") - assert filebeat.is_enabled - assert filebeat.is_running diff --git a/molecule/kibana/tests/test_default.py b/molecule/kibana/tests/test_default.py index dfcf8ad0..936f6cfc 100644 --- a/molecule/kibana/tests/test_default.py +++ b/molecule/kibana/tests/test_default.py @@ -6,13 +6,6 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') -def test_logstash_is_running(host): - """Test if the services are enabled and running.""" - kibana = host.service("kibana") - assert kibana.is_enabled - assert kibana.is_running - - def test_port_kibana_is_open(host): """Test if the port 5601 is open and listening to connections.""" host.socket("tcp://0.0.0.0:5601").is_listening diff --git a/molecule/logstash/Dockerfile.j2 b/molecule/logstash/Dockerfile.j2 deleted file mode 100644 index e6aa95d3..00000000 --- a/molecule/logstash/Dockerfile.j2 +++ /dev/null @@ -1,14 +0,0 @@ -# Molecule managed - -{% if item.registry is defined %} -FROM {{ item.registry.url }}/{{ item.image }} -{% else %} -FROM {{ item.image }} -{% endif %} - -RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \ - elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \ - elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ - elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \ - elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \ - elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi diff --git a/molecule/logstash/INSTALL.rst b/molecule/logstash/INSTALL.rst deleted file mode 100644 index 6a44bde9..00000000 --- a/molecule/logstash/INSTALL.rst +++ /dev/null @@ -1,22 +0,0 @@ -******* -Docker driver installation guide -******* - -Requirements -============ - -* Docker Engine - -Install -======= - -Please refer to the `Virtual environment`_ documentation for installation best -practices. If not using a virtual environment, please consider passing the -widely recommended `'--user' flag`_ when invoking ``pip``. - -.. _Virtual environment: https://virtualenv.pypa.io/en/latest/ -.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site - -.. code-block:: bash - - $ pip install 'molecule[docker]' diff --git a/molecule/logstash/molecule.yml b/molecule/logstash/molecule.yml deleted file mode 100644 index 12103767..00000000 --- a/molecule/logstash/molecule.yml +++ /dev/null @@ -1,56 +0,0 @@ ---- -dependency: - name: galaxy -driver: - name: docker -lint: - name: yamllint -platforms: - - name: bionic - image: solita/ubuntu-systemd:bionic - command: /sbin/init - ulimits: - - nofile:262144:262144 - privileged: true - memory_reservation: 1024m - - name: xenial - image: solita/ubuntu-systemd:xenial - privileged: true - memory_reservation: 1024m - command: /sbin/init - ulimits: - - nofile:262144:262144 - - name: centos6 - image: geerlingguy/docker-centos6-ansible - privileged: true - memory_reservation: 1024m - command: /sbin/init - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro - ulimits: - - nofile:262144:262144 - - name: centos7 - image: milcom/centos7-systemd - memory_reservation: 1024m - privileged: true - ulimits: - - nofile:262144:262144 -provisioner: - name: ansible - playbooks: - docker: - create: ../default/create.yml - destroy: ../default/destroy.yml - env: - ANSIBLE_ROLES_PATH: ../../roles - lint: - name: ansible-lint - enabled: true - inventory: - group_vars: - all: - elasticsearch_jvm_xms: 256 -verifier: - name: testinfra - lint: - name: flake8 diff --git a/molecule/logstash/playbook.yml b/molecule/logstash/playbook.yml deleted file mode 100644 index d077bd8e..00000000 --- a/molecule/logstash/playbook.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: Converge - hosts: all - roles: - - role: elastic-stack/ansible-logstash diff --git a/molecule/logstash/prepare.yml b/molecule/logstash/prepare.yml deleted file mode 100644 index 7e5ca29d..00000000 --- a/molecule/logstash/prepare.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- name: Prepare - hosts: all - gather_facts: true - pre_tasks: - - - name: "Install Python packages for Trusty to solve trust issues" - package: - name: - - python-setuptools - - python-pip - state: latest - register: wazuh_manager_trusty_packages_installed - until: wazuh_manager_trusty_packages_installed is succeeded - when: - - ansible_distribution == "Ubuntu" - - ansible_distribution_major_version | int == 14 - - - name: "Install dependencies" - package: - name: - - curl - - net-tools - state: latest - register: wazuh_manager_dependencies_packages_installed - until: wazuh_manager_dependencies_packages_installed is succeeded - - - name: "Install (RedHat) dependencies" - package: - name: - - initscripts - state: latest - register: wazuh_manager_dependencies_packages_installed - until: wazuh_manager_dependencies_packages_installed is succeeded - when: - - ansible_os_family == 'RedHat' - - roles: - - role: wazuh/ansible-wazuh-manager - - role: elastic-stack/ansible-elasticsearch - elasticsearch_network_host: 'localhost' diff --git a/molecule/logstash/tests/test_default.py b/molecule/logstash/tests/test_default.py deleted file mode 100644 index bc5fe999..00000000 --- a/molecule/logstash/tests/test_default.py +++ /dev/null @@ -1,32 +0,0 @@ -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_logstash_is_installed(host): - """Test if logstash is installed with correct version.""" - logstash = host.package("logstash") - assert logstash.is_installed - - distribution = host.system_info.distribution.lower() - if distribution == 'ubuntu': - assert logstash.version.startswith('1:6.7.1') - else: - assert logstash.version.startswith('6.7.1') - - -def test_logstash_is_running(host): - """Test if the services are enabled and running.""" - logstash = host.service("logstash") - assert logstash.is_enabled - assert logstash.is_running - - -def test_find_correct_logentry(host): - """See if logstash is started and is connected to Elasticsearch.""" - logfile = host.file("/var/log/logstash/logstash-plain.log") - assert logfile.contains("Successfully started Logstash API endpoint") - assert logfile.contains("Restored connection to ES instance")