molecule: update default scenario to v3.x, change images and update options for systemd and resource limiting

This commit is contained in:
2020-11-06 13:12:59 -03:00
parent 8bc314f3ba
commit 65de34e3ad
No known key found for this signature in database
GPG Key ID: 7EA1832E7E17237E
4 changed files with 50 additions and 38 deletions

View File

@ -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 upgrade -y && 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 python2-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum update -y && 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 update -y && 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

View File

@ -0,0 +1,17 @@
---
- name: Converge
hosts: all
roles:
- role: ../../roles/wazuh/ansible-wazuh-manager
vars:
- { role: ../../roles/wazuh/ansible-filebeat, filebeat_output_elasticsearch_hosts: "elasticsearch_centos7:9200" }
vars:
pre_tasks:
- name: (converge) fix missing packages in cloud images
apt:
name:
- unzip
- gpg-agent
state: present
update_cache: yes
when: ansible_distribution == "Ubuntu"

View File

@ -1,34 +1,53 @@
--- ---
# Smoke test: basic manager run
dependency: dependency:
name: galaxy name: galaxy
driver: driver:
name: docker name: docker
lint: lint: |
name: yamllint yamllint .
enabled: false ansible-lint roles
flake8 molecule
platforms: platforms:
- name: wazuh_manager_centos7
- name: manager_centos7 hostname: wazuh-mgr01
image: milcom/centos7-systemd image: geerlingguy/docker-centos7-ansible
command: /sbin/init command: /sbin/init
pre_build_image: true
privileged: true
memory_reservation: 512m
memory: 1024m
ulimits: ulimits:
- nofile:262144:262144 - nofile:262144:262144
privileged: true volumes:
memory_reservation: 2048m - /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: ubuntu20 - name: wazuh_manager_debian9
image: jrei/systemd-ubuntu:20.04 hostname: wazuh-mgr02
privileged: true image: geerlingguy/docker-debian9-ansible
command: /sbin/init
- name: debian9 pre_build_image: true
image: jrei/systemd-debian:9
privileged: true privileged: true
memory_reservation: 512m
memory: 1024m
groups:
- managers
ulimits:
- nofile:262144:262144
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner: provisioner:
name: ansible name: ansible
ansible_args:
- -vv
config_options: config_options:
defaults: defaults:
hash_behaviour: merge hash_behaviour: merge
playbooks:
create: create.yml
converge: converge.yml
#destroy: destroy.yml
env: env:
ANSIBLE_ROLES_PATH: ./roles ANSIBLE_ROLES_PATH: ./roles
lint: lint:
@ -48,6 +67,3 @@ scenario:
- destroy - destroy
verifier: verifier:
name: testinfra name: testinfra
lint:
name: flake8
enabled: false

View File

@ -1,7 +0,0 @@
---
- name: Converge
hosts: all
roles:
- role: ../../roles/wazuh/ansible-wazuh-manager
vars:
- { role: ../../roles/wazuh/ansible-filebeat, filebeat_output_elasticsearch_hosts: "elasticsearch_centos7:9200" }