PARALLAX

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

NameTypeRequiredDefaultDescription
ad_userstringActive Directory username. Use when authenticating with an Active Directory user rather than service principal.
adfs_authority_urlstringAzure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority.
api_profilestringlatestSelects 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_licenseslistThe 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_packageslistChanges 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_sourcestringautoControls 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_namestringyesThe name of the Batch Account.
cert_validation_modestringControls 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.
certificateslistFor 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_idstringAzure 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_environmentstringAzureCloudFor 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_configurationdictUsing CloudServiceConfiguration specifies that the nodes should be creating using Azure Cloud Services (PaaS).
Using VirtualMachineConfiguration uses Azure Virtual Machines (IaaS).
disable_instance_discoveryboolfalseDetermines 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_namestringThe display name for the pool.
identitydictThe 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_communicationstringThis 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_scaleboolfalseWhether disables automatic scaling for a pool.
is_stop_resizeboolfalseWhether stops an ongoing resize operation on the pool.
log_modestringParent argument.
log_pathstringParent argument.
metadatalistThe Batch service does not assign any meaning to this metadata; it is solely for the use of user code.
mount_configurationlistThis supports Azure Files, NFS, CIFS/SMB, and Blobfuse.
namestringyesThe name of the Batch Account Pool.
network_configurationdictThe network configuration for a pool.
oidc_tokenstringDirect 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_pathstringPath 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.
passwordstringActive Directory user password. Use when authenticating with an Active Directory user rather than service principal.
profilestringSecurity profile found in ~/.azure/credentials file.
resource_groupstringyesThe name of the resource group in which to create the Batch Account Pool.
resource_tagsdictThe 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_settingsdictDefines 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.
secretstringAzure client secret. Use when authenticating with a Service Principal.
start_taskdictIn an PATCH (update) operation, this property can be set to an empty object to remove the start task from the pool.
statestringpresentAssert 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_idstringYour Azure subscription Id.
target_node_communication_modestringDefaultIf omitted, the default value is C(Default).
task_scheduling_policydictSpecifies how tasks should be distributed across compute nodes.
task_slots_per_nodeint1The 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.
tenantstringAzure tenant ID. Use when authenticating with a Service Principal.
thumbprintstringThe 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_policydictDescribes an upgrade policy.
user_accountslistThe list of user accounts to be created on each node in the pool.
vm_sizestringFor 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_pathstringPath 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
Search
    ↑ ↓ move↵ openesc close