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

cnspec scan via ansible inventory #455

Closed
atomic111 opened this issue Nov 11, 2024 · 3 comments
Closed

cnspec scan via ansible inventory #455

atomic111 opened this issue Nov 11, 2024 · 3 comments
Assignees

Comments

@atomic111
Copy link
Member

I didn't get the command to work, so I think it's no longer correct

https://github.com/mondoohq/docs/blob/main/docs/platform/infra/opsys/automation/ansible.md?plain=1#L242

this works:

https://github.com/mondoohq/docs/blob/main/docs/platform/infra/opsys/automation/ansible.md?plain=1#L262

Can we please test the command and correct the ansible docs.

@atomic111 atomic111 added the bug Something isn't functioning in the docs mechanism label Nov 11, 2024
@misterpantz
Copy link
Contributor

What shell are you using, @atomic111

@atomic111
Copy link
Member Author

i use zsh. I think we have two issues. At first the flag --insecure is not supported

ansible-inventory -i inventory-test.yml --list | cnspec scan --inventory-format-ansible --insecure
Error: unknown flag: --insecure

if i remove the the --insecure flag it scans my notebook but not the target that is defined in the inventory

ansible-inventory -i inventory-test.yml --list | cnspec scan --inventory-format-ansible
→ no provider specified, defaulting to local. Use --help to see all providers.
→ loaded configuration from /Users/user/.config/mondoo/mondoo.yml using source default
→ using service account credentials
→ discover related assets for 1 asset(s)

 notebook ───────────────────────────────────────────────────────────────────────────────────────────   0%


→ synchronize assets

my inventory file:

all:
  vars:
    ansible_connection: ssh
    ansible_port: 22
  hosts:
    debian12:
      ansible_host: 1.176.111.111
      ansible_user: admin
      ansible_ssh_private_key_file: ~/.ssh/key-rsa

@misterpantz misterpantz removed the bug Something isn't functioning in the docs mechanism label Nov 12, 2024
@misterpantz misterpantz self-assigned this Nov 12, 2024
@misterpantz
Copy link
Contributor

@chris-rock believes this is likely a product issue. So I created mondoohq/cnquery#4846.

In the meantime, I have this: #457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants