Skip to content

Commit

Permalink
Linting Updates
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Williams <[email protected]>
  • Loading branch information
MrSteve81 committed Mar 23, 2023
1 parent 1124d38 commit be906f2
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 76 deletions.
35 changes: 19 additions & 16 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
---

parseable: true
quiet: true
skip_list:
- 'schema'
- 'no-changed-when'
- 'fqcn-builtins'
- 'experimental'
- 'fqcn[action-core]'
- 'fqcn[action]'
- 'name[casing]'
- 'name[template]'
- 'jinja[spacing]'
- 'var-naming' # Older playbook no new release
- '204'
- '305'
- '303'
- '403'
- '306'
- '602'
- 'schema'
- 'no-changed-when'
- 'fqcn-builtins'
- 'experimental'
- 'fqcn[action-core]'
- 'fqcn[action]'
- 'name[casing]'
- 'name[template]'
- 'jinja[spacing]'
- 'var-naming' # Older playbook no new release
- '204'
- '208'
- '305'
- '303'
- '403'
- '306'
- '602'
use_default_rules: true
verbosity: 0
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

44 changes: 24 additions & 20 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
---
ignore: |
tests/
molecule/
.github/
.gitlab-ci.yml
*molecule.yml

# Based on ansible-lint config
extends: default

rules:
indentation:
# Requiring 4 space indentation
spaces: 4
# Requiring consistent indentation within a file, either indented or not
indent-sequences: consistent
truthy: disable
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
line-length: disable
braces: {max-spaces-inside: 1, level: error}
brackets: {max-spaces-inside: 1, level: error}
colons: {max-spaces-after: -1, level: error}
commas: {max-spaces-after: -1, level: error}
comments: disable
comments-indentation: disable
document-start: disable
empty-lines: {max: 3, level: error}
hyphens: {level: error}
indentation:
# Requiring 4 space indentation
spaces: 4
# Requiring consistent indentation within a file, either indented or not
indent-sequences: consistent
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: enable
new-lines:
type: unix
trailing-spaces: enable
truthy:
allowed-values: ['true', 'false']
check-keys: true
5 changes: 3 additions & 2 deletions collections/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---

collections:
- name: community.windows

- name: community.general
- name: community.windows

- name: community.general
4 changes: 3 additions & 1 deletion site.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
- hosts: all

- hosts: all # noqa: name[play]

vars:
is_container: false

Expand Down
4 changes: 2 additions & 2 deletions tasks/cat1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
- "Warning!! You do not have any AV software running"
- "Please enable defender or a 3rd party AV software like McAfee or Symantec"
when:
- win10_00_000045_av_sftw_status.exists == false or
- not win10_00_000045_av_sftw_status.exists or
win10_00_000045_av_sftw_status.services[0].state != "started"

- name: "HIGH | WN10-00-000045 | AUDIT | The Windows 10 system must use an anti-virus program | Warn Count."
ansible.builtin.import_tasks: warning_facts.yml
vars:
warn_control_id: 'WN10-00-000045'
when:
- win10_00_000045_av_sftw_status.exists == false or
- not win10_00_000045_av_sftw_status.exists or
win10_00_000045_av_sftw_status.services[0].state != "started"
when:
- wn10_00_000045
Expand Down
4 changes: 2 additions & 2 deletions tasks/cat2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2267,7 +2267,7 @@
win_regedit:
path: HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main
value: FormSuggest Passwords
data: no
data: no # yamllint disable-line rule:truthy
type: string
when:
- wn10_CC_000245
Expand Down Expand Up @@ -3338,7 +3338,7 @@
- name: "MEDIUM | WN10-SO-000251 | PATCH | Windows 10 must use multifactor authentication for local and network access to privileged and non-privileged accounts. | Warning Message."
debug:
msg: "Warning!! You are not on a domain which means you should configure Windows Hello for sign on options would be suggested based on the organizations needs and capabilities."

- name: "MEDIUM | WN10-SO-000251 | PATCH | Windows 10 must use multifactor authentication for local and network access to privileged and non-privileged accounts. | Warn Count."
ansible.builtin.import_tasks: warning_facts.yml
vars:
Expand Down
2 changes: 1 addition & 1 deletion tasks/cat3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
warn_control_id: 'WN10-CC-000206'
when:
- ansible_windows_domain_member
- win10stig_dodownloadmod_domain != 0 or
- win10stig_dodownloadmod_domain != 0 or
win10stig_dodownloadmod_domain != 1
- win10_displayversion.value == '1507'

Expand Down
4 changes: 2 additions & 2 deletions tasks/warning_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
# the count increases by a value of 1
- name: "NO CONTROL ID | AUDIT | Set fact for manual task warning."
set_fact:
warn_control_list: "{{ warn_control_list }} [{{ warn_control_id }}]"
warn_count: "{{ warn_count | int + 1 }}"
warn_control_list: "{{ warn_control_list }} [{{ warn_control_id }}]"
warn_count: "{{ warn_count | int + 1 }}"
2 changes: 1 addition & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
- hosts: localhost
remote_user: root
roles:
- .
- .

0 comments on commit be906f2

Please sign in to comment.