Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ exclude_paths:
- molecule/ext # since this is a subtree, linting should be taken care of upstream
- molecule/*/extra_prepare.yml # these are included with 'include_tasks' and hence do not validate as playbooks
- docker-compose.yml
- molecule/*/.env.yml
skip_list:
- role-name
- var-naming
24 changes: 20 additions & 4 deletions .github/workflows/ansible_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,25 @@ jobs:
build:
name: Ansible Lint # Naming the build is important to use it as a status check
runs-on: ubuntu-latest
env:
VIRTUAL_ENV: ${{ github.workspace }}/.venv
steps:
- uses: actions/checkout@v4
- name: Run ansible-lint
uses: ansible/ansible-lint@main
- name: Set Up Python
uses: actions/setup-python@v7
with:
args: "."
python-version: '3.12'

- name: Set up UV and caching
uses: astral-sh/setup-uv@v9.0.0
with:
enable-cache: true

- uses: actions/checkout@v7
- name: Install Dependencies
run: |
uv venv $VIRTUAL_ENV
uv pip install ansible-lint

- name: Run Ansible Lint
run: |
uv run ansible-lint .
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ Additionally, you can create multiple test *scenarios*, in order to test the exe

This repository contains some Molecule configuration files in `molecule/ext/molecule-src`. This setup is geared towards testing ResearchCloud components. It configures default container images, and [mimics certain other features of ResearchCloud workspaces](https://github.com/UtrechtUniversity/SRC-molecule#scenarios).

**Note: for `molecule` to run correctly, the path to the component playbook should be correctly set in `molecule/default/molecule.yml! It defaults to the default `playbook.yml`, but if you rename this file, be sure to change in the `molecule.yml`, too.**
**Note: for `molecule` to run correctly, the path to the component playbook should be correctly set in `molecule/default/.env.yml`! It defaults to the default `playbook.yml`, but if you rename this file, be sure to change in the `molecule.yml`, too.**

**Note: parameters that should be passed to your playbook by molecule should be set in `molecule/default/.env.yml`!**

To run `molecule`:

Expand Down
5 changes: 5 additions & 0 deletions molecule/default/.env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
components:
- name: test_component
path: playbook.yml
parameters:
# Add parameters that you expect to be set in the ResearchCloud portal
17 changes: 9 additions & 8 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
provisioner:
name: ansible
env:
components:
- name: test_component
path: playbook.yml
parameters:
# Add parameters that you expect to be set in the ResearchCloud portal
driver:
name: podman
platforms:
- name: workspace-src-ubuntu_jammy
image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_noble-nginx # you can optionally change to a non-nginx image
command: /sbin/init
pre_build_image: true
published_ports: # this is not necessary if not testing against nginx
- 8080:80
Loading