From f5edd6f4a440a063f09ec16a4a3a9a626c342117 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Fri, 10 Nov 2023 12:56:18 -0500 Subject: [PATCH] add git clones; made debugging a block --- .ansible-lint | 3 +++ venv.yml | 51 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 36 insertions(+), 18 deletions(-) create mode 100644 .ansible-lint diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..279e590 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,3 @@ +skip_list: + - yaml[colons] + - yaml[empty-lines] diff --git a/venv.yml b/venv.yml index 79eb74c..ddcd035 100644 --- a/venv.yml +++ b/venv.yml @@ -5,11 +5,13 @@ 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: - - name: Enable CRB repository for python3-wheel + - name: Enable CRB repository for python3-wheel (required by virtualenv) ansible.builtin.command: cmd: dnf config-manager --enable crb changed_when: true @@ -30,25 +32,38 @@ virtualenv_python: python3.9 - # - name: Source venv - # ansible.builtin.shell: - # cmd: "source {{ ansible_lint_venv_dir }}/bin/activate" - # changed_when: false + - name: Ansible Lint Debug Information + block: + - name: Test Ansible Lint - Version + ansible.builtin.command: "{{ ansible_lint_venv_dir }}/bin/ansible-lint --nocolor --version" + register: r_lint_version + changed_when: false - - name: Test Ansible Lint - Version - ansible.builtin.command: "{{ ansible_lint_venv_dir }}/bin/ansible-lint --nocolor --version" - register: r_lint_version - changed_when: false + - name: Test Ansible Lint - Help + ansible.builtin.command: "{{ ansible_lint_venv_dir }}/bin/ansible-lint --nocolor --help" + register: r_lint_help + changed_when: false - - name: Test Ansible Lint - Help - ansible.builtin.command: "{{ ansible_lint_venv_dir }}/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'] }}" + - "'ansible-lint --help': {{ r_lint_help['stdout'] }}" + verbosity: 1 - - name: Show ansible-lint infos - ansible.builtin.debug: - msg: "ansible-lint version: {{ r_lint_version['stdout'] }}" - verbosity: 1 + - name: Create destination for cloned repositories + ansible.builtin.file: + path: "{{ lint_work_dir }}" + state: directory + mode: "0755" + + + - name: Clone target repository into + ansible.builtin.git: + repo: "{{ git_repo_to_lint }}" + dest: "{{ lint_work_dir }}" + version: main +