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