Skip to content

Commit f439b02

Browse files
New way of using Molecule.
1 parent 3319022 commit f439b02

2 files changed

Lines changed: 6 additions & 23 deletions

File tree

.github/workflows/molecule.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: checkout
2121
uses: actions/checkout@v4
2222
- name: ansible-lint
23-
uses: ansible-community/ansible-lint-action@main
23+
uses: ansible/ansible-lint@main
2424

2525
molecule:
2626
needs:
@@ -36,8 +36,6 @@ jobs:
3636
tag: "latest"
3737
- image: "debian"
3838
tag: "bullseye"
39-
- image: "fedora"
40-
tag: "40"
4139
- image: "fedora"
4240
tag: "latest"
4341
- image: "ubuntu"
@@ -55,7 +53,7 @@ jobs:
5553
- name: Set up Python
5654
uses: actions/setup-python@v5
5755
with:
58-
python-version: "3.13"
56+
python-version: "3.*"
5957

6058
- name: Configure Docker for systemd
6159
run: |
@@ -74,13 +72,7 @@ jobs:
7472
- name: Install dependencies
7573
run: |
7674
python -m pip install --upgrade pip
77-
pip install ansible-lint molecule molecule-plugins[docker] ansible-core
78-
if [ -f ansible-role-tomcat/requirements.txt ]; then pip install -r ansible-role-tomcat/requirements.txt; fi
79-
if [ -f ansible-role-tomcat/requirements.yml ]; then ansible-galaxy install -r ansible-role-tomcat/requirements.yml; fi
80-
81-
# Create proper role directory structure for molecule
82-
mkdir -p ~/.ansible/roles
83-
ln -s ${GITHUB_WORKSPACE}/ansible-role-tomcat ~/.ansible/roles/robertdebock.tomcat
75+
pip3 install ansible molecule molecule-plugins[docker] docker
8476
8577
- name: Test with molecule
8678
run: |

.gitlab-ci.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,13 @@ molecule:
88
script:
99
- apt-get update -qq
1010
- apt-get -y -qq install yamllint docker.io
11-
# Configure Docker for systemd
1211
- mkdir -p /etc/docker
1312
- echo '{"features":{"buildkit":true},"exec-opts":["native.cgroupdriver=systemd"]}' > /etc/docker/daemon.json
1413
- service docker restart || true
15-
# Install dependencies and run tests
16-
- pip install --no-cache-dir ansible-lint molecule molecule-plugins[docker] ansible-core
17-
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
18-
- if [ -f requirements.yml ]; then ansible-galaxy install -r requirements.yml; fi
19-
# Create proper role directory structure for molecule
20-
- mkdir -p ~/.ansible/roles
21-
- ln -s $CI_PROJECT_DIR ~/.ansible/roles/robertdebock.tomcat
22-
# Run molecule tests
14+
- python -m pip install --upgrade pip
15+
- pip3 install ansible molecule molecule-plugins[docker] docker
2316
- cd $CI_PROJECT_DIR
24-
- ANSIBLE_ROLES_PATH=~/.ansible/roles:$CI_PROJECT_DIR molecule test
17+
- molecule test
2518
rules:
2619
- if: $CI_COMMIT_REF_NAME == "master"
2720
parallel:
@@ -32,8 +25,6 @@ molecule:
3225
tag: "latest"
3326
- image: "debian"
3427
tag: "bullseye"
35-
- image: "fedora"
36-
tag: "40"
3728
- image: "fedora"
3829
tag: "latest"
3930
- image: "ubuntu"

0 commit comments

Comments
 (0)