fix ansible_ls
This commit is contained in:
@@ -2,53 +2,32 @@
|
||||
---
|
||||
- name: Configure ansible_lint
|
||||
when:
|
||||
- __ansible_lint_configured is undefined or
|
||||
not __ansible_lint_configured
|
||||
- "'ansible_lint' not in __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 %}"
|
||||
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 == 'pipx' or
|
||||
ansible_lint_install_method == 'system_pip'
|
||||
- ansible_lint_install_method == 'source'
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_pkgname: "{{ 'ansible_lint' if ansible_lint_version == 'latest' else 'ansible-lint==' ~ ansible_lint_version }}"
|
||||
ansible_lint_pkgname: "{{ ansible_lint_pkgname['pipx'] }}{{ '==' ~ ansible_lint_version if ansible_lint_version != 'latest' }}"
|
||||
|
||||
- name: Set package name
|
||||
- name: Add ansible_lint to pipx install list
|
||||
when:
|
||||
- install_method == 'system'
|
||||
- ansible_lint_install_method == 'source'
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_pkgname:
|
||||
RedHat: ansible-lint
|
||||
Debian: ansible-lint
|
||||
Archlinux: ansible-lint
|
||||
Alpine: ansible-lint
|
||||
FreeBSD: py311-ansible-lint
|
||||
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:
|
||||
__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]] }}"
|
||||
__configured: "{{ __configured | combine( { 'ansible_lint': true } ) }}"
|
||||
|
||||
Reference in New Issue
Block a user