Skip to content

Commit

Permalink
remove mondoo.yml also from the home directory (#75)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Münch <[email protected]>
  • Loading branch information
atomic111 authored Sep 4, 2024
1 parent 0bd89c8 commit c4b3b80
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tasks/linux_login.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,22 @@
# 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
path: /etc/opt/mondoo/mondoo.yml
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 }}"
Expand Down

0 comments on commit c4b3b80

Please sign in to comment.