diff --git a/README.md b/README.md index 77609f9..e7d95c2 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/molecule/default/tests/mondoo-installer.mql.yaml b/molecule/default/tests/mondoo-installer.mql.yaml index cfbdf88..f99e00f 100644 --- a/molecule/default/tests/mondoo-installer.mql.yaml +++ b/molecule/default/tests/mondoo-installer.mql.yaml @@ -9,15 +9,13 @@ policies: authors: - name: Mondoo, Inc email: hello@mondoo.com - 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 diff --git a/tasks/linux_login.yml b/tasks/linux_login.yml index afec0bd..f31707e 100644 --- a/tasks/linux_login.yml +++ b/tasks/linux_login.yml @@ -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: