Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add molecule setup for mirsg.infrastructure.install_python #11

Merged
merged 3 commits into from
Dec 13, 2023
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
13 changes: 13 additions & 0 deletions .github/workflows/molecule-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Test Python
on:
pull_request:
paths:
- "roles/install_python/**"
- ".github/workflows/molecule.yml"
- ".github/workflows/molecule-python.yml"

jobs:
molecule-firewalld:
uses: ./.github/workflows/molecule.yml
with:
run-tags: python
18 changes: 1 addition & 17 deletions roles/install_python/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# Ansible Role: mirsg.install_python
# Ansible Role: mirsg.infrastructure.install_python

This role installs Python, pip, and setuptools on Debian and RedHat operating systems. It will also update pip to the latest version or a
user-specified version, and then install user-specified Python packages using pip.

## Requirements

If you would like to run Ansible Molecule to test this role, the requirements are in [`requirements.txt`](https://github.com/UCL-MIRSG/ansible-role-install-python/blob/main/requirements.txt).

## Role Variables

`install_python` is a dictionary that contains the following variables:
Expand All @@ -29,10 +25,6 @@ The packages listed in `install_python.system_packages` will be installed by the

`pip_packages`: list of Python packages to be installed by pip. This defaults to `[]`.

## Dependencies

There are no Ansible-Galaxy dependencies for this role.

## Example Playbook

This role will install Python on a managed host. To used this role, add it to the list of roles in a play:
Expand All @@ -43,11 +35,3 @@ This role will install Python on a managed host. To used this role, add it to th
roles:
- mirsg.install_python
```

## License

[BSD 3-Clause License](https://github.com/UCL-MIRSG/ansible-role-install-python/blob/main/LICENSE).

## Author Information

This role was created by the [Medical Imaging Research Software Group](https://www.ucl.ac.uk/advanced-research-computing/expertise/research-software-development/medical-imaging-research-software-group) at [UCL](https://www.ucl.ac.uk/).
Comment on lines -47 to -53
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing these bits?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they should be in the top-level readme for the Collection instead of readmes for each role

12 changes: 12 additions & 0 deletions tests/molecule/resources/inventory/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ selinux_enabled: false
# mirsg.infrastructure.provision
server_locale: "en_GB.UTF-8"

# mirsg.infrastructure.install_python
install_python:
version: "2"
pip_version: "20.3.4"
pip_executable: "pip"
system_packages:
- python
- python-pip
- python-setuptools
pip_packages:
- cryptography

# mirsg.infrastructure.firewalld
allow_public_access: true
internal_zone_open_services:
Expand Down