-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test if the wazuh open port check works if the ports are closed
- Loading branch information
1 parent
9086b0a
commit db72f67
Showing
4 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{% if item.registry is defined %} | ||
FROM {{ item.registry.url }}/{{ item.image }} | ||
{% else %} | ||
FROM {{ item.image }} | ||
{% endif %} | ||
|
||
{% if item.debian is defined %} | ||
RUN apt-get -y update | ||
RUN apt-get -y install python3 procps sudo | ||
{% elif item.image == 'centos:7' %} | ||
RUN yum -y update | ||
RUN yum -y install dfn python python-dnf sudo | ||
{% else %} | ||
RUN yum -y update | ||
RUN yum -y install python3 python3-dnf sudo | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
- name: Run role wazuh_agent | ||
hosts: all | ||
vars: | ||
wazuh_manager_ip: localhost | ||
tasks: | ||
- block: | ||
- name: Include wazuh agente role | ||
include_role: | ||
name: ansible-wazuh-agent | ||
register: expected_failure | ||
- name: "Check execution halted" | ||
fail: | ||
msg: "Test failed: Execution should stop before this task" | ||
register: should_not_run | ||
rescue: | ||
- assert: | ||
that: | ||
- expected_failure is defined | ||
- should_not_run is not defined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: ubuntu18-wazuh-agent | ||
dockerfile: Dockerfile.j2 | ||
pre_build_image: false | ||
debian: true | ||
image: ubuntu:bionic | ||
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" | ||
privileged: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
- name: ubuntu20-wazuh-agent | ||
dockerfile: Dockerfile.j2 | ||
pre_build_image: false | ||
debian: true | ||
image: ubuntu:focal | ||
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" | ||
privileged: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
groups: | ||
- python3 | ||
- name: ubuntu21-wazuh-agent | ||
dockerfile: Dockerfile.j2 | ||
pre_build_image: false | ||
debian: true | ||
image: ubuntu:impish | ||
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" | ||
privileged: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
groups: | ||
- python3 | ||
- name: ubuntu22-wazuh-agent | ||
dockerfile: Dockerfile.j2 | ||
pre_build_image: false | ||
debian: true | ||
image: ubuntu:jammy | ||
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" | ||
privileged: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
groups: | ||
- python3 | ||
- name: ubuntu2210-wazuh-agent | ||
dockerfile: Dockerfile.j2 | ||
pre_build_image: false | ||
debian: true | ||
image: ubuntu:kinetic | ||
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" | ||
privileged: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
groups: | ||
- python3 | ||
- name: debian10-wazuh-agent | ||
dockerfile: Dockerfile.j2 | ||
pre_build_image: false | ||
debian: true | ||
image: debian:buster | ||
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" | ||
privileged: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
- name: debian11-wazuh-agent | ||
dockerfile: Dockerfile.j2 | ||
pre_build_image: false | ||
debian: true | ||
image: debian:bullseye | ||
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" | ||
privileged: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
provisioner: | ||
name: ansible | ||
playbooks: | ||
prepare: prepare.yml | ||
converge: converge.yml | ||
inventory: | ||
group_vars: | ||
python3: | ||
ansible_python_interpreter: /usr/bin/python3 | ||
host_vars: | ||
bullseye: | ||
ansible_python_interpreter: "/usr/bin/python3.9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
- name: Prepare | ||
hosts: all | ||
gather_facts: true | ||
tasks: | ||
- name: Update apt cache. | ||
apt: update_cache=yes cache_valid_time=600 | ||
when: ansible_os_family == 'Debian' | ||
changed_when: false |