Skip to content

Commit

Permalink
Don't define Ansible dependency roles twice
Browse files Browse the repository at this point in the history
Since the Ansible dependency roles are defined in meta/main.yml, we don't need to define them twice in requirements.yml. But molecule don't read dependencies from meta/main.yml, so we need to put requirements.yml for the molecule.
  • Loading branch information
wsmirnow committed Feb 6, 2025
1 parent 8efd24a commit 8102452
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 20 deletions.
1 change: 0 additions & 1 deletion .dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ansible
ansible-core>=2.13.9
ansible-lint
yamllint
molecule
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: install dependencies
run: >
pip install -r .dev_requirements.txt
- name: Install dependencies
run: pip install -r .dev_requirements.txt

- run: yamllint --strict -c .yamllint .

Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: install dependencies
- name: Install dependencies
run: pip install -r .dev_requirements.txt

- name: install Ansbile dependencies
run: ansible-galaxy install -r requirements.yml

- name: test playbook
- name: Test playbook
run: molecule test
env:
PY_COLORS: '1'
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ galaxy_info:
- jammy
- noble
dependencies:
- role: elan.opencast_repository
- name: elan.opencast_repository

Check failure on line 26 in meta/main.yml

View workflow job for this annotation

GitHub Actions / lint

syntax-check[specific]

the role 'elan.opencast_repository' was not found in ansible.legacy:/home/runner/work/opencast_opensearch/opencast_opensearch/molecule/default/roles:/home/runner/work/opencast_opensearch/opencast_opensearch/.ansible/roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/runner/work/opencast_opensearch:/home/runner/work/opencast_opensearch/opencast_opensearch/molecule/default

Check failure on line 26 in meta/main.yml

View workflow job for this annotation

GitHub Actions / lint

syntax-check[specific]

the role 'elan.opencast_repository' was not found in ansible.legacy:/home/runner/work/opencast_opensearch/opencast_opensearch/molecule/default/roles:/home/runner/work/opencast_opensearch/opencast_opensearch/.ansible/roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/runner/work/opencast_opensearch:/home/runner/work/opencast_opensearch/opencast_opensearch/molecule/default
version: v0.1.0
6 changes: 2 additions & 4 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@
opencast_version_major: 17
opencast_repository_enabled_release: true
opencast_opensearch_heap_size: 100m
tasks:
- name: Include opensearch role
ansible.builtin.include_role:
name: "opencast_opensearch"
roles:
- elan.opencast_opensearch
2 changes: 1 addition & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ driver:
name: containers
dependency:
name: galaxy
enabled: false
enabled: true
platforms:
# GH Action for EL8 fails
# - name: el8
Expand Down
3 changes: 3 additions & 0 deletions molecule/default/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
- name: elan.opencast_repository
version: v0.1.0
5 changes: 0 additions & 5 deletions requirements.yml

This file was deleted.

0 comments on commit 8102452

Please sign in to comment.