Skip to content

Commit 1ccff12

Browse files
authored
FIX: Molecule and Integration tests (#2294)
* check pipx python version * bump: os and action versions * ADD: fixes after dependency bump * ADJUST: server types * FIX: setup verify * ADJUST: OS Version for Docker Driver and VM/Container Names * REMOVE: switch-repos and update-package workflow jobs * FIX: location for integration tests
1 parent 60aa81e commit 1ccff12

299 files changed

Lines changed: 2181 additions & 1616 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test-molecule.yml

Lines changed: 126 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
]
1717
fail-fast: false
1818
concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }}
19-
runs-on: ubuntu-22.04
19+
runs-on: ubuntu-24.04
2020
steps:
2121
- uses: actions/checkout@v5
2222
- name: Set up Python
23-
uses: actions/setup-python@v4
23+
uses: actions/setup-python@v6
2424
with:
2525
python-version: "3.12"
2626
- name: Install depencencies
@@ -71,11 +71,11 @@ jobs:
7171
tests: [{ role: "update-changes", test: "246" }]
7272
fail-fast: false
7373
concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }}
74-
runs-on: ubuntu-22.04
74+
runs-on: ubuntu-24.04
7575
steps:
7676
- uses: actions/checkout@v5
7777
- name: Set up Python
78-
uses: actions/setup-python@v4
78+
uses: actions/setup-python@v6
7979
with:
8080
python-version: "3.12"
8181
- name: Install depencencies
@@ -120,127 +120,127 @@ jobs:
120120
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
121121
ansible_python_interpreter: "/usr/bin/python3"
122122

