Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧹 ensure os provider is on latest version before we login #49

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ This playbook demonstrates how to use the Mondoo Package role to install `cnquer
- hosts: linux_hosts
become: yes
roles:
- role: mondoo.client
- role: ansible-mondoo # if used from galaxy: mondoo.client
vars:
registration_token: "changeme"
```
Expand All @@ -76,7 +76,7 @@ In addition we support the following variables:
- hosts: linux_hosts
become: yes
roles:
- role: mondoo.client
- role: ansible-mondoo # if used from galaxy: mondoo.client
vars:
registration_token: "changeme"
force_registration: true
Expand All @@ -96,7 +96,7 @@ If you want to use cnspec behind a proxy
https_proxy: "http://192.168.56.1:3128"

roles:
- role: mondoo.client
- role: ansible-mondoo # if used from galaxy: mondoo.client
vars:
registration_token: "changeme"
force_registration: true
Expand All @@ -107,8 +107,12 @@ If you want to use cnspec behind a proxy
1. Run the playbook with the local hosts file

```bash
# download mondoo role
# download mondoo role from github
ansible-galaxy role install git+https://github.com/mondoohq/ansible-mondoo.git

# (alternative) download mondoo role from ansible galaxy
ansible-galaxy install mondoo.client

# apply the playbook
ansible-playbook -i hosts playbook.yml
```
Expand Down Expand Up @@ -139,7 +143,7 @@ If you are targeting windows, the configuration is slightly different since `bec
```yaml
- hosts: windows_hosts
roles:
- role: mondoo.client
- role: ansible-mondoo # if used from galaxy: mondoo.client
vars:
registration_token: "changeme"
force_registration: false
Expand Down
5 changes: 5 additions & 0 deletions tasks/linux_login.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

---

- name: Ensure we have the latest os provider installed
ansible.builtin.command: cnspec providers install os
become: "{{ use_become }}"
when: not ansible_check_mode

- name: Create mondoo config directory
ansible.builtin.file:
dest: /etc/opt/mondoo
Expand Down
Loading