azure_rm_batchaccountpool
Manages a Batch Account Pool on Azure
Collection: azure.azcollection
Full Name: azure.azcollection.azure_rm_batchaccountpool
Synopsis
Manages a Batch Account Pool on Azure
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| ad_user | string | Active Directory username. Use when authenticating with an Active Directory user rather than service principal. | ||
| adfs_authority_url | string | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. | ||
| api_profile | string | latest | Selects an API profile to use when communicating with Azure services. Default value of C(latest) is appropriate for public clouds; future values will allow use with Azure Stack. | |
| application_licenses | list | The list of application licenses must be a subset of available Batch service application licenses. | ||
| If a license is requested which is not supported, pool creation will fail. | ||||
| application_packages | list | Changes to application package references affect all new compute nodes joining the pool. | ||
| But do not affect compute nodes that are already in the pool until they are rebooted or reimaged. | ||||
| There is a maximum of 10 application package references on any given pool. | ||||
| auth_source | string | auto | Controls the source of the credentials to use for authentication. | |
| Can also be set via the C(ANSIBLE_AZURE_AUTH_SOURCE) environment variable. | ||||
| When set to C(auto) (the default) the precedence is module parameters -> C(env) -> C(credential_file) -> C(cli). | ||||
| When set to C(env), the credentials will be read from the environment variables. | ||||
| When set to C(credential_file), it will read the profile from C(~/.azure/credentials). | ||||
| When set to C(cli), the credentials will be sources from the Azure CLI profile. C(subscription_id) or the environment variable C(AZURE_SUBSCRIPTION_ID) can be used to identify the subscription ID if more than one is present otherwise the default az cli subscription is used. | ||||
| When set to C(msi), the host machine must be an azure resource with an enabled MSI extension. C(subscription_id) or the environment variable C(AZURE_SUBSCRIPTION_ID) can be used to identify the subscription ID if the resource is granted access to more than one subscription, otherwise the first subscription is chosen. | ||||
| The C(msi) was added in Ansible 2.6. | ||||
| batch_account_name | string | yes | The name of the Batch Account. | |
| cert_validation_mode | string | Controls the certificate validation behavior for Azure endpoints. By default, all modules will validate the server certificate, but when an HTTPS proxy is in use, or against Azure Stack, it may be necessary to disable this behavior by passing C(ignore). Can also be set via credential file profile or the C(AZURE_CERT_VALIDATION) environment variable. | ||
| certificates | list | For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. | ||
| For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. | ||||
| For certificates with visibility of ‘remoteUser’, a ‘certs’ directory is created in the user’s home directory and certificates are placed in that directory. | ||||
| client_id | string | Azure client ID. Use when authenticating with a Service Principal or Managed Identity (msi). | ||
| Can also be set via the C(AZURE_CLIENT_ID) environment variable. | ||||
| cloud_environment | string | AzureCloud | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, C(AzureChinaCloud), C(AzureUSGovernment)), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the C(AZURE_CLOUD_ENVIRONMENT) environment variable. | |
| deployment_configuration | dict | Using CloudServiceConfiguration specifies that the nodes should be creating using Azure Cloud Services (PaaS). | ||
| Using VirtualMachineConfiguration uses Azure Virtual Machines (IaaS). | ||||
| disable_instance_discovery | bool | false | Determines whether or not instance discovery is performed when attempting to authenticate. Setting this to true will completely disable both instance discovery and authority validation. This functionality is intended for use in scenarios where the metadata endpoint cannot be reached such as in private clouds or Azure Stack. The process of instance discovery entails retrieving authority metadata from https://login.microsoft.com/ to validate the authority. By setting this to True, the validation of the authority is disabled. As a result, it is crucial to ensure that the configured authority host is valid and trustworthy. | |
| Set via credential file profile or the C(AZURE_DISABLE_INSTANCE_DISCOVERY) environment variable. | ||||
| display_name | string | The display name for the pool. | ||
| identity | dict | The type of identity used for the Batch Pool. | ||
| If the pool identity is updated during update an existing pool. | ||||
| Only the new vms which are created after the pool shrinks to 0 will have the updated identities. | ||||
| inter_node_communication | string | This imposes restrictions on which nodes can be assigned to the pool. | ||
| Enabling this value can reduce the chance of the requested number of nodes to be allocated in the pool. | ||||
| If not specified, this value defaults to C(Disabled). | ||||
| is_disable_auto_scale | bool | false | Whether disables automatic scaling for a pool. | |
| is_stop_resize | bool | false | Whether stops an ongoing resize operation on the pool. | |
| log_mode | string | Parent argument. | ||
| log_path | string | Parent argument. | ||
| metadata | list | The Batch service does not assign any meaning to this metadata; it is solely for the use of user code. | ||
| mount_configuration | list | This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. | ||
| name | string | yes | The name of the Batch Account Pool. | |
| network_configuration | dict | The network configuration for a pool. | ||
| oidc_token | string | Direct OpenID Connect (OIDC) token (JWT) used for workload identity authentication. | ||
| This token is exchanged with Azure AD using OIDC federated identity. | ||||
| Useful in CI systems (for example GitHub Actions, Azure DevOps) where an OIDC token is provided directly by the platform. | ||||
| Can also be set via the C(AZURE_FEDERATED_TOKEN) environment variable. | ||||
| oidc_token_file_path | string | Path to a file containing an OpenID Connect (OIDC) token (JWT) used for workload identity authentication. | ||
| The file must contain only raw token. | ||||
| This method is commonly used in platforms that materialize OIDC tokens as files | ||||
| Can also be set via the C(AZURE_FEDERATED_TOKEN_FILE) environment variable. | ||||
| password | string | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. | ||
| profile | string | Security profile found in ~/.azure/credentials file. | ||
| resource_group | string | yes | The name of the resource group in which to create the Batch Account Pool. | |
| resource_tags | dict | The user-defined tags to be associated with the Azure Batch Pool. | ||
| When specified, these tags are propagated to the backing Azure resources associated with the pool. | ||||
| This property can only be specified when the Batch account was created with the poolAllocationMode property set to ‘UserSubscription’. | ||||
| scale_settings | dict | Defines the desired size of the pool. | ||
| This can either be ‘fixedScale’ where the requested targetDedicatedNodes is specified, or ‘autoScale’ which defines a formula which is periodically reevaluated. | ||||
| If this property is not specified, the pool will have a fixed scale with 0 targetDedicatedNodes. | ||||
| secret | string | Azure client secret. Use when authenticating with a Service Principal. | ||
| start_task | dict | In an PATCH (update) operation, this property can be set to an empty object to remove the start task from the pool. | ||
| state | string | present | Assert the state of the Batch Account Pool. | |
| Use C(present) to create or update a Batch Account Pool and C(absent) to delete it. | ||||
| subscription_id | string | Your Azure subscription Id. | ||
| target_node_communication_mode | string | Default | If omitted, the default value is C(Default). | |
| task_scheduling_policy | dict | Specifies how tasks should be distributed across compute nodes. | ||
| task_slots_per_node | int | 1 | The default value is C(1). | |
| The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256. | ||||
| tenant | string | Azure tenant ID. Use when authenticating with a Service Principal. | ||
| thumbprint | string | The thumbprint of the private key specified in I(x509_certificate_path). | ||
| Use when authenticating with a Service Principal. | ||||
| Required if I(x509_certificate_path) is defined. | ||||
| upgrade_policy | dict | Describes an upgrade policy. | ||
| user_accounts | list | The list of user accounts to be created on each node in the pool. | ||
| vm_size | string | For information about available sizes of virtual machines for Cloud Services Pools. | ||
| Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2, | ||||
| Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). | ||||
| x509_certificate_path | string | Path to the X509 certificate used to create the service principal in PEM format. | ||
| The certificate must be appended to the private key. | ||||
| Use when authenticating with a Service Principal. |
Example
yaml
- name: Create a new batch account pool
azure.azcollection.azure_rm_batchaccountpool:
resource_group: "{{ resource_group }}"
batch_account_name: "{{ batch_account_name }}"
name: "pool{{ batch_account_name }}--004"
deployment_configuration:
virtual_machine_configuration:
image_reference:
offer: ubuntu-hpc
publisher: microsoft-dsvm
sku: 2204
version: latest
node_agent_sku_id: batch.node.ubuntu 22.04
node_placement_configuration:
policy: Regional
os_disk:
caching: None
managed_disk:
storage_account_type: Premium_LRS
display_name: "fredtest01"
identity:
type: UserAssigned
user_assigned_identities:
'/subscriptions/xxx-xxx/resourceGroups/testRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/AzSecPackAutoConfigUA-westus':
client_id: xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
principal_id: yyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
'/subscriptions/xxx-xxx/resourceGroups/yishitest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ystestidentity':
client_id: yyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
principal_id: xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
inter_node_communication: Disabled
network_configuration:
dynamic_vnet_assignment_scope: none
subnet_id: "/subscriptions/xxx-xxx/resourceGroups/testRG/providers/Microsoft.Network/virtualNetworks/vnet02/subnets/default"
endpoint_configuration:
inbound_nat_pools:
- backend_port: 33
frontend_port_range_end: 49999
frontend_port_range_start: 1
name: nat02
protocol: UDP
public_ip_address_configuration:
provision: BatchManaged
scale_settings:
fixed_scale:
resize_timeout: PT15M
target_dedicated_nodes: 0
target_low_priority_nodes: 0
target_node_communication_mode: Default
task_scheduling_policy:
node_fill_type: Pack
task_slots_per_node: 1
vm_size: STANDARD_D2S_V3
upgrade_policy:
mode: manual
rolling_upgrade_policy:
max_batch_instance_percent: 20
max_unhealthy_instance_percent: 20
max_unhealthy_upgraded_instance_percent: 20
pause_time_between_batches: P0D
rollback_failed_instances_on_policy_breach: false
automatic_os_upgrade_policy:
disable_automatic_rollback: false
enable_automatic_os_upgrade: false
os_rolling_upgrade_deferral: false
use_rolling_upgrade_policy: false
- name: Delete the Batch Account Pool
azure.azcollection.azure_rm_batchaccountpool:
resource_group: MyResGroup
name: pool01
batch_account_name: mybatchaccount
state: absent