add ansible_lint_vers to specify which release to install
add linting on the desired directory; using chdir for testing
This commit is contained in:
parent
85e79659bf
commit
9d311793a3
21
venv.yml
21
venv.yml
@ -5,6 +5,7 @@
|
||||
|
||||
|
||||
vars:
|
||||
ansible_lint_vers : "6.13.1"
|
||||
ansible_lint_venv : /tmp/ansible-lint-venv
|
||||
git_repo_to_lint : https://gitea.thezengarden.net/chris/ansible-lint-poc.git
|
||||
lint_work_dir : /tmp/lint_repository
|
||||
@ -25,7 +26,7 @@
|
||||
state: present
|
||||
|
||||
|
||||
- name: Disable CRB repository as it is no longer neded
|
||||
- name: Disable CRB repository as it is no longer needed
|
||||
ansible.builtin.command:
|
||||
cmd: dnf config-manager --disable crb
|
||||
changed_when: true
|
||||
@ -33,7 +34,7 @@
|
||||
|
||||
- name: Create VirtualEnv and Install ansible-lint
|
||||
ansible.builtin.pip:
|
||||
name: ansible-lint==6.22.0
|
||||
name: "ansible-lint=={{ ansible_lint_vers }}"
|
||||
virtualenv: "{{ ansible_lint_venv }}"
|
||||
virtualenv_python: python3.9
|
||||
|
||||
@ -74,9 +75,19 @@
|
||||
version: main
|
||||
|
||||
|
||||
- name: Clone target repository into
|
||||
ansible.builtin.pause:
|
||||
seconds: 30
|
||||
- name: Test Ansible Lint - Playbooks/Roles
|
||||
ansible.builtin.command:
|
||||
cmd: "{{ ansible_lint_venv }}/bin/ansible-lint --nocolor --format json"
|
||||
chdir: "{{ lint_work_dir }}"
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
register: r_lint_output
|
||||
|
||||
|
||||
- name: Debug r_lint_output
|
||||
ansible.builtin.debug:
|
||||
verbosity: 1
|
||||
var: r_lint_output['stdout']
|
||||
|
||||
|
||||
- name: Cleanup repository destination
|
||||
|
Loading…
x
Reference in New Issue
Block a user