add lint venv dir var
ansible-lint references updated to call from venv bin dir
This commit is contained in:
parent
730a7cd893
commit
b3c406b2f4
18
venv.yml
18
venv.yml
@ -5,6 +5,10 @@
|
|||||||
gather_facts: true
|
gather_facts: true
|
||||||
|
|
||||||
|
|
||||||
|
vars:
|
||||||
|
ansible_lint_venv_dir: /tmp/ansible-lint-venv
|
||||||
|
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Ensure virtualenv command is present
|
- name: Ensure virtualenv command is present
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
@ -15,18 +19,23 @@
|
|||||||
- name: Create VirtualEnv and Install ansible-lint
|
- name: Create VirtualEnv and Install ansible-lint
|
||||||
ansible.builtin.pip:
|
ansible.builtin.pip:
|
||||||
name: ansible-lint==6.22.0
|
name: ansible-lint==6.22.0
|
||||||
virtualenv: /tmp/ansible-lint-venv
|
virtualenv: "{{ ansible_lint_venv_dir }}"
|
||||||
virtualenv_python: python3.6
|
|
||||||
|
|
||||||
|
# - name: Source venv
|
||||||
|
# ansible.builtin.shell:
|
||||||
|
# cmd: "source {{ ansible_lint_venv_dir }}/bin/activate"
|
||||||
|
# changed_when: false
|
||||||
|
|
||||||
|
|
||||||
- name: Test Ansible Lint - Version
|
- name: Test Ansible Lint - Version
|
||||||
ansible.builtin.command: /tmp/ansible-lint-venv/bin/ansible-lint --nocolor --version
|
ansible.builtin.command: "{{ ansible_lint_venv_dir }}/bin/ansible-lint --nocolor --version"
|
||||||
register: r_lint_version
|
register: r_lint_version
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
|
|
||||||
- name: Test Ansible Lint - Help
|
- name: Test Ansible Lint - Help
|
||||||
ansible.builtin.command: /tmp/ansible-lint-venv/bin/ansible-lint --nocolor --help
|
ansible.builtin.command: "{{ ansible_lint_venv_dir }}/bin/ansible-lint --nocolor --help"
|
||||||
register: r_lint_help
|
register: r_lint_help
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
@ -34,3 +43,4 @@
|
|||||||
- name: Show ansible-lint infos
|
- name: Show ansible-lint infos
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "ansible-lint version: {{ r_lint_version['stdout'] }}"
|
msg: "ansible-lint version: {{ r_lint_version['stdout'] }}"
|
||||||
|
verbosity: 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user