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

add more sysctl settings, allow overwriting #120

Merged
merged 4 commits into from
Jun 27, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion tasks/rhosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

- name: delete rhosts-files from system | DTAG SEC Req 3.21-4
file: dest='~{{ item }}/.rhosts' state=absent
with_items: '{{ users.stdout_lines | default(omit) }}'
with_items: '{{ users.stdout_lines | default() }}'

- name: delete hosts.equiv from system | DTAG SEC Req 3.21-4
file: dest='/etc/hosts.equiv' state=absent
2 changes: 1 addition & 1 deletion tasks/suid_sgid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
- name: remove suid/sgid bit from all binaries except in system and user whitelist
file: path='{{item}}' mode='a-s' state=file follow=yes
with_items:
- '{{ suid | default(omit) | difference(os_security_suid_sgid_whitelist) }}'
- '{{ suid | default() | difference(os_security_suid_sgid_whitelist) }}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case better use with_flattened and default([]) :) Similar goes with the other uses of default in with_items.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated it!

when: os_security_suid_sgid_remove_from_unknown
2 changes: 1 addition & 1 deletion tasks/sysctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

- name: create a combined sysctl-dict if overwrites are defined
set_fact: sysctl_config="{{ sysctl_config | combine(sysctl_overwrite) }}"
when: sysctl_overwrite | default(omit)
when: sysctl_overwrite | default()

- name: Change various sysctl-settings, look at the sysctl-vars file for documentation
sysctl:
Expand Down
2 changes: 1 addition & 1 deletion tasks/user_accounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
- name: change system accounts not on the user provided ignore-list
user: name='{{item}}' shell='{{os_nologin_shell_path}}' password='*'
with_items:
- '{{sys_accs_cond | default(omit) | difference(os_ignore_users) | list }}'
- '{{sys_accs_cond | default() | difference(os_ignore_users) | list }}'