34 lines
1.2 KiB
YAML
34 lines
1.2 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
---
|
|
- name: Configure ansible_lint
|
|
when:
|
|
- "'ansible_lint' not in __configured"
|
|
block:
|
|
- name: Set ansible_lint install method
|
|
when:
|
|
- ansible_lint_install_method is undefined
|
|
ansible.builtin.set_fact:
|
|
ansible_lint_install_method: "{{ install_method if install_method in ansible_lint_install_methods else ansible_lint_methods[0] }}"
|
|
|
|
- name: Set pipx pkgnname
|
|
when:
|
|
- ansible_lint_install_method == 'source'
|
|
ansible.builtin.set_fact:
|
|
ansible_lint_pkgname: "{{ ansible_lint_pkgname['pipx'] }}{{ '==' ~ ansible_lint_version if ansible_lint_version != 'latest' }}"
|
|
|
|
- name: Add ansible_lint to pipx install list
|
|
when:
|
|
- ansible_lint_install_method == 'source'
|
|
ansible.builtin.set_fact:
|
|
pkg_pipx: "{{ pkg_pipx + [ansible_lint_pkgname] }}"
|
|
|
|
- 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]] }}"
|
|
|
|
- name: Complete ansible_lint configuration
|
|
ansible.builtin.set_fact:
|
|
__configured: "{{ __configured | combine( { 'ansible_lint': true } ) }}"
|