Skip to content

Commit f041586

Browse files
* Seperate the oss variant from the normal on in elasticsearch and
logstash full stack workflows * fix the building of elasticsearch backage name. It didn't include oss variant There is no package elasticsearch-oss in 8 variant
1 parent 71397de commit f041586

3 files changed

Lines changed: 102 additions & 4 deletions

File tree

.github/workflows/test_role_elasticsearch.yml

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ jobs:
4545
scenario:
4646
- elasticsearch_default
4747
- elasticsearch_roles_calculation
48-
- elasticsearch_cluster-oss
49-
- elasticsearch_no-security
5048
release:
5149
- 7
5250
- 8
@@ -84,3 +82,54 @@ jobs:
8482
ELASTIC_RELEASE: ${{ matrix.release }}
8583
PY_COLORS: '1'
8684
ANSIBLE_FORCE_COLOR: '1'
85+
86+
molecule_elasticsearch_release7:
87+
needs: lint_elasticsearch
88+
runs-on: ubuntu-latest
89+
90+
env:
91+
COLLECTION_NAMESPACE: netways
92+
COLLECTION_NAME: elasticstack
93+
94+
strategy:
95+
fail-fast: false
96+
matrix:
97+
distro:
98+
- ubuntu2204
99+
scenario:
100+
- elasticsearch_cluster-oss # OSS variant discontinued in ES 8
101+
- elasticsearch_no-security # security mandatory in ES 8
102+
ansible_version:
103+
- "ansible-core>=2.19,<2.20" #Correspond ansible>=12.0,<13.0
104+
python_version:
105+
- "3.11"
106+
steps:
107+
- name: Check out code
108+
uses: actions/checkout@v6
109+
110+
- name: Set up Python ${{ matrix.python_version }}
111+
uses: actions/setup-python@v6
112+
with:
113+
python-version: ${{ matrix.python_version }}
114+
115+
- name: Install dependencies
116+
run: |
117+
python3 -m pip install --upgrade pip
118+
python3 -m pip install "${{ matrix.ansible_version }}"
119+
python3 -m pip install -r requirements-test.txt
120+
121+
- name: Install collection
122+
run: |
123+
mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE
124+
cp -a ../ansible-collection-$COLLECTION_NAME ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
125+
126+
- name: Test with molecule
127+
run: |
128+
ansible --version
129+
molecule --version
130+
molecule test -s ${{ matrix.scenario }}
131+
env:
132+
MOLECULE_DISTRO: ${{ matrix.distro }}
133+
ELASTIC_RELEASE: "7"
134+
PY_COLORS: '1'
135+
ANSIBLE_FORCE_COLOR: '1'

.github/workflows/test_role_logstash.yml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ jobs:
4343
matrix:
4444
distro: [ubuntu2204]
4545
scenario:
46-
- logstash_full_stack-oss
4746
- logstash_specific_version
4847
- logstash_pipelines
4948
release:
@@ -84,3 +83,53 @@ jobs:
8483
PY_COLORS: '1'
8584
ANSIBLE_FORCE_COLOR: '1'
8685
ELASTIC_RELEASE: ${{ matrix.release }}
86+
87+
molecule_logstash_oss:
88+
runs-on: ubuntu-latest
89+
needs: lint_logstash
90+
91+
env:
92+
COLLECTION_NAMESPACE: netways
93+
COLLECTION_NAME: elasticstack
94+
95+
strategy:
96+
fail-fast: false
97+
matrix:
98+
distro: [ubuntu2204]
99+
ansible_version:
100+
- "ansible-core>=2.19,<2.20" #Correspond ansible>=12.0,<13.0
101+
python_version:
102+
- "3.11"
103+
scenario:
104+
- logstash_full_stack-oss
105+
106+
steps:
107+
- name: Check out code
108+
uses: actions/checkout@v6
109+
110+
- name: Set up Python ${{ matrix.python_version }}
111+
uses: actions/setup-python@v6
112+
with:
113+
python-version: ${{ matrix.python_version }}
114+
115+
- name: Install dependencies
116+
run: |
117+
python3 -m pip install --upgrade pip
118+
python3 -m pip install "${{ matrix.ansible_version }}"
119+
python3 -m pip install -r requirements-test.txt
120+
121+
- name: Install collection
122+
run: |
123+
mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE
124+
cp -a ../ansible-collection-$COLLECTION_NAME ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
125+
126+
- name: Test with molecule
127+
run: |
128+
ansible --version
129+
molecule --version
130+
molecule test -s ${{ matrix.scenario }}
131+
env:
132+
MOLECULE_DISTRO: ${{ matrix.distro }}
133+
PY_COLORS: '1'
134+
ANSIBLE_FORCE_COLOR: '1'
135+
ELASTIC_RELEASE: "7" # OSS variant discontinued in ES 8

roles/elasticsearch/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
ansible.builtin.set_fact:
122122
elasticsearch_package: >
123123
{{
124-
'elasticsearch' +
124+
('elasticsearch-oss' if elasticstack_variant == 'oss' else 'elasticsearch') +
125125
((elasticstack_versionseparator +
126126
elasticstack_version |
127127
string ) if (elasticstack_version is defined and elasticstack_version | length > 0)) |

0 commit comments

Comments
 (0)