fix missing directory structure creation before file copy for hardening-basic

This commit is contained in:
Claudio Maradonna 2022-12-01 11:45:28 +01:00
parent 8905c9cb02
commit af7de5fbbc
Signed by untrusted user who does not match committer: claudiomaradonna
GPG key ID: 0CBA58694C5680D9

View file

@ -3,6 +3,14 @@
- name: Basic Hardening
block:
- name: Create directory structure
ansible.builtin.file:
path: '/etc/{{ item.path }}'
state: directory
mode: '{{ item.mode }}'
with_community.general.filetree: '../templates/basic/etc/'
when: item.state == 'directory'
- name: Create and copy hardening files
ansible.builtin.template:
src: '{{ item.src }}'
@ -13,6 +21,14 @@
- name: Harden SSH Config
when: 'hardening_sshd_enabled is true'
block:
- name: Create directory structure
ansible.builtin.file:
path: '/etc/{{ item.path }}'
state: directory
mode: '{{ item.mode }}'
with_community.general.filetree: '../templates/ssh/etc/'
when: item.state == 'directory'
- name: Create and copy hardening files
ansible.builtin.template:
src: '{{ item.src }}'