-
Notifications
You must be signed in to change notification settings - Fork 2
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
Update Ansible doc #65
Conversation
Starting creation of the PREview environment... |
PREview environment has been created at https://mondoo-pre-docs-3250593319.storage.googleapis.com/docs/index.html |
PREview has been updated at https://mondoo-pre-docs-3250593319.storage.googleapis.com/docs/index.html |
PREview has been updated at https://mondoo-pre-docs-3250593319.storage.googleapis.com/docs/index.html |
PREview has been updated at https://mondoo-pre-docs-3250593319.storage.googleapis.com/docs/index.html |
docs/cnspec/cli/cnspec_scan.md
Outdated
@@ -180,7 +180,7 @@ cnspec scan --inventory-file FILENAME | |||
#### Scan an Ansible inventory file | |||
|
|||
```bash | |||
ansible-inventory -i hosts.ini --list | cnspec scan --inventory-format-ansible --inventory-file FILENAME | |||
ansible-inventory -i hosts.ini --list | cnspec scan --inventory-format-ansible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Piping in the file from ansible doesn't seem to work:
~/dev ansible-inventory -i hosts.ini --list
{
"_meta": {
"hostvars": {}
},
"all": {
"children": [
"ungrouped",
"servers"
]
},
"servers": {
"hosts": [
"172.16.1.50",
"172.16.1.248"
]
}
}
~/dev ansible-inventory -i hosts.ini --list | cnspec scan --inventory-format-ansible
→ no provider specified, defaulting to local. Use --help to see all providers.
→ loaded configuration from /Users/tsmith/.config/mondoo/mondoo.yml using source default
→ using service account credentials
→ discover related assets for 1 asset(s)
Tim-Smith.localdomain ──────────────────────────────────────────────────────────────────────────────────────────── 0%
This scanned my local system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And your shell does support piping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay @tas50, to troubleshoot, does this scan your Ansible inventory?
ansible-inventory -i hosts.ini --list > hosts.json
cnspec scan --inventory-file hosts.json --inventory-format-ansible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reply to me was:
Auth fails, but it does in fact pick things up that way:
→ no provider specified, defaulting to local. Use --help to see all providers.
→ found a new version for 'os' provider installed=10.3.7 latest=10.4.0
→ successfully installed os provider path=/Users/tsmith/.config/mondoo/providers/os version=10.4.0
→ loaded configuration from /Users/tsmith/.config/mondoo/mondoo.yml using source default
→ load inventory inventory-file=hosts.json
→ use ansible inventory
→ using service account credentials
→ discover related assets for 2 asset(s)
! could not find keys in ssh agent
x unable to create runtime for asset error="rpc error: code = Unknown desc = no authentication method defined" asset=172.16.1.50
! could not find keys in ssh agent
x unable to create runtime for asset error="rpc error: code = Unknown desc = no authentication method defined" asset=172.16.1.248
Asset: 172.16.1.248
-------------------
error: rpc error: code = Unknown desc = no authentication method defined
Scanned 1 asset
Auth fails, but it does in fact pick things up that way:
|
Description
Update the Ansible documentation:
Related issue
n/a
Types of changes
Checklist