initial opensuse support

This commit is contained in:
AJ Schroeder
2024-01-15 10:43:03 -06:00
parent 0e58779cac
commit 53d6b2d1d5
13 changed files with 1450 additions and 17 deletions

View File

@@ -1,10 +1,19 @@
---
- name: "Clean the {{ ansible_facts['distribution'] }} guest operating system."
- name: Prepare the {{ ansible_facts['distribution'] }} guest operating system
include_tasks: "{{ ansible_facts['distribution'] | lower }}.yml"
when: "ansible_facts['distribution'] == 'Debian'"
- name: "Clean the {{ ansible_facts['distribution'] }} guest operating system."
- name: Prepare the {{ ansible_facts['distribution'] }} guest operating system
include_tasks: "{{ ansible_facts['distribution'] | lower }}.yml"
when: "ansible_facts['distribution'] == 'Ubuntu'"
- name: "Clean the {{ ansible_facts['distribution'] }} guest operating system."
- name: Prepare the {{ ansible_facts['distribution'] }} guest operating system
include_tasks: redhat.yml
when: "ansible_facts['distribution'] in ['RedHat', 'CentOS', 'Rocky', 'AlmaLinux', 'OracleLinux']"
- name: Prepare the {{ ansible_facts['distribution'] }} guest operating system
include_tasks: "{{ ansible_facts['distribution'] | lower }}.yml"
when: "ansible_facts['distribution'] == 'Suse'"
...

View File

@@ -0,0 +1,80 @@
---
# Tasks to clean the SUSE Customer Center file.
- name: "Cleaning the SUSE Customer Center file."
file:
path: /etc/SUSEConnect
state: absent
# Tasks to clean the audit logs.
- name: "Cleaning the audit logs."
file:
path: "{{ item }}"
state: absent
loop:
- /var/log/audit/audit.log
- /var/log/boot.log
- /var/log/lastlog
- /var/log/mail
- /var/log/messages
- /var/log/secure
- /var/log/warn
- /var/log/wtmp
- /var/log/zypper.log
# Tasks to clean the persistent udev rules.
- name: "Cleaning persistent udev rules."
file:
path: /etc/udev/rules.d/70-persistent-net.rules
state: absent
# Tasks to find the /tmp directories.
- name: "Finding the /tmp directories."
find:
paths:
- /tmp
- /var/tmp
- /var/cache/zypp
file_type: any
register: find_tmp_directories
# Tasks to clean the /tmp directories.
- name: "Cleaning the /tmp directories."
file:
path: "{{ item.path }}"
state: absent
loop: "{{ find_tmp_directories.files }}"
loop_control:
label: "{{ item.path }}"
# Tasks to find the SSH host keys.
- name: "Finding the SSH host keys."
find:
paths: /etc/ssh
patterns: 'ssh_host_*'
register: find_ssh_host_keys
# Tasks to clean the SSH host keys.
- name: "Cleaning the SSH host keys."
file:
path: "{{ item.path }}"
state: absent
loop: "{{ find_ssh_host_keys.files }}"
loop_control:
label: "{{ item.path }}"
# Tasks to clean the machine-id.
- name: "Emptying the /etc/machine-id."
community.general.filesize:
path: /etc/machine-id
size: 0
# Tasks to clean the shell history.
- name: "Cleaning the shell history."
block:
- name: "Cleaning the shell history."
file:
path: "{{ ansible_env.HOME }}/.bash_history"
state: absent
...