Skip to content

Commit

Permalink
Ansible-lint: Refactor ansible-lint rules (#127)
Browse files Browse the repository at this point in the history
Partly osism/issues#496

Signed-off-by: Ramona Beermann <ramona.beermann@osism.tech>
  • Loading branch information
ra-beer committed Jun 23, 2023
1 parent e40aae7 commit a9a29d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 1 addition & 5 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ use_default_rules: true
rulesdir:
- ./.ansible-lint-rules/
skip_list:
- parser-error # AnsibleParserError.
- var-spacing # Variables should have spaces before and after: {{ var_name }}.
- fqcn-builtins
- yaml
- args[module]
- yaml # We use yamllint
# DO NOT DELETE THE WARNLIST! It is required for our custom rules!
# If this isn't there our custom rules will only through a warning and wont generate a failure!:
warn_list:
Expand Down
6 changes: 5 additions & 1 deletion files/ansible/playbooks/import-netbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
when: "item != 'localhost'"
ignore_errors: true

- name: Create local config context
- name: Create local config context # noqa: args[module]
netbox.netbox.netbox_device:
netbox_url: "{{ netbox_url }}"
netbox_token: "{{ netbox_token }}"
Expand All @@ -43,6 +43,8 @@
local_context_data: "{{ lookup('file', item.stat.path) | from_yaml }}"
loop: "{{ results.results }}"
when: item.stat.exists
tags:
- skip_ansible_lint

- name: Check inventory host_vars file with short hostnames
ansible.builtin.stat:
Expand All @@ -62,3 +64,5 @@
local_context_data: "{{ lookup('file', item.stat.path) | from_yaml }}"
loop: "{{ results.results }}"
when: item.stat.exists
tags:
- skip_ansible_lint
4 changes: 4 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
collections:
- name: netbox.netbox
source: https://galaxy.ansible.com

0 comments on commit a9a29d5

Please sign in to comment.