76 lines
1.8 KiB
YAML
76 lines
1.8 KiB
YAML
---
|
|
- name: Fetch OS dependent variables
|
|
include_vars:
|
|
file: '{{ item }}'
|
|
name: 'os_vars'
|
|
with_first_found:
|
|
- files:
|
|
- '{{ ansible_facts.distribution }}_{{ ansible_facts.distribution_major_version }}.yml'
|
|
- '{{ ansible_facts.distribution }}.yml'
|
|
- '{{ ansible_facts.os_family }}_{{ ansible_facts.distribution_major_version }}.yml'
|
|
- '{{ ansible_facts.os_family }}.yml'
|
|
skip: true
|
|
tags: always
|
|
|
|
# we only override variables with our default, if they have not been specified already
|
|
# by default the lookup functions finds all varnames containing the string, therefore
|
|
# we add ^ and $ to denote start and end of string, so this returns only exact maches
|
|
- name: Set OS dependent variables, if not already defined by user
|
|
set_fact:
|
|
'{{ item.key }}': '{{ item.value }}'
|
|
when: "not lookup('varnames', '^' + item.key + '$')"
|
|
with_dict: '{{ os_vars }}'
|
|
|
|
- import_tasks: auditd.yml
|
|
tags: auditd
|
|
when: os_auditd_enabled | bool
|
|
|
|
- import_tasks: cron.yml
|
|
tags: cron
|
|
|
|
- import_tasks: limits.yml
|
|
tags: limits
|
|
|
|
- import_tasks: login_defs.yml
|
|
tags: login_defs
|
|
|
|
- import_tasks: minimize_access.yml
|
|
tags: minimize_access
|
|
|
|
- import_tasks: pam.yml
|
|
tags: pam
|
|
|
|
- import_tasks: modprobe.yml
|
|
tags: modprobe
|
|
|
|
- import_tasks: profile.yml
|
|
tags: profile
|
|
|
|
- import_tasks: securetty.yml
|
|
tags: securetty
|
|
|
|
- import_tasks: suid_sgid.yml
|
|
when: os_security_suid_sgid_enforce | bool
|
|
tags: suid_sgid
|
|
|
|
- import_tasks: sysctl.yml
|
|
tags: sysctl
|
|
|
|
- import_tasks: user_accounts.yml
|
|
tags: user_accounts
|
|
|
|
- import_tasks: rhosts.yml
|
|
tags: rhosts
|
|
|
|
- import_tasks: yum.yml
|
|
when: ansible_facts.os_family == 'RedHat'
|
|
tags: yum
|
|
|
|
- import_tasks: apt.yml
|
|
when: ansible_facts.distribution in ['Debian', 'Ubuntu']
|
|
tags: apt
|
|
|
|
- import_tasks: selinux.yml
|
|
tags: selinux
|
|
when: ansible_facts.selinux.status == 'enabled'
|