Skip to content

Commit

Permalink
Merge pull request #23 from gforcada/update-scaffolding
Browse files Browse the repository at this point in the history
Update scaffolding
  • Loading branch information
gforcada committed Feb 6, 2024
2 parents e059320 + 7250e16 commit 23af68b
Show file tree
Hide file tree
Showing 12 changed files with 359 additions and 183 deletions.
3 changes: 3 additions & 0 deletions .ansible-lint-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file contains ignores rule violations for ansible-lint
tasks/python_generic.yml name[template]
tasks/venv.yml name[template]
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI
on:
pull_request:
push:
branches:
- master
- main

jobs:

yaml:
name: YAML syntax Lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v4

- name: Set up Python 3.
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install test dependencies.
run: pip3 install yamllint

- name: Lint code.
run: |
yamllint */*.yml
playbook:
name: ansible-playbook lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v4

- name: Set up Python 3.
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install test dependencies.
run: pip3 install ansible

- name: Lint code.
run: |
ansible-playbook --syntax-check ansible.yml
ansible-lint:
name: ansible-lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v4

- name: Set up Python 3.
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install test dependencies.
run: pip3 install ansible-lint

- name: Lint code.
run: |
ansible-lint .
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

42 changes: 24 additions & 18 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ venv_versions:
# fine grained settings
##
base_install_folder: "/srv"
ftp_url: "https://www.python.org/ftp/python"
pkg_url: "https://files.pythonhosted.org/packages"

py24:
version: "{{ versions.py24 }}"
major_version: "2.4"
url: "https://www.python.org/ftp/python/{{ versions.py24 }}/Python-{{ versions.py24 }}.tar.bz2"
url: "{{ ftp_url }}/{{ versions.py24 }}/Python-{{ versions.py24 }}.tar.bz2"
md5: "{{ hashes.py24 }}"
tar_file: "/tmp/py{{ versions.py24 }}.tar.bz2"
sources: "/tmp/Python-{{ versions.py24 }}"
Expand All @@ -79,7 +81,7 @@ py24:
py26:
version: "{{ versions.py26 }}"
major_version: "2.6"
url: "https://www.python.org/ftp/python/{{ versions.py26 }}/Python-{{ versions.py26 }}.tar.xz"
url: "{{ ftp_url }}/{{ versions.py26 }}/Python-{{ versions.py26 }}.tar.xz"
md5: "{{ hashes.py26 }}"
tar_file: "/tmp/py{{ versions.py26 }}.tar.xz"
sources: "/tmp/Python-{{ versions.py26 }}"
Expand All @@ -89,7 +91,7 @@ py26:
py27:
version: "{{ versions.py27 }}"
major_version: "2.7"
url: "https://www.python.org/ftp/python/{{ versions.py27 }}/Python-{{ versions.py27 }}.tar.xz"
url: "{{ ftp_url }}/{{ versions.py27 }}/Python-{{ versions.py27 }}.tar.xz"
md5: "{{ hashes.py27 }}"
tar_file: "/tmp/py{{ versions.py27 }}.tar.xz"
sources: "/tmp/Python-{{ versions.py27 }}"
Expand All @@ -99,7 +101,7 @@ py27:
py31:
version: "{{ versions.py31 }}"
major_version: "3.1"
url: "https://www.python.org/ftp/python/{{ versions.py31 }}/Python-{{ versions.py31 }}.tar.xz"
url: "{{ ftp_url }}/{{ versions.py31 }}/Python-{{ versions.py31 }}.tar.xz"
md5: "{{ hashes.py31 }}"
tar_file: "/tmp/py{{ versions.py31 }}.tar.xz"
sources: "/tmp/Python-{{ versions.py31 }}"
Expand All @@ -109,7 +111,7 @@ py31:
py32:
version: "{{ versions.py32 }}"
major_version: "3.2"
url: "https://www.python.org/ftp/python/{{ versions.py32 }}/Python-{{ versions.py32 }}.tar.xz"
url: "{{ ftp_url }}/{{ versions.py32 }}/Python-{{ versions.py32 }}.tar.xz"
md5: "{{ hashes.py32 }}"
tar_file: "/tmp/py{{ versions.py32 }}.tar.xz"
sources: "/tmp/Python-{{ versions.py32 }}"
Expand All @@ -119,7 +121,7 @@ py32:
py33:
version: "{{ versions.py33 }}"
major_version: "3.3"
url: "https://www.python.org/ftp/python/{{ versions.py33 }}/Python-{{ versions.py33 }}.tar.xz"
url: "{{ ftp_url }}/{{ versions.py33 }}/Python-{{ versions.py33 }}.tar.xz"
md5: "{{ hashes.py33 }}"
tar_file: "/tmp/py{{ versions.py33 }}.tar.xz"
sources: "/tmp/Python-{{ versions.py33 }}"
Expand All @@ -129,7 +131,7 @@ py33:
py34:
version: "{{ versions.py34 }}"
major_version: "3.4"
url: "https://www.python.org/ftp/python/{{ versions.py34 }}/Python-{{ versions.py34 }}.tar.xz"
url: "{{ ftp_url }}/{{ versions.py34 }}/Python-{{ versions.py34 }}.tar.xz"
md5: "{{ hashes.py34 }}"
tar_file: "/tmp/py{{ versions.py34 }}.tar.xz"
sources: "/tmp/Python-{{ versions.py34 }}"
Expand All @@ -139,7 +141,7 @@ py34:
py35:
version: "{{ versions.py35 }}"
major_version: "3.5"
url: "https://www.python.org/ftp/python/{{ versions.py35 }}/Python-{{ versions.py35 }}.tar.xz"
url: "{{ ftp_url }}/{{ versions.py35 }}/Python-{{ versions.py35 }}.tar.xz"
md5: "{{ hashes.py35 }}"
tar_file: "/tmp/py{{ versions.py35 }}.tar.xz"
sources: "/tmp/Python-{{ versions.py35 }}"
Expand All @@ -149,7 +151,7 @@ py35:
py36:
version: "{{ versions.py36 }}"
major_version: "3.6"
url: "https://www.python.org/ftp/python/{{ versions.py36 }}/Python-{{ versions.py36 }}.tar.xz"
url: "{{ ftp_url }}/{{ versions.py36 }}/Python-{{ versions.py36 }}.tar.xz"
md5: "{{ hashes.py36 }}"
tar_file: "/tmp/py{{ versions.py36 }}.tar.xz"
sources: "/tmp/Python-{{ versions.py36 }}"
Expand All @@ -159,7 +161,7 @@ py36:
py37:
version: "{{ versions.py37 }}"
major_version: "3.7"
url: "https://www.python.org/ftp/python/{{ versions.py37 }}/Python-{{ versions.py37 }}.tar.xz"
url: "{{ ftp_url }}/{{ versions.py37 }}/Python-{{ versions.py37 }}.tar.xz"
md5: "{{ hashes.py37 }}"
tar_file: "/tmp/py{{ versions.py37 }}.tar.xz"
sources: "/tmp/Python-{{ versions.py37 }}"
Expand All @@ -169,7 +171,7 @@ py37:
py38:
version: "{{ versions.py38 }}"
major_version: "3.8"
url: "https://www.python.org/ftp/python/{{ versions.py38 }}/Python-{{ versions.py38 }}.tar.xz"
url: "{{ ftp_url }}/{{ versions.py38 }}/Python-{{ versions.py38 }}.tar.xz"
md5: "{{ hashes.py38 }}"
tar_file: "/tmp/py{{ versions.py38 }}.tar.xz"
sources: "/tmp/Python-{{ versions.py38 }}"
Expand All @@ -179,7 +181,7 @@ py38:
py39:
version: "{{ versions.py39 }}"
major_version: "3.9"
url: "https://www.python.org/ftp/python/{{ versions.py39 }}/Python-{{ versions.py39 }}.tar.xz"
url: "{{ ftp_url }}/{{ versions.py39 }}/Python-{{ versions.py39 }}.tar.xz"
md5: "{{ hashes.py39 }}"
tar_file: "/tmp/py{{ versions.py39 }}.tar.xz"
sources: "/tmp/Python-{{ versions.py39 }}"
Expand All @@ -189,7 +191,7 @@ py39:
py310:
version: "{{ versions.py310 }}"
major_version: "3.10"
url: "https://www.python.org/ftp/python/{{ versions.py310 }}/Python-{{ versions.py310 }}.tar.xz"
url: "{{ ftp_url }}/{{ versions.py310 }}/Python-{{ versions.py310 }}.tar.xz"
md5: "{{ hashes.py310 }}"
tar_file: "/tmp/py{{ versions.py310 }}.tar.xz"
sources: "/tmp/Python-{{ versions.py310 }}"
Expand All @@ -199,7 +201,7 @@ py310:
py311:
version: "{{ versions.py311 }}"
major_version: "3.11"
url: "https://www.python.org/ftp/python/{{ versions.py311 }}/Python-{{ versions.py311 }}.tar.xz"
url: "{{ ftp_url }}/{{ versions.py311 }}/Python-{{ versions.py311 }}.tar.xz"
md5: "{{ hashes.py311 }}"
tar_file: "/tmp/py{{ versions.py311 }}.tar.xz"
sources: "/tmp/Python-{{ versions.py311 }}"
Expand All @@ -209,30 +211,34 @@ py311:
py312:
version: "{{ versions.py312 }}"
major_version: "3.12"
url: "https://www.python.org/ftp/python/{{ versions.py312 }}/Python-{{ versions.py312 }}.tar.xz"
url: "{{ ftp_url }}/{{ versions.py312 }}/Python-{{ versions.py312 }}.tar.xz"
md5: "{{ hashes.py312 }}"
tar_file: "/tmp/py{{ versions.py312 }}.tar.xz"
sources: "/tmp/Python-{{ versions.py312 }}"
install: "{{ base_install_folder }}/python{{ versions.py312 }}"
bin: "{{ base_install_folder }}/python{{ versions.py312 }}/bin/python3.12"


venv24:
version: "{{ venv_versions.py24 }}"
url: "https://files.pythonhosted.org/packages/16/86/7b88d35d0a353ec70e42aa37fd8b0bd1c643419c80f022ffaafa4d6449f0/virtualenv-1.7.2.tar.gz"
file_hash: "7b88d35d0a353ec70e42aa37fd8b0bd1c643419c80f022ffaafa4d6449f0"
url: "{{ pkg_url }}/16/86/{{ file_hash }}/virtualenv-1.7.2.tar.gz"
md5: "b5d63b05373a4344ae099a68875aae78"
tar_file: "/tmp/virtualenv-{{ venv_versions.py24 }}.tar.gz"
sources: "/tmp/virtualenv-{{ venv_versions.py24 }}"

venv26:
version: "{{ venv_versions.py26 }}"
url: "https://files.pythonhosted.org/packages/d5/5b/f425e456e017af4801bb08920e30c149a44ac0c194f2225bdb712e77701c/virtualenv-1.10.tar.gz"
file_hash: "f425e456e017af4801bb08920e30c149a44ac0c194f2225bdb712e77701c"
url: "{{ pkg_url }}/d5/5b/{{ file_hash }}/virtualenv-1.10.tar.gz"
md5: "9745c28256c70c76d36adb3767a00212"
tar_file: "/tmp/virtualenv-{{ venv_versions.py26 }}.tar.gz"
sources: "/tmp/virtualenv-{{ venv_versions.py26 }}"

venv27:
version: "{{ venv_versions.py27 }}"
url: "https://files.pythonhosted.org/packages/37/27/706af3ee62032933a3217454609c50a5325a6bd9c2c2f495b58c456ba286/virtualenv-16.6.1.tar.gz"
file_hash: "706af3ee62032933a3217454609c50a5325a6bd9c2c2f495b58c456ba286"
url: "{{ pkg_url }}/37/27/{{ file_hash }}/virtualenv-16.6.1.tar.gz"
md5: "b05b03dc6ecb3caaa3d58bfcccf4e786"
tar_file: "/tmp/virtualenv-{{ venv_versions.py27 }}.tar.gz"
sources: "/tmp/virtualenv-{{ venv_versions.py27 }}"
16 changes: 11 additions & 5 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
---

dependencies: []

galaxy_info:
author: Gil Forcada Codinachs
description: Install all dependencies and compile any version of Python
license: BSD
min_ansible_version: 2.2
role_name: compile_python
namespace: gforcada
license: BSD-3-Clause
min_ansible_version: '2.2'
platforms:
- name: Ubuntu
versions:
- trusty
- xenial
dependencies: []
- jammy
galaxy_tags:
- python
- compile
20 changes: 10 additions & 10 deletions tasks/deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

- name: Update APT sources
become: true
apt:
update_cache=yes
ansible.builtin.apt:
update_cache: true

- name: Python deps | Install compile time depdendencies
- name: Dependencies Python | Install compile time depdendencies
become: true
apt:
ansible.builtin.apt:
state: present
name:
- autotools-dev
Expand Down Expand Up @@ -35,9 +35,9 @@
- tk-dev
- zlib1g-dev

- name: Python 3.6 deps | Install compile time dependencies
- name: Dependencies Python 3.6 | Install compile time dependencies
become: true
apt:
ansible.builtin.apt:
state: present
name:
- liblzma-dev
Expand All @@ -47,9 +47,9 @@
# Pillow
##

- name: Pillow deps | Install compile time depdendencies
- name: Dependencies Pillow | Install compile time depdendencies
become: true
apt:
ansible.builtin.apt:
state: present
name:
- cmake
Expand All @@ -66,9 +66,9 @@
# lxml
##

- name: lxml deps | Install compile time dependencies
- name: Dependencies lxml | Install compile time dependencies
become: true
apt:
ansible.builtin.apt:
state: present
name:
- libxml2
Expand Down
Loading

0 comments on commit 23af68b

Please sign in to comment.