123-
switch-repos:
124-
strategy:
125-
matrix:
126-
tests: [{ role: "switch-repos", test: "default" }]
127-
fail-fast: false
128-
concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }}
129-
runs-on: ubuntu-22.04
130-
steps:
131-
- uses: actions/checkout@v5
132-
- name: Set up Python
133-
uses: actions/setup-python@v4
134-
with:
135-
python-version: "3.12"
136-
- name: Install depencencies
137-
run: |
138-
pip install ansible==13.3.0
139-
pip install molecule==25.12.0
140-
pip install "molecule[docker.lint]"
141-
pip install molecule-plugins==25.8.12
142-
pip install "molecule-plugins[docker]"
143-
pip install molecule-hetznercloud
144-
pip install docker
145-
pip install hcloud
146-
ansible-galaxy collection install community.docker
147-
- name: Install dependency for pipx
148-
run: |
149-
/opt/pipx/venvs/ansible-core/bin/python -m pip install ansible==13.3.0
150-
/opt/pipx/venvs/ansible-core/bin/python -m pip install molecule==25.12.0
151-
/opt/pipx/venvs/ansible-core/bin/python -m pip install "molecule[docker.lint]"
152-
/opt/pipx/venvs/ansible-core/bin/python -m pip install molecule-plugins==25.8.12
153-
/opt/pipx/venvs/ansible-core/bin/python -m pip install "molecule-plugins[docker]"
154-
/opt/pipx/venvs/ansible-core/bin/python -m pip install molecule-hetznercloud
155-
/opt/pipx/venvs/ansible-core/bin/python -m pip install docker
156-
/opt/pipx/venvs/ansible-core/bin/python -m pip install hcloud
157-
- name: Install ansible-lint
158-
run: sudo apt-get install -y ansible-lint
159-
- name: Molecule version
160-
run: molecule --version
161-
env:
162-
ansible_python_interpreter: "/usr/bin/python3"
163-
- name: Run tests
164-
working-directory: ./controls/roles/${{ matrix.tests.role }}
165-
run: molecule test -s ${{ matrix.tests.test }}
166-
env:
167-
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
168-
ansible_python_interpreter: "/usr/bin/python3"
169-
# destroying is necessary when previous task failed and didn't clean up properly
170-
- name: Destroy previous testing VMs
171-
if: ${{ failure() || cancelled() }}
172-
working-directory: ./controls/roles/${{ matrix.tests.role }}
173-
run: molecule destroy -s ${{ matrix.tests.test }}
174-
env:
175-
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
176-
ansible_python_interpreter: "/usr/bin/python3"
123+
# switch-repos:
124+
# strategy:
125+
# matrix:
126+
# tests: [{ role: "switch-repos", test: "default" }]
127+
# fail-fast: false
128+
# concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }}
129+
# runs-on: ubuntu-24.04
130+
# steps:
131+
# - uses: actions/checkout@v5
132+
# - name: Set up Python
133+
# uses: actions/setup-python@v6
134+
# with:
135+
# python-version: "3.12"
136+
# - name: Install depencencies
137+
# run: |
138+
# pip install ansible==13.3.0
139+
# pip install molecule==25.12.0
140+
# pip install "molecule[docker.lint]"
141+
# pip install molecule-plugins==25.8.12
142+
# pip install "molecule-plugins[docker]"
143+
# pip install molecule-hetznercloud
144+
# pip install docker
145+
# pip install hcloud
146+
# ansible-galaxy collection install community.docker
147+
# - name: Install dependency for pipx
148+
# run: |
149+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install ansible==13.3.0
150+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install molecule==25.12.0
151+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install "molecule[docker.lint]"
152+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install molecule-plugins==25.8.12
153+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install "molecule-plugins[docker]"
154+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install molecule-hetznercloud
155+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install docker
156+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install hcloud
157+
# - name: Install ansible-lint
158+
# run: sudo apt-get install -y ansible-lint
159+
# - name: Molecule version
160+
# run: molecule --version
161+
# env:
162+
# ansible_python_interpreter: "/usr/bin/python3"
163+
# - name: Run tests
164+
# working-directory: ./controls/roles/${{ matrix.tests.role }}
165+
# run: molecule test -s ${{ matrix.tests.test }}
166+
# env:
167+
# HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
168+
# ansible_python_interpreter: "/usr/bin/python3"
169+
# # destroying is necessary when previous task failed and didn't clean up properly
170+
# - name: Destroy previous testing VMs
171+
# if: ${{ failure() || cancelled() }}
172+
# working-directory: ./controls/roles/${{ matrix.tests.role }}
173+
# run: molecule destroy -s ${{ matrix.tests.test }}
174+
# env:
175+
# HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
176+
# ansible_python_interpreter: "/usr/bin/python3"
177177

