Applied ansible-lint fixes

This commit is contained in:
Sonny Bakker 2026-01-16 10:20:25 +01:00
parent 24b567fc57
commit 347104529f
20 changed files with 239 additions and 220 deletions

View file

@ -1,65 +1,66 @@
- name: 'check for {{ item.binary }} binary'
command: 'which {{ item.binary }}'
---
- name: "Check for {{ item.binary }} binary"
ansible.builtin.command: "which {{ item.binary }}"
changed_when: false
failed_when: python_installed.rc not in [ 0, 1 ]
register: python_installed
- name: 'check for {{ item.binary }} download'
stat:
path: '{{ python_build_dir }}/python-{{ item.version }}.tgz'
- name: "Check for {{ item.binary }} download"
ansible.builtin.stat:
path: "{{ python_build_dir }}/python-{{ item.version }}.tgz"
register: python_download
- block:
- when: python_installed.rc not in [ 0 ]
block:
# TODO: verify for checksum
- name: 'retrieve python {{ item.version }} source'
- name: "Retrieve python {{ item.version }} source"
become: true
get_url:
url: '{{ python_download_url }}/{{ item.version }}/Python-{{ item.version }}.tgz'
dest: '{{ python_build_dir }}/python-{{ item.version }}.tgz'
owner: '{{ ansible_user_id }}'
group: '{{ ansible_user_id }}'
ansible.builtin.get_url:
url: "{{ python_download_url }}/{{ item.version }}/Python-{{ item.version }}.tgz"
dest: "{{ python_build_dir }}/python-{{ item.version }}.tgz"
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
when: not python_download.stat.exists
- name: 'extract python {{ item.version }} sources'
- name: "Extract python {{ item.version }} sources"
become: true
unarchive:
src: '{{ python_build_dir }}/python-{{ item.version }}.tgz'
dest: '{{ python_build_dir }}'
include: 'Python-{{ item.version }}'
ansible.builtin.unarchive:
src: "{{ python_build_dir }}/python-{{ item.version }}.tgz"
dest: "{{ python_build_dir }}"
include: "Python-{{ item.version }}"
- name: rename source directory
- name: Rename source directory
become: true
ansible.builtin.command: 'mv {{ python_build_dir}}/Python-{{ item.version }} {{ python_build_dir }}/{{ item.path }}'
ansible.builtin.command: "mv {{ python_build_dir}}/Python-{{ item.version }} {{ python_build_dir }}/{{ item.path }}"
- name: set correct permissions
- name: Set correct permissions
become: true
file:
path: '{{ python_build_dir }}/{{ item.path }}'
ansible.builtin.file:
path: "{{ python_build_dir }}/{{ item.path }}"
recurse: true
owner: '{{ ansible_user_id }}'
group: '{{ ansible_user_id }}'
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
state: directory
- name: configure build
ansible.builtin.command: 'sh ./configure --prefix={{ python_install_dir }}/{{ item.path }}'
- name: Configure build
ansible.builtin.command: "sh ./configure --prefix={{ python_install_dir }}/{{ item.path }}"
args:
chdir: '{{ python_build_dir }}/{{ item.path }}/'
chdir: "{{ python_build_dir }}/{{ item.path }}/"
- name: make build
ansible.builtin.command: 'make'
- name: Make build
ansible.builtin.command: "make"
args:
chdir: '{{ python_build_dir }}/{{ item.path }}/'
chdir: "{{ python_build_dir }}/{{ item.path }}/"
- name: install build
- name: Install build
become: true
ansible.builtin.command: 'make install'
ansible.builtin.command: "make install"
args:
chdir: '{{ python_build_dir }}/{{ item.path }}/'
chdir: "{{ python_build_dir }}/{{ item.path }}/"
- name: 'create symlink for python {{ item.version }}'
- name: "Create symlink for python {{ item.version }}"
become: true
file:
src: '{{ python_install_dir }}/{{ item.path }}/bin/{{ item.binary }}'
dest: '/usr/bin/{{ item.binary }}'
ansible.builtin.file:
src: "{{ python_install_dir }}/{{ item.path }}/bin/{{ item.binary }}"
dest: "/usr/bin/{{ item.binary }}"
state: link
when: python_installed.rc not in [ 0 ]