55 lines
1.8 KiB
YAML
55 lines
1.8 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
---
|
|
- name: Configure ansible_lint
|
|
when:
|
|
- __ansible_lint_configured is undefined or
|
|
not __ansible_lint_configured
|
|
block:
|
|
- name: Set basic variables
|
|
ansible.builtin.set_fact:
|
|
ansible_lint_version: "{{ ansible_lint_version | default('latest') }}"
|
|
|
|
- name: Set ansible_lint install method
|
|
when:
|
|
- ansible_lint_install_method is undefined
|
|
ansible.builtin.set_fact:
|
|
ansible_lint_install_method: "{% if install_method in ansible_lint_install_methods %}{{ install_method }}{% else %}{{ ansible_lint_install_methods[0] }}{% endif %}"
|
|
|
|
- name: Set pipx pkgnname
|
|
when:
|
|
- ansible_lint_install_method == 'pipx' or
|
|
ansible_lint_install_method == 'system_pip'
|
|
ansible.builtin.set_fact:
|
|
ansible_lint_pkgname: "{{ 'ansible_lint' if ansible_lint_version == 'latest' else 'ansible-lint==' ~ ansible_lint_version }}"
|
|
|
|
- name: Set package name
|
|
when:
|
|
- install_method == 'system'
|
|
ansible.builtin.set_fact:
|
|
ansible_lint_pkgname:
|
|
RedHat: ansible-lint
|
|
Debian: ansible-lint
|
|
Archlinux: ansible-lint
|
|
Alpine: ansible-lint
|
|
FreeBSD: py311-ansible-lint
|
|
|
|
- name: Complete ansible_lint configuration
|
|
ansible.builtin.set_fact:
|
|
__ansible_lint_configured: true
|
|
|
|
- name: Add ansible_lint to pipx install list
|
|
when:
|
|
- ansible_lint_install_method == 'pipx'
|
|
ansible.builtin.set_fact:
|
|
pkg_pipx: "{{ pkg_pipx + [ansible_lint_pkgname] }}"
|
|
|
|
- name: Add ansible_lint to system_pip install list
|
|
when:
|
|
- ansible_lint_install_method == 'system_pip'
|
|
|
|
- name: Append ansible-lint to system install list
|
|
when:
|
|
- ansible_lint_install_method == 'system'
|
|
ansible.builtin.set_fact:
|
|
pkg_sys: "{{ pkg_sys + [ansible_lint_pkgname[ansible_os_family]] }}"
|