Skip to content

Commit

Permalink
🐛 do not try to install providers for old clients (#52)
Browse files Browse the repository at this point in the history
Fixes #51

---------

Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev authored Nov 7, 2023
1 parent 3317416 commit dfa51a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ For testing, this role uses molecule. You can install the dependencies via:
```bash
pip install molecule
pip install docker
pip install 'molecule[docker]'
pip install 'molecule-plugins[docker]'
```

The `molecule` cli covers the test lifecycle:
Expand Down
12 changes: 5 additions & 7 deletions molecule/default/tests/mondoo-installer.mql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ policies:
authors:
- name: Mondoo, Inc
email: [email protected]
specs:
- asset_filter:
query: asset.family.contains(_ == 'linux')
scoring_queries:
package-installed:
groups:
- checks:
- uid: package-installed
queries:
- uid: package-installed
title: Ensure mondoo, cnquery and cnspec package are installed
filters: asset.family.contains(_ == 'linux')
title: Ensure cnquery and cnspec package are installed
query: |
package("mondoo").installed
package("cnspec").installed
package("cnquery").installed
6 changes: 5 additions & 1 deletion tasks/linux_login.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@

---

- name: Get current cnspec version
ansible.builtin.command: cnspec version
register: cnspec_version

- name: Ensure we have the latest os provider installed
ansible.builtin.command: cnspec providers install os
become: "{{ use_become }}"
when: not ansible_check_mode
when: not ansible_check_mode and cnspec_version.stdout is match(".*cnspec 9.*")

- name: Create mondoo config directory
ansible.builtin.file:
Expand Down

0 comments on commit dfa51a1

Please sign in to comment.