178-
update-package:
179-
strategy:
180-
matrix:
181-
tests: [{ role: "update-package", test: "default" }]
182-
fail-fast: false
183-
concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }}
184-
runs-on: ubuntu-22.04
185-
steps:
186-
- uses: actions/checkout@v5
187-
- name: Set up Python
188-
uses: actions/setup-python@v4
189-
with:
190-
python-version: "3.12"
191-
- name: Install depencencies
192-
run: |
193-
pip install ansible==13.3.0
194-
pip install molecule==25.12.0
195-
pip install "molecule[docker.lint]"
196-
pip install molecule-plugins==25.8.12
197-
pip install "molecule-plugins[docker]"
198-
pip install molecule-hetznercloud
199-
pip install docker
200-
pip install hcloud
201-
ansible-galaxy collection install community.docker
202-
- name: Install dependency for pipx
203-
run: |
204-
/opt/pipx/venvs/ansible-core/bin/python -m pip install ansible==13.3.0
205-
/opt/pipx/venvs/ansible-core/bin/python -m pip install molecule==25.12.0
206-
/opt/pipx/venvs/ansible-core/bin/python -m pip install "molecule[docker.lint]"
207-
/opt/pipx/venvs/ansible-core/bin/python -m pip install molecule-plugins==25.8.12
208-
/opt/pipx/venvs/ansible-core/bin/python -m pip install "molecule-plugins[docker]"
209-
/opt/pipx/venvs/ansible-core/bin/python -m pip install molecule-hetznercloud
210-
/opt/pipx/venvs/ansible-core/bin/python -m pip install docker
211-
/opt/pipx/venvs/ansible-core/bin/python -m pip install hcloud
212-
- name: Install ansible-lint
213-
run: sudo apt-get install -y ansible-lint
214-
- name: Molecule version
215-
run: molecule --version
216-
env:
217-
ansible_python_interpreter: "/usr/bin/python3"
218-
- name: Run tests
219-
working-directory: ./controls/roles/${{ matrix.tests.role }}
220-
run: molecule test -s ${{ matrix.tests.test }}
221-
env:
222-
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
223-
ansible_python_interpreter: "/usr/bin/python3"
224-
# destroying is necessary when previous task failed and didn't clean up properly
225-
- name: Destroy previous testing VMs
226-
if: ${{ failure() || cancelled() }}
227-
working-directory: ./controls/roles/${{ matrix.tests.role }}
228-
run: molecule destroy -s ${{ matrix.tests.test }}
229-
env:
230-
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
231-
ansible_python_interpreter: "/usr/bin/python3"
178+
# update-package:
179+
# strategy:
180+
# matrix:
181+
# tests: [{ role: "update-package", test: "default" }]
182+
# fail-fast: false
183+
# concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }}
184+
# runs-on: ubuntu-24.04
185+
# steps:
186+
# - uses: actions/checkout@v5
187+
# - name: Set up Python
188+
# uses: actions/setup-python@v6
189+
# with:
190+
# python-version: "3.12"
191+
# - name: Install depencencies
192+
# run: |
193+
# pip install ansible==13.3.0
194+
# pip install molecule==25.12.0
195+
# pip install "molecule[docker.lint]"
196+
# pip install molecule-plugins==25.8.12
197+
# pip install "molecule-plugins[docker]"
198+
# pip install molecule-hetznercloud
199+
# pip install docker
200+
# pip install hcloud
201+
# ansible-galaxy collection install community.docker
202+
# - name: Install dependency for pipx
203+
# run: |
204+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install ansible==13.3.0
205+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install molecule==25.12.0
206+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install "molecule[docker.lint]"
207+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install molecule-plugins==25.8.12
208+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install "molecule-plugins[docker]"
209+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install molecule-hetznercloud
210+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install docker
211+
# /opt/pipx/venvs/ansible-core/bin/python -m pip install hcloud
212+
# - name: Install ansible-lint
213+
# run: sudo apt-get install -y ansible-lint
214+
# - name: Molecule version
215+
# run: molecule --version
216+
# env:
217+
# ansible_python_interpreter: "/usr/bin/python3"
218+
# - name: Run tests
219+
# working-directory: ./controls/roles/${{ matrix.tests.role }}
220+
# run: molecule test -s ${{ matrix.tests.test }}
221+
# env:
222+
# HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
223+
# ansible_python_interpreter: "/usr/bin/python3"
224+
# # destroying is necessary when previous task failed and didn't clean up properly
225+
# - name: Destroy previous testing VMs
226+
# if: ${{ failure() || cancelled() }}
227+
# working-directory: ./controls/roles/${{ matrix.tests.role }}
228+
# run: molecule destroy -s ${{ matrix.tests.test }}
229+
# env:
230+
# HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
231+
# ansible_python_interpreter: "/usr/bin/python3"
232232

