diff --git a/venv.yml b/venv.yml new file mode 100644 index 0000000..7eb7512 --- /dev/null +++ b/venv.yml @@ -0,0 +1,36 @@ +- name: Test Ansible Lint Formatting via VirtualEnv + hosts: localhost + connection: local + become: true + gather_facts: false + + + tasks: + - name: Ensure virtualenv command is present + ansible.builtin.package: + name: virtualenv + state: present + + + - name: Create VirtualEnv and Install ansible-lint + ansible.builtin.pip: + name: ansible-lint==6.22.0 + virtualenv: /tmp/ansible-lint-venv + virtualenv_python: python3 + + + - name: Test Ansible Lint - Version + ansible.builtin.command: /tmp/ansible-lint-venv/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 + register: r_lint_help + changed_when: false + + + - name: Show ansible-lint infos + ansible.builtin.debug: + msg: "ansible-lint version: {{ r_lint_version['stdout'] }}"