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

doc: Clean documentation for inv-from-ansible #927

Merged
merged 1 commit into from
Nov 14, 2024
Merged
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
37 changes: 18 additions & 19 deletions docs/cli/inv-from-ansible.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,12 @@ Options:
--help Show this message and exit.
```

!!! warning
!!! warning "Warnings"

`anta get from-ansible` does not support inline vaulted variables, comment them out to generate your inventory.
If the vaulted variable is necessary to build the inventory (e.g. `ansible_host`), it needs to be unvaulted for `from-ansible` command to work."
* `anta get from-ansible` does not support inline vaulted variables, comment them out to generate your inventory.
If the vaulted variable is necessary to build the inventory (e.g. `ansible_host`), it needs to be unvaulted for `from-ansible` command to work."

The output is an inventory where the name of the container is added as a tag for each host:

```yaml
anta_inventory:
hosts:
- host: 10.73.252.41
name: srv-pod01
- host: 10.73.252.42
name: srv-pod02
- host: 10.73.252.43
name: srv-pod03
```

!!! warning
The current implementation only considers devices directly attached to a specific Ansible group and does not support inheritance when using the `--ansible-group` option.
* The current implementation only considers devices directly attached to a specific Ansible group and does not support inheritance when using the `--ansible-group` option.

By default, if user does not provide `--output` file, anta will save output to configured anta inventory (`anta --inventory`). If the output file has content, anta will ask user to overwrite when running in interactive console. This mechanism can be controlled by triggers in case of CI usage: `--overwrite` to force anta to overwrite file. If not set, anta will exit

Expand All @@ -60,7 +46,7 @@ By default, if user does not provide `--output` file, anta will save output to c

```yaml
---
tooling:
all:
children:
endpoints:
hosts:
Expand All @@ -80,3 +66,16 @@ tooling:
ansible_host: 10.73.252.43
type: endpoint
```

The output is an inventory where the name of the container is added as a tag for each host:

```yaml
anta_inventory:
hosts:
- host: 10.73.252.41
name: srv-pod01
- host: 10.73.252.42
name: srv-pod02
- host: 10.73.252.43
name: srv-pod03
```