adjusting variable names, fixing errors
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_version: "{{ ansible_lint_version | default('latest') }}"
|
||||
ansible_lint:
|
||||
install_methods:
|
||||
methods:
|
||||
- source
|
||||
- system
|
||||
pkgname:
|
||||
@@ -28,35 +28,45 @@
|
||||
block:
|
||||
- name: Set ansible_lint install method
|
||||
when:
|
||||
- ansible_lint_install_method is undefined
|
||||
- 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_install_method: source
|
||||
ansible_lint_imethod: source
|
||||
|
||||
- name: Fallback set ansible_lint install method
|
||||
when:
|
||||
- ansible_lint_install_method is undefined
|
||||
- ansible_lint_imethod is undefined
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_install_method: "{{ install_method if install_method in ansible_lint.install_methods else ansible_lint.install_methods[0] }}"
|
||||
ansible_lint_imethod: "{{ imethod if imethod in ansible_lint.methods else ansible_lint.methods[0] }}"
|
||||
|
||||
- name: Configure pipx source install
|
||||
when:
|
||||
- ansible_lint_install_method == "source"
|
||||
- ansible_lint_imethod == "source"
|
||||
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'] }}"
|
||||
|
||||
- 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]] }}"
|
||||
- ansible_lint_imethod == 'system'
|
||||
block:
|
||||
- name: Queue ansible_lint system install
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + [ansible_lint_pkgname[os_family]] }}"
|
||||
|
||||
- name: Finalise ansible_lint system install
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_install: "{{ ansible_lint_imethod }}={{ ansible_lint.pkgname[os_family] }}"
|
||||
|
||||
- name: Complete ansible_lint configuration
|
||||
ansible.builtin.set_fact:
|
||||
__configured: "{{ __configured | combine( { 'ansible_lint': ansible_lint_install_method } ) }}"
|
||||
__configured: "{{ __configured | combine( { 'ansible_lint': ansible_lint_install } ) }}"
|
||||
|
||||
Reference in New Issue
Block a user