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 remarks #204

Merged
merged 1 commit into from
Nov 22, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
galaxy_info:
author: "Sebastian Gumprich"
description: 'This Ansible role provides numerous security-related configurations, providing all-round base protection.'
description: 'This role provides numerous security-related configurations, providing all-round base protection.'
company: Hardening Framework Team
license: Apache License 2.0
min_ansible_version: '2.5'
Expand Down
2 changes: 1 addition & 1 deletion tasks/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limit_type: hard
limit_item: core
value: 0
comment: Prevent core dumps for all users. These are usually only needed by developers and may contain sensitive information
comment: Prevent core dumps for all users. These are usually not needed and may contain sensitive information

- name: set 10.hardcore.conf perms to 0400 and root ownership
file:
Expand Down
1 change: 0 additions & 1 deletion tasks/login_defs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
owner: 'root'
group: 'root'
mode: '0444'

3 changes: 1 addition & 2 deletions tasks/modprobe.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: install modprobe to disable filesystems | os-10
package:
name: '{{modprobe_package}}'
name: '{{ modprobe_package }}'
state: 'present'

- name: check if efi is installed
Expand All @@ -21,4 +21,3 @@
owner: 'root'
group: 'root'
mode: '0640'

15 changes: 10 additions & 5 deletions tasks/pam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
apt:
name: 'libpam-modules'
state: 'present'
when: (ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu') and not os_auth_pam_passwdqc_enable and os_auth_retries > 0
when: (ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu') and
not os_auth_pam_passwdqc_enable and os_auth_retries > 0

- name: configure tally2
template:
Expand All @@ -56,25 +57,29 @@
mode: '0644'
owner: 'root'
group: 'root'
when: (ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu') and not os_auth_pam_passwdqc_enable and os_auth_retries > 0
when: (ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu') and
not os_auth_pam_passwdqc_enable and os_auth_retries > 0

- name: delete tally2 when retries is 0
file:
path: '{{ tally2_path }}'
state: 'absent'
when: (ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu') and not os_auth_pam_passwdqc_enable and os_auth_retries == 0
when: (ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu') and
not os_auth_pam_passwdqc_enable and os_auth_retries == 0

- name: remove pam_cracklib, because it does not play nice with passwdqc
yum:
name: '{{ os_packages_pam_cracklib }}'
state: 'absent'
when: (ansible_os_family == 'RedHat' and ansible_distribution_version < '7' and not ansible_distribution == 'Amazon') and os_auth_pam_passwdqc_enable
when: (ansible_os_family == 'RedHat' and ansible_distribution_version < '7' and not ansible_distribution == 'Amazon')
and os_auth_pam_passwdqc_enable

- name: install the package for strong password checking
yum:
name: '{{ os_packages_pam_passwdqc }}'
state: 'present'
when: (ansible_os_family == 'RedHat' and ansible_distribution_version < '7' and not ansible_distribution == 'Amazon') and os_auth_pam_passwdqc_enable
when: (ansible_os_family == 'RedHat' and ansible_distribution_version < '7' and not ansible_distribution == 'Amazon')
and os_auth_pam_passwdqc_enable

- name: remove passwdqc
yum:
Expand Down
6 changes: 4 additions & 2 deletions tasks/sysctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
owner: 'root'
group: 'root'
mode: '0544'
when: ansible_distribution == 'RedHat' or ansible_distribution == 'Fedora' or ansible_distribution == 'CentOS' or ansible_distribution == 'Amazon'
when: ansible_distribution == 'RedHat' or ansible_distribution == 'Fedora' or
ansible_distribution == 'CentOS' or ansible_distribution == 'Amazon'

- name: install initramfs-tools
apt:
Expand Down Expand Up @@ -59,7 +60,8 @@
reload: yes
ignoreerrors: yes
with_dict: '{{ sysctl_rhel_config }}'
when: ((ansible_distribution == 'RedHat' or ansible_distribution == 'Fedora' or ansible_distribution == 'CentOS') and ansible_distribution_major_version < '7') or ansible_distribution == 'Amazon'
when: ((ansible_distribution == 'RedHat' or ansible_distribution == 'Fedora' or ansible_distribution == 'CentOS') and
ansible_distribution_major_version < '7') or ansible_distribution == 'Amazon'

- name: Apply ufw defaults
template:
Expand Down