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
|
||||
|
||||
|
||||
vars:
|
||||
ansible_lint_venv_dir: /tmp/ansible-lint-venv
|
||||
|
||||
|
||||
tasks:
|
||||
- name: Ensure virtualenv command is present
|
||||
ansible.builtin.package:
|
||||
@ -15,18 +19,23 @@
|
||||
- name: Create VirtualEnv and Install ansible-lint
|
||||
ansible.builtin.pip:
|
||||
name: ansible-lint==6.22.0
|
||||
virtualenv: /tmp/ansible-lint-venv
|
||||
virtualenv_python: python3.6
|
||||
virtualenv: "{{ ansible_lint_venv_dir }}"
|
||||
|
||||
|
||||
# - name: Source venv
|
||||
# ansible.builtin.shell:
|
||||
# cmd: "source {{ ansible_lint_venv_dir }}/bin/activate"
|
||||
# changed_when: false
|
||||
|
||||
|
||||
- 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
|
||||
changed_when: false
|
||||
|
||||
|
||||
- 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
|
||||
changed_when: false
|
||||
|
||||
@ -34,3 +43,4 @@
|
||||
- name: Show ansible-lint infos
|
||||
ansible.builtin.debug:
|
||||
msg: "ansible-lint version: {{ r_lint_version['stdout'] }}"
|
||||
verbosity: 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user