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

Update Ansible doc #65

Merged
merged 11 commits into from
Mar 25, 2024
Merged

Update Ansible doc #65

merged 11 commits into from
Mar 25, 2024

Conversation

misterpantz
Copy link
Contributor

@misterpantz misterpantz commented Mar 21, 2024

Description

Update the Ansible documentation:

  • New console UI
  • New CLI flag
  • Make more concise/eliminate some repetition
  • Improve readability

Related issue

n/a

Types of changes

  • Functional documentation bug fix (i.e., broken link or some other busted behavior)
  • New functional doc capabilities (i.e., filter search results)
  • New content
  • Revision to existing content
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist

  • I have read the README document about contributing to this repo.
  • I have tested my changes locally and there are no issues.
  • All commits are signed.

Copy link
Contributor

Starting creation of the PREview environment...

Copy link
Contributor

PREview environment has been created at https://mondoo-pre-docs-3250593319.storage.googleapis.com/docs/index.html
Please allow a few minutes for the environment to be fully deployed.

Copy link
Contributor

Copy link
Contributor

@misterpantz misterpantz marked this pull request as ready for review March 21, 2024 22:59
Copy link
Contributor

@@ -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
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

Copy link
Contributor Author

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

Copy link
Contributor Author

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

@tas50
Copy link
Member

tas50 commented Mar 25, 2024

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

@tas50 tas50 merged commit d0ea463 into main Mar 25, 2024
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2024
@misterpantz misterpantz deleted the misterpantz/ansible branch July 19, 2024 18:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants