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:
|
vars:
|
||||||
|
ansible_lint_vers : "6.13.1"
|
||||||
ansible_lint_venv : /tmp/ansible-lint-venv
|
ansible_lint_venv : /tmp/ansible-lint-venv
|
||||||
git_repo_to_lint : https://gitea.thezengarden.net/chris/ansible-lint-poc.git
|
git_repo_to_lint : https://gitea.thezengarden.net/chris/ansible-lint-poc.git
|
||||||
lint_work_dir : /tmp/lint_repository
|
lint_work_dir : /tmp/lint_repository
|
||||||
@ -25,7 +26,7 @@
|
|||||||
state: present
|
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:
|
ansible.builtin.command:
|
||||||
cmd: dnf config-manager --disable crb
|
cmd: dnf config-manager --disable crb
|
||||||
changed_when: true
|
changed_when: true
|
||||||
@ -33,7 +34,7 @@
|
|||||||
|
|
||||||
- name: Create VirtualEnv and Install ansible-lint
|
- name: Create VirtualEnv and Install ansible-lint
|
||||||
ansible.builtin.pip:
|
ansible.builtin.pip:
|
||||||
name: ansible-lint==6.22.0
|
name: "ansible-lint=={{ ansible_lint_vers }}"
|
||||||
virtualenv: "{{ ansible_lint_venv }}"
|
virtualenv: "{{ ansible_lint_venv }}"
|
||||||
virtualenv_python: python3.9
|
virtualenv_python: python3.9
|
||||||
|
|
||||||
@ -74,9 +75,19 @@
|
|||||||
version: main
|
version: main
|
||||||
|
|
||||||
|
|
||||||
- name: Clone target repository into
|
- name: Test Ansible Lint - Playbooks/Roles
|
||||||
ansible.builtin.pause:
|
ansible.builtin.command:
|
||||||
seconds: 30
|
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
|
- name: Cleanup repository destination
|
||||||
|
Loading…
x
Reference in New Issue
Block a user