Note
This module is part of the azure.azcollection collection (version 3.7.0).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install azure.azcollection. You need further requirements to be able to use this module, see Requirements for details.
To use it in a playbook, specify: azure.azcollection.azure_rm_publicipprefix.
New in azure.azcollection 2.2.0
The below requirements are needed on the host that executes this module.
Parameter | Comments |
|---|---|
ad_user string | Active Directory username. Use when authenticating with an Active Directory user rather than service principal. |
adfs_authority_url string added in azure.azcollection 0.0.1 | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
api_profile string added in azure.azcollection 0.0.1 | Selects an API profile to use when communicating with Azure services. Default value of Default: |
append_tags boolean | Use to control if tags field is canonical or just appends to existing tags. When canonical, any tags not found in the tags parameter will be removed from the object’s metadata. Choices:
|
auth_source string added in azure.azcollection 0.0.1 | Controls the source of the credentials to use for authentication. Can also be set via the When set to When set to When set to When set to When set to The Choices:
|
cert_validation_mode string added in azure.azcollection 0.0.1 | 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 Choices:
|
client_id string | Azure client ID. Use when authenticating with a Service Principal or Managed Identity (msi). Can also be set via the |
cloud_environment string added in azure.azcollection 0.0.1 | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, Default: |
custom_ip_prefix dictionary | The Custom IP prefix that this prefix is associated with. |
|
id string |
Resource ID. |
disable_instance_discovery boolean added in azure.azcollection 2.3.0 | 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 Choices:
|
extended_location string | The extended location of the public ip address. |
ip_tags list / elements=dictionary | The list of tags associated with the public IP prefix. |
|
ip_tag_type string |
The IP tag type. Example as FirstPartyUsage. |
|
tag string |
The value of the IP tag associated with the public IP. Example as SQL. |
location string | Valid Azure location. Defaults to location of the resource group. |
log_mode string | Parent argument. |
log_path string | Parent argument. |
name string / required | Name of the Public IP prefix. |
password string | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
prefix_length integer | The Length of the Public IP Prefix. |
profile string | Security profile found in ~/.azure/credentials file. |
public_ip_address_version string | The public IP address version. Choices:
|
resource_group string / required | Name of resource group with which the Public IP prefix is associated. |
secret string | Azure client secret. Use when authenticating with a Service Principal. |
sku dictionary | The public IP prefix SKU. |
|
name string |
Name of a public IP prefix SKU. Choices:
|
|
tier string |
Tier of a public IP prefix SKU. Choices:
|
state string | Assert the state of the Public IP. Use Choices:
|
subscription_id string | Your Azure subscription Id. |
tags dictionary | Dictionary of string:string pairs to assign as metadata to the object. Metadata tags on the object will be updated with any provided values. To remove tags set append_tags option to false. Currently, Azure DNS zones and Traffic Manager services also don’t allow the use of spaces in the tag. Azure Front Door doesn’t support the use of Azure Automation and Azure CDN only support 15 tags on resources. |
tenant string | Azure tenant ID. Use when authenticating with a Service Principal. |
thumbprint string added in azure.azcollection 1.14.0 | The thumbprint of the private key specified in x509_certificate_path. Use when authenticating with a Service Principal. Required if x509_certificate_path is defined. |
x509_certificate_path path added in azure.azcollection 1.14.0 | 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. |
zones list / elements=string | A list of availability zones denoting the IP prefix allocated for the resource needs to come from. Choices:
|
Note
az login.See also
How to authenticate using the az login command.
- name: Create a public ip prefix
azure_rm_publicipprefix:
resource_group: myResourceGroup
name: my_public_ip
public_ip_address_version: IPV4
prefix_length: 29
sku:
name: Standard
tier: Regional
zones:
- 1
tags:
key1: value1
- name: Delete public ip prefix
azure_rm_publicipprefix:
resource_group: myResourceGroup
name: my_public_ipprefix
state: absent
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
state complex | List of public IP prefixes dicts. Returned: always |
|
custom_ip_prefix dictionary |
The customIpPrefix that this prefix is associated with. Returned: always Sample: |
|
id string |
Resource ID. Returned: always Sample: |
|
ip_tags list / elements=string |
The list of tags associated with the public IP prefixes. Returned: always Sample: |
|
location string |
Resource location. Returned: always Sample: |
|
name string |
Name of the public IP prefix. Returned: always Sample: |
|
public_ip_address_version string |
The public IP address version. Possible values are Returned: always Sample: |
|
public_ip_addresses list / elements=string |
The list of all referenced PublicIPAddresses. Returned: success Sample: |
|
resource_guid string |
The resource GUID property of the public IP prefix resource. Returned: success Sample: |
|
tags dictionary |
Resource tags. Returned: always Sample: |
|
type string |
Resource type. Returned: always Sample: |
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/azure/azcollection/azure_rm_publicipprefix_module.html