| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
from __future__ import absolute_import, division, print_function |
| 8 |
__metaclass__ = type |
| 9 |
|
| 10 |
|
| 11 |
class ModuleDocFragment(object): |
| 12 |
|
| 13 |
|
| 14 |
DOCUMENTATION = r''' |
| 15 |
options: |
| 16 |
plugin: |
| 17 |
description: marks this as an instance of the 'azure_rm' plugin |
| 18 |
required: true |
| 19 |
choices: ['azure_rm', 'azure.azcollection.azure_rm'] |
| 20 |
include_vm_resource_groups: |
| 21 |
description: A list of resource group names to search for virtual machines. '\*' will include all resource |
| 22 |
groups in the subscription. Can also be set comma separated resource group names via the |
| 23 |
C(ANSIBLE_AZURE_VM_RESOURCE_GROUPS) environment variable. |
| 24 |
default: ['*'] |
| 25 |
include_hcivm_resource_groups: |
| 26 |
description: A list of resource group names to search for Azure StackHCI virtual machines. '\*' will |
| 27 |
include all resource groups in the subscription. |
| 28 |
default: [] |
| 29 |
include_arc_resource_groups: |
| 30 |
description: A list of resource group names to search for Azure ARC machines. '\*' will include all |
| 31 |
resource groups in the subscription. |
| 32 |
default: [] |
| 33 |
include_vmss_resource_groups: |
| 34 |
description: A list of resource group names to search for virtual machine scale sets (VMSSs). '\*' will |
| 35 |
include all resource groups in the subscription. |
| 36 |
default: [] |
| 37 |
fail_on_template_errors: |
| 38 |
description: When false, template failures during group and filter processing are silently ignored (eg, |
| 39 |
if a filter or group expression refers to an undefined host variable) |
| 40 |
choices: [True, False] |
| 41 |
default: True |
| 42 |
keyed_groups: |
| 43 |
description: Creates groups based on the value of a host variable. Requires a list of dictionaries, |
| 44 |
defining C(key) (the source dictionary-typed variable), C(prefix) (the prefix to use for the new group |
| 45 |
name), and optionally C(separator) (which defaults to C(_)) |
| 46 |
conditional_groups: |
| 47 |
description: A mapping of group names to Jinja2 expressions. When the mapped expression is true, the host |
| 48 |
is added to the named group. |
| 49 |
hostvar_expressions: |
| 50 |
description: A mapping of hostvar names to Jinja2 expressions. The value for each host is the result of the |
| 51 |
Jinja2 expression (which may refer to any of the host's existing variables at the time this inventory |
| 52 |
plugin runs). |
| 53 |
exclude_host_filters: |
| 54 |
description: Excludes hosts from the inventory with a list of Jinja2 conditional expressions. Each |
| 55 |
expression in the list is evaluated for each host; when the expression is true, the host is excluded |
| 56 |
from the inventory. |
| 57 |
default: [] |
| 58 |
include_host_filters: |
| 59 |
description: Include hosts from the inventory with a list of Jinja2 conditional expressions. Each |
| 60 |
expression in the list is evaluated for each host; when the expression is true, the host is included |
| 61 |
in the inventory, all hosts are includes in the inventory by default. |
| 62 |
default: [true] |
| 63 |
batch_fetch: |
| 64 |
description: To improve performance, results are fetched using an unsupported batch API. Disabling |
| 65 |
C(batch_fetch) uses a much slower serial fetch, resulting in many more round-trips. Generally only |
| 66 |
useful for troubleshooting. |
| 67 |
default: true |
| 68 |
default_host_filters: |
| 69 |
description: A default set of filters that is applied in addition to the conditions in |
| 70 |
C(exclude_host_filters) to exclude powered-off and not-fully-provisioned hosts. Set this to a different |
| 71 |
value or empty list if you need to include hosts in these states. |
| 72 |
default: ['powerstate != "running"', 'provisioning_state != "succeeded"'] |
| 73 |
use_contrib_script_compatible_sanitization: |
| 74 |
description: |
| 75 |
- By default this plugin is using a general group name sanitization to create safe and usable group names for use in Ansible. |
| 76 |
This option allows you to override that, in efforts to allow migration from the old inventory script and |
| 77 |
matches the sanitization of groups when the script's C(replace_dash_in_groups) option is set to C(false). |
| 78 |
To replicate behavior of C(replace_dash_in_groups = true) with constructed groups, |
| 79 |
you will need to replace hyphens with underscores via the regex_replace filter for those entries. |
| 80 |
- For this to work you should also turn off the TRANSFORM_INVALID_GROUP_CHARS setting, |
| 81 |
otherwise the core engine will just use the standard sanitization on top. |
| 82 |
- This is not the default as such names break certain functionality as not all characters are valid Python identifiers |
| 83 |
which group names end up being used as. |
| 84 |
type: bool |
| 85 |
default: False |
| 86 |
version_added: '0.0.1' |
| 87 |
plain_host_names: |
| 88 |
description: |
| 89 |
- By default this plugin will use globally unique host names. |
| 90 |
This option allows you to override that, and use the name that matches the old inventory script naming. |
| 91 |
- This is not the default, as these names are not truly unique, and can conflict with other hosts. |
| 92 |
The default behavior will add extra hashing to the end of the hostname to prevent such conflicts. |
| 93 |
type: bool |
| 94 |
default: False |
| 95 |
version_added: '0.0.1' |
| 96 |
hostnames: |
| 97 |
description: |
| 98 |
- A list of Jinja2 expressions in order of precedence to compose inventory_hostname. |
| 99 |
- Ignores expression if result is an empty string or None value. |
| 100 |
- By default, inventory_hostname is generated to be globally unique based on the VM host name. |
| 101 |
See C(plain_host_names) for more details on the default. |
| 102 |
- An expression of C(default) will force using the default hostname generator if no previous hostname expression |
| 103 |
resulted in a valid hostname. |
| 104 |
- Use C(default_inventory_hostname) to access the default hostname generator's value in any of the Jinja2 expressions. |
| 105 |
type: list |
| 106 |
elements: str |
| 107 |
default: [default] |
| 108 |
''' |