add shell script to execute venv commands through

This commit is contained in:
Chris Hammer 2023-11-10 14:42:09 -05:00
parent 81b88080f5
commit 0bc1123c14
2 changed files with 14 additions and 3 deletions

View File

@ -0,0 +1,4 @@
#!/bin/bash
source {{ ansible_lint_venv }}/bin/activate
$@

View File

@ -28,16 +28,23 @@
virtualenv_python: python3.9
- name: Deploy execution template
ansible.builtin.template:
src: venv_activate.2
dest: "{{ ansible_lint_venv }}/bin/pyvenv.sh"
mode: "0755"
- name: Ansible Lint Debug Information
block:
- name: Test Ansible Lint - Version
ansible.builtin.command: "{{ ansible_lint_venv }}/bin/ansible-lint --nocolor --version"
ansible.builtin.command: "{{ ansible_lint_venv }}/bin/pyvenv.sh ansible-lint --nocolor --version"
register: r_lint_version
changed_when: false
- name: Test Ansible Lint - Help
ansible.builtin.command: "{{ ansible_lint_venv }}/bin/ansible-lint --nocolor --help"
ansible.builtin.command: "{{ ansible_lint_venv }}/bin/pyvenv.sh ansible-lint --nocolor --help"
register: r_lint_help
changed_when: false
@ -66,7 +73,7 @@
- name: Test Ansible Lint - Playbooks/Roles
ansible.builtin.command:
cmd: "{{ ansible_lint_venv }}/bin/ansible-lint --nocolor --format json"
cmd: "{{ ansible_lint_venv }}/bin/pyvenv.sh ansible-lint --nocolor --format json"
chdir: "{{ lint_work_dir }}"
ignore_errors: true
changed_when: false