Skip to main content

ash.avalanche.ash_cmd

The ash.avalanche.ash_cmd module is a Ash CLI wrapper.

Usage

- name: Get node info with Ash CLI
ash.avalanche.ash_cmd:
command: ["avalanche", "node", "info"]
options:
http-host: 192.168.60.11
http-port: 9650
register: ash_cli_command

- name: Print node Id from Ash CLI output
debug:
msg: "{{ ash_cli_command.output.id }}"

- name: Get list of Subnets on Fuji with Ash CLI
ash.avalanche.ash_cmd:
command: avalanche subnet list
options:
network: fuji
register: ash_cli_command

- name: Print number of Subnets on Fuji from Ash CLI output
debug:
msg: "There are {{ ash_cli_command.output | length }} Subnets on Fuji"

Parameters

ParameterRequiredTypeDefaultDescription
commandYeslistNAThe command to run as a string (e.g. avalanche node info) or a list of strings (e.g.: ["avalanche", "node", "info"])
optionsNodict{}The options to pass to the command. See Ash CLI for more details.
ash_pathNostr/opt/avalanche/ash-cli/bin/ashThe path to the Ash CLI binary
ash_configNostr/etc/avalanche/ash-cli/conf/default.ymlThe path to the Ash CLI configuration file
jsonNoboolTrueIf True, output will be rendered in JSON