Add deploy_linux_vm role with LVM and SSH hardening
Features: - Multi-distribution support (Debian, Ubuntu, RHEL, AlmaLinux, Rocky, SUSE) - LVM configuration with meaningful volume groups and logical volumes - 8 LVs: lv_opt, lv_tmp, lv_home, lv_var, lv_var_log, lv_var_tmp, lv_var_audit, lv_swap - Security mount options on sensitive directories SSH Hardening: - GSSAPI authentication disabled - GSSAPI cleanup credentials disabled - Root login disabled via SSH - Password authentication disabled - Key-based authentication only - MaxAuthTries: 3, ClientAliveInterval: 300s Security Features: - SELinux enforcing (RHEL family) - AppArmor enabled (Debian family) - Firewall configuration (UFW/firewalld) - Automatic security updates - Audit daemon (auditd) enabled - Time synchronization (chrony) - Essential security packages (aide, auditd) Role Structure: - Modular task organization (validate, install, download, storage, deploy, lvm) - Tag-based execution for selective deployment - OS-family specific cloud-init templates - Comprehensive variable defaults (100+ configurable options) - Post-deployment validation tasks
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
---
|
||||
# =============================================================================
|
||||
# Cleanup Tasks - Remove Temporary Files
|
||||
# =============================================================================
|
||||
|
||||
- name: Remove temporary cloud-init directory
|
||||
file:
|
||||
path: /tmp/cloud-init-{{ deploy_linux_vm_name }}
|
||||
state: absent
|
||||
tags: [cleanup]
|
||||
|
||||
- name: Remove downloaded checksums
|
||||
file:
|
||||
path: /tmp/{{ deploy_linux_vm_os_distribution }}-CHECKSUM
|
||||
state: absent
|
||||
tags: [cleanup]
|
||||
|
||||
- name: Remove cloud-init ISO (if requested)
|
||||
file:
|
||||
path: "{{ deploy_linux_vm_cloud_init_iso_path }}"
|
||||
state: absent
|
||||
when: deploy_linux_vm_remove_cloud_init_iso_after_boot | bool
|
||||
tags: [cleanup]
|
||||
|
||||
- name: Display cleanup summary
|
||||
debug:
|
||||
msg:
|
||||
- "=== Cleanup Complete ==="
|
||||
- "Temporary files removed"
|
||||
- "VM is ready for use"
|
||||
tags: [cleanup]
|
||||
Reference in New Issue
Block a user