Skip to content

Commit bb1ff83

Browse files
Exclude roles symlink from ansibe-lint
Some files in roles dir are excluded from lint check. Adding roles dir symlink in hooks dir is causing lint to check those files too, causing lint job to fail. Excluding that symlink should help. Signed-off-by: Amartya Sinha <[email protected]> Co-Authored-By: Daniel Pawlik <[email protected]>
1 parent 1ea6b9c commit bb1ff83

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

.ansible-lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ exclude_paths:
2222
- roles/kustomize_deploy/molecule/flexible_loop/prepare.yml # import_playbook
2323
- roles/*/molecule/*/side_effect.yml # syntax-check[empty-playbook] https://github.com/ansible/molecule/issues/3617
2424
- roles/ci_multus/molecule/*/nads_output.yml # internal-error due to "---" characters
25+
- hooks/playbooks/roles/
2526
strict: true
2627
quiet: false
2728
verbosity: 1

roles/pcp_metrics/tasks/annotations.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@
2121
register: _annotations_shell
2222

2323
- name: Ensure the output directory exist
24-
file:
24+
ansible.builtin.file:
2525
path: "{{ pcp_metrics_output_dir }}"
2626
state: directory
2727
mode: '0755'
2828

2929
- name: Save annotations
30-
copy:
30+
ansible.builtin.copy:
3131
content: "{{ _annotations_shell.stdout }}"
3232
dest: "{{ pcp_metrics_output_dir }}/annotations.txt"
33+
mode: "0644"

roles/pcp_metrics/tasks/coreos.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
name: baseos
1818
description: BaseOS repository
1919
baseurl: "{{ pcp_repo_url }}/BaseOS/$basearch/os/"
20-
gpgcheck: no
20+
gpgcheck: false
2121

2222
- name: Set repositories (AppStream)
2323
ansible.builtin.yum_repository:
2424
file: pcp-coreos-hack
2525
name: appstream
2626
description: AppStream repository
2727
baseurl: "{{ pcp_repo_url }}/AppStream/$basearch/os/"
28-
gpgcheck: no
28+
gpgcheck: false
2929

3030
- name: Make /usr writable
3131
become: true
@@ -39,3 +39,4 @@
3939
ansible.builtin.file:
4040
path: /var/lib/rpm-state
4141
state: directory
42+
mode: "0750"

roles/pcp_metrics/tasks/gather.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
register: _pmrep
2222

2323
- name: Check if archive exists
24-
stat:
24+
ansible.builtin.stat:
2525
path: "{{ pcp_metrics_archive }}"
2626
register: _pcp_archive
2727

@@ -47,14 +47,15 @@
4747
changed_when: false
4848

4949
- name: Ensure the output directory exist
50-
file:
50+
ansible.builtin.file:
5151
path: "{{ pcp_metrics_output_dir }}"
5252
state: directory
5353
mode: '0755'
5454
delegate_to: localhost
5555

5656
- name: Save the collected metrics to a local file
57-
copy:
57+
ansible.builtin.copy:
5858
content: "{{ _pcp_metrics_pmrep.stdout }}"
5959
dest: "{{ pcp_metrics_output_dir }}/{{ ansible_hostname }}.csv"
60+
mode: "0644"
6061
delegate_to: localhost

0 commit comments

Comments
 (0)