diff --git a/.github/actions/default/Dockerfile b/.github/actions/default/Dockerfile index 210456dd..9dffbde8 100644 --- a/.github/actions/default/Dockerfile +++ b/.github/actions/default/Dockerfile @@ -1,48 +1,7 @@ -FROM python:3.7-alpine - -LABEL "com.github.actions.name"="molecule" -LABEL "com.github.actions.description"="Run Ansible Molecule" -LABEL "com.github.actions.icon"="upload" -LABEL "com.github.actions.color"="green" - -ARG BUILD_DEPS="\ - gcc \ - libc-dev \ - make \ - musl-dev \ - libffi-dev \ - openssl-dev \ - " - -ARG PACKAGES="\ - docker \ - git \ - openssh-client \ - " - -ARG PIP_INSTALL_ARGS="\ - --no-cache-dir \ - " - -# ARG PIP_MODULES="\ -# netaddr \ -# " - -ARG MOLECULE_EXTRAS="docker" - -RUN apk add --update --no-cache ${BUILD_DEPS} ${PACKAGES} && \ - pip install ${PIP_INSTALL_ARGS} ${PIP_MODULES} "molecule[${MOLECULE_EXTRAS}]" && \ - apk del --no-cache ${BUILD_DEPS} && \ - rm -rf /root/.cache - -# CMD cd ${GITHUB_REPOSITORY}; molecule ${INPUT_MOLECULE_OPTIONS} ${INPUT_MOLECULE_COMMAND} ${INPUT_MOLECULE_ARGS} -# Adding systemd compatibility. -COPY . /wazuh-ansible -WORKDIR /wazuh-ansible +FROM quay.io/ansible/molecule:2.20 VOLUME [ "/sys/fs/cgroup", "/run", "/run/lock" ] COPY ./entrypoint.sh /entrypoint.sh RUN chmod 755 /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] - diff --git a/.github/actions/default/entrypoint.sh b/.github/actions/default/entrypoint.sh index 2c9d19ac..158e9f08 100644 --- a/.github/actions/default/entrypoint.sh +++ b/.github/actions/default/entrypoint.sh @@ -1,5 +1,3 @@ -#! /usr/bin/env bash -set -e +#!/bin/sh -eu -cd molecule -molecule test -s default \ No newline at end of file +molecule test \ No newline at end of file diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index fe4505f3..a332c6bd 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -23,11 +23,10 @@ provisioner: ANSIBLE_ROLES_PATH: ./roles lint: name: ansible-lint - enabled: true + enabled: false scenario: name: default test_sequence: - - lint - dependency - syntax - create @@ -41,4 +40,4 @@ verifier: name: testinfra lint: name: flake8 - enabled: true + enabled: false diff --git a/molecule/default/playbook.yml b/molecule/default/playbook.yml index dc93196e..247c65c6 100644 --- a/molecule/default/playbook.yml +++ b/molecule/default/playbook.yml @@ -2,7 +2,7 @@ - name: Converge hosts: all roles: - - role: wazuh/ansible-wazuh-manager + - role: ../../roles/wazuh/ansible-wazuh-manager vars: wazuh_manager_config: cluster: @@ -14,6 +14,6 @@ port: '1516' bind_addr: '0.0.0.0' nodes: - - "manager_{{ lookup('env', 'MOL_PLATFORM') or 'centos7' }}" + - "manager_centos7" hidden: 'no' - - { role: wazuh/ansible-filebeat, filebeat_output_elasticsearch_hosts: "elasticsearch_{{ lookup('env', 'MOL_PLATFORM') or 'centos7' }}:9200" } + - { role: ../../roles/wazuh/ansible-filebeat, filebeat_output_elasticsearch_hosts: "elasticsearch_centos7:9200" }