diff --git a/roles/hardening-basic/tasks/main.yml b/roles/hardening-basic/tasks/main.yml index 9754d8c..f69a529 100644 --- a/roles/hardening-basic/tasks/main.yml +++ b/roles/hardening-basic/tasks/main.yml @@ -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 }}'