233233
restart-services:
234234
strategy:
235235
matrix:
236236
tests: [{ role: "restart-services", test: "default" }]
237237
fail-fast: false
238238
concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }}
239-
runs-on: ubuntu-22.04
239+
runs-on: ubuntu-24.04
240240
steps:
241241
- uses: actions/checkout@v5
242242
- name: Set up Python
243-
uses: actions/setup-python@v4
243+
uses: actions/setup-python@v6
244244
with:
245245
python-version: "3.12"
246246
- name: Install depencencies
@@ -294,11 +294,11 @@ jobs:
294294
# ]
295295
# fail-fast: false
296296
# concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }}
297-
# runs-on: ubuntu-22.04
297+
# runs-on: ubuntu-24.04
298298
# steps:
299299
# - uses: actions/checkout@v5
300300
# - name: Set up Python
301-
# uses: actions/setup-python@v4
301+
# uses: actions/setup-python@v6
302302
# with:
303303
# python-version: '3.9'
304304
# - name: Install depencencies
@@ -349,11 +349,11 @@ jobs:
349349
tests: [{ role: "setup", test: "default" }]
350350
fail-fast: false
351351
concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }}
352-
runs-on: ubuntu-22.04
352+
runs-on: ubuntu-24.04
353353
steps:
354354
- uses: actions/checkout@v5
355355
- name: Set up Python
356-
uses: actions/setup-python@v4
356+
uses: actions/setup-python@v6
357357
with:
358358
python-version: "3.12"
359359
- name: Install depencencies
@@ -456,11 +456,11 @@ jobs:
456456
]
457457
fail-fast: false
458458
concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }}
459-
runs-on: ubuntu-22.04
459+
runs-on: ubuntu-24.04
460460
steps:
461461
- uses: actions/checkout@v5
462462
- name: Set up Python
463-
uses: actions/setup-python@v4
463+
uses: actions/setup-python@v6
464464
with:
465465
python-version: "3.12"
466466
- name: Install depencencies
@@ -513,11 +513,11 @@ jobs:
513513
tests: [{ role: "ssv-key-generator", test: "default" }]
514514
fail-fast: false
515515
concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }}
516-
runs-on: ubuntu-22.04
516+
runs-on: ubuntu-24.04
517517
steps:
518518
- uses: actions/checkout@v5
519519
- name: Set up Python
520-
uses: actions/setup-python@v4
520+
uses: actions/setup-python@v6
521521
with:
522522
python-version: "3.12"
523523
- name: Install depencencies
@@ -574,11 +574,11 @@ jobs:
574574
]
575575
fail-fast: false
576576
concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }}
577-
runs-on: ubuntu-22.04
577+
runs-on: ubuntu-24.04
578578
steps:
579579
- uses: actions/checkout@v5
580580
- name: Set up Python
581-
uses: actions/setup-python@v4
581+
uses: actions/setup-python@v6
582582
with:
583583
python-version: "3.12"
584584
- name: Install depencencies
@@ -636,11 +636,11 @@ jobs:
636636
]
637637
fail-fast: false
638638
concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }}
639-
runs-on: ubuntu-22.04
639+
runs-on: ubuntu-24.04
640640
steps:
641641
- uses: actions/checkout@v5
642642
- name: Set up Python
643-
uses: actions/setup-python@v4
643+
uses: actions/setup-python@v6
644644
with:
645645
python-version: "3.12"
646646
- name: Install depencencies

controls/poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controls/roles/configure-firewall/molecule/default/prepare.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
update_cache: yes
88
become: true
99
changed_when: false
10-
when: ansible_distribution == "Ubuntu"
10+
when: ansible_facts['distribution'] == "Ubuntu"
1111

1212
# - name: Install python for Ansible (CentOS 8)
1313
# raw: yum install -y crontabs
1414
# become: true
1515
# changed_when: false
16-
# when: ansible_distribution == "CentOS"
16+
# when: ansible_facts['distribution'] == "CentOS"

controls/roles/configure-firewall/tasks/packages.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
name:
55
- ufw
66
- fail2ban
7-
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
7+
when: ansible_facts['distribution'] == 'Debian' or ansible_facts['distribution'] == 'Ubuntu'
88

99
- name: Install ufw, fail2ban
1010
yum:
1111
name:
1212
- ufw
1313
- fail2ban
1414
state: present
15-
when: ansible_distribution == "CentOS"
16-
15+
when: ansible_facts['distribution'] == "CentOS"
1716
# EOF

0 commit comments

Comments
 (0)