Skip to content

Commit

Permalink
install os provider for latest cnspec version(11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Noe committed Nov 26, 2024
1 parent 964f0c8 commit 758e55b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tasks/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# SPDX-License-Identifier: BUSL-1.1

---

# download the latest json to fetch the latest released version

- name: Determine latest released version
Expand Down Expand Up @@ -95,11 +94,15 @@
chdir: "C:\\Program Files\\Mondoo"
register: cnspec_version

- name: Log Cnspec Version
ansible.builtin.debug:
var: cnspec_version

- name: Ensure we have the latest os provider installed
ansible.windows.win_command: cnspec providers install os
args:
chdir: "C:\\Program Files\\Mondoo"
when: not ansible_check_mode and cnspec_version.stdout is match(".*cnspec 9.*")
when: not ansible_check_mode and cnspec_version.stdout is match(".*cnspec 11.*")

- name: Logout cnquery and cnspec from Mondoo Platform
ansible.windows.win_command: cnspec.exe logout --force --config C:\\ProgramData\\Mondoo\\mondoo.yml
Expand Down

0 comments on commit 758e55b

Please sign in to comment.