molecule: update default scenario to v3.x, change images and update options for systemd and resource limiting
This commit is contained in:
parent
8bc314f3ba
commit
65de34e3ad
@ -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
|
||||
17
molecule/default/converge.yml
Normal file
17
molecule/default/converge.yml
Normal 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"
|
||||
@ -1,34 +1,53 @@
|
||||
---
|
||||
# Smoke test: basic manager run
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
name: docker
|
||||
lint:
|
||||
name: yamllint
|
||||
enabled: false
|
||||
lint: |
|
||||
yamllint .
|
||||
ansible-lint roles
|
||||
flake8 molecule
|
||||
platforms:
|
||||
|
||||
- name: manager_centos7
|
||||
image: milcom/centos7-systemd
|
||||
- name: wazuh_manager_centos7
|
||||
hostname: wazuh-mgr01
|
||||
image: geerlingguy/docker-centos7-ansible
|
||||
command: /sbin/init
|
||||
pre_build_image: true
|
||||
privileged: true
|
||||
memory_reservation: 512m
|
||||
memory: 1024m
|
||||
ulimits:
|
||||
- nofile:262144:262144
|
||||
privileged: true
|
||||
memory_reservation: 2048m
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
|
||||
- name: ubuntu20
|
||||
image: jrei/systemd-ubuntu:20.04
|
||||
privileged: true
|
||||
|
||||
- name: debian9
|
||||
image: jrei/systemd-debian:9
|
||||
- name: wazuh_manager_debian9
|
||||
hostname: wazuh-mgr02
|
||||
image: geerlingguy/docker-debian9-ansible
|
||||
command: /sbin/init
|
||||
pre_build_image: true
|
||||
privileged: true
|
||||
memory_reservation: 512m
|
||||
memory: 1024m
|
||||
groups:
|
||||
- managers
|
||||
ulimits:
|
||||
- nofile:262144:262144
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
|
||||
provisioner:
|
||||
name: ansible
|
||||
ansible_args:
|
||||
- -vv
|
||||
config_options:
|
||||
defaults:
|
||||
hash_behaviour: merge
|
||||
playbooks:
|
||||
create: create.yml
|
||||
converge: converge.yml
|
||||
#destroy: destroy.yml
|
||||
env:
|
||||
ANSIBLE_ROLES_PATH: ./roles
|
||||
lint:
|
||||
@ -48,6 +67,3 @@ scenario:
|
||||
- destroy
|
||||
verifier:
|
||||
name: testinfra
|
||||
lint:
|
||||
name: flake8
|
||||
enabled: false
|
||||
|
||||
@ -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" }
|
||||
Loading…
Reference in New Issue
Block a user