From c4b3b807e3ae9533827b5d72ba5915e3ca6717e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20M=C3=BCnch?= Date: Wed, 4 Sep 2024 14:19:22 +0200 Subject: [PATCH] remove mondoo.yml also from the home directory (#75) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick Münch --- tasks/linux_login.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tasks/linux_login.yml b/tasks/linux_login.yml index f93e37e..ca0c6c1 100644 --- a/tasks/linux_login.yml +++ b/tasks/linux_login.yml @@ -29,7 +29,7 @@ # if the credentials are already invalid, the command will throw an error ignore_errors: true -- name: Remove existing credentials +- name: Remove existing credentials from /etc/opt/mondoo # ensure no configuration file exists if force mode was activated ansible.builtin.file: state: absent @@ -37,6 +37,14 @@ mode: '0644' when: force_registration +- name: Remove existing credentials from Home Directory + # ensure no configuration file exists if force mode was activated + ansible.builtin.file: + state: absent + path: "{{ ansible_env.HOME }}/.config/mondoo/mondoo.yml" + mode: '0644' + when: force_registration + - name: Store cnspec login command as string ansible.builtin.set_fact: login_cmd: "cnspec login --config /etc/opt/mondoo/mondoo.yml --token {{ registration_token }}"