$ ansible-doc -t callback yaml
> COMMUNITY.GENERAL.YAML (/home/admin/.ansible/collections/ansible_collections/community/general/plugins/callback/yaml.py)
Ansible output that can be quite a bit easier to read than the default JSON formatting.
$ ansible-navigator images -h
Usage: ansible-navigator images [options]
images: Explore execution environment images
Options (global):
-h --help Show this help message and exit
--version Show the application version and
exit
--rad --ansible-runner-artifact-dir The directory path to store
artifacts generated by ansible-
runner
--rac --ansible-runner-rotate-artifacts-count Keep ansible-runner artifact
directories, for last n runs, if set
to 0 artifact directories won't be
deleted
--rt --ansible-runner-timeout The timeout value after which
ansible-runner will forcefully stop
the execution
--cdcp --collection-doc-cache-path The path to collection doc cache
(default:
/home/admin/.cache/ansible-
navigator/collection_doc_cache.db)
--ce --container-engine Specify the container engine
(auto=podman then docker)
(auto|podman|docker) (default: auto)
--co --container-options Extra parameters passed to the
container engine command
--dc --display-color Enable the use of color for mode
interactive and stdout (true|false)
(default: true)
--ecmd --editor-command Specify the editor command (default:
vi +{line_number} {filename})
--econ --editor-console Specify if the editor is console
based (true|false) (default: true)
--ee --execution-environment Enable or disable the use of an
execution environment (true|false)
(default: true)
--eei --execution-environment-image Specify the name of the execution
environment image (default:
quay.io/ansible/creator-ee:v0.4.2)
--eev --execution-environment-volume-mounts Specify volume to be bind mounted
within an execution environment
(--eev
/home/user/test:/home/user/test:Z)
--la --log-append Specify if log messages should be
appended to an existing log file,
otherwise a new log file will be
created per session (true|false)
(default: true)
--lf --log-file Specify the full path for the
ansible-navigator log file (default:
/home/admin/git/general/vagrant/nwla
b/ee/ansible-navigator.log)
--ll --log-level Specify the ansible-navigator log
level
(debug|info|warning|error|critical)
(default: warning)
-m --mode Specify the user-interface mode
(stdout|interactive) (default:
interactive)
--osc4 --osc4 Enable or disable terminal color
changing support with OSC 4
(true|false) (default: true)
--penv --pass-environment-variable Specify an existing environment
variable to be passed through to and
set within the execution environment
(--penv MY_VAR)
--pa --pull-arguments Specify any additional parameters
that should be added to the pull
command when pulling an execution
environment from a container
registry. e.g. --pa='--tls-
verify=false'
--pp --pull-policy Specify the image pull policy
always:Always pull the image,
missing:Pull if not locally
available, never:Never pull the
image, tag:if the image tag is
'latest', always pull the image,
otherwise pull if not locally
available (always|missing|never|tag)
(default: tag)
--senv --set-environment-variable Specify an environment variable and
a value to be set within the
execution environment (--senv
MY_VAR=42)
--tz --time-zone Specify the IANA time zone to use or
'local' to use the system time zone
(default: utc)
Options (images subcommand):
-d --details Provide detailed information about
the selected execution environment
image (ansible_collections|ansible_v
ersion|everything|os_release|python_
packages|python_version|redhat_relea
se|system_packages) (default:
['everything'])
$ ansible-navigator
Warning: Issues were found while applying the settings.
Hint: Command provided: ''
Error: The following errors were found in the settings file (/home/admin/git/general/vagrant/nwlab/ee/ansible-navigator.yml):
In 'ansible-navigator': Additional properties are not allowed ('execution-enviroment' was unexpected).
Hint: Check the settings file and compare it to the current version.
The current version can be found here:
(https://ansible-navigator.readthedocs.io/en/latest/settings/#ansible-navigator-settings)
The schema used for validation can be seen with 'ansible-navigator settings --schema'
A sample settings file can be created with 'ansible-navigator settings --sample'
Note: Configuration failed, using default log file location. (/home/admin/git/general/vagrant/nwlab/ee/ansible-navigator.log) Log
level set to debug
Hint: Review the hints and log file to see what went wrong.
'execution-enviroment' was unexpected とあるので、すぐに気づけます。もし問題なければ、この場合は Welcome 画面が開きます。
$ ansible-navigator
The following version migrations are required:
- Version 1 to Version 2 settings file format migration
Do you want to run them all? (Y/n): Y # 書き換えする場合は Y
Version 1 to Version 2 settings file format migration:
Migration of 'config path'..................................Not needed
Migration of 'documentation'................................Updated # 書き換わった
Migration of 'playbook path'................................Not needed
Migration of 'help builder'.................................Not needed
Migration of 'help config'..................................Not needed
Migration of 'help doc'.....................................Not needed
Migration of 'help inventory'...............................Not needed
Migration of 'help playbook'................................Not needed
Migration of 'inventory paths'..............................Not needed
Migration of 'playbook artifact timestamp'..................Not needed
Migration of 'pull-policy'..................................Not needed
Migration of 'volume mount labels'..........................Not needed
Backup: /home/admin/git/general/vagrant/nwlab/ee/ansible-navigator.v1
Updated: /home/admin/git/general/vagrant/nwlab/ee/ansible-navigator.yml
Migration complete
Press Enter to continue: # 処理を続けるには Enter
--pa --pull-arguments Specify any additional parameters that should be added
to the pull command when pulling an execution
environment from a container registry. e.g. --pa='--
tls-verify=false'
$ ansible-navigator settings -m stdout
---
- choices: []
cli_parameters:
long: --ansible-runner-artifact-dir
short: --rad
current_settings_file: None
current_value: Not set
default: true
default_value: Not set
description: The directory path to store artifacts generated by ansible-runner
env_var: ANSIBLE_NAVIGATOR_ANSIBLE_RUNNER_ARTIFACT_DIR
name: Ansible runner artifact dir
settings_file_sample:
ansible-navigator:
ansible-runner:
artifact-dir: <------
source: Not set
subcommands:
# ...(略)...
参考: settings サブコマンドのヘルプ
▼ ansible-navigator settings --help の結果(クリックして開く)
$ ansible-navigator settings --help
Usage: ansible-navigator settings [options]
settings: Review the current ansible-navigator settings
Options (global):
-h --help Show this help message and exit
--version Show the application version and exit
--rad --ansible-runner-artifact-dir The directory path to store artifacts generated by ansible-runner
--rac --ansible-runner-rotate-artifacts-count Keep ansible-runner artifact directories, for last n runs, if set to 0 artifact directories won't be deleted
--rt --ansible-runner-timeout The timeout value after which ansible-runner will forcefully stop the execution
--cdcp --collection-doc-cache-path The path to collection doc cache (default: /home/admin/.cache/ansible-navigator/collection_doc_cache.db)
--ce --container-engine Specify the container engine (auto=podman then docker) (auto|podman|docker) (default: auto)
--co --container-options Extra parameters passed to the container engine command
--dc --display-color Enable the use of color for mode interactive and stdout (true|false) (default: true)
--ecmd --editor-command Specify the editor command (default: vi +{line_number} {filename})
--econ --editor-console Specify if the editor is console based (true|false) (default: true)
--ee --execution-environment Enable or disable the use of an execution environment (true|false) (default: true)
--eei --execution-environment-image Specify the name of the execution environment image (default: quay.io/ansible/creator-ee:v0.4.2)
--eev --execution-environment-volume-mounts Specify volume to be bind mounted within an execution environment (--eev /home/user/test:/home/user/test:Z)
--la --log-append Specify if log messages should be appended to an existing log file, otherwise a new log file will be created per
session (true|false) (default: true)
--lf --log-file Specify the full path for the ansible-navigator log file (default: /home/admin/git/general/ansible-
navigator.log)
--ll --log-level Specify the ansible-navigator log level (debug|info|warning|error|critical) (default: warning)
-m --mode Specify the user-interface mode (stdout|interactive) (default: interactive)
--osc4 --osc4 Enable or disable terminal color changing support with OSC 4 (true|false) (default: true)
--penv --pass-environment-variable Specify an existing environment variable to be passed through to and set within the execution environment
(--penv MY_VAR)
--pa --pull-arguments Specify any additional parameters that should be added to the pull command when pulling an execution environment
from a container registry. e.g. --pa='--tls-verify=false'
--pp --pull-policy Specify the image pull policy always:Always pull the image, missing:Pull if not locally available, never:Never
pull the image, tag:if the image tag is 'latest', always pull the image, otherwise pull if not locally available
(always|missing|never|tag) (default: tag)
--senv --set-environment-variable Specify an environment variable and a value to be set within the execution environment (--senv MY_VAR=42)
--tz --time-zone Specify the IANA time zone to use or 'local' to use the system time zone (default: utc)
Options (settings subcommand):
--se --effective Show the effective settings. Defaults, CLI parameters, environment variables, and the settings file will be
combined
--gs --sample Generate a sample settings file
--ss --schema Generate a schema for the settings file ('json'= draft-07 JSON Schema) (json) (default: json)
--so --sources Show the source of each current settings entry
$ ansible-navigator builder --help-builder
usage: ansible-builder [-h] [--version] {create,build,introspect} ...
Tooling to help build container images for running Ansible content. Get started by looking at the help text for one of the subcommands.
positional arguments:
{create,build,introspect}
The command to invoke.
create Creates a build context, which can be used by podman to build an image.
build Builds a container image.
introspect Introspects collections in folder.
optional arguments:
-h, --help show this help message and exit
--version Print ansible-builder version and exit.
$ ansible-navigator builder --help
Usage: ansible-navigator builder [options]
builder: Build execution environment (container image)
Options (global):
-h --help Show this help message and exit
--version Show the application version and exit
--rad --ansible-runner-artifact-dir The directory path to store artifacts generated by ansible-runner
--rac --ansible-runner-rotate-artifacts-count Keep ansible-runner artifact directories, for last n runs, if set to 0 artifact directories won't be deleted
--rt --ansible-runner-timeout The timeout value after which ansible-runner will forcefully stop the execution
--cdcp --collection-doc-cache-path The path to collection doc cache (default: /home/admin/.cache/ansible-navigator/collection_doc_cache.db)
--ce --container-engine Specify the container engine (auto=podman then docker) (auto|podman|docker) (default: auto)
--co --container-options Extra parameters passed to the container engine command
--dc --display-color Enable the use of color for mode interactive and stdout (true|false) (default: true)
--ecmd --editor-command Specify the editor command (default: vi +{line_number} {filename})
--econ --editor-console Specify if the editor is console based (true|false) (default: true)
--ee --execution-environment Enable or disable the use of an execution environment (true|false) (default: true)
--eei --execution-environment-image Specify the name of the execution environment image (default: quay.io/ansible/creator-ee:v0.4.2)
--eev --execution-environment-volume-mounts Specify volume to be bind mounted within an execution environment (--eev /home/user/test:/home/user/test:Z)
--la --log-append Specify if log messages should be appended to an existing log file, otherwise a new log file will be created per
session (true|false) (default: true)
--lf --log-file Specify the full path for the ansible-navigator log file (default: /home/admin/git/general/ansible-
navigator.log)
--ll --log-level Specify the ansible-navigator log level (debug|info|warning|error|critical) (default: warning)
-m --mode Specify the user-interface mode (stdout|interactive) (default: interactive)
--osc4 --osc4 Enable or disable terminal color changing support with OSC 4 (true|false) (default: true)
--penv --pass-environment-variable Specify an existing environment variable to be passed through to and set within the execution environment
(--penv MY_VAR)
--pa --pull-arguments Specify any additional parameters that should be added to the pull command when pulling an execution environment
from a container registry. e.g. --pa='--tls-verify=false'
--pp --pull-policy Specify the image pull policy always:Always pull the image, missing:Pull if not locally available, never:Never
pull the image, tag:if the image tag is 'latest', always pull the image, otherwise pull if not locally available
(always|missing|never|tag) (default: tag)
--senv --set-environment-variable Specify an environment variable and a value to be set within the execution environment (--senv MY_VAR=42)
--tz --time-zone Specify the IANA time zone to use or 'local' to use the system time zone (default: utc)
Options (builder subcommand):
--hb --help-builder Help options for ansible-builder command in stdout mode (true|false)
--bwd --workdir Specify the path that contains ansible-builder manifest files (default: /home/admin/git/general)
Note: 'ansible-navigator builder' additionally supports the same parameters as the 'ansible-builder' command. For more information about these, try 'ansible-
navigator builder --help-builder --mode stdout'
最後の行に、
Note: 'ansible-navigator builder' additionally supports the same parameters as the 'ansible-builder' command.
$ ansible-navigator exec --help
Usage: ansible-navigator exec [options]
exec: Run a command within an execution environment
Options (global):
-h --help Show this help message and exit
--version Show the application version and exit
--rad --ansible-runner-artifact-dir The directory path to store artifacts generated by ansible-runner
--rac --ansible-runner-rotate-artifacts-count Keep ansible-runner artifact directories, for last n runs, if set to 0 artifact directories won't be deleted
--rt --ansible-runner-timeout The timeout value after which ansible-runner will forcefully stop the execution
--cdcp --collection-doc-cache-path The path to collection doc cache (default: /home/admin/.cache/ansible-navigator/collection_doc_cache.db)
--ce --container-engine Specify the container engine (auto=podman then docker) (auto|podman|docker) (default: auto)
--co --container-options Extra parameters passed to the container engine command
--dc --display-color Enable the use of color for mode interactive and stdout (true|false) (default: true)
--ecmd --editor-command Specify the editor command (default: vi +{line_number} {filename})
--econ --editor-console Specify if the editor is console based (true|false) (default: true)
--ee --execution-environment Enable or disable the use of an execution environment (true|false) (default: true)
--eei --execution-environment-image Specify the name of the execution environment image (default: quay.io/ansible/creator-ee:v0.4.2)
--eev --execution-environment-volume-mounts Specify volume to be bind mounted within an execution environment (--eev /home/user/test:/home/user/test:Z)
--la --log-append Specify if log messages should be appended to an existing log file, otherwise a new log file will be created per
session (true|false) (default: true)
--lf --log-file Specify the full path for the ansible-navigator log file (default: /home/admin/git/general/ansible-
navigator.log)
--ll --log-level Specify the ansible-navigator log level (debug|info|warning|error|critical) (default: warning)
-m --mode Specify the user-interface mode (stdout|interactive) (default: interactive)
--osc4 --osc4 Enable or disable terminal color changing support with OSC 4 (true|false) (default: true)
--penv --pass-environment-variable Specify an existing environment variable to be passed through to and set within the execution environment
(--penv MY_VAR)
--pa --pull-arguments Specify any additional parameters that should be added to the pull command when pulling an execution environment
from a container registry. e.g. --pa='--tls-verify=false'
--pp --pull-policy Specify the image pull policy always:Always pull the image, missing:Pull if not locally available, never:Never
pull the image, tag:if the image tag is 'latest', always pull the image, otherwise pull if not locally available
(always|missing|never|tag) (default: tag)
--senv --set-environment-variable Specify an environment variable and a value to be set within the execution environment (--senv MY_VAR=42)
--tz --time-zone Specify the IANA time zone to use or 'local' to use the system time zone (default: utc)
Options (exec subcommand):
exec_command Specify the command to run within the execution environment (default: /bin/bash)
--exshell --exec-shell Specify the exec command should be run in a shell (true|false) (default: true)
Note: During development, it may become necessary to interact directly with the execution environment to review and confirm its build and behavior. All navigator
settings will be applied when starting the execution environment.
$ ansible-navigator lint -m stdout
WARNING: PATH altered to include /usr/bin
yaml: truthy value should be one of [false, true] (truthy)
playbook.yml:2
fqcn-builtins: Use FQCN for builtin actions.
playbook.yml:6 Task/Handler: debug msg=hello
unnamed-task: All tasks should be named.
playbook.yml:6 Task/Handler: debug msg=hello
yaml: no new line character at the end of file (new-line-at-end-of-file)
playbook.yml:7
参考: lint サブコマンドのヘルプ
▼ ansible-navigator lint --help 結果(クリックして開く)
$ ansible-navigator lint --help
Usage: ansible-navigator lint [options]
lint: Lint a file or directory for common errors and issues
Options (global):
-h --help Show this help message and exit
--version Show the application version and exit
--rad --ansible-runner-artifact-dir The directory path to store artifacts generated by ansible-runner
--rac --ansible-runner-rotate-artifacts-count Keep ansible-runner artifact directories, for last n runs, if set to 0 artifact directories won't be deleted
--rt --ansible-runner-timeout The timeout value after which ansible-runner will forcefully stop the execution
--cdcp --collection-doc-cache-path The path to collection doc cache (default: /home/admin/.cache/ansible-navigator/collection_doc_cache.db)
--ce --container-engine Specify the container engine (auto=podman then docker) (auto|podman|docker) (default: auto)
--co --container-options Extra parameters passed to the container engine command
--dc --display-color Enable the use of color for mode interactive and stdout (true|false) (default: true)
--ecmd --editor-command Specify the editor command (default: vi +{line_number} {filename})
--econ --editor-console Specify if the editor is console based (true|false) (default: true)
--ee --execution-environment Enable or disable the use of an execution environment (true|false) (default: true)
--eei --execution-environment-image Specify the name of the execution environment image (default: quay.io/ansible/creator-ee:v0.4.2)
--eev --execution-environment-volume-mounts Specify volume to be bind mounted within an execution environment (--eev /home/user/test:/home/user/test:Z)
--la --log-append Specify if log messages should be appended to an existing log file, otherwise a new log file will be created per session (true|false)
(default: true)
--lf --log-file Specify the full path for the ansible-navigator log file (default: /home/admin/git/general/ansible-navigator.log)
--ll --log-level Specify the ansible-navigator log level (debug|info|warning|error|critical) (default: warning)
-m --mode Specify the user-interface mode (stdout|interactive) (default: interactive)
--osc4 --osc4 Enable or disable terminal color changing support with OSC 4 (true|false) (default: true)
--penv --pass-environment-variable Specify an existing environment variable to be passed through to and set within the execution environment (--penv MY_VAR)
--pa --pull-arguments Specify any additional parameters that should be added to the pull command when pulling an execution environment from a container registry.
e.g. --pa='--tls-verify=false'
--pp --pull-policy Specify the image pull policy always:Always pull the image, missing:Pull if not locally available, never:Never pull the image, tag:if the
image tag is 'latest', always pull the image, otherwise pull if not locally available (always|missing|never|tag) (default: tag)
--senv --set-environment-variable Specify an environment variable and a value to be set within the execution environment (--senv MY_VAR=42)
--tz --time-zone Specify the IANA time zone to use or 'local' to use the system time zone (default: utc)
Options (lint subcommand):
--lic --lint-config Specify the path to the ansible-lint configuration file
lintables Path to files on which to run ansible-lint
Note: Defaults to the current working directory. If using an execution environment, ansible-lint must be installed in it. If not using an execution environment, ansible-lint must be installed
on your system.
こちらの issueを見てなるほどと思ったのですが、デフォルトだと実行中(running)でない VM や、provisioning_state が succeeded でない VM は除外されます。何らかの事情で、状態に関わらずインベントリとして取得したい場合は、default_host_filters オプションで空リストを指定すればいいということなので、試してみました。
$ vault server -dev
==> Vault server configuration:
...(略)...
WARNING! dev mode is enabled! In this mode, Vault runs entirely in-memory
and starts unsealed with a single unseal key. The root token is already
authenticated to the CLI, so you can immediately begin using Vault.
You may need to set the following environment variable:
$ export VAULT_ADDR='http://127.0.0.1:8200'
The unseal key and root token are displayed below in case you want to
seal/unseal the Vault or re-authenticate.
Unseal Key: dummyxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Root Token: hvs.dummyxxxxxxxxx
Development mode should NOT be used in production installations!