fix ansible_lint
This commit is contained in:
@@ -8,17 +8,20 @@
|
||||
---
|
||||
- name: Set ansible_lint default facts # {{{
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_version: "{{ ansible_lint_version | default('latest') }}"
|
||||
ansible_lint:
|
||||
methods:
|
||||
- source
|
||||
- system
|
||||
default: [source]
|
||||
Archlinux: [system, source]
|
||||
pkgname:
|
||||
RedHat: ansible-lint
|
||||
Debian: ansible-lint
|
||||
Archlinux: ansible-lint
|
||||
Alpine: ansible-lint
|
||||
default: ansible-lint
|
||||
FreeBSD: py311-ansible-lint
|
||||
|
||||
- name: Finalise ansible_lint default facts
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint:
|
||||
methods: "{{ ansible_lint.methods[os_family] | default(ansible_lint.methods.default) }}"
|
||||
version: "{{ ansible_lint_version | default('latest') }}"
|
||||
pkgname: "{{ ansible_lint.pkgname[os_family] | default(ansible_lint.pkgname.default) }}"
|
||||
pip:
|
||||
name: ansible_lint
|
||||
pkg_deps:
|
||||
@@ -32,14 +35,7 @@
|
||||
when:
|
||||
- ansible_lint_imethod is undefined
|
||||
block:
|
||||
- name: Configure for RedHat <= 10
|
||||
when:
|
||||
- os_family == 'RedHat'
|
||||
- ansible_distribution_major_version|int <= 10
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_imethod: source
|
||||
|
||||
- name: Fallback set ansible_lint install method
|
||||
- name: Set ansible_lint install method
|
||||
when:
|
||||
- ansible_lint_imethod is undefined
|
||||
ansible.builtin.set_fact:
|
||||
@@ -51,11 +47,8 @@
|
||||
block:
|
||||
- name: Add ansible_lint to pipx install list
|
||||
ansible.builtin.set_fact:
|
||||
pkg_pipx: "{{ pkg_pipx + [ansible_lint.pkgname['pip']] }}"
|
||||
|
||||
- name: Finalise ansible_lint source install
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_install: "{{ ansible_lint_imethod }}={{ ansible_lint.pkgname['pip'] }}"
|
||||
pkg_pipx: "{{ pkg_pipx + [ansible_lint.pip.name }}"
|
||||
ansible_lint_install: "{{ ansible_lint_imethod }}={{ ansible_lint.pip.name }}"
|
||||
|
||||
- name: Append ansible-lint to system install list
|
||||
when:
|
||||
|
||||
Reference in New Issue
Block a user