What is a dynamic inventory?
IntermediateConceptInventory
Answer
An inventory generated at run time by querying an external source (a cloud API, CMDB, Kubernetes, vSphere) instead of a hand-edited file. In a cloud with autoscaling, a static file is wrong within hours, while a dynamic one reflects what exists now.
Today this is done with inventory plugins such as amazon.aws.aws_ec2, azure.azcollection.azure_rm, google.cloud.gcp_compute, or kubernetes.core.k8s. Older executable scripts that print JSON still work with --list and --host but are discouraged.
More on Inventory
What is an inventory and why does Ansible need one?BeginnerWhat are the INI and YAML inventory formats and how do they differ?BeginnerHow do you create groups of groups?BeginnerExplain host patterns: `:`, `:&`, `:!` and wildcards.IntermediateWhich connection variables can you set per host in inventory?BeginnerWhat are `group_vars` and `host_vars` directories?Intermediate