Skip to content

Commit

Permalink
fix: ignore var prefix linting errors for called modules
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwillsher committed Sep 12, 2024
1 parent 4bcaba2 commit ae7b231
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exclude_paths:
- .tox/
- .markdownlint.yaml
skip_list:
- var-naming[no-role-prefix]
- meta-runtime[unsupported-version]
- experimental
mock_roles:
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
### USER OPTIONS
# Set to false to disable this role completely
sshd_enable: true
Expand Down
6 changes: 3 additions & 3 deletions tasks/firewall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ansible.builtin.include_role:
name: fedora.linux_system_roles.firewall
vars:
firewall:
firewall: # noqa: var-naming[no-role-prefix]
- service: ssh
state: enabled
when:
Expand All @@ -15,11 +15,11 @@
ansible.builtin.include_role:
name: fedora.linux_system_roles.firewall
vars:
firewall:
firewall: # noqa: var-naming[no-role-prefix]
- port: "{{ sshd_item }}/tcp"
state: enabled
loop: "{{ __sshd_ports_from_config | from_json | d([]) }}"
loop_control:
loop_var: sshd_item # avoid conflicts with the firewall loops
loop_var: sshd_item # avoid conflicts with the firewall loops
when:
- __sshd_ports_from_config | from_json != [22]
4 changes: 2 additions & 2 deletions tests/tests_firewall_selinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
ansible.builtin.include_role:
name: fedora.linux_system_roles.firewall
vars:
firewall:
firewall: # noqa: var-naming[no-role-prefix]
- port: "222/tcp"
state: disabled
when: __sshd_test_firewall
Expand All @@ -133,7 +133,7 @@
ansible.builtin.include_role:
name: fedora.linux_system_roles.selinux
vars:
selinux:
selinux: # noqa: var-naming[no-role-prefix]
port: 222
proto: tcp
setype: ssh_port_t
Expand Down
1 change: 1 addition & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
__sshd_config_file: "/etc/ssh/sshd_config"
__sshd_config_owner: "root"
__sshd_config_group: "root"
Expand Down

0 comments on commit ae7b231

Please sign in to comment.