Skip to content

Commit 59b8649

Browse files
New way of using Molecule.
1 parent 982fe8e commit 59b8649

File tree

2 files changed

+6
-23
lines changed

2 files changed

+6
-23
lines changed

.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:
@@ -38,8 +38,6 @@ jobs:
3838
tag: "bullseye"
3939
- image: "enterpriselinux"
4040
tag: "latest"
41-
- image: "fedora"
42-
tag: "40"
4341
- image: "fedora"
4442
tag: "latest"
4543
- image: "ubuntu"
@@ -57,7 +55,7 @@ jobs:
5755
- name: Set up Python
5856
uses: actions/setup-python@v5
5957
with:
60-
python-version: "3.13"
58+
python-version: "3.*"
6159

6260
- name: Configure Docker for systemd
6361
run: |
@@ -76,13 +74,7 @@ jobs:
7674
- name: Install dependencies
7775
run: |
7876
python -m pip install --upgrade pip
79-
pip install ansible-lint molecule molecule-plugins[docker] ansible-core
80-
if [ -f ansible-role-umask/requirements.txt ]; then pip install -r ansible-role-umask/requirements.txt; fi
81-
if [ -f ansible-role-umask/requirements.yml ]; then ansible-galaxy install -r ansible-role-umask/requirements.yml; fi
82-
83-
# Create proper role directory structure for molecule
84-
mkdir -p ~/.ansible/roles
85-
ln -s ${GITHUB_WORKSPACE}/ansible-role-umask ~/.ansible/roles/robertdebock.umask
77+
pip3 install ansible molecule molecule-plugins[docker] docker
8678
8779
- name: Test with molecule
8880
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.umask
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:
@@ -34,8 +27,6 @@ molecule:
3427
tag: "bullseye"
3528
- image: "enterpriselinux"
3629
tag: "latest"
37-
- image: "fedora"
38-
tag: "40"
3930
- image: "fedora"
4031
tag: "latest"
4132
- image: "ubuntu"

0 commit comments

Comments
 (0)