Adding upstream version 1.4.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
dc7df702ea
commit
7996c81031
166 changed files with 13787 additions and 11959 deletions
|
@ -16,40 +16,7 @@ This command will list all devices available in the inventory. Using the `--tags
|
|||
### Command overview
|
||||
|
||||
```bash
|
||||
Usage: anta get inventory [OPTIONS]
|
||||
|
||||
Show inventory loaded in ANTA.
|
||||
|
||||
Options:
|
||||
-u, --username TEXT Username to connect to EOS [env var:
|
||||
ANTA_USERNAME; required]
|
||||
-p, --password TEXT Password to connect to EOS that must be
|
||||
provided. It can be prompted using '--prompt'
|
||||
option. [env var: ANTA_PASSWORD]
|
||||
--enable-password TEXT Password to access EOS Privileged EXEC mode.
|
||||
It can be prompted using '--prompt' option.
|
||||
Requires '--enable' option. [env var:
|
||||
ANTA_ENABLE_PASSWORD]
|
||||
--enable Some commands may require EOS Privileged EXEC
|
||||
mode. This option tries to access this mode
|
||||
before sending a command to the device. [env
|
||||
var: ANTA_ENABLE]
|
||||
-P, --prompt Prompt for passwords if they are not
|
||||
provided. [env var: ANTA_PROMPT]
|
||||
--timeout FLOAT Global API timeout. This value will be used
|
||||
for all devices. [env var: ANTA_TIMEOUT;
|
||||
default: 30.0]
|
||||
--insecure Disable SSH Host Key validation. [env var:
|
||||
ANTA_INSECURE]
|
||||
--disable-cache Disable cache globally. [env var:
|
||||
ANTA_DISABLE_CACHE]
|
||||
-i, --inventory FILE Path to the inventory YAML file. [env var:
|
||||
ANTA_INVENTORY; required]
|
||||
--tags TEXT List of tags using comma as separator:
|
||||
tag1,tag2,tag3. [env var: ANTA_TAGS]
|
||||
--connected / --not-connected Display inventory after connection has been
|
||||
created
|
||||
--help Show this message and exit.
|
||||
--8<-- "anta_get_inventory_help.txt"
|
||||
```
|
||||
|
||||
> [!TIP]
|
||||
|
|
|
@ -7,27 +7,18 @@ anta_title: Retrieving Tests information
|
|||
~ that can be found in the LICENSE file.
|
||||
-->
|
||||
|
||||
`anta get tests` commands help you discover available tests in ANTA.
|
||||
## `anta get tests`
|
||||
|
||||
`anta get tests` commands help you discover the available tests in ANTA.
|
||||
|
||||
### Command overview
|
||||
|
||||
```bash
|
||||
Usage: anta get tests [OPTIONS]
|
||||
|
||||
Show all builtin ANTA tests with an example output retrieved from each test
|
||||
documentation.
|
||||
|
||||
Options:
|
||||
--module TEXT Filter tests by module name. [default: anta.tests]
|
||||
--test TEXT Filter by specific test name. If module is specified,
|
||||
searches only within that module.
|
||||
--short Display test names without their inputs.
|
||||
--count Print only the number of tests found.
|
||||
--help Show this message and exit.
|
||||
--8<-- "anta_get_tests_help.txt"
|
||||
```
|
||||
|
||||
> [!TIP]
|
||||
> By default, `anta get tests` will retrieve all tests available in ANTA.
|
||||
> By default, `anta get tests` retrieves all the tests available in ANTA.
|
||||
|
||||
### Examples
|
||||
|
||||
|
@ -60,7 +51,7 @@ anta.tests.aaa:
|
|||
[...]
|
||||
```
|
||||
|
||||
#### Module usage
|
||||
#### Filtering using `--module`
|
||||
|
||||
To retrieve all the tests from `anta.tests.stun`.
|
||||
|
||||
|
@ -81,7 +72,7 @@ anta.tests.stun:
|
|||
# Verifies the STUN server status is enabled and running.
|
||||
```
|
||||
|
||||
#### Test usage
|
||||
#### Filtering using `--test`
|
||||
|
||||
``` yaml title="anta get tests --test VerifyTacacsSourceIntf"
|
||||
anta.tests.aaa:
|
||||
|
@ -118,3 +109,132 @@ anta.tests.aaa:
|
|||
```bash title="anta get tests --count"
|
||||
There are 155 tests available in `anta.tests`.
|
||||
```
|
||||
|
||||
## `anta get commands`
|
||||
|
||||
`anta get commands` returns the EOS commands used by the targeted tests, if no filter is provided, the targeted tests are all the built-in ANTA tests.
|
||||
|
||||
### Command overview
|
||||
|
||||
```bash
|
||||
--8<-- "anta_get_commands_help.txt"
|
||||
```
|
||||
|
||||
> [!TIP]
|
||||
> By default, `anta get commands` returns the commands from every tests builtin in ANTA.
|
||||
|
||||
### Examples
|
||||
|
||||
#### Default usage
|
||||
|
||||
``` yaml title="anta get commands"
|
||||
anta.tests.aaa:
|
||||
- VerifyAcctConsoleMethods:
|
||||
- show aaa methods accounting
|
||||
- VerifyAcctDefaultMethods:
|
||||
- show aaa methods accounting
|
||||
- VerifyAuthenMethods:
|
||||
- show aaa methods authentication
|
||||
- VerifyAuthzMethods:
|
||||
- show aaa methods authorization
|
||||
- VerifyTacacsServerGroups:
|
||||
- show tacacs
|
||||
- VerifyTacacsServers:
|
||||
- show tacacs
|
||||
- VerifyTacacsSourceIntf:
|
||||
- show tacacs
|
||||
anta.tests.avt:
|
||||
- VerifyAVTPathHealth:
|
||||
- show adaptive-virtual-topology path
|
||||
- VerifyAVTRole:
|
||||
- show adaptive-virtual-topology path
|
||||
- VerifyAVTSpecificPath:
|
||||
- show adaptive-virtual-topology path
|
||||
[...]
|
||||
```
|
||||
|
||||
#### Filtering using `--module`
|
||||
|
||||
To retrieve all the commands from the tests in `anta.tests.stun`.
|
||||
|
||||
``` yaml title="anta get commands --module anta.tests.stun"
|
||||
anta.tests.stun:
|
||||
- VerifyStunClient:
|
||||
- show stun client translations {source_address} {source_port}
|
||||
- VerifyStunClientTranslation:
|
||||
- show stun client translations {source_address} {source_port}
|
||||
- VerifyStunServer:
|
||||
- show stun server status
|
||||
```
|
||||
|
||||
#### Filtering using `--test`
|
||||
|
||||
``` yaml title="anta get commands --test VerifyBGPExchangedRoutes"
|
||||
anta.tests.routing.bgp:
|
||||
- VerifyBGPExchangedRoutes:
|
||||
- show bgp neighbors {peer} advertised-routes vrf {vrf}
|
||||
- show bgp neighbors {peer} routes vrf {vrf}
|
||||
vrf: MGMT
|
||||
```
|
||||
|
||||
> [!TIP]
|
||||
> You can filter tests by providing a prefix - ANTA will return all tests that start with your specified string.
|
||||
|
||||
```yaml title="anta get tests --test VerifyTacacs"
|
||||
anta.tests.aaa:
|
||||
- VerifyTacacsServerGroups:
|
||||
- show tacacs
|
||||
- VerifyTacacsServers:
|
||||
- show tacacs
|
||||
- VerifyTacacsSourceIntf:
|
||||
- show tacacs
|
||||
```
|
||||
|
||||
#### Filtering using `--catalog`
|
||||
|
||||
To retrieve all the commands from the tests in a catalog:
|
||||
|
||||
``` yaml title="anta get commands --catalog my-catalog.yml"
|
||||
anta.tests.interfaces:
|
||||
- VerifyL3MTU:
|
||||
- show interfaces
|
||||
anta.tests.mlag:
|
||||
- VerifyMlagStatus:
|
||||
- show mlag
|
||||
anta.tests.system:
|
||||
- VerifyAgentLogs:
|
||||
- show agent logs crash
|
||||
- VerifyCPUUtilization:
|
||||
- show processes top once
|
||||
- VerifyCoredump:
|
||||
- show system coredump
|
||||
- VerifyFileSystemUtilization:
|
||||
- bash timeout 10 df -h
|
||||
- VerifyMemoryUtilization:
|
||||
- show version
|
||||
- VerifyNTP:
|
||||
- show ntp status
|
||||
- VerifyReloadCause:
|
||||
- show reload cause
|
||||
- VerifyUptime:
|
||||
- show uptime
|
||||
```
|
||||
|
||||
#### Output using `--unique`
|
||||
|
||||
Using the `--unique` flag will output only the list of unique commands that will be run which can be useful to configure a AAA system.
|
||||
|
||||
For instance with the previous catalog, the output would be:
|
||||
|
||||
``` yaml title="anta get commands --catalog my-catalog.yml --unique"
|
||||
show processes top once
|
||||
bash timeout 10 df -h
|
||||
show system coredump
|
||||
show agent logs crash
|
||||
show interfaces
|
||||
show uptime
|
||||
show ntp status
|
||||
show version
|
||||
show reload cause
|
||||
show mlag
|
||||
```
|
||||
|
|
|
@ -12,23 +12,7 @@ In large setups, it might be beneficial to construct your inventory based on you
|
|||
## Command overview
|
||||
|
||||
```bash
|
||||
$ anta get from-ansible --help
|
||||
Usage: anta get from-ansible [OPTIONS]
|
||||
|
||||
Build ANTA inventory from an ansible inventory YAML file.
|
||||
|
||||
NOTE: This command does not support inline vaulted variables. Make sure to
|
||||
comment them out.
|
||||
|
||||
Options:
|
||||
-o, --output FILE Path to save inventory file [env var:
|
||||
ANTA_INVENTORY; required]
|
||||
--overwrite Do not prompt when overriding current inventory
|
||||
[env var: ANTA_GET_FROM_ANSIBLE_OVERWRITE]
|
||||
-g, --ansible-group TEXT Ansible group to filter
|
||||
--ansible-inventory FILE Path to your ansible inventory file to read
|
||||
[required]
|
||||
--help Show this message and exit.
|
||||
--8<-- "anta_get_fromansible_help.txt"
|
||||
```
|
||||
|
||||
> [!WARNING]
|
||||
|
|
|
@ -15,26 +15,7 @@ In large setups, it might be beneficial to construct your inventory based on Clo
|
|||
## Command overview
|
||||
|
||||
```bash
|
||||
Usage: anta get from-cvp [OPTIONS]
|
||||
|
||||
Build ANTA inventory from CloudVision.
|
||||
|
||||
NOTE: Only username/password authentication is supported for on-premises CloudVision instances.
|
||||
Token authentication for both on-premises and CloudVision as a Service (CVaaS) is not supported.
|
||||
|
||||
Options:
|
||||
-o, --output FILE Path to save inventory file [env var: ANTA_INVENTORY;
|
||||
required]
|
||||
--overwrite Do not prompt when overriding current inventory [env
|
||||
var: ANTA_GET_FROM_CVP_OVERWRITE]
|
||||
-host, --host TEXT CloudVision instance FQDN or IP [required]
|
||||
-u, --username TEXT CloudVision username [required]
|
||||
-p, --password TEXT CloudVision password [required]
|
||||
-c, --container TEXT CloudVision container where devices are configured
|
||||
--ignore-cert By default connection to CV will use HTTPS
|
||||
certificate, set this flag to disable it [env var:
|
||||
ANTA_GET_FROM_CVP_IGNORE_CERT]
|
||||
--help Show this message and exit.
|
||||
--8<-- "anta_get_fromcvp_help.txt"
|
||||
```
|
||||
|
||||
The output is an inventory where the name of the container is added as a tag for each host:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue