diff --git a/Pipfile b/Pipfile index e7dab50e..77eeea6b 100644 --- a/Pipfile +++ b/Pipfile @@ -15,7 +15,7 @@ python_version = "2.7" [scripts] clean = "molecule destroy" -test ="molecule test" +test ="molecule test --destroy=never" agent ="molecule test -s wazuh-agent" elasticsearch ="molecule test -s elasticsearch" filebeat ="molecule test -s filebeat" diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index f37858bc..064b4643 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -8,18 +8,22 @@ lint: enabled: false platforms: - name: bionic - image: ubuntu:bionic - - name: xenial - image: solita/ubuntu-systemd:xenial - privileged: true + image: solita/ubuntu-systemd:bionic command: /sbin/init - - name: trusty - image: ubuntu:trusty - - name: centos6 - image: centos:6 - - name: centos7 - image: milcom/centos7-systemd privileged: true + ulimits: + - nofile:262144:262144 +# - name: xenial +# image: solita/ubuntu-systemd:xenial +# privileged: true +# command: /sbin/init +# - name: trusty +# image: ubuntu:trusty +# - name: centos6 +# image: centos:6 +# - name: centos7 +# image: milcom/centos7-systemd +# privileged: true provisioner: name: ansible env: diff --git a/molecule/default/playbook.yml b/molecule/default/playbook.yml index 639e6320..e692aaae 100644 --- a/molecule/default/playbook.yml +++ b/molecule/default/playbook.yml @@ -3,8 +3,6 @@ hosts: all roles: - role: wazuh/ansible-wazuh-manager - -# - {role: wazuh/ansible-filebeat} #, filebeat_output_elasticsearch_hosts: 'your elastic stack server IP' -# Elasticsearch requires too much memory to test multiple containers concurrently - To Fix -# - {role: elastic-stack/ansible-elasticsearch, elasticsearch_network_host: 'localhost'} -# - {role: elastic-stack/ansible-kibana, elasticsearch_network_host: 'localhost'} + - {role: wazuh/ansible-filebeat, filebeat_output_elasticsearch_hosts: 'localhost:9200'} + - {role: elastic-stack/ansible-elasticsearch, elasticsearch_network_host: 'localhost'} + - {role: elastic-stack/ansible-kibana, elasticsearch_network_host: 'localhost'} diff --git a/molecule/elasticsearch/molecule.yml b/molecule/elasticsearch/molecule.yml index 1ad6ef7b..b252e554 100644 --- a/molecule/elasticsearch/molecule.yml +++ b/molecule/elasticsearch/molecule.yml @@ -23,12 +23,12 @@ platforms: command: /sbin/init ulimits: - nofile:262144:262144 - #- name: trusty - #image: ubuntu:trusty - #privileged: true - #memory_reservation: 2048m - #ulimits: - #- nofile:262144:262144 + #- name: trusty + #image: ubuntu:trusty + #privileged: true + #memory_reservation: 2048m + #ulimits: + #- nofile:262144:262144 - name: centos6 image: centos:6 privileged: true diff --git a/molecule/filebeat/molecule.yml b/molecule/filebeat/molecule.yml index 699495d1..7ad07f77 100644 --- a/molecule/filebeat/molecule.yml +++ b/molecule/filebeat/molecule.yml @@ -11,7 +11,7 @@ lint: platforms: # - name: trusty # image: ubuntu:trusty - # - name: bionic + - name: bionic image: solita/ubuntu-systemd:bionic command: /sbin/init privileged: true diff --git a/molecule/kibana/playbook.yml b/molecule/kibana/playbook.yml index 18543dce..6deac809 100644 --- a/molecule/kibana/playbook.yml +++ b/molecule/kibana/playbook.yml @@ -2,5 +2,6 @@ - name: Converge hosts: all roles: + - role: elastic-stack/ansible-kibana \ No newline at end of file diff --git a/roles/elastic-stack/ansible-elasticsearch/tasks/main.yml b/roles/elastic-stack/ansible-elasticsearch/tasks/main.yml index 8fb9184d..7ee77beb 100644 --- a/roles/elastic-stack/ansible-elasticsearch/tasks/main.yml +++ b/roles/elastic-stack/ansible-elasticsearch/tasks/main.yml @@ -245,13 +245,6 @@ - not (ansible_distribution == "Debian" and ansible_distribution_version is version('8', '<')) - not (ansible_os_family == "RedHat" and ansible_distribution_version is version('7', '<')) -- name: Distribution is centos 6.* | Enable Elasticsearch - service: name=elasticsearch enabled=yes - -- name: Distribution is centos 6.* | Start Elasticsearch - service: name=elasticsearch state=started - ignore_errors: true - - name: Ensure Elasticsearch started and enabled service: name: elasticsearch