Skip to content

Commit f7eac8d

Browse files
authored
Merge pull request #224 from Normo/master
Fix deprecation warnings in Ansible 2.8
2 parents 08ebd3d + bd795c9 commit f7eac8d

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

tasks/apt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
apt:
44
name: '{{ os_security_packages_list }}'
55
state: 'absent'
6-
when: 'os_security_packages_clean'
6+
when: os_security_packages_clean | bool

tasks/hardening.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
- import_tasks: auditd.yml
1717
tags: auditd
18-
when: os_auditd_enabled
18+
when: os_auditd_enabled | bool
1919

2020
- import_tasks: limits.yml
2121
tags: limits
@@ -39,7 +39,7 @@
3939
tags: securetty
4040

4141
- import_tasks: suid_sgid.yml
42-
when: os_security_suid_sgid_enforce
42+
when: os_security_suid_sgid_enforce | bool
4343
tags: suid_sgid
4444

4545
- import_tasks: sysctl.yml

tasks/limits.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
domain: '*'
1616
limit_type: hard
1717
limit_item: core
18-
value: 0
18+
value: '0'
1919
comment: Prevent core dumps for all users. These are usually not needed and may contain sensitive information
2020

2121
- name: set 10.hardcore.conf perms to 0400 and root ownership
@@ -25,10 +25,10 @@
2525
group: 'root'
2626
mode: '0440'
2727

28-
when: 'not os_security_kernel_enable_core_dump'
28+
when: not os_security_kernel_enable_core_dump | bool
2929

3030
- name: remove 10.hardcore.conf config file
3131
file:
3232
path: /etc/security/limits.d/10.hardcore.conf
3333
state: absent
34-
when: 'os_security_kernel_enable_core_dump'
34+
when: os_security_kernel_enable_core_dump | bool

tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22

33
- import_tasks: hardening.yml
4-
when: os_hardening_enabled
4+
when: os_hardening_enabled | bool

tasks/profile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
owner: 'root'
77
group: 'root'
88
mode: '0750'
9-
when: not os_security_kernel_enable_core_dump
9+
when: not os_security_kernel_enable_core_dump | bool
1010

1111
- name: remove pinerolo_profile.sh from profile.d
1212
file:
1313
path: /etc/profile.d/pinerolo_profile.sh
1414
state: absent
15-
when: os_security_kernel_enable_core_dump
15+
when: os_security_kernel_enable_core_dump | bool

tasks/suid_sgid.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
- name: find binaries with suid/sgid set | os-06
1414
shell: find / -xdev \( -perm -4000 -o -perm -2000 \) -type f ! -path '/proc/*' -print 2>/dev/null
1515
register: sbit_binaries
16-
when: os_security_suid_sgid_remove_from_unknown
16+
when: os_security_suid_sgid_remove_from_unknown | bool
1717
changed_when: False
1818

1919
- name: gather files from which to remove suids/sgids and remove system white-listed files | os-06
2020
set_fact:
2121
suid: '{{ sbit_binaries.stdout_lines | difference(os_security_suid_sgid_system_whitelist) }}'
22-
when: os_security_suid_sgid_remove_from_unknown
22+
when: os_security_suid_sgid_remove_from_unknown | bool
2323

2424
- name: remove suid/sgid bit from all binaries except in system and user whitelist | os-06
2525
file:
@@ -29,4 +29,4 @@
2929
follow: 'yes'
3030
with_flattened:
3131
- '{{ suid | default([]) | difference(os_security_suid_sgid_whitelist) }}'
32-
when: os_security_suid_sgid_remove_from_unknown
32+
when: os_security_suid_sgid_remove_from_unknown | bool

tasks/yum.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- 'CentOS-Debuginfo'
88
- 'CentOS-Media'
99
- 'CentOS-Vault'
10-
when: os_security_packages_clean
10+
when: os_security_packages_clean | bool
1111

1212
- name: get yum-repository-files
1313
shell: 'find /etc/yum.repos.d/ -type f -name *.repo'
@@ -38,4 +38,4 @@
3838
yum:
3939
name: '{{ os_security_packages_list }}'
4040
state: 'absent'
41-
when: os_security_packages_clean
41+
when: os_security_packages_clean | bool

0 commit comments

Comments
 (0)