add git clones; made debugging a block

This commit is contained in:
Chris Hammer 2023-11-10 12:56:18 -05:00
parent f99abb7273
commit f5edd6f4a4
2 changed files with 36 additions and 18 deletions

3
.ansible-lint Normal file
View File

@ -0,0 +1,3 @@
skip_list:
- yaml[colons]
- yaml[empty-lines]

View File

@ -5,11 +5,13 @@
vars: vars:
ansible_lint_venv_dir: /tmp/ansible-lint-venv ansible_lint_venv_dir : /tmp/ansible-lint-venv
git_repo_to_lint : https://gitea.thezengarden.net/chris/ansible-lint-poc.git
lint_work_dir : /tmp/repositories
tasks: tasks:
- name: Enable CRB repository for python3-wheel - name: Enable CRB repository for python3-wheel (required by virtualenv)
ansible.builtin.command: ansible.builtin.command:
cmd: dnf config-manager --enable crb cmd: dnf config-manager --enable crb
changed_when: true changed_when: true
@ -30,25 +32,38 @@
virtualenv_python: python3.9 virtualenv_python: python3.9
# - name: Source venv - name: Ansible Lint Debug Information
# ansible.builtin.shell: block:
# cmd: "source {{ ansible_lint_venv_dir }}/bin/activate" - name: Test Ansible Lint - Version
# changed_when: false ansible.builtin.command: "{{ ansible_lint_venv_dir }}/bin/ansible-lint --nocolor --version"
register: r_lint_version
changed_when: false
- name: Test Ansible Lint - Version - name: Test Ansible Lint - Help
ansible.builtin.command: "{{ ansible_lint_venv_dir }}/bin/ansible-lint --nocolor --version" ansible.builtin.command: "{{ ansible_lint_venv_dir }}/bin/ansible-lint --nocolor --help"
register: r_lint_version register: r_lint_help
changed_when: false changed_when: false
- name: Test Ansible Lint - Help - name: Show ansible-lint infos
ansible.builtin.command: "{{ ansible_lint_venv_dir }}/bin/ansible-lint --nocolor --help" ansible.builtin.debug:
register: r_lint_help msg:
changed_when: false - "'ansible-lint --version': {{ r_lint_version['stdout'] }}"
- "'ansible-lint --help': {{ r_lint_help['stdout'] }}"
verbosity: 1
- name: Show ansible-lint infos - name: Create destination for cloned repositories
ansible.builtin.debug: ansible.builtin.file:
msg: "ansible-lint version: {{ r_lint_version['stdout'] }}" path: "{{ lint_work_dir }}"
verbosity: 1 state: directory
mode: "0755"
- name: Clone target repository into
ansible.builtin.git:
repo: "{{ git_repo_to_lint }}"
dest: "{{ lint_work_dir }}"
version: main