Krikri::InventoryPlugins
YAML-defined inventory plugins (plugin: <name> at the top level of an
inventory YAML file), the format real Ansible uses for both its built-in
sources (host_list, constructed, ini, yaml) and collection
plugins (amazon.aws.aws_ec2).
Detection is by the top-level plugin key, same as real Ansible. The
collection prefix is stripped ("amazon.aws.aws_ec2" dispatches on
"aws_ec2"), so a plugin from any collection whose final segment matches
a supported name is handled here.
aws_ec2 talks to the real EC2 API with SigV4-signed HTTP (via
awscr-signer) rather than shelling out to the aws CLI: real Ansible
only needs boto3 on the controller, and this needs nothing but the two
credential environment variables. The DescribeInstances response is
parsed from XML and mapped to hosts, then run through the same
constructed-style option machinery (compose/keyed_groups/groups/filters)
that the aws_ec2 plugin is itself built on in real Ansible - which is
also what the standalone constructed plugin uses.
Constants
Class methods
The constructed-style option machinery shared by the constructed
plugin and aws_ec2: filters, keyed_groups, groups and compose,
applied to every host already in inventory.
Build hosts from a DescribeInstances XML response. Split out from parse_aws_ec2 so specs can exercise the mapping without network.
True when path is a YAML inventory source whose plugin is
constructed. Used by directory parsing: constructed sources do not
contribute hosts themselves, they transform hosts contributed by the
OTHER sources in the same directory, so they must be applied after
every other source is merged (real Ansible behaves the same way).