diff --git a/templates/venv_activate.j2 b/templates/venv_activate.j2 new file mode 100644 index 0000000..ebc9fba --- /dev/null +++ b/templates/venv_activate.j2 @@ -0,0 +1,4 @@ +#!/bin/bash + +source {{ ansible_lint_venv }}/bin/activate +$@ diff --git a/test-lint-rhel8.yml b/test-lint-rhel8.yml index 7f02414..038f76e 100644 --- a/test-lint-rhel8.yml +++ b/test-lint-rhel8.yml @@ -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