Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ansible lint for SLE platforms #11911

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -6,7 +6,7 @@

- name: {{{ rule_title }}} - Set List of Mount Points Which Permits Execution of Privileged Commands
ansible.builtin.set_fact:
privileged_mount_points: "{{(ansible_facts.mounts | rejectattr('options', 'search', 'noexec|nosuid') | rejectattr('mount', 'match', '/proc($|/.*$)') | map(attribute='mount') | list ) }}"
privileged_mount_points: "{{ (ansible_facts.mounts | rejectattr('options', 'search', 'noexec|nosuid') | rejectattr('mount', 'match', '/proc($|/.*$)') | map(attribute='mount') | list ) }}"

- name: {{{ rule_title }}} - Search for Privileged Commands in Eligible Mount Points
ansible.builtin.shell:
Expand Down
Expand Up @@ -6,5 +6,5 @@

{{{ ansible_instantiate_variables("var_accounts_passwords_pam_tally2_unlock_time") }}}

{{{ ansible_ensure_pam_module_option('/etc/pam.d/login', 'auth', 'required', 'pam_tally2.so', 'unlock_time', "{{var_accounts_passwords_pam_tally2_unlock_time}}", '') }}}
{{{ ansible_ensure_pam_module_option('/etc/pam.d/login', 'auth', 'required', 'pam_tally2.so', 'unlock_time', "{{ var_accounts_passwords_pam_tally2_unlock_time }}", '') }}}
{{{ ansible_ensure_pam_module_option('/etc/pam.d/common-account', 'account', 'required', 'pam_tally2.so', '', '', '') }}}
Expand Up @@ -16,7 +16,7 @@
{{% if 'sle' in product %}}
- name: "{{{ rule_title }}} - Ensure Repositories Are Updated"
ansible.builtin.command: zypper -q --no-remote ref
ignore_errors: True
failed_when: false
{{% endif %}}

- name: "{{{ rule_title }}} - Ensure AIDE Is Installed"
Expand Down
Expand Up @@ -23,5 +23,5 @@
value: '1'
no_extra_spaces: True
# regex filters grep output for files ending in .repo and matching section names.
loop: "{{ repo_grep_results.stdout |regex_findall( '(.+\\.repo):\\[(.+)\\]\\n?' ) if repo_grep_results is not skipped else []}}"
loop: "{{ repo_grep_results.stdout |regex_findall( '(.+\\.repo):\\[(.+)\\]\\n?' ) if repo_grep_results is not skipped else [] }}"
when: repo_grep_results is not skipped
Expand Up @@ -25,7 +25,7 @@
ansible.builtin.shell: |
{{%- if not 'debian' in product %}}
set -o pipefail{{% endif %}}
awk '/)/{f=0} /include\(/{f=1} f{nf=gensub("^(include\\(|\\s*)file=\"(\\S+)\".*","\\2",1); if($0!=nf){print nf}}' {{ rsyslog_etc_config }} || true
awk '/)/{f=0} /include\(/{f=1} f{ nf=gensub("^(include\\(|\\s*)file=\"(\\S+)\".*","\\2",1); if($0!=nf){ print nf }}' {{ rsyslog_etc_config }} || true
register: rsyslog_new_inc
changed_when: False

Expand Down