Parameter |
Choices/Defaults |
Configuration |
Comments |
auth_kind
-
/ required
|
Choices:
- application
- serviceaccount
- machineaccount
|
env:GCP_AUTH_KIND
|
The type of credential used.
|
cache
boolean
|
|
ini entries:
[inventory] cache = no
env:ANSIBLE_INVENTORY_CACHE
|
Toggle to enable/disable the caching of the inventory's source data, requires a cache plugin setup to work.
|
cache_connection
string
|
|
ini entries:
[defaults] fact_caching_connection = VALUE
[inventory] cache_connection = VALUE
env:ANSIBLE_CACHE_PLUGIN_CONNECTION
env:ANSIBLE_INVENTORY_CACHE_CONNECTION
|
Cache connection data or path, read cache plugin documentation for specifics.
|
cache_plugin
string
|
Default:
"memory"
|
ini entries:
[defaults] fact_caching = memory
[inventory] cache_plugin = memory
env:ANSIBLE_CACHE_PLUGIN
env:ANSIBLE_INVENTORY_CACHE_PLUGIN
|
Cache plugin to use for the inventory's source data.
|
cache_prefix
-
|
Default:
"ansible_inventory_"
|
ini entries:
[default] fact_caching_prefix = ansible_inventory_
[inventory] cache_prefix = ansible_inventory_
env:ANSIBLE_CACHE_PLUGIN_PREFIX
env:ANSIBLE_INVENTORY_CACHE_PLUGIN_PREFIX
|
Prefix to use for cache plugin files/tables
|
cache_timeout
integer
|
Default:
3600
|
ini entries:
[defaults] fact_caching_timeout = 3600
[inventory] cache_timeout = 3600
env:ANSIBLE_CACHE_PLUGIN_TIMEOUT
env:ANSIBLE_INVENTORY_CACHE_TIMEOUT
|
Cache duration in seconds
|
compose
dictionary
|
Default:
{}
|
|
Create vars from jinja2 expressions.
|
filters
list
|
|
|
A list of filter value pairs. Available filters are listed here
groups
dictionary
|
Default:
{}
|
|
Add hosts to group based on Jinja2 conditionals.
|
hostnames
list
|
Default:
["public_ip", "private_ip", "name"]
|
|
A list of options that describe the ordering for which hostnames should be assigned. Currently supported hostnames are 'public_ip', 'private_ip', or 'name'.
|
keyed_groups
list
|
Default:
[]
|
|
Add hosts to group based on the values of a variable.
|
plugin
-
/ required
|
|
|
token that ensures this is a source file for the 'gcp_compute' plugin.
|
projects
list
/ required
|
|
|
A list of projects in which to describe GCE instances.
|
retrieve_image_info
boolean
added in 2.8 |
|
|
Populate the image host fact for the instances returned with the GCP image name
By default this plugin does not attempt to resolve the boot image of an instance to the image name cataloged in GCP because of the performance overhead of the task.
Unless this option is enabled, the image host variable will be null
|
scopes
list
|
Default:
["https://www.googleapis.com/auth/compute"]
|
env:GCP_SCOPES
|
list of authentication scopes
|
service_account_contents
string
added in 2.8.2 |
|
env:GCP_SERVICE_ACCOUNT_CONTENTS
|
A string representing the contents of a Service Account JSON file. This should not be passed in as a dictionary, but a string that has the exact contents of a service account json file (valid JSON).
|
service_account_email
-
|
|
env:GCP_SERVICE_ACCOUNT_EMAIL
|
An optional service account email address if machineaccount is selected and the user does not wish to use the default email.
|
service_account_file
path
|
|
env:GCP_SERVICE_ACCOUNT_FILE
env:GCE_CREDENTIALS_FILE_PATH
|
The path of a Service Account JSON file if serviceaccount is selected as type.
|
strict
boolean
|
|
|
If yes make invalid entries a fatal error, otherwise skip and continue.
Since it is possible to use facts in the expressions they might not always be available and we ignore those errors by default.
|
use_contrib_script_compatible_sanitization
boolean
added in 2.8 |
|
|
By default this plugin is using a general group name sanitization to create safe and usable group names for use in Ansible. This option allows you to override that, in efforts to allow migration from the old inventory script.
For this to work you should also turn off the TRANSFORM_INVALID_GROUP_CHARS setting, otherwise the core engine will just use the standard sanitization on top.
This is not the default as such names break certain functionality as not all characters are valid Python identifiers which group names end up being used as.
|
vars_prefix
-
|
Default:
""
|
|
prefix to apply to host variables, does not include facts nor params
|
zones
list
|
|
|
A list of regions in which to describe GCE instances. If none provided, it defaults to all zones available to a given project.
|