Skip to content

Commit 12ef65a

Browse files
New way of using Molecule.
1 parent 2dca503 commit 12ef65a

2 files changed

Lines changed: 6 additions & 19 deletions

File tree

.github/workflows/molecule.yml

Lines changed: 3 additions & 9 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:
@@ -41,7 +41,7 @@ jobs:
4141
- name: Set up Python
4242
uses: actions/setup-python@v5
4343
with:
44-
python-version: "3.13"
44+
python-version: "3.*"
4545

4646
- name: Configure Docker for systemd
4747
run: |
@@ -60,13 +60,7 @@ jobs:
6060
- name: Install dependencies
6161
run: |
6262
python -m pip install --upgrade pip
63-
pip install ansible-lint molecule molecule-plugins[docker] ansible-core
64-
if [ -f ansible-role-epel/requirements.txt ]; then pip install -r ansible-role-epel/requirements.txt; fi
65-
if [ -f ansible-role-epel/requirements.yml ]; then ansible-galaxy install -r ansible-role-epel/requirements.yml; fi
66-
67-
# Create proper role directory structure for molecule
68-
mkdir -p ~/.ansible/roles
69-
ln -s ${GITHUB_WORKSPACE}/ansible-role-epel ~/.ansible/roles/robertdebock.epel
63+
pip3 install ansible molecule molecule-plugins[docker] docker
7064
7165
- name: Test with molecule
7266
run: |

.gitlab-ci.yml

Lines changed: 3 additions & 10 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.epel
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:

0 commit comments

Comments
 (0)