37 lines
965 B
YAML
37 lines
965 B
YAML
- name: Test Ansible Lint Formatting via VirtualEnv
|
|
hosts: localhost
|
|
connection: local
|
|
become: true
|
|
gather_facts: true
|
|
|
|
|
|
tasks:
|
|
- name: Ensure virtualenv command is present
|
|
ansible.builtin.dnf:
|
|
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'] }}"
|