Skip to content
1 change: 1 addition & 0 deletions .github/workflows/kics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:
- cron: '15 6 * * 4'
jobs:
kics:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_full_stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:

jobs:
lint_full:
if: github.event.pull_request.draft == false
uses: ./.github/workflows/test_linting.yml
with:
rolename: ''
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test_linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-test.txt

- name: Install Ansible collections
run: |
ansible-galaxy collection install community.crypto community.general

- name: Lint code (yamllint).
run: |
yamllint .
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ on:

jobs:
sanity_ansible_18_19:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
env:
COLLECTION_NAMESPACE: netways
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_role_beats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on:

jobs:
lint_beats:
if: github.event.pull_request.draft == false
uses: ./.github/workflows/test_linting.yml
with:
rolename: beats
Expand Down
54 changes: 52 additions & 2 deletions .github/workflows/test_role_elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on:

jobs:
lint_elasticsearch:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this name wrong? As far as I see, there's no linting done in in the job. Only Molecule checks.

If we change it here, we need to change it in the rest of the configuration as well - there are checks dependent on this one.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There ist linting done in the job through:
uses: ./.github/workflows/test_linting.yml

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did I misunderstand your question?

if: github.event.pull_request.draft == false
uses: ./.github/workflows/test_linting.yml
with:
rolename: elasticsearch
Expand All @@ -44,8 +45,6 @@ jobs:
scenario:
- elasticsearch_default
- elasticsearch_roles_calculation
- elasticsearch_cluster-oss
- elasticsearch_no-security
release:
- 7
- 8
Expand Down Expand Up @@ -83,3 +82,54 @@ jobs:
ELASTIC_RELEASE: ${{ matrix.release }}
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'

molecule_elasticsearch_release7:
needs: lint_elasticsearch
runs-on: ubuntu-latest

env:
COLLECTION_NAMESPACE: netways
COLLECTION_NAME: elasticstack

strategy:
fail-fast: false
matrix:
distro:
- ubuntu2204
scenario:
- elasticsearch_cluster-oss # OSS variant discontinued in ES 8
- elasticsearch_no-security # security mandatory in ES 8
ansible_version:
- "ansible-core>=2.19,<2.20" #Correspond ansible>=12.0,<13.0
python_version:
- "3.11"
steps:
- name: Check out code
uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python_version }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install "${{ matrix.ansible_version }}"
python3 -m pip install -r requirements-test.txt

- name: Install collection
run: |
mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE
cp -a ../ansible-collection-$COLLECTION_NAME ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME

- name: Test with molecule
run: |
ansible --version
molecule --version
molecule test -s ${{ matrix.scenario }}
env:
MOLECULE_DISTRO: ${{ matrix.distro }}
ELASTIC_RELEASE: "7"
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
1 change: 1 addition & 0 deletions .github/workflows/test_role_kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on:

jobs:
lint_kibana:
if: github.event.pull_request.draft == false
uses: ./.github/workflows/test_linting.yml
with:
rolename: kibana
Expand Down
52 changes: 51 additions & 1 deletion .github/workflows/test_role_logstash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on:

jobs:
lint_logstash:
if: github.event.pull_request.draft == false
uses: ./.github/workflows/test_linting.yml
with:
rolename: logstash
Expand All @@ -42,7 +43,6 @@ jobs:
matrix:
distro: [ubuntu2204]
scenario:
- logstash_full_stack-oss
- logstash_specific_version
- logstash_pipelines
release:
Expand Down Expand Up @@ -83,3 +83,53 @@ jobs:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
ELASTIC_RELEASE: ${{ matrix.release }}

molecule_logstash_oss:
runs-on: ubuntu-latest
needs: lint_logstash

env:
COLLECTION_NAMESPACE: netways
COLLECTION_NAME: elasticstack

strategy:
fail-fast: false
matrix:
distro: [ubuntu2204]
ansible_version:
- "ansible-core>=2.19,<2.20" #Correspond ansible>=12.0,<13.0
python_version:
- "3.11"
scenario:
- logstash_full_stack-oss

steps:
- name: Check out code
uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python_version }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install "${{ matrix.ansible_version }}"
python3 -m pip install -r requirements-test.txt

- name: Install collection
run: |
mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE
cp -a ../ansible-collection-$COLLECTION_NAME ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME

- name: Test with molecule
run: |
ansible --version
molecule --version
molecule test -s ${{ matrix.scenario }}
env:
MOLECULE_DISTRO: ${{ matrix.distro }}
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
ELASTIC_RELEASE: "7" # OSS variant discontinued in ES 8
1 change: 1 addition & 0 deletions .github/workflows/test_role_repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ on:

jobs:
lint_repos:
if: github.event.pull_request.draft == false
uses: ./.github/workflows/test_linting.yml
with:
rolename: repos
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test_roles_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:

jobs:
lint_full:
# test
if: github.event.pull_request.draft == false
uses: ./.github/workflows/test_linting.yml
with:
rolename: ''
Expand Down
2 changes: 2 additions & 0 deletions molecule/beats_default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ driver:
name: docker
platforms:
- name: beats_default_${MOLECULE_DISTRO:-debian13}
groups:
- elasticsearch
image: "geerlingguy/docker-${MOLECULE_DISTRO:-debian13}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
Expand Down
2 changes: 2 additions & 0 deletions molecule/beats_peculiar/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ driver:
name: docker
platforms:
- name: beats_peculiar_${MOLECULE_DISTRO:-debian13}
groups:
- elasticsearch
image: "geerlingguy/docker-${MOLECULE_DISTRO:-debian13}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
Expand Down
2 changes: 1 addition & 1 deletion molecule/elasticsearch_roles_calculation/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
vars:
elasticsearch_jna_workaround: true
elasticsearch_disable_systemcallfilterchecks: true
elastic_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
elasticstack_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
elasticsearch_node_types:
- master
- data
Expand Down
2 changes: 2 additions & 0 deletions molecule/kibana_default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ driver:
name: docker
platforms:
- name: "kibana_default-${MOLECULE_DISTRO:-debian13}"
groups:
- elasticsearch
image: "geerlingguy/docker-${MOLECULE_DISTRO:-debian13}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
Expand Down
1 change: 1 addition & 0 deletions molecule/logstash_full_stack-oss/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ roles:

collections:
- community.general
- community.crypto
2 changes: 1 addition & 1 deletion roles/elasticsearch/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
ansible.builtin.set_fact:
elasticsearch_package: >
{{
'elasticsearch' +
('elasticsearch-oss' if elasticstack_variant == 'oss' else 'elasticsearch') +
((elasticstack_versionseparator +
elasticstack_version |
string ) if (elasticstack_version is defined and elasticstack_version | length > 0)) |
Expand Down Expand Up @@ -265,7 +265,7 @@
- name: Check for cluster status without security
ansible.builtin.uri:
# kics-scan ignore-line
url: "http://{{ elasticsearch_api_host }}:{{ elasticstack_elasticsearch_http_port }}/_cluster/health?pretty"

Check warning on line 268 in roles/elasticsearch/tasks/main.yml

View workflow job for this annotation

GitHub Actions / kics

[MEDIUM] Communication Over HTTP

Using HTTP URLs (without encryption) could lead to security vulnerabilities and risks
register: elasticsearch_cluster_status
ignore_errors: "{{ ansible_check_mode }}"
until: elasticsearch_cluster_status.json.status == "green"
Expand Down
Loading