From 70d4ecf06795bb39bed810f592d3fbb794d9d4c9 Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Tue, 14 Nov 2023 21:35:50 -0500 Subject: [PATCH] fix: ansible truncate machine-id (#774) Fixes the `machine-id` truncate issue introduced in #394. Signed-off-by: Ryan Johnson --- ansible/roles/clean/tasks/debian.yml | 7 +++---- ansible/roles/clean/tasks/photon.yml | 7 +++---- ansible/roles/clean/tasks/redhat.yml | 8 +++----- ansible/roles/clean/tasks/suse.yml | 4 ++-- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/ansible/roles/clean/tasks/debian.yml b/ansible/roles/clean/tasks/debian.yml index 81ef0b64d..85d6ac5da 100644 --- a/ansible/roles/clean/tasks/debian.yml +++ b/ansible/roles/clean/tasks/debian.yml @@ -58,11 +58,10 @@ # Tasks to clean the machine-id. - name: "Cleaning the machine-id." block: - - name: "Resizing the /etc/machine-id." - file: + - name: "Emptying the /etc/machine-id." + community.general.filesize: path: /etc/machine-id - state: touch - mode: '0000' + size: 0 - name: "Removing /var/lib/dbus/machine-id." file: path: /var/lib/dbus/machine-id diff --git a/ansible/roles/clean/tasks/photon.yml b/ansible/roles/clean/tasks/photon.yml index f5fd99ffb..7b0ef6242 100644 --- a/ansible/roles/clean/tasks/photon.yml +++ b/ansible/roles/clean/tasks/photon.yml @@ -52,11 +52,10 @@ # Tasks to clean the machine-id. - name: "Cleaning the machine-id." block: - - name: "Resizing the /etc/machine-id." - file: + - name: "Emptying the /etc/machine-id." + community.general.filesize: path: /etc/machine-id - state: touch - mode: '0000' + size: 0 - name: "Removing /var/lib/dbus/machine-id." file: path: /var/lib/dbus/machine-id diff --git a/ansible/roles/clean/tasks/redhat.yml b/ansible/roles/clean/tasks/redhat.yml index 09fe5cd22..099772cf7 100644 --- a/ansible/roles/clean/tasks/redhat.yml +++ b/ansible/roles/clean/tasks/redhat.yml @@ -65,11 +65,10 @@ label: "{{ item.path }}" # Tasks to clean the machine-id. -- name: "Resizing the /etc/machine-id." - file: +- name: "Emptying the /etc/machine-id." + community.general.filesize: path: /etc/machine-id - state: touch - mode: '0000' + size: 0 - name: "Cleaning the machine-id." block: @@ -77,7 +76,6 @@ file: path: /var/lib/dbus/machine-id state: absent - - name: "Creating a symbolic link to /etc/machine-id." file: src: /etc/machine-id diff --git a/ansible/roles/clean/tasks/suse.yml b/ansible/roles/clean/tasks/suse.yml index ee0ccd7f8..31ffee5aa 100644 --- a/ansible/roles/clean/tasks/suse.yml +++ b/ansible/roles/clean/tasks/suse.yml @@ -63,10 +63,10 @@ label: "{{ item.path }}" # Tasks to clean the machine-id. -- name: "Resizing the /etc/machine-id." +- name: "Emptying the /etc/machine-id." community.general.filesize: path: /etc/machine-id - size: 0B + size: 0 # Tasks to clean the shell history. - name: "Cleaning the shell history."