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 support for Noble #15

Merged
merged 6 commits into from
Nov 6, 2024
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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ jobs:
fail-fast: false
matrix:
include:
- distro: debian8
- distro: debian9
- distro: debian10
- distro: ubuntu1604
ansible-version: '>=2.10, <2.11'
- distro: ubuntu1604
- distro: debian11
- distro: debian12
- distro: ubuntu1804
ansible-version: '>=9, <10'
- distro: ubuntu2004
- distro: ubuntu2204
- distro: ubuntu2404

steps:
- name: Check out the codebase
Expand All @@ -65,8 +65,8 @@ jobs:
python-version: '3.x'

- name: Install test dependencies
run: pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker

run: |
pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker
- name: Run Molecule tests
run: |
molecule test
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@
[![CI](https://github.com/Oefenweb/ansible-pip/workflows/CI/badge.svg)](https://github.com/Oefenweb/ansible-pip/actions?query=workflow%3ACI)
[![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-pip-blue.svg)](https://galaxy.ansible.com/Oefenweb/pip)

Set up (the latest version of) [pip](https://pypi.python.org/pypi/pip), [wheel](https://packaging.python.org/key_projects/#wheel) and [setuptools](https://packaging.python.org/key_projects/#setuptools) in Debian-like systems.
Set up (the latest version of) [pip](https://pypi.python.org/pypi/pip) in Debian-like systems.

#### Requirements

* `python(2|3)` (will be installed)
* `python(2|3)-dev` (will be installed)
* `curl` (will be installed)

when using `pip_install_method: get-pip`

#### Variables

* `pip_python_version_major` [default: `2`]: Python version to install `pip` for.
* `pip_python_version` [default: `pip_python_version`]: Deprecated
* `pip_install_method`: [default: `native`]: The way to install `pip` (e.g. `native` (from Ubuntu/Debian repo) or `get-pip`, `< 24.04` only)

* `pip_python_version_major` [default: `3`]: Python version to install `pip` for

* `pip_install`: [default: `[]`]: Additional packages to install

## Dependencies

Expand Down
39 changes: 23 additions & 16 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
role = File.basename(File.expand_path(File.dirname(__FILE__)))

boxes = [
{
:name => "ubuntu-1604",
:box => "bento/ubuntu-16.04",
:ip => '10.0.0.12',
:cpu => "50",
:ram => "256"
},
{
:name => "ubuntu-1804",
:box => "bento/ubuntu-18.04",
Expand All @@ -23,21 +16,21 @@ boxes = [
:box => "bento/ubuntu-20.04",
:ip => '10.0.0.14',
:cpu => "50",
:ram => "384"
:ram => "512"
},
{
:name => "debian-8",
:box => "bento/debian-8",
:ip => '10.0.0.16',
:name => "ubuntu-2204",
:box => "bento/ubuntu-22.04",
:ip => '10.0.0.15',
:cpu => "50",
:ram => "256"
:ram => "512"
},
{
:name => "debian-9",
:box => "bento/debian-9",
:ip => '10.0.0.17',
:name => "ubuntu-2404",
:box => "bento/ubuntu-24.04",
:ip => '10.0.0.16',
:cpu => "50",
:ram => "256"
:ram => "512"
},
{
:name => "debian-10",
Expand All @@ -46,6 +39,20 @@ boxes = [
:cpu => "50",
:ram => "256"
},
{
:name => "debian-11",
:box => "bento/debian-11",
:ip => '10.0.0.19',
:cpu => "50",
:ram => "256"
},
{
:name => "debian-12",
:box => "bento/debian-12",
:ip => '10.0.0.20',
:cpu => "50",
:ram => "384"
},
]

Vagrant.configure("2") do |config|
Expand Down
8 changes: 7 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# defaults file
---
pip_python_version_major: 2
pip_install_method: native
# Only available for < 24.04
# pip_install_method: get-pip

pip_python_version_major: 3
pip_python_version: "{{ pip_python_version_major }}"

pip_install: []
10 changes: 5 additions & 5 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# meta file
---
galaxy_info:
namespace: oefenweb
author: oefenweb
role_name: pip
author: Mischa ter Smitten
company: Oefenweb.nl B.V.
description: Set up (the latest version of) pip, setuptools and wheel in Debian-like systems
license: MIT
min_ansible_version: 2.10.0
platforms:
- name: Ubuntu
versions:
- xenial
- bionic
- focal
- jammy
- noble
- name: Debian
versions:
- jessie
- stretch
- buster
- bullseye
- bookworm
galaxy_tags:
- development
- system
Expand Down
6 changes: 1 addition & 5 deletions molecule/default/collections.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
---
collections:
- name: community.docker
version: '>=1.2.0,<2'
- name: community.general
version: '>=2,<3'
collections: []
2 changes: 1 addition & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu1604}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand Down
113 changes: 113 additions & 0 deletions tasks/install-get-pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# tasks file
---
- name: install | get-pip | install dependencies

Check warning on line 3 in tasks/install-get-pip.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.apt:
name: "{{ pip_install_get_pip_dependencies }}"
state: "{{ apt_install_state | default('latest') }}"
update_cache: true
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}"
tags:
- pip-install-get-pip-dependencies

- name: install | get-pip | create (download) directory

Check warning on line 12 in tasks/install-get-pip.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.file:
path: "{{ pip_install_get_pip_download_path }}"
state: directory
owner: root
group: root
mode: 0755
tags:
- pip-install-get-pip-directory

- name: install | get-pip | get python version # noqa risky-shell-pipe

Check warning on line 22 in tasks/install-get-pip.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.shell: >
python{{ pip_python_version_major | string }} --version 2>&1 | awk '{print $2}'
register: _python_version
changed_when: false
tags:
- pip-install-get-pip-get-python-version

- name: install | get-pip | get download url

Check warning on line 30 in tasks/install-get-pip.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
tags:
- pip-install-get-pip-get-download-url
block:
- name: install | get-pip | get download url (2.6)

Check warning on line 34 in tasks/install-get-pip.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/2.6/get-pip.py'
when:
- _python_version.stdout is version('2.6', '>=')
- _python_version.stdout is version('2.7', '<')

- name: install | get-pip | get download url (2.7)

Check warning on line 41 in tasks/install-get-pip.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/2.7/get-pip.py'
when:
- _python_version.stdout is version('2.7', '>=')
- _python_version.stdout is version('2.8', '<')

- name: install | get-pip | get download url (3.2)

Check warning on line 48 in tasks/install-get-pip.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/3.2/get-pip.py'
when:
- _python_version.stdout is version('3.2', '>=')
- _python_version.stdout is version('3.3', '<')

- name: install | get-pip | get download url (3.3)

Check warning on line 55 in tasks/install-get-pip.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/3.3/get-pip.py'
when:
- _python_version.stdout is version('3.3', '>=')
- _python_version.stdout is version('3.4', '<')

- name: install | get-pip | get download url (3.4)
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/3.4/get-pip.py'
when:
- _python_version.stdout is version('3.4', '>=')
- _python_version.stdout is version('3.5', '<')

- name: install | get-pip | get download url (3.5)
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/3.5/get-pip.py'
when:
- _python_version.stdout is version('3.5', '>=')
- _python_version.stdout is version('3.6', '<')

- name: install | get-pip | get download url (3.6)
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/3.6/get-pip.py'
when:
- _python_version.stdout is version('3.6', '>=')
- _python_version.stdout is version('3.7', '<')

- name: install | get-pip | get download url (3.7)
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/3.7/get-pip.py'
when:
- _python_version.stdout is version('3.7', '>=')
- _python_version.stdout is version('3.8', '<')

- name: install | get-pip | get download url (latest)
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/get-pip.py'
when: _python_version.stdout is version('3.8', '>=')

- name: install | get-pip | download (latest)
ansible.builtin.get_url:
url: "{{ pip_download_url }}"
dest: "{{ pip_install_get_pip_download_path }}/{{ pip_download_url | basename }}-{{ pip_python_version_major | string }}"
owner: root
group: root
mode: 0644
force: true
register: _download_latest
tags:
- pip-install-get-pip-download

- name: install | get-pip | install (latest)
ansible.builtin.command: >
python{{ pip_python_version_major | string }} {{ _download_latest.dest }}
when: _download_latest is changed
changed_when: true
tags:
- pip-install-get-pip-install
10 changes: 10 additions & 0 deletions tasks/install-native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# tasks file
---
- name: install | native | dependencies
ansible.builtin.apt:
name: "{{ pip_install_native_dependencies }}"
state: "{{ apt_install_state | default('latest') }}"
update_cache: true
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}"
tags:
- pip-install-native-dependencies
Loading
Loading