code
stringlengths 2.5k
150k
| kind
stringclasses 1
value |
---|---|
ansible inspur.sm.edit_alert_policy – Set alert policy. inspur.sm.edit\_alert\_policy – Set alert policy.
=================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.edit_alert_policy`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Set alert policy on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **channel** string | **Choices:*** shared
* dedicated
| LAN Channel. Only the M5 model supports this parameter. |
| **destination** string | | Alert destination,when type is snmp,fill in IP; when type is email,fill in user name; when type is snmpdomain,fill in domain. |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **id** integer / required | **Choices:*** 1
* 2
* 3
* 4
| Alert id. The values for M5 modules are 1,2,3. The values for M6 modules are 1,2,3,4. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **status** string | **Choices:*** enable
* disable
| Alert policy status. |
| **trap\_port** integer | | SNMP trap port(1-65535). Only the M6 model supports this parameter. |
| **type** string | **Choices:*** snmp
* email
* snmpdomain
| Alert Type. Only the M5 model supports this parameter. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Alert policy test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Set alert policy"
inspur.sm.edit_alert_policy:
id: 1
status: "enable"
type: "snmp"
destination: "100.2.2.2"
channel: "shared"
provider: "{{ ism }}"
- name: "Set alert policy"
inspur.sm.edit_alert_policy:
id: 1
status: "disable"
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.edit_snmp – Set snmp. inspur.sm.edit\_snmp – Set snmp.
================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.edit_snmp`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Set snmp on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_password** string | | Set auth password of V3 trap or v3get/v3set, Password is a string of 8 to 16 alpha-numeric characters. Required when *auth\_protocol* is either `SHA` or `MD5`. |
| **auth\_protocol** string | **Choices:*** NONE
* SHA
* MD5
| Choose authentication of V3 trap or v3get/v3set. |
| **community** string | | Community of v1/v2c or v1get/v1set/v2cget/v2cset. |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **priv\_password** string | | Set privacy password of V3 trap or v3get/v3set, password is a string of 8 to 16 alpha-numeric characters. Required when *priv\_protocol* is either `DES` or `AES`. |
| **priv\_protocol** string | **Choices:*** NONE
* DES
* AES
| Choose Privacy of V3 trap or v3get/v3set. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **snmp\_status** list / elements=string | | NMP read/write status of customize, the input parameters are 'v1get', 'v1set', 'v2cget', 'v2cset', 'v3get', 'v3set',separated by commas,such as v1get,v1set,v2cget. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **v3username** string | | Set user name of V3 trap or v3get/v3set. |
| **version** integer | **Choices:*** 0
* 1
* 2
* 3
* 4
| SNMP trap version option, 0 - 'v1', 1 - 'v2c', 2 - 'v3', 3 - 'all', 4 - 'customize'. |
Examples
--------
```
- name: Snmp test
hosts: ism
no_log: true
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Set snmp get/set"
inspur.sm.edit_snmp:
community: "test"
v3username: "Inspur"
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.del_user – Delete user. inspur.sm.del\_user – Delete user.
==================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.del_user`.
New in version 0.1.0: of inspur.sm
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
version 3.0.0
Why
Merge functions into the [inspur.sm.user](user_module#ansible-collections-inspur-sm-user-module) module.
Alternative
Use [inspur.sm.user](user_module#ansible-collections-inspur-sm-user-module) instead.
Synopsis
--------
* Delete user on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **uname** string / required | | User name. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Delete user test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Delete user"
inspur.sm.del_user:
uname: "wbs"
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
Status
------
* This module will be removed in version 3.0.0. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.edit_smtp – Set SMTP information. inspur.sm.edit\_smtp – Set SMTP information.
============================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.edit_smtp`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Set SMTP information on Inspur server.
* Only the M5 models support this feature.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **email** string | | Sender email. |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **interface** string / required | **Choices:*** eth0
* eth1
* bond0
| LAN Channel,eth0 is shared,eth1 is dedicated. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **primary\_auth** string | **Choices:*** enable
* disable
| Primary SMTP server authentication. |
| **primary\_ip** string | | Primary SMTP server IP. |
| **primary\_name** string | | Primary SMTP server name. |
| **primary\_password** string | | Primary SMTP server Password,lenth be 4 to 64 bits,cannot contain ' '(space). Required when *primary\_auth=enable*. |
| **primary\_port** integer | | Primary SMTP server port,The Identification for retry count configuration(1-65535). |
| **primary\_status** string | **Choices:*** enable
* disable
| Primary SMTP Support. |
| **primary\_username** string | | Primary SMTP server Username,lenth be 4 to 64 bits, must start with letters and cannot contain ','(comma) ':'(colon) ' '(space) ';'(semicolon) '\'(backslash). |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **secondary\_auth** string | **Choices:*** enable
* disable
| S.econdary SMTP server authentication |
| **secondary\_ip** string | | Secondary SMTP server IP. |
| **secondary\_name** string | | Secondary SMTP server name. |
| **secondary\_password** string | | Secondary SMTP server Password,lenth be 4 to 64 bits,cannot contain ' '(space). Required when *secondary\_auth=enable*. |
| **secondary\_port** integer | | Secondary SMTP server port,The Identification for retry count configuration(1-65535). |
| **secondary\_status** string | **Choices:*** enable
* disable
| Secondary SMTP Support. |
| **secondary\_username** string | | Secondary SMTP server Username,lenth be 4 to 64 bits, must start with letters and cannot contain ','(comma) ':'(colon) ' '(space) ';'(semicolon) '\'(backslash). |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Smtp test
hosts: ism
no_log: true
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Set smtp information"
inspur.sm.edit_smtp:
interface: "eth0"
email: "[email protected]"
primary_status: "enable"
primary_ip: "100.2.2.2"
primary_name: "inspur"
primary_auth: "disable"
provider: "{{ ism }}"
- name: "Set smtp information"
inspur.sm.edit_smtp:
interface: "eth0"
email: "[email protected]"
primary_status: "enable"
primary_ip: "100.2.2.2"
primary_name: "inspur"
primary_auth: "enable"
primary_username: "test"
primary_password: my_password
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.log_setting_info – Get bmc log setting information. inspur.sm.log\_setting\_info – Get bmc log setting information.
===============================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.log_setting_info`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get bmc log setting information on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Bmc log setting test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Get bmc log setting information"
inspur.sm.log_setting_info:
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
| programming_docs |
ansible inspur.sm.edit_preserve_config – Set preserve config. inspur.sm.edit\_preserve\_config – Set preserve config.
=======================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.edit_preserve_config`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Set preserve config on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **override** list / elements=string | **Choices:*** authentication
* dcmi
* fru
* hostname
* ipmi
* kvm
* network
* ntp
* pef
* sdr
* sel
* smtp
* snmp
* sol
* ssh
* syslog
* user
| Configuration items that need to be retained. Required when *setting=manual*. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **setting** string / required | **Choices:*** all
* none
* manual
| Preserve option, all - preserve all config; none - overwrite all config; manual - manual choose. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Preserve test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Set preserve all"
inspur.sm.edit_preserve_config:
setting: "all"
provider: "{{ ism }}"
- name: "Set preserve none"
edit_preserve_config:
setting: "none"
provider: "{{ ism }}"
- name: "Set preserve manual"
edit_preserve_config:
setting: "manual"
override:
- fru
- ntp
- network
- user
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.sensor_info – Get sensor information. inspur.sm.sensor\_info – Get sensor information.
================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.sensor_info`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get sensor information on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Sensor test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Get sensor information"
inspur.sm.sensor_info:
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.edit_snmp_trap – Set snmp trap. inspur.sm.edit\_snmp\_trap – Set snmp trap.
===========================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.edit_snmp_trap`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Set snmp trap on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_password** string | | Set auth password of V3 trap, password is a string of 8 to 16 alpha-numeric characters. Required when *auth\_protocol* is either `SHA` or `MD5`. |
| **auth\_protocol** string | **Choices:*** NONE
* SHA
* MD5
| Choose authentication. |
| **community** string | | Community of v1/v2c. |
| **contact** string | | Set contact, can set NULL. Only the M5 model supports this parameter. |
| **engine\_id** string | | Set Engine ID of V3 trap, engine ID is a string of 10 to 48 hex characters, must even, can set NULL. |
| **event\_severity** string | **Choices:*** all
* warning
* critical
| Event Severity. |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **host\_id** string | **Choices:*** HostName
* SerialNum
* AssertTag
| Host id. Only the M6 model supports this parameter. |
| **location** string | | Set host Location, can set NULL. Only the M5 model supports this parameter. |
| **os** string | | Set host OS, can set NULL. Only the M5 model supports this parameter. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **priv\_password** string | | Set privacy password of V3 trap, password is a string of 8 to 16 alpha-numeric characters. Required when *priv\_protocol* is either `DES` or `AES`. |
| **priv\_protocol** string | **Choices:*** NONE
* DES
* AES
| Choose Privacy. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **system\_id** string | | Set system ID, can set NULL. Only the M5 model supports this parameter. |
| **system\_name** string | | Set system name, can set NULL. Only the M5 model supports this parameter. |
| **trap\_port** integer | | Set SNMP trap Port(1-65535). Only the M5 model supports this parameter. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **v3username** string | | Set user name of V3 trap. |
| **version** string | **Choices:*** 1
* 2c
* 3
| SNMP trap version. |
Examples
--------
```
- name: Trap test
hosts: ism
no_log: true
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Set snmp trap v2c"
inspur.sm.edit_snmp_trap:
version: "2c"
event_severity: "warning"
inspur: "test"
system_name: "Inspur"
provider: "{{ ism }}"
- name: "Set snmp trap v3"
inspur.sm.edit_snmp_trap:
version: "3"
event_severity: "all"
v3username: "Inspur"
engine_id: "1234567890"
auth_protocol: "SHA"
auth_password: "12345678"
priv_protocol: "AES"
priv_password: "123454678"
trap_port: 162
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.edit_user_group – Set user group. inspur.sm.edit\_user\_group – Set user group.
=============================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.edit_user_group`.
New in version 0.1.0: of inspur.sm
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
version 3.0.0
Why
Merge functions into the [inspur.sm.user\_group](user_group_module#ansible-collections-inspur-sm-user-group-module) module.
Alternative
Use [inspur.sm.user\_group](user_group_module#ansible-collections-inspur-sm-user-group-module) instead.
Synopsis
--------
* Set user group on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **name** string / required | | Group name. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **pri** string / required | **Choices:*** administrator
* operator
* user
* oem
* none
| Group privilege. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Set user group test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Set user group"
inspur.sm.edit_user_group:
name: "test"
pri: "administrator"
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
Status
------
* This module will be removed in version 3.0.0. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.user_group_info – Get user group information. inspur.sm.user\_group\_info – Get user group information.
=========================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.user_group_info`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get user group information on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: User group test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Get user group information"
inspur.sm.user_group_info:
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.edit_bios – Set BIOS setup attributes. inspur.sm.edit\_bios – Set BIOS setup attributes.
=================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.edit_bios`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Set BIOS setup attributes on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **attribute** string | | BIOS setup option. Required when *file\_url=None*. |
| **file\_url** string | | BIOS option file.attribute must be used with value, Mutually exclusive with fileurl format,"/directory/filename". Only the M5 model supports this parameter. |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **value** string | | BIOS setup option value. Required when *file\_url=None*. |
Examples
--------
```
- name: Bios test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Set bios setup"
inspur.sm.edit_bios:
attribute: "VMX"
value: "Disable"
provider: "{{ ism }}"
- name: "Set bios setup"
inspur.sm.edit_bios:
attribute: "VMX"
value: "Enable"
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
| programming_docs |
ansible inspur.sm.ldap_info – Get ldap information. inspur.sm.ldap\_info – Get ldap information.
============================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.ldap_info`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get ldap information on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Ldap test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Get ldap information"
inspur.sm.ldap_info:
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.fan_info – Get fan information. inspur.sm.fan\_info – Get fan information.
==========================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.fan_info`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get fan information on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Fan test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Get fan information"
inspur.sm.fan_info:
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.edit_fru – Set fru settings. inspur.sm.edit\_fru – Set fru settings.
=======================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.edit_fru`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Set fru settings on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **attribute** string / required | **Choices:*** CP
* CS
* PM
* PPN
* PS
* PN
* PV
* PAT
* BM
* BPN
* BS
* BP
| Attribute,CP is Chassis Part Number,CS is Chassis Serial,PM is Product Manufacturer, PPN is Product Part Number,PS is Product Serial,PN is Product Name,PV is Product Version, PAT is Product Asset Tag,BM is Board Mfg,BPN is Board Product Name,BS is Board Serial, BP is Board Part Number. |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **value** string / required | | Set the value of attribute. |
Examples
--------
```
- name: Fru test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Set Fru"
inspur.sm.edit_fru:
attribute: "CP"
value: "Inspur"
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.event_log_policy_info – Get event log policy information. inspur.sm.event\_log\_policy\_info – Get event log policy information.
======================================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.event_log_policy_info`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get event log policy information on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Event log policy test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Get event log policy information"
inspur.sm.event_log_policy_info:
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.edit_threshold – Set threshold information. inspur.sm.edit\_threshold – Set threshold information.
======================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.edit_threshold`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Set threshold information on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **lc** integer | | Lower critical threshold,should be integer. |
| **lnc** integer | | Lower non critical threshold,should be integer. |
| **lnr** integer | | Lower non recoverable threshold,should be integer. |
| **name** string / required | | Sensor name. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **uc** integer | | Up critical threshold,should be integer. |
| **unc** integer | | Up non critical threshold,should be integer. |
| **unr** integer | | Up non recoverable threshold,should be integer. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Threshold test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Set threshold information"
inspur.sm.edit_threshold:
name: "GPU1_Temp"
uc: 94
unc: 92
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.edit_ipv6 – Set ipv6 information. inspur.sm.edit\_ipv6 – Set ipv6 information.
============================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.edit_ipv6`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Set ipv6 information on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **interface\_name** string / required | **Choices:*** eth0
* eth1
* bond0
| Set interface\_name. |
| **ipv6\_address** string | | If DHCP is disabled, specify a static IPv6 address to be configured for the selected interface. Required when *ipv6\_dhcp\_enable=static*. |
| **ipv6\_dhcp\_enable** string | **Choices:*** dhcp
* static
| Enable 'Enable DHCP' to dynamically configure IPv6 address using Dynamic Host Configuration Protocol (DHCP). |
| **ipv6\_gateway** string | | If DHCP is disabled, specify a static Default Gateway to be configured for the selected interface. Required when *ipv6\_dhcp\_enable=static*. |
| **ipv6\_index** integer | | Ipv6 index(0-15). Required when *ipv6\_dhcp\_enable=static*. |
| **ipv6\_prefix** integer | | The subnet prefix length for the IPv6 settings(0-128). Required when *ipv6\_dhcp\_enable=static*. |
| **ipv6\_status** string | **Choices:*** enable
* disable
| Enable or disable IPV6. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Ipv6 test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Set ipv6 information"
inspur.sm.edit_ipv6:
interface_name: "eth0"
ipv6_status: "disable"
provider: "{{ ism }}"
- name: "Set ipv6 information"
inspur.sm.edit_ipv6:
interface_name: "eth0"
ipv6_status: "enable"
ipv6_dhcp_enable: "dhcp"
provider: "{{ ism }}"
- name: "Set ipv6 information"
inspur.sm.edit_ipv6:
interface_name: "eth0"
ipv6_status: "enable"
ipv6_dhcp_enable: "static"
ipv6_address: "::ffff:100:2:36:10"
ipv6_index: 12
ipv6_prefix: 16
ipv6_gateway: "::"
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
| programming_docs |
ansible inspur.sm.psu_peak_info – Get psu peak information. inspur.sm.psu\_peak\_info – Get psu peak information.
=====================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.psu_peak_info`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get psu peak information on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Psu peak test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Get psu peak information"
inspur.sm.psu_peak_info:
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | check to see if a change was made on the device |
| **message** string | always | messages returned after module execution |
| **state** string | always | status after module execution |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.user – Manage user. inspur.sm.user – Manage user.
=============================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.user`.
New in version 1.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage user on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **email** string | | User email. |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **priv** list / elements=string | **Choices:*** kvm
* vmm
* sol
* none
| User access, select one or more from None/KVM/VMM/SOL. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **role\_id** string | | user group, default user group,'Administrator', 'Operator', 'Commonuser','OEM','NoAccess', use command `user_group_info` can get all group information. |
| **state** string | **Choices:*** **present** ←
* absent
| Whether the user should exist or not, taking action if the state is different from what is stated. |
| **uname** string / required | | User name. |
| **upass** string | | User password. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: User test
hosts: ism
no_log: true
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Add user"
inspur.sm.user:
state: "present"
uname: "wbs"
upass: "admin"
role_id: "Administrator"
priv: "kvm,sol"
email: "[email protected]"
provider: "{{ ism }}"
- name: "Set user"
inspur.sm.user:
state: "present"
uname: "wbs"
upass: "12345678"
role_id: "user"
priv: "kvm,sol"
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.snmp_info – Get snmp get/set information. inspur.sm.snmp\_info – Get snmp get/set information.
====================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.snmp_info`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get snmp get/set information on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Snmp test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Get snmp get/set information"
inspur.sm.snmp_info:
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.bios_info – Get BIOS setup. inspur.sm.bios\_info – Get BIOS setup.
======================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.bios_info`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get BIOS setup on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Bios test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Get bios setup"
inspur.sm.bios_info:
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.edit_event_log_policy – Set event log policy. inspur.sm.edit\_event\_log\_policy – Set event log policy.
==========================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.edit_event_log_policy`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Set event log policy on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **policy** string / required | **Choices:*** Linear
* Circular
| Event Log Policy. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Event log policy test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Set event log policy"
inspur.sm.edit_event_log_policy:
policy: "Linear"
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.snmp_trap_info – Get snmp trap information. inspur.sm.snmp\_trap\_info – Get snmp trap information.
=======================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.snmp_trap_info`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get snmp trap information on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Trap test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Get snmp trap information"
inspur.sm.snmp_trap_info:
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
| programming_docs |
ansible inspur.sm.edit_priv_user – Change user privilege. inspur.sm.edit\_priv\_user – Change user privilege.
===================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.edit_priv_user`.
New in version 0.1.0: of inspur.sm
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
version 3.0.0
Why
Merge functions into the [inspur.sm.user](user_module#ansible-collections-inspur-sm-user-module) module.
Alternative
Use [inspur.sm.user](user_module#ansible-collections-inspur-sm-user-module) instead.
Synopsis
--------
* Change user privilege on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **priv** list / elements=string / required | **Choices:*** kvm
* vmm
* sol
* none
| User access, select one or more from None/KVM/VMM/SOL. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **role\_id** string / required | | user group, default user group,'Administrator', 'Operator', 'Commonuser','OEM','NoAccess', use command `user_group_info` can get all group information. |
| **uname** string / required | | User name. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Edit user privilege test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Change user privilege"
inspur.sm.edit_priv_user:
uname: "wbs"
role_id: "Administrator"
priv: "kvm,sol"
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
Status
------
* This module will be removed in version 3.0.0. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.ldisk_info – Get logical disks information. inspur.sm.ldisk\_info – Get logical disks information.
======================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.ldisk_info`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get logical disks information on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Ldisk test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Get logical disks information"
inspur.sm.ldisk_info:
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.add_ad_group – Add active directory group information. inspur.sm.add\_ad\_group – Add active directory group information.
==================================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.add_ad_group`.
New in version 0.1.0: of inspur.sm
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
version 3.0.0
Why
Merge functions into the [inspur.sm.ad\_group](ad_group_module#ansible-collections-inspur-sm-ad-group-module) module.
Alternative
Use [inspur.sm.ad\_group](ad_group_module#ansible-collections-inspur-sm-ad-group-module) instead.
Synopsis
--------
* Add active directory group information on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **domain** string / required | | Group domain. |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **kvm** string / required | **Choices:*** enable
* disable
| Kvm privilege. |
| **name** string / required | | Group name. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **pri** string / required | **Choices:*** administrator
* user
* operator
* oem
* none
| Group privilege. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **vm** string / required | **Choices:*** enable
* disable
| Vmedia privilege. |
Examples
--------
```
- name: Ad group test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Add active directory group information"
inspur.sm.add_ad_group:
name: "wbs"
domain: "inspur.com"
pri: "administrator"
kvm: "enable"
vm: "disable"
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
Status
------
* This module will be removed in version 3.0.0. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.edit_log_setting – Set bmc system and audit log setting. inspur.sm.edit\_log\_setting – Set bmc system and audit log setting.
====================================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.edit_log_setting`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Set bmc system and audit log setting on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **audit\_status** string | **Choices:*** enable
* disable
| Audit Log Status. |
| **audit\_type** string | **Choices:*** local
* remote
* both
| Audit log type. |
| **file\_size** integer | | File Size(3-65535bytes), set when type is local(default 30000). |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **protocol\_type** string | **Choices:*** UDP
* TCP
| Protocol Type, set when type is remote. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **rotate\_count** integer | **Choices:*** 0
* 1
| Rotate Count, set when type is local, 0-delete old files(default), 1-bak old files. |
| **server\_addr** string | | Server Address, set when type is remote. |
| **server\_port** integer | | Server Port(0-65535), set when type is remote. |
| **status** string | **Choices:*** enable
* disable
| System Log Status. |
| **type** string | **Choices:*** local
* remote
* both
| System log type. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Edit log setting test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Edit bmc system log setting"
inspur.sm.edit_log_setting:
status: "enable"
type: "both"
provider: "{{ ism }}"
- name: "Edit bmc audit log setting"
inspur.sm.edit_log_setting:
audit_status: "enable"
audit_type: "remote"
server_addr: "100.2.126.11"
server_port: "514"
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
ansible inspur.sm.edit_restore_factory_default – Set preserver config. inspur.sm.edit\_restore\_factory\_default – Set preserver config.
=================================================================
Note
This plugin is part of the [inspur.sm collection](https://galaxy.ansible.com/inspur/sm) (version 1.3.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 inspur.sm`.
To use it in a playbook, specify: `inspur.sm.edit_restore_factory_default`.
New in version 0.1.0: of inspur.sm
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Set preserver config on Inspur server.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| **mode** string / required | **Choices:*** all
* none
* manual
| Restore factory defaults mode. |
| **override** list / elements=string | **Choices:*** authentication
* dcmi
* fru
* hostname
* ipmi
* kvm
* network
* ntp
* pef
* sdr
* sel
* smtp
* snmp
* sol
* ssh
* syslog
* user
| Configuration items that need to be retained. Required when *mode=manual*. |
| **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **username** string | | Configures the username to use to authenticate the connection to the remote device. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Examples
--------
```
- name: Restore default test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Set restore default auto"
inspur.sm.edit_restore_factory_default:
mode: "all"
provider: "{{ ism }}"
- name: "Set restore default manual"
inspur.sm.edit_restore_factory_default:
mode: "manual"
override:
- fru
- ntp
- network
- user
provider: "{{ ism }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Check to see if a change was made on the device. |
| **message** string | always | Messages returned after module execution. |
| **state** string | always | Status after module execution. |
### Authors
* WangBaoshan (@ISIB-group)
| programming_docs |
ansible Collections in the Hetzner Namespace Collections in the Hetzner Namespace
====================================
These are the collections with docs hosted on [docs.ansible.com](https://docs.ansible.com/) in the **hetzner** namespace.
* [hetzner.hcloud](hcloud/index#plugins-in-hetzner-hcloud)
ansible hetzner.hcloud.hcloud_certificate – Create and manage certificates on the Hetzner Cloud. hetzner.hcloud.hcloud\_certificate – Create and manage certificates on the Hetzner Cloud.
=========================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_certificate`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and manage certificates on the Hetzner Cloud.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **certificate** string | | Certificate and chain in PEM format, in order so that each record directly certifies the one preceding. Required if certificate does not exists. |
| **domain\_names** list / elements=string | | Certificate key in PEM format. Required if certificate does not exists. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the Hetzner Cloud certificate to manage. Only required if no certificate *name* is given |
| **labels** dictionary | | User-defined labels (key-value pairs) |
| **name** string | | The Name of the Hetzner Cloud certificate to manage. Only required if no certificate *id* is given or a certificate does not exists. |
| **private\_key** string | | Certificate key in PEM format. Required if certificate does not exists. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the certificate. |
| **type** string | **Choices:*** **uploaded** ←
* managed
| Choose between uploading a Certificate in PEM format or requesting a managed Let's Encrypt Certificate. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a basic certificate
hcloud_certificate:
name: my-certificate
certificate: "ssh-rsa AAAjjk76kgf...Xt"
private_key: "ssh-rsa AAAjjk76kgf...Xt"
state: present
- name: Create a certificate with labels
hcloud_certificate:
name: my-certificate
certificate: "ssh-rsa AAAjjk76kgf...Xt"
private_key: "ssh-rsa AAAjjk76kgf...Xt"
labels:
key: value
mylabel: 123
state: present
- name: Ensure the certificate is absent (remove if needed)
hcloud_certificate:
name: my-certificate
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_certificate** complex | Always | The certificate instance |
| | **certificate** string | always | Certificate and chain in PEM format **Sample:** -----BEGIN CERTIFICATE-----... |
| | **domain\_names** dictionary | always | List of Domains and Subdomains covered by the Certificate |
| | **fingerprint** string | always | Fingerprint of the certificate **Sample:** 03:c7:55:9b:2a:d1:04:17:09:f6:d0:7f:18:34:63:d4:3e:5f |
| | **id** integer | always | Numeric identifier of the certificate **Sample:** 1937415 |
| | **labels** dictionary | always | User-defined labels (key-value pairs) |
| | **name** string | always | Name of the certificate **Sample:** my website cert |
| | **not\_valid\_after** string | always | Point in time when the Certificate stops being valid (in ISO-8601 format) |
| | **not\_valid\_before** string | always | Point in time when the Certificate becomes valid (in ISO-8601 format) |
### Authors
* Lukas Kaemmerling (@lkaemmerling)
ansible hetzner.hcloud.hcloud_load_balancer_network – Manage the relationship between Hetzner Cloud Networks and Load Balancers hetzner.hcloud.hcloud\_load\_balancer\_network – Manage the relationship between Hetzner Cloud Networks and Load Balancers
==========================================================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_load_balancer_network`.
New in version 0.1.0: of hetzner.hcloud
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create and delete the relationship Hetzner Cloud Networks and Load Balancers
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
* hcloud-python >= 1.8.1
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **ip** string | | The IP the Load Balancer should have. |
| **load\_balancer** string / required | | The name of the Hetzner Cloud Load Balancer. |
| **network** string / required | | The name of the Hetzner Cloud Networks. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the load\_balancer\_network. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a basic Load Balancer network
hcloud_load_balancer_network:
network: my-network
load_balancer: my-LoadBalancer
state: present
- name: Create a Load Balancer network and specify the ip address
hcloud_load_balancer_network:
network: my-network
load_balancer: my-LoadBalancer
ip: 10.0.0.1
state: present
- name: Ensure the Load Balancer network is absent (remove if needed)
hcloud_load_balancer_network:
network: my-network
load_balancer: my-LoadBalancer
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_load\_balancer\_network** complex | always | The relationship between a Load Balancer and a network |
| | **ip** string | always | IP of the Load Balancer within the Network ip range **Sample:** 10.0.0.8 |
| | **load\_balancer** string | always | Name of the Load Balancer **Sample:** my-LoadBalancer |
| | **network** string | always | Name of the Network **Sample:** my-network |
### Authors
* Lukas Kaemmerling (@lkaemmerling)
ansible hetzner.hcloud.hcloud_route – Create and delete cloud routes on the Hetzner Cloud. hetzner.hcloud.hcloud\_route – Create and delete cloud routes on the Hetzner Cloud.
===================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_route`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete cloud routes on the Hetzner Cloud.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
* hcloud-python >= 1.3.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **destination** string / required | | Destination network or host of this route. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **gateway** string / required | | Gateway for the route. |
| **network** string / required | | The name of the Hetzner Cloud Network. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the route. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a basic route
hcloud_route:
network: my-network
destination: 10.100.1.0/24
gateway: 10.0.1.1
state: present
- name: Ensure the route is absent
hcloud_route:
network: my-network
destination: 10.100.1.0/24
gateway: 10.0.1.1
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_route** complex | always | One Route of a Network |
| | **destination** string | always | Destination network or host of this route **Sample:** 10.0.0.0/8 |
| | **gateway** string | always | Gateway of the route **Sample:** 10.0.0.1 |
| | **network** string | always | Name of the Network **Sample:** my-network |
### Authors
* Lukas Kaemmerling (@lkaemmerling)
ansible Hetzner.Hcloud Hetzner.Hcloud
==============
Collection version 1.6.0
Plugin Index
------------
These are the plugins in the hetzner.hcloud collection
### Inventory Plugins
* [hcloud](hcloud_inventory#ansible-collections-hetzner-hcloud-hcloud-inventory) – Ansible dynamic inventory plugin for the Hetzner Cloud.
### Modules
* [hcloud\_certificate](hcloud_certificate_module#ansible-collections-hetzner-hcloud-hcloud-certificate-module) – Create and manage certificates on the Hetzner Cloud.
* [hcloud\_certificate\_info](hcloud_certificate_info_module#ansible-collections-hetzner-hcloud-hcloud-certificate-info-module) – Gather infos about your Hetzner Cloud certificates.
* [hcloud\_datacenter\_info](hcloud_datacenter_info_module#ansible-collections-hetzner-hcloud-hcloud-datacenter-info-module) – Gather info about the Hetzner Cloud datacenters.
* [hcloud\_firewall](hcloud_firewall_module#ansible-collections-hetzner-hcloud-hcloud-firewall-module) – Create and manage firewalls on the Hetzner Cloud.
* [hcloud\_floating\_ip](hcloud_floating_ip_module#ansible-collections-hetzner-hcloud-hcloud-floating-ip-module) – Create and manage cloud Floating IPs on the Hetzner Cloud.
* [hcloud\_floating\_ip\_info](hcloud_floating_ip_info_module#ansible-collections-hetzner-hcloud-hcloud-floating-ip-info-module) – Gather infos about the Hetzner Cloud Floating IPs.
* [hcloud\_image\_info](hcloud_image_info_module#ansible-collections-hetzner-hcloud-hcloud-image-info-module) – Gather infos about your Hetzner Cloud images.
* [hcloud\_load\_balancer](hcloud_load_balancer_module#ansible-collections-hetzner-hcloud-hcloud-load-balancer-module) – Create and manage cloud Load Balancers on the Hetzner Cloud.
* [hcloud\_load\_balancer\_info](hcloud_load_balancer_info_module#ansible-collections-hetzner-hcloud-hcloud-load-balancer-info-module) – Gather infos about your Hetzner Cloud Load Balancers.
* [hcloud\_load\_balancer\_network](hcloud_load_balancer_network_module#ansible-collections-hetzner-hcloud-hcloud-load-balancer-network-module) – Manage the relationship between Hetzner Cloud Networks and Load Balancers
* [hcloud\_load\_balancer\_service](hcloud_load_balancer_service_module#ansible-collections-hetzner-hcloud-hcloud-load-balancer-service-module) – Create and manage the services of cloud Load Balancers on the Hetzner Cloud.
* [hcloud\_load\_balancer\_target](hcloud_load_balancer_target_module#ansible-collections-hetzner-hcloud-hcloud-load-balancer-target-module) – Manage Hetzner Cloud Load Balancer targets
* [hcloud\_load\_balancer\_type\_info](hcloud_load_balancer_type_info_module#ansible-collections-hetzner-hcloud-hcloud-load-balancer-type-info-module) – Gather infos about the Hetzner Cloud Load Balancer types.
* [hcloud\_location\_info](hcloud_location_info_module#ansible-collections-hetzner-hcloud-hcloud-location-info-module) – Gather infos about your Hetzner Cloud locations.
* [hcloud\_network](hcloud_network_module#ansible-collections-hetzner-hcloud-hcloud-network-module) – Create and manage cloud Networks on the Hetzner Cloud.
* [hcloud\_network\_info](hcloud_network_info_module#ansible-collections-hetzner-hcloud-hcloud-network-info-module) – Gather info about your Hetzner Cloud networks.
* [hcloud\_placement\_group](hcloud_placement_group_module#ansible-collections-hetzner-hcloud-hcloud-placement-group-module) – Create and manage placement groups on the Hetzner Cloud.
* [hcloud\_rdns](hcloud_rdns_module#ansible-collections-hetzner-hcloud-hcloud-rdns-module) – Create and manage reverse DNS entries on the Hetzner Cloud.
* [hcloud\_route](hcloud_route_module#ansible-collections-hetzner-hcloud-hcloud-route-module) – Create and delete cloud routes on the Hetzner Cloud.
* [hcloud\_server](hcloud_server_module#ansible-collections-hetzner-hcloud-hcloud-server-module) – Create and manage cloud servers on the Hetzner Cloud.
* [hcloud\_server\_info](hcloud_server_info_module#ansible-collections-hetzner-hcloud-hcloud-server-info-module) – Gather infos about your Hetzner Cloud servers.
* [hcloud\_server\_network](hcloud_server_network_module#ansible-collections-hetzner-hcloud-hcloud-server-network-module) – Manage the relationship between Hetzner Cloud Networks and servers
* [hcloud\_server\_type\_info](hcloud_server_type_info_module#ansible-collections-hetzner-hcloud-hcloud-server-type-info-module) – Gather infos about the Hetzner Cloud server types.
* [hcloud\_ssh\_key](hcloud_ssh_key_module#ansible-collections-hetzner-hcloud-hcloud-ssh-key-module) – Create and manage ssh keys on the Hetzner Cloud.
* [hcloud\_ssh\_key\_info](hcloud_ssh_key_info_module#ansible-collections-hetzner-hcloud-hcloud-ssh-key-info-module) – Gather infos about your Hetzner Cloud ssh\_keys.
* [hcloud\_subnetwork](hcloud_subnetwork_module#ansible-collections-hetzner-hcloud-hcloud-subnetwork-module) – Manage cloud subnetworks on the Hetzner Cloud.
* [hcloud\_volume](hcloud_volume_module#ansible-collections-hetzner-hcloud-hcloud-volume-module) – Create and manage block Volume on the Hetzner Cloud.
* [hcloud\_volume\_info](hcloud_volume_info_module#ansible-collections-hetzner-hcloud-hcloud-volume-info-module) – Gather infos about your Hetzner Cloud Volumes.
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible hetzner.hcloud.hcloud_volume_info – Gather infos about your Hetzner Cloud Volumes. hetzner.hcloud.hcloud\_volume\_info – Gather infos about your Hetzner Cloud Volumes.
====================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_volume_info`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather infos about your Hetzner Cloud Volumes.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the Volume you want to get. |
| **label\_selector** string | | The label selector for the Volume you want to get. |
| **name** string | | The name of the Volume you want to get. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Gather hcloud Volume infos
hcloud_volume_info:
register: output
- name: Print the gathered infos
debug:
var: output.hcloud_volume_info
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_volume\_info** complex | always | The Volume infos as list |
| | **delete\_protection** boolean added in 0.1.0 of hetzner.hcloud | always | True if the Volume is protected for deletion |
| | **id** integer | always | Numeric identifier of the Volume **Sample:** 1937415 |
| | **labels** dictionary | always | User-defined labels (key-value pairs) |
| | **linux\_device** string added in 0.1.0 of hetzner.hcloud | always | Path to the device that contains the Volume. **Sample:** /dev/disk/by-id/scsi-0HC\_Volume\_12345 |
| | **location** string | always | Name of the location where the Volume resides in **Sample:** fsn1 |
| | **name** string | always | Name of the Volume **Sample:** my-volume |
| | **server** string | always | Name of the server where the Volume is attached to **Sample:** my-server |
| | **size** string | always | Size of the Volume **Sample:** 10 |
### Authors
* Lukas Kaemmerling (@LKaemmerling)
ansible hetzner.hcloud.hcloud_server – Create and manage cloud servers on the Hetzner Cloud. hetzner.hcloud.hcloud\_server – Create and manage cloud servers on the Hetzner Cloud.
=====================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_server`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and manage cloud servers on the Hetzner Cloud.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **allow\_deprecated\_image** boolean | **Choices:*** **no** ←
* yes
| Allows the creation of servers with deprecated images. |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **backups** boolean | **Choices:*** no
* yes
| Enable or disable Backups for the given Server. |
| **datacenter** string | | Datacenter of Server. Required of no *location* is given and server does not exists. |
| **delete\_protection** boolean | **Choices:*** no
* yes
| Protect the Server for deletion. Needs to be the same as *rebuild\_protection*. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **firewalls** list / elements=string | | List of Firewall IDs that should be attached to the server on server creation. |
| **force** boolean | **Choices:*** **no** ←
* yes
| Force the update of the server. May power off the server if update. |
| **force\_upgrade** boolean | **Choices:*** **no** ←
* yes
| Deprecated Force the upgrade of the server. Power off the server if it is running on upgrade. |
| **id** integer | | The ID of the Hetzner Cloud server to manage. Only required if no server *name* is given |
| **image** string | | Image the server should be created from. Required if server does not exists. |
| **labels** dictionary | | User-defined labels (key-value pairs). |
| **location** string | | Location of Server. Required if no *datacenter* is given and server does not exists. |
| **name** string | | The Name of the Hetzner Cloud server to manage. Only required if no server *id* is given or a server does not exists. |
| **placement\_group** string | | Placement Group of the server. |
| **rebuild\_protection** boolean | **Choices:*** no
* yes
| Protect the Server for rebuild. Needs to be the same as *delete\_protection*. |
| **rescue\_mode** string | | Add the Hetzner rescue system type you want the server to be booted into. |
| **server\_type** string | | The Server Type of the Hetzner Cloud server to manage. Required if server does not exists. |
| **ssh\_keys** list / elements=string | | List of SSH key names The key names correspond to the SSH keys configured for your Hetzner Cloud account access. |
| **state** string | **Choices:*** absent
* **present** ←
* restarted
* started
* stopped
* rebuild
| State of the server. |
| **upgrade\_disk** boolean | **Choices:*** **no** ←
* yes
| Resize the disk size, when resizing a server. If you want to downgrade the server later, this value should be False. |
| **user\_data** string | | User Data to be passed to the server on creation. Only used if server does not exists. |
| **volumes** list / elements=string | | List of Volumes IDs that should be attached to the server on server creation. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a basic server
hcloud_server:
name: my-server
server_type: cx11
image: ubuntu-18.04
state: present
- name: Create a basic server with ssh key
hcloud_server:
name: my-server
server_type: cx11
image: ubuntu-18.04
location: fsn1
ssh_keys:
- me@myorganisation
state: present
- name: Resize an existing server
hcloud_server:
name: my-server
server_type: cx21
upgrade_disk: yes
state: present
- name: Ensure the server is absent (remove if needed)
hcloud_server:
name: my-server
state: absent
- name: Ensure the server is started
hcloud_server:
name: my-server
state: started
- name: Ensure the server is stopped
hcloud_server:
name: my-server
state: stopped
- name: Ensure the server is restarted
hcloud_server:
name: my-server
state: restarted
- name: Ensure the server is will be booted in rescue mode and therefore restarted
hcloud_server:
name: my-server
rescue_mode: linux64
state: restarted
- name: Ensure the server is rebuild
hcloud_server:
name: my-server
image: ubuntu-18.04
state: rebuild
- name: Add server to placement group
hcloud_server:
name: my-server
placement_group: my-placement-group
force: True
state: present
- name: Remove server from placement group
hcloud_server:
name: my-server
placement_group: null
state: present
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_server** complex | Always | The server instance |
| | **backup\_window** boolean | always | Time window (UTC) in which the backup will run, or null if the backups are not enabled **Sample:** 22-02 |
| | **datacenter** string | always | Name of the datacenter of the server **Sample:** fsn1-dc14 |
| | **delete\_protection** boolean added in 0.1.0 of hetzner.hcloud | always | True if server is protected for deletion |
| | **id** integer | always | Numeric identifier of the server **Sample:** 1937415 |
| | **ipv4\_address** string | always | Public IPv4 address of the server **Sample:** 116.203.104.109 |
| | **ipv6** string | always | IPv6 network of the server **Sample:** 2a01:4f8:1c1c:c140::/64 |
| | **labels** dictionary | always | User-defined labels (key-value pairs) |
| | **location** string | always | Name of the location of the server **Sample:** fsn1 |
| | **name** string | always | Name of the server **Sample:** my-server |
| | **placement\_group** string added in 1.5.0 of hetzner.hcloud | always | Placement Group of the server **Sample:** 4711 |
| | **rebuild\_protection** boolean added in 0.1.0 of hetzner.hcloud | always | True if server is protected for rebuild |
| | **rescue\_enabled** boolean | always | True if rescue mode is enabled, Server will then boot into rescue system on next reboot |
| | **server\_type** string | always | Name of the server type of the server **Sample:** cx11 |
| | **status** string | always | Status of the server **Sample:** running |
### Authors
* Lukas Kaemmerling (@LKaemmerling)
| programming_docs |
ansible hetzner.hcloud.hcloud_image_info – Gather infos about your Hetzner Cloud images. hetzner.hcloud.hcloud\_image\_info – Gather infos about your Hetzner Cloud images.
==================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_image_info`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather infos about your Hetzner Cloud images.
* This module was called `hcloud_location_facts` before Ansible 2.9, returning `ansible_facts` and `hcloud_location_facts`. Note that the [hetzner.hcloud.hcloud\_image\_info](#ansible-collections-hetzner-hcloud-hcloud-image-info-module) module no longer returns `ansible_facts` and the value was renamed to `hcloud_image_info`!
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the image you want to get. |
| **label\_selector** string | | The label selector for the images you want to get. |
| **name** string | | The name of the image you want to get. |
| **type** string | **Choices:*** **system** ←
* snapshot
* backup
| The label selector for the images you want to get. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Gather hcloud image infos
hcloud_image_info:
register: output
- name: Print the gathered infos
debug:
var: output
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_image\_info** complex | always | The image infos as list |
| | **description** string | always | Detail description of the image **Sample:** Ubuntu 18.04 Standard 64 bit |
| | **id** integer | always | Numeric identifier of the image **Sample:** 1937415 |
| | **labels** dictionary | always | User-defined labels (key-value pairs) |
| | **name** string | always | Name of the image **Sample:** ubuntu-18.04 |
| | **os\_flavor** string | always | OS flavor of the image **Sample:** ubuntu |
| | **os\_version** string | always | OS version of the image **Sample:** 18.04 |
| | **status** string | always | Status of the image **Sample:** available |
| | **type** string | always | Type of the image **Sample:** system |
### Authors
* Lukas Kaemmerling (@LKaemmerling)
ansible hetzner.hcloud.hcloud_volume – Create and manage block Volume on the Hetzner Cloud. hetzner.hcloud.hcloud\_volume – Create and manage block Volume on the Hetzner Cloud.
====================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_volume`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and attach/detach block Volume on the Hetzner Cloud.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **automount** boolean | **Choices:*** **no** ←
* yes
| Automatically mount the Volume. |
| **delete\_protection** boolean | **Choices:*** no
* yes
| Protect the Volume for deletion. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **format** string | **Choices:*** xfs
* ext4
| Automatically Format the volume on creation Can only be used in case the Volume does not exists. |
| **id** integer | | The ID of the Hetzner Cloud Block Volume to manage. Only required if no volume *name* is given |
| **labels** dictionary | | User-defined key-value pairs. |
| **location** string | | Location of the Hetzner Cloud Volume. Required if no *server* is given and Volume does not exists. |
| **name** string | | The Name of the Hetzner Cloud Block Volume to manage. Only required if no volume *id* is given or a volume does not exists. |
| **server** string | | Server Name the Volume should be assigned to. Required if no *location* is given and Volume does not exists. |
| **size** integer | | The size of the Block Volume in GB. Required if volume does not yet exists. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the Volume. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a Volume
hcloud_volume:
name: my-volume
location: fsn1
size: 100
state: present
- name: Create a Volume and format it with ext4
hcloud_volume:
name: my-volume
location: fsn
format: ext4
size: 100
state: present
- name: Mount a existing Volume and automount
hcloud_volume:
name: my-volume
server: my-server
automount: yes
state: present
- name: Mount a existing Volume and automount
hcloud_volume:
name: my-volume
server: my-server
automount: yes
state: present
- name: Ensure the Volume is absent (remove if needed)
hcloud_volume:
name: my-volume
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_volume** complex | Always | The block Volume |
| | **delete\_protection** boolean added in 0.1.0 of hetzner.hcloud | always | True if Volume is protected for deletion |
| | **id** integer | Always | ID of the Volume **Sample:** 12345 |
| | **labels** dictionary | Always | User-defined labels (key-value pairs) **Sample:** {'key': 'value', 'mylabel': 123} |
| | **linux\_device** string added in 0.1.0 of hetzner.hcloud | always | Path to the device that contains the Volume. **Sample:** /dev/disk/by-id/scsi-0HC\_Volume\_12345 |
| | **location** string | Always | Location name where the Volume is located at **Sample:** fsn1 |
| | **name** string | Always | Name of the Volume **Sample:** my-volume |
| | **server** string | Always | Server name where the Volume is attached to **Sample:** my-server |
| | **size** integer | Always | Size in GB of the Volume **Sample:** 1337 |
### Authors
* Christopher Schmitt (@cschmitt-hcloud)
ansible hetzner.hcloud.hcloud_load_balancer_target – Manage Hetzner Cloud Load Balancer targets hetzner.hcloud.hcloud\_load\_balancer\_target – Manage Hetzner Cloud Load Balancer targets
==========================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_load_balancer_target`.
New in version 0.1.0: of hetzner.hcloud
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create and delete Hetzner Cloud Load Balancer targets
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
* hcloud-python >= 1.8.1
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **ip** string | | An IP from a Hetzner Dedicated Server, needs to belongs to the same user as the project. Required if *type* is ip |
| **label\_selector** string | | A Label Selector that will be used to determine the targets dynamically Required if *type* is label\_selector |
| **load\_balancer** string / required | | The name of the Hetzner Cloud Load Balancer. |
| **server** string | | The name of the Hetzner Cloud Server. Required if *type* is server |
| **state** string | **Choices:*** absent
* **present** ←
| State of the load\_balancer\_network. |
| **type** string / required | **Choices:*** server
* label\_selector
* ip
| The type of the target. |
| **use\_private\_ip** boolean | **Choices:*** **no** ←
* yes
| Route the traffic over the private IP of the Load Balancer through a Hetzner Cloud Network. Load Balancer needs to be attached to a network. See [hetzner.hcloud.hcloud.hcloud\_load\_balancer\_network](hcloud.hcloud_load_balancer_network_module)
|
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a server Load Balancer target
hcloud_load_balancer_target:
type: server
load_balancer: my-LoadBalancer
server: my-server
state: present
- name: Create a label_selector Load Balancer target
hcloud_load_balancer_target:
type: server
load_balancer: my-LoadBalancer
label_selector: application=backend
state: present
- name: Create an IP Load Balancer target
hcloud_load_balancer_target:
type: server
load_balancer: my-LoadBalancer
ip: 127.0.0.1
state: present
- name: Ensure the Load Balancer target is absent (remove if needed)
hcloud_load_balancer_target:
type: server
load_balancer: my-LoadBalancer
server: my-server
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_load\_balancer\_target** complex | always | The relationship between a Load Balancer and a network |
| | **ip** string | if *type* is ip | IP of the dedicated server **Sample:** 127.0.0.1 |
| | **label\_selector** string | if *type* is label\_selector | Label Selector **Sample:** application=backend |
| | **load\_balancer** string | always | Name of the Load Balancer **Sample:** my-LoadBalancer |
| | **server** string | if *type* is server | Name of the Server **Sample:** my-server |
| | **type** string | always | Type of the Load Balancer Target **Sample:** server |
| | **use\_private\_ip** boolean | always | Route the traffic over the private IP of the Load Balancer through a Hetzner Cloud Network. Load Balancer needs to be attached to a network. See [hetzner.hcloud.hcloud.hcloud\_load\_balancer\_network](hcloud.hcloud_load_balancer_network_module)
**Sample:** True |
### Authors
* Lukas Kaemmerling (@lkaemmerling)
ansible hetzner.hcloud.hcloud_server_type_info – Gather infos about the Hetzner Cloud server types. hetzner.hcloud.hcloud\_server\_type\_info – Gather infos about the Hetzner Cloud server types.
==============================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_server_type_info`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather infos about your Hetzner Cloud server types.
* This module was called `hcloud_server_type_facts` before Ansible 2.9, returning `ansible_facts` and `hcloud_server_type_facts`. Note that the [hetzner.hcloud.hcloud\_server\_type\_info](#ansible-collections-hetzner-hcloud-hcloud-server-type-info-module) module no longer returns `ansible_facts` and the value was renamed to `hcloud_server_type_info`!
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the server type you want to get. |
| **name** string | | The name of the server type you want to get. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Gather hcloud server type infos
hcloud_server_type_info:
register: output
- name: Print the gathered infos
debug:
var: output.hcloud_server_type_info
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_server\_type\_info** complex | always | The server type infos as list |
| | **cores** integer | always | Number of cpu cores a server of this type will have **Sample:** 1 |
| | **cpu\_type** string | always | Type of cpu **Sample:** shared |
| | **description** string | always | Detail description of the server type **Sample:** Falkenstein DC Park 1 |
| | **disk** integer | always | Disk size a server of this type will have in GB **Sample:** 25 |
| | **id** integer | always | Numeric identifier of the server type **Sample:** 1937415 |
| | **memory** integer | always | Memory a server of this type will have in GB **Sample:** 1 |
| | **name** string | always | Name of the server type **Sample:** fsn1 |
| | **storage\_type** string | always | Type of server boot drive **Sample:** local |
### Authors
* Lukas Kaemmerling (@LKaemmerling)
ansible hetzner.hcloud.hcloud_load_balancer – Create and manage cloud Load Balancers on the Hetzner Cloud. hetzner.hcloud.hcloud\_load\_balancer – Create and manage cloud Load Balancers on the Hetzner Cloud.
====================================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_load_balancer`.
New in version 0.1.0: of hetzner.hcloud
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and manage cloud Load Balancers on the Hetzner Cloud.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
* hcloud-python >= 1.8.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **delete\_protection** boolean | **Choices:*** no
* yes
| Protect the Load Balancer for deletion. |
| **disable\_public\_interface** boolean | **Choices:*** **no** ←
* yes
| Disables the public interface. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the Hetzner Cloud Load Balancer to manage. Only required if no Load Balancer *name* is given |
| **labels** dictionary | | User-defined labels (key-value pairs). |
| **load\_balancer\_type** string | | The Load Balancer Type of the Hetzner Cloud Load Balancer to manage. Required if Load Balancer does not exists. |
| **location** string | | Location of Load Balancer. Required if no *network\_zone* is given and Load Balancer does not exists. |
| **name** string | | The Name of the Hetzner Cloud Load Balancer to manage. Only required if no Load Balancer *id* is given or a Load Balancer does not exists. |
| **network\_zone** string | | Network Zone of Load Balancer. Required of no *location* is given and Load Balancer does not exists. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the Load Balancer. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a basic Load Balancer
hcloud_load_balancer:
name: my-Load Balancer
load_balancer_type: lb11
location: fsn1
state: present
- name: Ensure the Load Balancer is absent (remove if needed)
hcloud_load_balancer:
name: my-Load Balancer
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_load\_balancer** complex | Always | The Load Balancer instance |
| | **delete\_protection** boolean | always | True if Load Balancer is protected for deletion |
| | **disable\_public\_interface** boolean | always | True if Load Balancer public interface is disabled |
| | **id** integer | always | Numeric identifier of the Load Balancer **Sample:** 1937415 |
| | **ipv4\_address** string | always | Public IPv4 address of the Load Balancer **Sample:** 116.203.104.109 |
| | **ipv6\_address** string | always | Public IPv6 address of the Load Balancer **Sample:** 2a01:4f8:1c1c:c140::1 |
| | **labels** dictionary | always | User-defined labels (key-value pairs) |
| | **load\_balancer\_type** string | always | Name of the Load Balancer type of the Load Balancer **Sample:** cx11 |
| | **location** string | always | Name of the location of the Load Balancer **Sample:** fsn1 |
| | **name** string | always | Name of the Load Balancer **Sample:** my-Load-Balancer |
| | **status** string | always | Status of the Load Balancer **Sample:** running |
### Authors
* Lukas Kaemmerling (@LKaemmerling)
| programming_docs |
ansible hetzner.hcloud.hcloud_location_info – Gather infos about your Hetzner Cloud locations. hetzner.hcloud.hcloud\_location\_info – Gather infos about your Hetzner Cloud locations.
========================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_location_info`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather infos about your Hetzner Cloud locations.
* This module was called `hcloud_location_facts` before Ansible 2.9, returning `ansible_facts` and `hcloud_location_facts`. Note that the [hetzner.hcloud.hcloud\_location\_info](#ansible-collections-hetzner-hcloud-hcloud-location-info-module) module no longer returns `ansible_facts` and the value was renamed to `hcloud_location_info`!
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the location you want to get. |
| **name** string | | The name of the location you want to get. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Gather hcloud location infos
hcloud_location_info:
register: output
- name: Print the gathered infos
debug:
var: output
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_location\_info** complex | always | The location infos as list |
| | **city** string | always | City of the location **Sample:** Falkenstein |
| | **country** string | always | Country code of the location **Sample:** DE |
| | **description** string | always | Detail description of the location **Sample:** Falkenstein DC Park 1 |
| | **id** integer | always | Numeric identifier of the location **Sample:** 1937415 |
| | **name** string | always | Name of the location **Sample:** fsn1 |
### Authors
* Lukas Kaemmerling (@LKaemmerling)
ansible hetzner.hcloud.hcloud_firewall – Create and manage firewalls on the Hetzner Cloud. hetzner.hcloud.hcloud\_firewall – Create and manage firewalls on the Hetzner Cloud.
===================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_firewall`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and manage firewalls on the Hetzner Cloud.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the Hetzner Cloud firewall to manage. Only required if no firewall *name* is given |
| **labels** dictionary | | User-defined labels (key-value pairs) |
| **name** string | | The Name of the Hetzner Cloud firewall to manage. Only required if no firewall *id* is given, or a firewall does not exists. |
| **rules** list / elements=dictionary | | List of rules the firewall should contain. |
| | **description** string | | User defined description of this rule. |
| | **destination\_ips** list / elements=string | | List of CIDRs that are allowed within this rule |
| | **direction** string | **Choices:*** in
* out
| The direction of the firewall rule. |
| | **port** string | | The port of the firewall rule. |
| | **protocol** string | **Choices:*** icmp
* tcp
* udp
| The protocol of the firewall rule. |
| | **source\_ips** list / elements=string | | List of CIDRs that are allowed within this rule |
| **state** string | **Choices:*** absent
* **present** ←
| State of the firewall. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a basic firewall
hcloud_firewall:
name: my-firewall
state: present
- name: Create a firewall with rules
hcloud_firewall:
name: my-firewall
rules:
- direction: in
protocol: icmp
source_ips:
- 0.0.0.0/0
- ::/0
description: allow icmp in
state: present
- name: Create a firewall with labels
hcloud_firewall:
name: my-firewall
labels:
key: value
mylabel: 123
state: present
- name: Ensure the firewall is absent (remove if needed)
hcloud_firewall:
name: my-firewall
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_firewall** complex | Always | The firewall instance |
| | **id** integer | always | Numeric identifier of the firewall **Sample:** 1937415 |
| | **labels** dictionary | always | User-defined labels (key-value pairs) |
| | **name** string | always | Name of the firewall **Sample:** my firewall |
| | **rules** complex | always | List of Rules within this Firewall |
| | | **description** string | always | User defined description of the Firewall Rule |
| | | **destination\_ips** list / elements=string | always | Source IPs of the Firewall |
| | | **direction** string | always | Direction of the Firewall Rule **Sample:** in |
| | | **port** string | always | Port of the Firewall Rule, None/Null if protocol is icmp **Sample:** in |
| | | **protocol** string | always | Protocol of the Firewall Rule **Sample:** icmp |
| | | **source\_ips** list / elements=string | always | Source IPs of the Firewall |
### Authors
* Lukas Kaemmerling (@lkaemmerling)
ansible hetzner.hcloud.hcloud_floating_ip – Create and manage cloud Floating IPs on the Hetzner Cloud. hetzner.hcloud.hcloud\_floating\_ip – Create and manage cloud Floating IPs on the Hetzner Cloud.
================================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_floating_ip`.
New in version 0.1.0: of hetzner.hcloud
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and manage cloud Floating IPs on the Hetzner Cloud.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
* hcloud-python >= 1.6.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **delete\_protection** boolean | **Choices:*** no
* yes
| Protect the Floating IP for deletion. |
| **description** string | | The Description of the Hetzner Cloud Floating IPs. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **force** boolean | **Choices:*** no
* yes
| Force the assignment or deletion of the Floating IP. |
| **home\_location** string | | Home Location of the Hetzner Cloud Floating IP. Required if no *server* is given and Floating IP does not exists. |
| **id** integer | | The ID of the Hetzner Cloud Floating IPs to manage. Only required if no Floating IP *name* is given. |
| **labels** dictionary | | User-defined labels (key-value pairs). |
| **name** string | | The Name of the Hetzner Cloud Floating IPs to manage. Only required if no Floating IP *id* is given or a Floating IP does not exists. |
| **server** string | | Server Name the Floating IP should be assigned to. Required if no *home\_location* is given and Floating IP does not exists. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the Floating IP. |
| **type** string | **Choices:*** ipv4
* ipv6
| Type of the Floating IP. Required if Floating IP does not exists |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a basic IPv4 Floating IP
hcloud_floating_ip:
name: my-floating-ip
home_location: fsn1
type: ipv4
state: present
- name: Create a basic IPv6 Floating IP
hcloud_floating_ip:
name: my-floating-ip
home_location: fsn1
type: ipv6
state: present
- name: Assign a Floating IP to a server
hcloud_floating_ip:
name: my-floating-ip
server: 1234
state: present
- name: Assign a Floating IP to another server
hcloud_floating_ip:
name: my-floating-ip
server: 1234
force: yes
state: present
- name: Floating IP should be absent
hcloud_floating_ip:
name: my-floating-ip
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_floating\_ip** complex | Always | The Floating IP instance |
| | **delete\_protection** boolean added in 0.1.0 of hetzner.hcloud | always | True if Floating IP is protected for deletion |
| | **description** string | Always | Description of the Floating IP **Sample:** my-floating-ip |
| | **home\_location** string | Always | Name of the home location of the Floating IP **Sample:** fsn1 |
| | **id** integer | Always | ID of the Floating IP **Sample:** 12345 |
| | **ip** string | Always | IP Address of the Floating IP **Sample:** 116.203.104.109 |
| | **labels** dictionary | Always | User-defined labels (key-value pairs) **Sample:** {'key': 'value', 'mylabel': 123} |
| | **name** string | Always | Name of the Floating IP **Sample:** my-floating-ip |
| | **server** string | Always | Name of the server the Floating IP is assigned to. **Sample:** my-server |
| | **type** string | Always | Type of the Floating IP **Sample:** ipv4 |
### Authors
* Lukas Kaemmerling (@lkaemmerling)
ansible hetzner.hcloud.hcloud_floating_ip_info – Gather infos about the Hetzner Cloud Floating IPs. hetzner.hcloud.hcloud\_floating\_ip\_info – Gather infos about the Hetzner Cloud Floating IPs.
==============================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_floating_ip_info`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather facts about your Hetzner Cloud Floating IPs.
* This module was called `hcloud_floating_ip_facts` before Ansible 2.9, returning `ansible_facts` and `hcloud_floating_ip_facts`. Note that the [hetzner.hcloud.hcloud\_floating\_ip\_info](#ansible-collections-hetzner-hcloud-hcloud-floating-ip-info-module) module no longer returns `ansible_facts` and the value was renamed to `hcloud_floating_ip_info`!
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the Floating IP you want to get. |
| **label\_selector** string | | The label selector for the Floating IP you want to get. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Gather hcloud Floating ip infos
hcloud_floating_ip_info:
register: output
- name: Print the gathered infos
debug:
var: output
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_floating\_ip\_info** complex | always | The Floating ip infos as list |
| | **delete\_protection** boolean added in 0.1.0 of hetzner.hcloud | always | True if the Floating IP is protected for deletion |
| | **description** string | always | Description of the Floating IP **Sample:** Falkenstein DC 8 |
| | **home\_location** string | always | Location the Floating IP was created in **Sample:** fsn1 |
| | **id** integer | always | Numeric identifier of the Floating IP **Sample:** 1937415 |
| | **ip** string | always | IP address of the Floating IP **Sample:** 131.232.99.1 |
| | **labels** dictionary | always | User-defined labels (key-value pairs) |
| | **name** string added in 0.1.0 of hetzner.hcloud | Always | Name of the Floating IP **Sample:** my-floating-ip |
| | **server** string | always | Name of the server where the Floating IP is assigned to. **Sample:** my-server |
| | **type** string | always | Type of the Floating IP **Sample:** ipv4 |
### Authors
* Lukas Kaemmerling (@LKaemmerling)
ansible hetzner.hcloud.hcloud_load_balancer_type_info – Gather infos about the Hetzner Cloud Load Balancer types. hetzner.hcloud.hcloud\_load\_balancer\_type\_info – Gather infos about the Hetzner Cloud Load Balancer types.
=============================================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_load_balancer_type_info`.
New in version 0.1.0: of hetzner.hcloud
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather infos about your Hetzner Cloud Load Balancer types.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the Load Balancer type you want to get. |
| **name** string | | The name of the Load Balancer type you want to get. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Gather hcloud Load Balancer type infos
hcloud_load_balancer_type_info:
register: output
- name: Print the gathered infos
debug:
var: output.hcloud_load_balancer_type_info
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_load\_balancer\_type\_info** complex | always | The Load Balancer type infos as list |
| | **description** string | always | Description of the Load Balancer type **Sample:** LB11 |
| | **id** integer | always | Numeric identifier of the Load Balancer type **Sample:** 1937415 |
| | **max\_assigned\_certificates** integer | always | Number of SSL Certificates that can be assigned to a single Load Balancer **Sample:** 5 |
| | **max\_connections** integer | always | Number of maximum simultaneous open connections **Sample:** 1 |
| | **max\_services** integer | always | Number of services a Load Balancer of this type can have **Sample:** 1 |
| | **max\_targets** integer | always | Number of targets a single Load Balancer can have **Sample:** 25 |
| | **name** string | always | Name of the Load Balancer type **Sample:** lb11 |
### Authors
* Lukas Kaemmerling (@LKaemmerling)
ansible hetzner.hcloud.hcloud_ssh_key_info – Gather infos about your Hetzner Cloud ssh_keys. hetzner.hcloud.hcloud\_ssh\_key\_info – Gather infos about your Hetzner Cloud ssh\_keys.
========================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_ssh_key_info`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather facts about your Hetzner Cloud ssh\_keys.
* This module was called `hcloud_ssh_key_facts` before Ansible 2.9, returning `ansible_facts` and `hcloud_ssh_key_facts`. Note that the [hetzner.hcloud.hcloud\_ssh\_key\_info](#ansible-collections-hetzner-hcloud-hcloud-ssh-key-info-module) module no longer returns `ansible_facts` and the value was renamed to `hcloud_ssh_key_info`!
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **fingerprint** string | | The fingerprint of the ssh key you want to get. |
| **id** integer | | The ID of the ssh key you want to get. |
| **label\_selector** string | | The label selector for the ssh key you want to get. |
| **name** string | | The name of the ssh key you want to get. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Gather hcloud sshkey infos
hcloud_ssh_key_info:
register: output
- name: Print the gathered infos
debug:
var: output.hcloud_ssh_key_info
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_ssh\_key\_info** complex | Always | The ssh key instances |
| | **fingerprint** string | always | Fingerprint of the ssh key **Sample:** 0e:e0:bd:c7:2d:1f:69:49:94:44:91:f1:19:fd:35:f3 |
| | **id** integer | always | Numeric identifier of the ssh\_key **Sample:** 1937415 |
| | **labels** dictionary | always | User-defined labels (key-value pairs) |
| | **name** string | always | Name of the ssh\_key **Sample:** my-ssh-key |
| | **public\_key** string | always | The actual public key **Sample:** ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGpl/tnk74nnQJxxLAtutUApUZMRJxryKh7VXkNbd4g9 [email protected] |
### Authors
* Christopher Schmitt (@cschmitt-hcloud)
| programming_docs |
ansible hetzner.hcloud.hcloud_placement_group – Create and manage placement groups on the Hetzner Cloud. hetzner.hcloud.hcloud\_placement\_group – Create and manage placement groups on the Hetzner Cloud.
==================================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_placement_group`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and manage placement groups on the Hetzner Cloud.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
* hcloud-python >= 1.15.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the Hetzner Cloud placement group to manage. Only required if no placement group *name* is given |
| **labels** dictionary | | User-defined labels (key-value pairs) |
| **name** string | | The Name of the Hetzner Cloud placement group to manage. Only required if no placement group *id* is given, or a placement group does not exists. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the placement group. |
| **type** string | | The Type of the Hetzner Cloud placement group. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a basic placement group
hcloud_placement_group:
name: my-placement-group
state: present
type: spread
- name: Create a placement group with labels
hcloud_placement_group:
name: my-placement-group
type: spread
labels:
key: value
mylabel: 123
state: present
- name: Ensure the placement group is absent (remove if needed)
hcloud_placement_group:
name: my-placement-group
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_placement\_group** complex | Always | The placement group instance |
| | **id** integer | always | Numeric identifier of the placement group **Sample:** 1937415 |
| | **labels** dictionary | always | User-defined labels (key-value pairs) |
| | **name** string | always | Name of the placement group **Sample:** my placement group |
| | **servers** list / elements=integer | always | Server IDs of the placement group **Sample:** [4711, 4712] |
| | **type** string | always | Type of the placement group **Sample:** spread |
### Authors
* Adrian Huber (@Adi146)
ansible hetzner.hcloud.hcloud_network – Create and manage cloud Networks on the Hetzner Cloud. hetzner.hcloud.hcloud\_network – Create and manage cloud Networks on the Hetzner Cloud.
=======================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_network`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and manage cloud Networks on the Hetzner Cloud.
* You need at least hcloud-python 1.3.0.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
* hcloud-python >= 1.3.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **delete\_protection** boolean | **Choices:*** no
* yes
| Protect the Network for deletion. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the Hetzner Cloud Networks to manage. Only required if no Network *name* is given. |
| **ip\_range** string | | IP range of the Network. Required if Network does not exists. |
| **labels** dictionary | | User-defined labels (key-value pairs). |
| **name** string | | The Name of the Hetzner Cloud Network to manage. Only required if no Network *id* is given or a Network does not exists. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the Network. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a basic network
hcloud_network:
name: my-network
ip_range: 10.0.0.0/8
state: present
- name: Ensure the Network is absent (remove if needed)
hcloud_network:
name: my-network
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_network** complex | always | The Network |
| | **delete\_protection** boolean added in 0.1.0 of hetzner.hcloud | always | True if Network is protected for deletion |
| | **id** integer | always | ID of the Network **Sample:** 12345 |
| | **ip\_range** string | always | IP range of the Network **Sample:** 10.0.0.0/8 |
| | **labels** dictionary | always | User-defined labels (key-value pairs) **Sample:** {'key': 'value', 'mylabel': 123} |
| | **name** string | always | Name of the Network **Sample:** my-volume |
### Authors
* Lukas Kaemmerling (@lkaemmerling)
ansible hetzner.hcloud.hcloud_ssh_key – Create and manage ssh keys on the Hetzner Cloud. hetzner.hcloud.hcloud\_ssh\_key – Create and manage ssh keys on the Hetzner Cloud.
==================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_ssh_key`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and manage ssh keys on the Hetzner Cloud.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **fingerprint** string | | The Fingerprint of the Hetzner Cloud ssh\_key to manage. Only required if no ssh\_key *id* or *name* is given. |
| **id** integer | | The ID of the Hetzner Cloud ssh\_key to manage. Only required if no ssh\_key *name* is given |
| **labels** dictionary | | User-defined labels (key-value pairs) |
| **name** string | | The Name of the Hetzner Cloud ssh\_key to manage. Only required if no ssh\_key *id* is given or a ssh\_key does not exists. |
| **public\_key** string | | The Public Key to add. Required if ssh\_key does not exists. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the ssh\_key. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a basic ssh_key
hcloud_ssh_key:
name: my-ssh_key
public_key: "ssh-rsa AAAjjk76kgf...Xt"
state: present
- name: Create a ssh_key with labels
hcloud_ssh_key:
name: my-ssh_key
public_key: "ssh-rsa AAAjjk76kgf...Xt"
labels:
key: value
mylabel: 123
state: present
- name: Ensure the ssh_key is absent (remove if needed)
hcloud_ssh_key:
name: my-ssh_key
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_ssh\_key** complex | Always | The ssh\_key instance |
| | **fingerprint** string | Always | Fingerprint of the ssh\_key **Sample:** b7:2f:30:a0:2f:6c:58:6c:21:04:58:61:ba:06:3b:2f |
| | **id** integer | Always | ID of the ssh\_key **Sample:** 12345 |
| | **labels** dictionary | Always | User-defined labels (key-value pairs) **Sample:** {'key': 'value', 'mylabel': 123} |
| | **name** string | Always | Name of the ssh\_key **Sample:** my-ssh-key |
| | **public\_key** string | Always | Public key of the ssh\_key **Sample:** ssh-rsa AAAjjk76kgf...Xt |
### Authors
* Lukas Kaemmerling (@LKaemmerling)
ansible hetzner.hcloud.hcloud_network_info – Gather info about your Hetzner Cloud networks. hetzner.hcloud.hcloud\_network\_info – Gather info about your Hetzner Cloud networks.
=====================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_network_info`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather info about your Hetzner Cloud networks.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the network you want to get. |
| **label\_selector** string | | The label selector for the network you want to get. |
| **name** string | | The name of the network you want to get. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Gather hcloud network info
local_action:
module: hcloud_network_info
- name: Print the gathered info
debug:
var: hcloud_network_info
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_network\_info** complex | always | The network info as list |
| | **delete\_protection** boolean added in 0.1.0 of hetzner.hcloud | always | True if the network is protected for deletion |
| | **id** integer | always | Numeric identifier of the network **Sample:** 1937415 |
| | **ip\_range** string | always | IP range of the network **Sample:** 10.0.0.0/16 |
| | **labels** dictionary | always | Labels of the network |
| | **name** string | always | Name of the network **Sample:** awesome-network |
| | **routes** complex | always | Routes belonging to the network |
| | | **gateway** string | always | Gateway of this route **Sample:** 10.0.0.1 |
| | | **ip\_range** string | always | Destination network or host of this route. **Sample:** 10.0.0.0/16 |
| | **servers** complex | always | Servers attached to the network |
| | | **backup\_window** boolean | always | Time window (UTC) in which the backup will run, or null if the backups are not enabled **Sample:** 22-02 |
| | | **datacenter** string | always | Name of the datacenter of the server **Sample:** fsn1-dc14 |
| | | **id** integer | always | Numeric identifier of the server **Sample:** 1937415 |
| | | **ipv4\_address** string | always | Public IPv4 address of the server **Sample:** 116.203.104.109 |
| | | **ipv6** string | always | IPv6 network of the server **Sample:** 2a01:4f8:1c1c:c140::/64 |
| | | **labels** dictionary | always | User-defined labels (key-value pairs) |
| | | **location** string | always | Name of the location of the server **Sample:** fsn1 |
| | | **name** string | always | Name of the server **Sample:** my-server |
| | | **rescue\_enabled** boolean | always | True if rescue mode is enabled, Server will then boot into rescue system on next reboot |
| | | **server\_type** string | always | Name of the server type of the server **Sample:** cx11 |
| | | **status** string | always | Status of the server **Sample:** running |
| | **subnetworks** complex | always | Subnetworks belonging to the network |
| | | **gateway** string | always | Gateway of this subnetwork **Sample:** 10.0.0.1 |
| | | **ip\_range** string | always | IP range of the subnetwork **Sample:** 10.0.0.0/24 |
| | | **network\_zone** string | always | Network of the subnetwork. **Sample:** eu-central |
| | | **type** string | always | Type of the subnetwork. **Sample:** cloud |
### Authors
* Christopher Schmitt (@cschmitt-hcloud)
ansible hetzner.hcloud.hcloud_load_balancer_info – Gather infos about your Hetzner Cloud Load Balancers. hetzner.hcloud.hcloud\_load\_balancer\_info – Gather infos about your Hetzner Cloud Load Balancers.
===================================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_load_balancer_info`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather infos about your Hetzner Cloud Load Balancers..
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the Load Balancers you want to get. |
| **label\_selector** string | | The label selector for the Load Balancers you want to get. |
| **name** string | | The name of the Load Balancers you want to get. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Gather hcloud load_balancer infos
hcloud_load_balancer_info:
register: output
- name: Print the gathered infos
debug:
var: output
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_load\_balancer\_info** complex | always | The load\_balancer infos as list |
| | **delete\_protection** boolean | always | True if Load Balancer is protected for deletion |
| | **disable\_public\_interface** boolean | always | True if Load Balancer public interface is disabled |
| | **id** integer | always | Numeric identifier of the Load Balancer **Sample:** 1937415 |
| | **ipv4\_address** string | always | Public IPv4 address of the Load Balancer **Sample:** 116.203.104.109 |
| | **ipv6\_address** string | always | Public IPv6 address of the Load Balancer **Sample:** 2a01:4f8:1c1c:c140::1 |
| | **labels** dictionary | always | User-defined labels (key-value pairs) |
| | **load\_balancer\_type** string | always | Name of the Load Balancer type of the Load Balancer **Sample:** cx11 |
| | **location** string | always | Name of the location of the Load Balancer **Sample:** fsn1 |
| | **name** string | always | Name of the Load Balancer **Sample:** my-Load-Balancer |
| | **services** complex | Always | all services from this Load Balancer |
| | | **destination\_port** integer | always | The port traffic is forwarded to, i.e. the port the targets are listening and accepting connections on. **Sample:** 80 |
| | | **health\_check** complex | always | Configuration for health checks |
| | | | **http** complex | always | Additional Configuration of health checks with protocol http/https |
| | | | | **domain** string | always | Domain we will set within the HTTP HOST header **Sample:** example.com |
| | | | | **path** string | always | Path we will try to access **Sample:** / |
| | | | | **response** string | always | Response we expect, if response is not within the health check response the target is unhealthy |
| | | | | **status\_codes** list / elements=string | always | List of HTTP status codes we expect to get when we perform the health check. **Sample:** ['2??', '3??'] |
| | | | | **tls** boolean | always | Verify the TLS certificate, only available if health check protocol is https |
| | | | **interval** integer | always | Interval of health checks, in seconds **Sample:** 15 |
| | | | **port** integer | always | Port the health check will be performed on **Sample:** 80 |
| | | | **protocol** string | always | Protocol the health checks will be performed over **Sample:** http |
| | | | **retries** integer | always | Number of retries until a target is marked as unhealthy **Sample:** 3 |
| | | | **timeout** integer | always | Timeout of health checks, in seconds **Sample:** 10 |
| | | **http** complex | always | Configuration for HTTP and HTTPS services |
| | | | **certificates** list / elements=string | always | List of Names or IDs of certificates |
| | | | **cookie\_lifetime** integer | always | Lifetime of the cookie which will be set when you enable sticky sessions, in seconds **Sample:** 3600 |
| | | | **cookie\_name** string | always | Name of the cookie which will be set when you enable sticky sessions **Sample:** HCLBSTICKY |
| | | | **redirect\_http** boolean | always | Redirect Traffic from Port 80 to Port 443, only available if protocol is https |
| | | | **sticky\_sessions** boolean | always | Enable or disable sticky\_sessions **Sample:** True |
| | | **listen\_port** integer | always | The port the service listens on, i.e. the port users can connect to. **Sample:** 443 |
| | | **protocol** string | always | Protocol of the service **Sample:** http |
| | | **proxyprotocol** boolean | always | Enable the PROXY protocol. |
| | **status** string | always | Status of the Load Balancer **Sample:** running |
| | **targets** complex | always | The targets of the Load Balancer |
| | | **ip** string | if *type* is ip | IP of the dedicated server **Sample:** 127.0.0.1 |
| | | **label\_selector** string | if *type* is label\_selector | Label Selector **Sample:** application=backend |
| | | **load\_balancer** string | always | Name of the Load Balancer **Sample:** my-LoadBalancer |
| | | **server** string | if *type* is server | Name of the Server **Sample:** my-server |
| | | **type** string | always | Type of the Load Balancer Target **Sample:** server |
| | | **use\_private\_ip** boolean | always | Route the traffic over the private IP of the Load Balancer through a Hetzner Cloud Network. Load Balancer needs to be attached to a network. See [hetzner.hcloud.hcloud.hcloud\_load\_balancer\_network](hcloud.hcloud_load_balancer_network_module)
**Sample:** True |
### Authors
* Lukas Kaemmerling (@LKaemmerling)
| programming_docs |
ansible hetzner.hcloud.hcloud_load_balancer_service – Create and manage the services of cloud Load Balancers on the Hetzner Cloud. hetzner.hcloud.hcloud\_load\_balancer\_service – Create and manage the services of cloud Load Balancers on the Hetzner Cloud.
=============================================================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_load_balancer_service`.
New in version 0.1.0: of hetzner.hcloud
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and manage the services of cloud Load Balancers on the Hetzner Cloud.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
* hcloud-python >= 1.8.1
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **destination\_port** integer | | The port traffic is forwarded to, i.e. the port the targets are listening and accepting connections on. Required if services does not exists and protocol is tcp. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **health\_check** dictionary | | Configuration for health checks |
| | **http** dictionary | | Additional Configuration of health checks with protocol http/https |
| | | **domain** string | | Domain we will set within the HTTP HOST header |
| | | **path** string | | Path we will try to access |
| | | **response** string | | Response we expect, if response is not within the health check response the target is unhealthy |
| | | **status\_codes** list / elements=string | | List of HTTP status codes we expect to get when we perform the health check. |
| | | **tls** boolean | **Choices:*** **no** ←
* yes
| Verify the TLS certificate, only available if health check protocol is https |
| | **interval** integer | | Interval of health checks, in seconds |
| | **port** integer | | Port the health check will be performed on |
| | **protocol** string | **Choices:*** http
* https
* tcp
| Protocol the health checks will be performed over |
| | **retries** integer | | Number of retries until a target is marked as unhealthy |
| | **timeout** integer | | Timeout of health checks, in seconds |
| **http** dictionary | | Configuration for HTTP and HTTPS services |
| | **certificates** list / elements=string | | List of Names or IDs of certificates |
| | **cookie\_lifetime** integer | | Lifetime of the cookie which will be set when you enable sticky sessions, in seconds |
| | **cookie\_name** string | | Name of the cookie which will be set when you enable sticky sessions |
| | **redirect\_http** boolean | **Choices:*** **no** ←
* yes
| Redirect Traffic from Port 80 to Port 443, only available if protocol is https |
| | **sticky\_sessions** boolean | **Choices:*** **no** ←
* yes
| Enable or disable sticky\_sessions |
| **listen\_port** integer / required | | The port the service listens on, i.e. the port users can connect to. |
| **load\_balancer** string / required | | The Name of the Hetzner Cloud Load Balancer the service belongs to |
| **protocol** string | **Choices:*** http
* https
* tcp
| Protocol of the service. Required if Load Balancer does not exists. |
| **proxyprotocol** boolean | **Choices:*** **no** ←
* yes
| Enable the PROXY protocol. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the Load Balancer. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a basic Load Balancer service with Port 80
hcloud_load_balancer_service:
load_balancer: my-load-balancer
protocol: http
listen_port: 80
state: present
- name: Ensure the Load Balancer is absent (remove if needed)
hcloud_load_balancer_service:
load_balancer: my-Load Balancer
protocol: http
listen_port: 80
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_load\_balancer\_service** complex | Always | The Load Balancer service instance |
| | **destination\_port** integer | always | The port traffic is forwarded to, i.e. the port the targets are listening and accepting connections on. **Sample:** 80 |
| | **health\_check** complex | always | Configuration for health checks |
| | | **http** complex | always | Additional Configuration of health checks with protocol http/https |
| | | | **domain** string | always | Domain we will set within the HTTP HOST header **Sample:** example.com |
| | | | **path** string | always | Path we will try to access **Sample:** / |
| | | | **response** string | always | Response we expect, if response is not within the health check response the target is unhealthy |
| | | | **status\_codes** list / elements=string | always | List of HTTP status codes we expect to get when we perform the health check. **Sample:** ['2??', '3??'] |
| | | | **tls** boolean | always | Verify the TLS certificate, only available if health check protocol is https |
| | | **interval** integer | always | Interval of health checks, in seconds **Sample:** 15 |
| | | **port** integer | always | Port the health check will be performed on **Sample:** 80 |
| | | **protocol** string | always | Protocol the health checks will be performed over **Sample:** http |
| | | **retries** integer | always | Number of retries until a target is marked as unhealthy **Sample:** 3 |
| | | **timeout** integer | always | Timeout of health checks, in seconds **Sample:** 10 |
| | **http** complex | always | Configuration for HTTP and HTTPS services |
| | | **certificates** list / elements=string | always | List of Names or IDs of certificates |
| | | **cookie\_lifetime** integer | always | Lifetime of the cookie which will be set when you enable sticky sessions, in seconds **Sample:** 3600 |
| | | **cookie\_name** string | always | Name of the cookie which will be set when you enable sticky sessions **Sample:** HCLBSTICKY |
| | | **redirect\_http** boolean | always | Redirect Traffic from Port 80 to Port 443, only available if protocol is https |
| | | **sticky\_sessions** boolean | always | Enable or disable sticky\_sessions **Sample:** True |
| | **listen\_port** integer | always | The port the service listens on, i.e. the port users can connect to. **Sample:** 443 |
| | **load\_balancer** string | always | The name of the Load Balancer where the service belongs to **Sample:** my-load-balancer |
| | **protocol** string | always | Protocol of the service **Sample:** http |
| | **proxyprotocol** boolean | always | Enable the PROXY protocol. |
### Authors
* Lukas Kaemmerling (@LKaemmerling)
ansible hetzner.hcloud.hcloud_rdns – Create and manage reverse DNS entries on the Hetzner Cloud. hetzner.hcloud.hcloud\_rdns – Create and manage reverse DNS entries on the Hetzner Cloud.
=========================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_rdns`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete reverse DNS entries on the Hetzner Cloud.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
* hcloud-python >= 1.3.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **dns\_ptr** string | | The DNS address the *ip\_address* should resolve to. Omit the param to reset the reverse DNS entry to the default value. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **floating\_ip** string | | The name of the Hetzner Cloud Floating IP you want to add the reverse DNS entry to. |
| **ip\_address** string / required | | The IP address that should point to *dns\_ptr*. |
| **load\_balancer** string | | The name of the Hetzner Cloud Load Balancer you want to add the reverse DNS entry to. |
| **server** string | | The name of the Hetzner Cloud server you want to add the reverse DNS entry to. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the reverse DNS entry. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a reverse DNS entry for a server
hcloud_rdns:
server: my-server
ip_address: 123.123.123.123
dns_ptr: example.com
state: present
- name: Create a reverse DNS entry for a Floating IP
hcloud_rdns:
floating_ip: my-floating-ip
ip_address: 123.123.123.123
dns_ptr: example.com
state: present
- name: Create a reverse DNS entry for a Load Balancer
hcloud_rdns:
load_balancer: my-load-balancer
ip_address: 123.123.123.123
dns_ptr: example.com
state: present
- name: Ensure the reverse DNS entry is absent (remove if needed)
hcloud_rdns:
server: my-server
ip_address: 123.123.123.123
dns_ptr: example.com
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_rdns** complex | always | The reverse DNS entry |
| | **dns\_ptr** string | always | The DNS that resolves to the IP **Sample:** example.com |
| | **floating\_ip** string | always | Name of the Floating IP **Sample:** my-floating-ip |
| | **ip\_address** string | always | The IP address that point to the DNS ptr **Sample:** 123.123.123.123 |
| | **load\_balancer** string | always | Name of the Load Balancer **Sample:** my-load-balancer |
| | **server** string | always | Name of the server **Sample:** my-server |
### Authors
* Lukas Kaemmerling (@lkaemmerling)
ansible hetzner.hcloud.hcloud_server_info – Gather infos about your Hetzner Cloud servers. hetzner.hcloud.hcloud\_server\_info – Gather infos about your Hetzner Cloud servers.
====================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_server_info`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather infos about your Hetzner Cloud servers.
* This module was called `hcloud_server_facts` before Ansible 2.9, returning `ansible_facts` and `hcloud_server_facts`. Note that the [hetzner.hcloud.hcloud\_server\_info](#ansible-collections-hetzner-hcloud-hcloud-server-info-module) module no longer returns `ansible_facts` and the value was renamed to `hcloud_server_info`!
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the server you want to get. |
| **label\_selector** string | | The label selector for the server you want to get. |
| **name** string | | The name of the server you want to get. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Gather hcloud server infos
hcloud_server_info:
register: output
- name: Print the gathered infos
debug:
var: output.hcloud_server_info
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_server\_info** complex | always | The server infos as list |
| | **backup\_window** boolean | always | Time window (UTC) in which the backup will run, or null if the backups are not enabled **Sample:** 22-02 |
| | **datacenter** string | always | Name of the datacenter of the server **Sample:** fsn1-dc14 |
| | **delete\_protection** boolean added in 0.1.0 of hetzner.hcloud | always | True if server is protected for deletion |
| | **id** integer | always | Numeric identifier of the server **Sample:** 1937415 |
| | **ipv4\_address** string | always | Public IPv4 address of the server **Sample:** 116.203.104.109 |
| | **ipv6** string | always | IPv6 network of the server **Sample:** 2a01:4f8:1c1c:c140::/64 |
| | **labels** dictionary | always | User-defined labels (key-value pairs) |
| | **location** string | always | Name of the location of the server **Sample:** fsn1 |
| | **name** string | always | Name of the server **Sample:** my-server |
| | **placement\_group** string added in 1.5.0 of hetzner.hcloud | always | Placement Group of the server **Sample:** 4711 |
| | **rebuild\_protection** boolean added in 0.1.0 of hetzner.hcloud | always | True if server is protected for rebuild |
| | **rescue\_enabled** boolean | always | True if rescue mode is enabled, Server will then boot into rescue system on next reboot |
| | **server\_type** string | always | Name of the server type of the server **Sample:** cx11 |
| | **status** string | always | Status of the server **Sample:** running |
### Authors
* Lukas Kaemmerling (@LKaemmerling)
ansible hetzner.hcloud.hcloud_server_network – Manage the relationship between Hetzner Cloud Networks and servers hetzner.hcloud.hcloud\_server\_network – Manage the relationship between Hetzner Cloud Networks and servers
===========================================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_server_network`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create and delete the relationship Hetzner Cloud Networks and servers
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
* hcloud-python >= 1.3.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **alias\_ips** list / elements=string | | Alias IPs the server has. |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **ip** string | | The IP the server should have. |
| **network** string / required | | The name of the Hetzner Cloud Networks. |
| **server** string / required | | The name of the Hetzner Cloud server. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the server\_network. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a basic server network
hcloud_server_network:
network: my-network
server: my-server
state: present
- name: Create a server network and specify the ip address
hcloud_server_network:
network: my-network
server: my-server
ip: 10.0.0.1
state: present
- name: Create a server network and add alias ips
hcloud_server_network:
network: my-network
server: my-server
ip: 10.0.0.1
alias_ips:
- 10.1.0.1
- 10.2.0.1
state: present
- name: Ensure the server network is absent (remove if needed)
hcloud_server_network:
network: my-network
server: my-server
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_server\_network** complex | always | The relationship between a server and a network |
| | **alias\_ips** string | always | Alias IPs of the server within the Network ip range **Sample:** ['10.1.0.1', '...'] |
| | **ip** string | always | IP of the server within the Network ip range **Sample:** 10.0.0.8 |
| | **network** string | always | Name of the Network **Sample:** my-network |
| | **server** string | always | Name of the server **Sample:** my-server |
### Authors
* Lukas Kaemmerling (@lkaemmerling)
ansible hetzner.hcloud.hcloud – Ansible dynamic inventory plugin for the Hetzner Cloud. hetzner.hcloud.hcloud – Ansible dynamic inventory plugin for the Hetzner Cloud.
===============================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Reads inventories from the Hetzner Cloud API.
* Uses a YAML configuration file that ends with hcloud.(yml|yaml).
Requirements
------------
The below requirements are needed on the local controller node that executes this inventory.
* python >= 2.7
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **compose** dictionary | **Default:**{} | | Create vars from jinja2 expressions. |
| **connect\_with** string | **Choices:*** **public\_ipv4** ←
* hostname
* ipv4\_dns\_ptr
* private\_ipv4
| | Connect to the server using the value from this field. |
| **groups** dictionary | **Default:**{} | | Add hosts to group based on Jinja2 conditionals. |
| **images** list / elements=string | **Default:**[] | | Populate inventory with instances with this image name, only available for system images. |
| **keyed\_groups** list / elements=string | **Default:**[] | | Add hosts to group based on the values of a variable. |
| **label\_selector** string | **Default:**"" | | Populate inventory with instances with this label. |
| **leading\_separator** boolean added in 2.11 of ansible.builtin | **Choices:*** no
* **yes** ←
| | Use in conjunction with keyed\_groups. By default, a keyed group that does not have a prefix or a separator provided will have a name that starts with an underscore. This is because the default prefix is "" and the default separator is "\_". Set this option to False to omit the leading underscore (or other separator) if no prefix is given. If the group name is derived from a mapping the separator is still used to concatenate the items. To not use a separator in the group name at all, set the separator for the keyed group to an empty string instead. |
| **locations** list / elements=string | **Default:**[] | | Populate inventory with instances in this location. |
| **network** string | **Default:**"" | | Populate inventory with instances which are attached to this network name or ID. |
| **plugin** string / required | **Choices:*** hcloud
* hetzner.hcloud.hcloud
| | marks this as an instance of the "hcloud" plugin |
| **strict** boolean | **Choices:*** **no** ←
* yes
| | 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. |
| **token** string | | | The Hetzner Cloud API Token. |
| **token\_env** string | **Default:**"HCLOUD\_TOKEN" | | Environment variable to load the Hetzner Cloud API Token from. |
| **types** list / elements=string | **Default:**[] | | Populate inventory with instances with this type. |
| **use\_extra\_vars** boolean added in 2.11 of ansible.builtin | **Choices:*** **no** ←
* yes
| ini entries: [inventory\_plugins]use\_extra\_vars = no env:ANSIBLE\_INVENTORY\_USE\_EXTRA\_VARS | Merge extra vars into the available variables for composition (highest precedence). |
Examples
--------
```
# Minimal example. `HCLOUD_TOKEN` is exposed in environment.
plugin: hcloud
# Example with locations, types, groups and token
plugin: hcloud
token: foobar
locations:
- nbg1
types:
- cx11
# Group by a location with prefix e.g. "hcloud_location_nbg1"
# and image_os_flavor without prefix and separator e.g. "ubuntu"
# and status with prefix e.g. "server_status_running"
plugin: hcloud
keyed_groups:
- key: location
prefix: hcloud_location
- key: image_os_flavor
separator: ""
- key: status
prefix: server_status
```
### Authors
* Lukas Kaemmerling (@lkaemmerling)
| programming_docs |
ansible hetzner.hcloud.hcloud_subnetwork – Manage cloud subnetworks on the Hetzner Cloud. hetzner.hcloud.hcloud\_subnetwork – Manage cloud subnetworks on the Hetzner Cloud.
==================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_subnetwork`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete cloud subnetworks on the Hetzner Cloud.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
* hcloud-python >= 1.10.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **ip\_range** string / required | | IP range of the subnetwork. |
| **network** string / required | | The ID or Name of the Hetzner Cloud Networks. |
| **network\_zone** string / required | | Name of network zone. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the subnetwork. |
| **type** string / required | **Choices:*** server
* cloud
* vswitch
| Type of subnetwork. |
| **vswitch\_id** integer | | ID of the vSwitch you want to couple with your Network. Required if type == vswitch |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Create a basic subnetwork
hcloud_subnetwork:
network: my-network
ip_range: 10.0.0.0/16
network_zone: eu-central
type: cloud
state: present
- name: Create a basic subnetwork
hcloud_subnetwork:
network: my-vswitch-network
ip_range: 10.0.0.0/24
network_zone: eu-central
type: vswitch
vswitch_id: 123
state: present
- name: Ensure the subnetwork is absent (remove if needed)
hcloud_subnetwork:
network: my-network
ip_range: 10.0.0.0/8
network_zone: eu-central
type: cloud
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_subnetwork** complex | always | One Subnet of a Network |
| | **gateway** string | always | Gateway of the subnetwork **Sample:** 10.0.0.1 |
| | **ip\_range** string | always | IP range of the Network **Sample:** 10.0.0.0/8 |
| | **network** string | always | Name of the Network **Sample:** my-network |
| | **network\_zone** string | always | Name of network zone **Sample:** eu-central |
| | **type** string | always | Type of subnetwork **Sample:** server |
| | **vswitch\_id** integer | always | ID of the vswitch, null if not type vswitch **Sample:** 123 |
### Authors
* Lukas Kaemmerling (@lkaemmerling)
ansible hetzner.hcloud.hcloud_certificate_info – Gather infos about your Hetzner Cloud certificates. hetzner.hcloud.hcloud\_certificate\_info – Gather infos about your Hetzner Cloud certificates.
==============================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_certificate_info`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather facts about your Hetzner Cloud certificates.
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the certificate you want to get. |
| **label\_selector** string | | The label selector for the certificate you want to get. |
| **name** string | | The name of the certificate you want to get. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Gather hcloud certificate infos
hcloud_certificate_info:
register: output
- name: Print the gathered infos
debug:
var: output.hcloud_certificate_info
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_certificate\_info** complex | Always | The certificate instances |
| | **certificate** string | always | Certificate and chain in PEM format **Sample:** -----BEGIN CERTIFICATE-----... |
| | **domain\_names** dictionary | always | List of Domains and Subdomains covered by the Certificate |
| | **fingerprint** string | always | Fingerprint of the certificate **Sample:** 03:c7:55:9b:2a:d1:04:17:09:f6:d0:7f:18:34:63:d4:3e:5f |
| | **id** integer | always | Numeric identifier of the certificate **Sample:** 1937415 |
| | **labels** dictionary | always | User-defined labels (key-value pairs) |
| | **name** string | always | Name of the certificate **Sample:** my website cert |
| | **not\_valid\_after** string | always | Point in time when the Certificate stops being valid (in ISO-8601 format) |
| | **not\_valid\_before** string | always | Point in time when the Certificate becomes valid (in ISO-8601 format) |
### Authors
* Lukas Kaemmerling (@LKaemmerling)
ansible hetzner.hcloud.hcloud_datacenter_info – Gather info about the Hetzner Cloud datacenters. hetzner.hcloud.hcloud\_datacenter\_info – Gather info about the Hetzner Cloud datacenters.
==========================================================================================
Note
This plugin is part of the [hetzner.hcloud collection](https://galaxy.ansible.com/hetzner/hcloud) (version 1.6.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 hetzner.hcloud`.
To use it in a playbook, specify: `hetzner.hcloud.hcloud_datacenter_info`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather info about your Hetzner Cloud datacenters.
* This module was called `hcloud_datacenter_facts` before Ansible 2.9, returning `ansible_facts` and `hcloud_datacenter_facts`. Note that the [hetzner.hcloud.hcloud\_datacenter\_info](#ansible-collections-hetzner-hcloud-hcloud-datacenter-info-module) module no longer returns `ansible_facts` and the value was renamed to `hcloud_datacenter_info`!
Requirements
------------
The below requirements are needed on the host that executes this module.
* hcloud-python >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_token** string / required | | This is the API Token for the Hetzner Cloud. |
| **endpoint** string | **Default:**"https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
| **id** integer | | The ID of the datacenter you want to get. |
| **name** string | | The name of the datacenter you want to get. |
See Also
--------
See also
[Documentation for Hetzner Cloud API](https://docs.hetzner.cloud/)
Complete reference for the Hetzner Cloud API.
Examples
--------
```
- name: Gather hcloud datacenter info
hcloud_datacenter_info:
register: output
- name: Print the gathered info
debug:
var: output
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **hcloud\_datacenter\_info** complex | always | The datacenter info as list This module was called `hcloud_datacenter_facts` before Ansible 2.9, returning `ansible_facts` and `hcloud_datacenter_facts`. Note that the [hetzner.hcloud.hcloud\_datacenter\_info](hcloud_datacenter_info_module) module no longer returns `ansible_facts` and the value was renamed to `hcloud_datacenter_info`! |
| | **city** string | always | City of the location **Sample:** fsn1 |
| | **description** string | always | Detail description of the datacenter **Sample:** Falkenstein DC 8 |
| | **id** integer | always | Numeric identifier of the datacenter **Sample:** 1937415 |
| | **location** string | always | Name of the location where the datacenter resides in **Sample:** fsn1 |
| | **name** string | always | Name of the datacenter **Sample:** fsn1-dc8 |
### Authors
* Lukas Kaemmerling (@LKaemmerling)
ansible Collections in the Gluster Namespace Collections in the Gluster Namespace
====================================
These are the collections with docs hosted on [docs.ansible.com](https://docs.ansible.com/) in the **gluster** namespace.
* [gluster.gluster](gluster/index#plugins-in-gluster-gluster)
ansible gluster.gluster.gluster_volume – Manage GlusterFS volumes gluster.gluster.gluster\_volume – Manage GlusterFS volumes
==========================================================
Note
This plugin is part of the [gluster.gluster collection](https://galaxy.ansible.com/gluster/gluster) (version 1.0.2).
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 gluster.gluster`.
To use it in a playbook, specify: `gluster.gluster.gluster_volume`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Create, remove, start, stop and tune GlusterFS volumes
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **arbiters** integer | | Arbiter count for volume. |
| **bricks** string | | Brick paths on servers. Multiple brick paths can be separated by commas.
aliases: brick |
| **cluster** list / elements=string | | List of hosts to use for probing and brick setup. |
| **directory** string | | Directory for limit-usage. |
| **disperses** integer | | Disperse count for volume. |
| **force** boolean | **Choices:*** no
* yes
| If brick is being created in the root partition, module will fail. Set force to true to override this behaviour. |
| **host** string | | Override local hostname (for peer probing purposes). |
| **name** string / required | | The volume name.
aliases: volume |
| **options** dictionary | | A dictionary/hash with options/settings for the volume. |
| **quota** string | | Quota value for limit-usage (be sure to use 10.0MB instead of 10MB, see quota list). |
| **rebalance** boolean | **Choices:*** **no** ←
* yes
| Controls whether the cluster is rebalanced after changes. |
| **redundancies** integer | | Redundancy count for volume. |
| **replicas** integer | | Replica count for volume. |
| **start\_on\_create** boolean | **Choices:*** no
* **yes** ←
| Controls whether the volume is started after creation or not. |
| **state** string / required | **Choices:*** absent
* present
* started
* stopped
| Use present/absent ensure if a volume exists or not. Use started/stopped to control its availability. |
| **stripes** integer | | Stripe count for volume. |
| **transport** string | **Choices:*** **tcp** ←
* rdma
* tcp,rdma
| Transport type for volume. |
Notes
-----
Note
* Requires cli tools for GlusterFS on servers.
* Will add new bricks, but not remove them.
Examples
--------
```
- name: create gluster volume
gluster.gluster.gluster_volume:
state: present
name: test1
bricks: /bricks/brick1/g1
rebalance: yes
cluster:
- 192.0.2.10
- 192.0.2.11
run_once: true
- name: tune
gluster.gluster.gluster_volume:
state: present
name: test1
options:
performance.cache-size: 256MB
- name: Set multiple options on GlusterFS volume
gluster.gluster.gluster_volume:
state: present
name: test1
options:
{ performance.cache-size: 128MB,
write-behind: 'off',
quick-read: 'on'
}
- name: start gluster volume
gluster.gluster.gluster_volume:
state: started
name: test1
- name: limit usage
gluster.gluster.gluster_volume:
state: present
name: test1
directory: /foo
quota: 20.0MB
- name: stop gluster volume
gluster.gluster.gluster_volume:
state: stopped
name: test1
- name: remove gluster volume
gluster.gluster.gluster_volume:
state: absent
name: test1
- name: create gluster volume with multiple bricks
gluster.gluster.gluster_volume:
state: present
name: test2
bricks: /bricks/brick1/g2,/bricks/brick2/g2
cluster:
- 192.0.2.10
- 192.0.2.11
run_once: true
- name: Remove the bricks from gluster volume
gluster.gluster.gluster_volume:
state: present
name: testvol
bricks: /bricks/brick1/b1,/bricks/brick2/b2
cluster:
- 10.70.42.85
force: true
run_once: true
- name: Reduce cluster configuration
gluster.gluster.gluster_volume:
state: present
name: testvol
bricks: /bricks/brick3/b1,/bricks/brick4/b2
replicas: 2
cluster:
- 10.70.42.85
force: true
run_once: true
```
### Authors
* Taneli Leppä (@rosmo)
ansible Gluster.Gluster Gluster.Gluster
===============
Collection version 1.0.2
Plugin Index
------------
These are the plugins in the gluster.gluster collection
### Modules
* [geo\_rep](geo_rep_module#ansible-collections-gluster-gluster-geo-rep-module) – Manage geo-replication sessions
* [gluster\_heal\_info](gluster_heal_info_module#ansible-collections-gluster-gluster-gluster-heal-info-module) – Gather information on self-heal or rebalance status
* [gluster\_peer](gluster_peer_module#ansible-collections-gluster-gluster-gluster-peer-module) – Attach/Detach peers to/from the cluster
* [gluster\_volume](gluster_volume_module#ansible-collections-gluster-gluster-gluster-volume-module) – Manage GlusterFS volumes
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible gluster.gluster.gluster_peer – Attach/Detach peers to/from the cluster gluster.gluster.gluster\_peer – Attach/Detach peers to/from the cluster
=======================================================================
Note
This plugin is part of the [gluster.gluster collection](https://galaxy.ansible.com/gluster/gluster) (version 1.0.2).
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 gluster.gluster`.
To use it in a playbook, specify: `gluster.gluster.gluster_peer`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Create or diminish a GlusterFS trusted storage pool. A set of nodes can be added into an existing trusted storage pool or a new storage pool can be formed. Or, nodes can be removed from an existing trusted storage pool.
Requirements
------------
The below requirements are needed on the host that executes this module.
* GlusterFS > 3.2
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **force** boolean | **Choices:*** no
* yes
**Default:**"false" | Applicable only while removing the nodes from the pool. gluster will refuse to detach a node from the pool if any one of the node is down, in such cases force can be used. |
| **nodes** list / elements=string / required | | List of nodes that have to be probed into the pool. |
| **state** string / required | **Choices:*** **present** ←
* absent
| Determines whether the nodes should be attached to the pool or removed from the pool. If the state is present, nodes will be attached to the pool. If state is absent, nodes will be detached from the pool. |
Notes
-----
Note
* This module does not support check mode.
Examples
--------
```
- name: Create a trusted storage pool
gluster.gluster.gluster_peer:
state: present
nodes:
- 10.0.1.5
- 10.0.1.10
- name: Delete a node from the trusted storage pool
gluster.gluster.gluster_peer:
state: absent
nodes:
- 10.0.1.10
- name: Delete a node from the trusted storage pool by force
gluster.gluster.gluster_peer:
state: absent
nodes:
- 10.0.0.1
force: true
```
### Authors
* Sachidananda Urs (@sac)
ansible gluster.gluster.geo_rep – Manage geo-replication sessions gluster.gluster.geo\_rep – Manage geo-replication sessions
==========================================================
Note
This plugin is part of the [gluster.gluster collection](https://galaxy.ansible.com/gluster/gluster) (version 1.0.2).
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 gluster.gluster`.
To use it in a playbook, specify: `gluster.gluster.geo_rep`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Create, stop, delete and configure geo-replication session
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **action** string / required | **Choices:*** create
* start
* stop
* delete
* pause
* resume
* config
| Action to be performed on geo-replication session. |
| **changelog\_log\_level** string | | The log level for the changelog. |
| **checkpoint** string | | Sets a checkpoint with the given option. |
| **force** string | | force the system to perform the action. |
| **georepuser** string | | Username to be used for the action being performed. |
| **gluster\_log\_file** string | | The path to the geo-replication glusterfs log file. |
| **gluster\_log\_level** string | | The log level for glusterfs processes. |
| **ignore\_deletes** string | | file deletion on the master will not trigger a delete operation on the slave. |
| **log\_file** string | | The path to the geo-replication log file. |
| **log\_level** string | | The log level for geo-replication. |
| **log\_rsync\_performance** string | | for recording the rsync performance in log files. |
| **mastervol** string | | Master volume name. |
| **meta\_volume\_mnt** string | | The path of the meta volume mount point. |
| **rsync\_command** string | | The command to use for setting synchronizing method for the files. |
| **rsync\_options** string | | Additional options to rsync. |
| **slavevol** string | | Slave volume name. |
| **ssh\_command** string | | The SSH command to connect to the remote machine. |
| **sync\_acls** string | | Syncs acls to the Slave cluster. |
| **sync\_jobs** string | | number of sync-jobs . |
| **sync\_xattrs** string | | Syncs extended attributes to the Slave cluster. |
| **timeout** string | | timeout period. |
| **use\_meta\_volume** string | | to use meta volume in Geo-replication. |
| **use\_tarssh** string | | To use tar over ssh. |
| **volume\_id** string | | deletes the existing master UID for the intermediate/slave node. |
Examples
--------
```
- name: Create the geo-rep session
gluster.gluster.geo_rep:
action: create
mastervol: 10.70.42.122:mastervolume
slavevol: 10.70.43.48:slavevolume
force: true
georepuser: staff
- name: Starts the geo-rep session
gluster.gluster.geo_rep:
action: start
mastervol: 10.70.42.122:mastervolume
slavevol: 10.70.43.48:slavevolume
force: true
georepuser: staff
- name: Pause the geo-rep session
gluster.gluster.geo_rep:
action: pause
mastervol: 10.70.42.122:mastervolume
slavevol: 10.70.43.48:slavevolume
force: true
georepuser: staff
- name: Resume the geo-rep session
gluster.gluster.geo_rep:
action: resume
mastervol: 10.70.42.122:mastervolume
slavevol: 10.70.43.48:slavevolume
force: true
georepuser: staff
- name: Stop the geo-rep session
gluster.gluster.geo_rep:
action: stop
mastervol: 10.70.42.122:mastervolume
slavevol: 10.70.43.48:slavevolume
force: true
georepuser: staff
- name: Configures the geo-rep session
gluster.gluster.geo_rep:
action: config
mastervol: 10.70.42.122:mastervolume
slavevol: 10.70.43.48:slavevolume
gluster_log_file: /var/log/glusterfs/geo-replication/gluster.log
gluster_log_level: INFO
log_file: /var/log/glusterfs/geo-replication/file.log
log_level: INFO
changelog_log_level: INFO
ssh_command: SSH
rsync_command: rsync
use_tarssh: true
volume_id: 6a071cfa-b150-4f0b-b1ed-96ab5d4bd671
timeout: 60
sync_jobs: 3
ignore_deletes: 1
checkpoint: now
sync_acls: true
sync_xattr: true
log_rsync_performance: true
rsync_options: --compress-level=0
use_meta_volume: true
meta_volume_mnt: /var/run/gluster/shared_storage/
- name: Delete the geo-rep session
gluster.gluster.geo_rep:
action: delete
mastervol: 10.70.42.122:mastervolume
slavevol: 10.70.43.48:slavevolume
georepuser: staff
```
### Authors
* Sachidananda Urs (@sac)
| programming_docs |
ansible gluster.gluster.gluster_heal_info – Gather information on self-heal or rebalance status gluster.gluster.gluster\_heal\_info – Gather information on self-heal or rebalance status
=========================================================================================
Note
This plugin is part of the [gluster.gluster collection](https://galaxy.ansible.com/gluster/gluster) (version 1.0.2).
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 gluster.gluster`.
To use it in a playbook, specify: `gluster.gluster.gluster_heal_info`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather facts about either self-heal or rebalance status.
* This module was called `gluster_heal_facts` before Ansible 2.9, returning `ansible_facts`. Note that the [gluster.gluster.gluster\_heal\_info](#ansible-collections-gluster-gluster-gluster-heal-info-module) module no longer returns `ansible_facts`!
Requirements
------------
The below requirements are needed on the host that executes this module.
* GlusterFS > 3.2
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **name** string / required | | The volume name.
aliases: volume |
| **status\_filter** string | **Choices:*** **self-heal** ←
* rebalance
| Determines which facts are to be returned. If the `status_filter` is `self-heal`, status of self-heal, along with the number of files still in process are returned. If the `status_filter` is `rebalance`, rebalance status is returned. |
Examples
--------
```
- name: Gather self-heal facts about all gluster hosts in the cluster
gluster.gluster.gluster_heal_info:
name: test_volume
status_filter: self-heal
register: self_heal_status
- debug:
var: self_heal_status
- name: Gather rebalance facts about all gluster hosts in the cluster
gluster.gluster.gluster_heal_info:
name: test_volume
status_filter: rebalance
register: rebalance_status
- debug:
var: rebalance_status
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **heal\_info** list / elements=string | On success | List of files that still need healing process |
| **name** string | always | GlusterFS volume name |
| **rebalance\_status** list / elements=string | On success | Status of rebalance operation |
| **status\_filter** string | always | Whether self-heal or rebalance status is to be returned |
### Authors
* Devyani Kota (@devyanikota)
ansible Collections in the Amazon Namespace Collections in the Amazon Namespace
===================================
These are the collections with docs hosted on [docs.ansible.com](https://docs.ansible.com/) in the **amazon** namespace.
* [amazon.aws](aws/index#plugins-in-amazon-aws)
ansible amazon.aws.ec2_group_info – Gather information about ec2 security groups in AWS. amazon.aws.ec2\_group\_info – Gather information about ec2 security groups in AWS.
==================================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_group_info`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about ec2 security groups in AWS.
* This module was called `amazon.aws.ec2_group_facts` before Ansible 2.9. The usage did not change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **filters** dictionary | **Default:**{} | A dict of filters to apply. Each dict item consists of a filter key and a filter value. See <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html> for possible filters. Filter names and values are case sensitive. You can also use underscores (\_) instead of dashes (-) in the filter keys, which will take precedence in case of conflict. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* By default, the module will return all security groups. To limit results use the appropriate filters.
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Gather information about all security groups
- amazon.aws.ec2_group_info:
# Gather information about all security groups in a specific VPC
- amazon.aws.ec2_group_info:
filters:
vpc-id: vpc-12345678
# Gather information about all security groups in a specific VPC
- amazon.aws.ec2_group_info:
filters:
vpc-id: vpc-12345678
# Gather information about a security group
- amazon.aws.ec2_group_info:
filters:
group-name: example-1
# Gather information about a security group by id
- amazon.aws.ec2_group_info:
filters:
group-id: sg-12345678
# Gather information about a security group with multiple filters, also mixing the use of underscores as filter keys
- amazon.aws.ec2_group_info:
filters:
group_id: sg-12345678
vpc-id: vpc-12345678
# Gather information about various security groups
- amazon.aws.ec2_group_info:
filters:
group-name:
- example-1
- example-2
- example-3
# Gather information about any security group with a tag key Name and value Example.
# The quotes around 'tag:name' are important because of the colon in the value
- amazon.aws.ec2_group_info:
filters:
"tag:Name": Example
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **security\_groups** list / elements=string | always | Security groups that match the provided filters. Each element consists of a dict with all the information related to that security group. |
### Authors
* Henrique Rodrigues (@Sodki)
ansible amazon.aws.cloudformation_info – Obtain information about an AWS CloudFormation stack amazon.aws.cloudformation\_info – Obtain information about an AWS CloudFormation stack
======================================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.cloudformation_info`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gets information about an AWS CloudFormation stack.
* This module was called `amazon.aws.cloudformation_facts` before Ansible 2.9, returning `ansible_facts`. Note that the [amazon.aws.cloudformation\_info](#ansible-collections-amazon-aws-cloudformation-info-module) module no longer returns `ansible_facts`!
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3 >= 1.0.0
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **all\_facts** boolean | **Choices:*** **no** ←
* yes
| Get all stack information for the stack. |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **stack\_change\_sets** boolean | **Choices:*** **no** ←
* yes
| Get stack change sets for the stack |
| **stack\_events** boolean | **Choices:*** **no** ←
* yes
| Get stack events for the stack. |
| **stack\_name** string | | The name or id of the CloudFormation stack. Gathers information on all stacks by default. |
| **stack\_policy** boolean | **Choices:*** **no** ←
* yes
| Get stack policy for the stack. |
| **stack\_resources** boolean | **Choices:*** **no** ←
* yes
| Get stack resources for the stack. |
| **stack\_template** boolean | **Choices:*** **no** ←
* yes
| Get stack template body for the stack. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Get summary information about a stack
amazon.aws.cloudformation_info:
stack_name: my-cloudformation-stack
register: output
- debug:
msg: "{{ output['cloudformation']['my-cloudformation-stack'] }}"
# When the module is called as cloudformation_facts, return values are published
# in ansible_facts['cloudformation'][<stack_name>] and can be used as follows.
# Note that this is deprecated and will stop working in Ansible after 2021-12-01.
- amazon.aws.cloudformation_facts:
stack_name: my-cloudformation-stack
- debug:
msg: "{{ ansible_facts['cloudformation']['my-cloudformation-stack'] }}"
# Get stack outputs, when you have the stack name available as a fact
- set_fact:
stack_name: my-awesome-stack
- amazon.aws.cloudformation_info:
stack_name: "{{ stack_name }}"
register: my_stack
- debug:
msg: "{{ my_stack.cloudformation[stack_name].stack_outputs }}"
# Get all stack information about a stack
- amazon.aws.cloudformation_info:
stack_name: my-cloudformation-stack
all_facts: true
# Get stack resource and stack policy information about a stack
- amazon.aws.cloudformation_info:
stack_name: my-cloudformation-stack
stack_resources: true
stack_policy: true
# Fail if the stack doesn't exist
- name: try to get facts about a stack but fail if it doesn't exist
amazon.aws.cloudformation_info:
stack_name: nonexistent-stack
all_facts: yes
failed_when: cloudformation['nonexistent-stack'] is undefined
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **stack\_change\_sets** list / elements=string | only if all\_facts or stack\_change\_sets is true and the stack exists | A list of stack change sets. Each item in the list represents the details of a specific changeset |
| **stack\_description** dictionary | if the stack exists | Summary facts about the stack |
| **stack\_events** list / elements=string | only if all\_facts or stack\_events is true and the stack exists | All stack events for the stack |
| **stack\_outputs** dictionary | if the stack exists | Dictionary of stack outputs keyed by the value of each output 'OutputKey' parameter and corresponding value of each output 'OutputValue' parameter **Sample:** {'ApplicationDatabaseName': 'dazvlpr01xj55a.ap-southeast-2.rds.amazonaws.com'} |
| **stack\_parameters** dictionary | if the stack exists | Dictionary of stack parameters keyed by the value of each parameter 'ParameterKey' parameter and corresponding value of each parameter 'ParameterValue' parameter **Sample:** {'DatabaseEngine': 'mysql', 'DatabasePassword': '\*\*\*'} |
| **stack\_policy** dictionary | only if all\_facts or stack\_policy is true and the stack exists | Describes the stack policy for the stack |
| **stack\_resource\_list** list / elements=string | only if all\_facts or stack\_resources is true and the stack exists | Describes stack resources for the stack |
| **stack\_resources** dictionary | only if all\_facts or stack\_resources is true and the stack exists | Dictionary of stack resources keyed by the value of each resource 'LogicalResourceId' parameter and corresponding value of each resource 'PhysicalResourceId' parameter **Sample:** {'ApplicationDatabase': 'dazvlpr01xj55a', 'AutoScalingGroup': 'dev-someapp-AutoscalingGroup-1SKEXXBCAN0S7', 'AutoScalingSecurityGroup': 'sg-abcd1234'} |
| **stack\_template** dictionary | only if all\_facts or stack\_template is true and the stack exists | Describes the stack template for the stack |
### Authors
* Justin Menga (@jmenga)
* Kevin Coming (@waffie1)
| programming_docs |
ansible Amazon.Aws Amazon.Aws
==========
Collection version 1.5.1
Plugin Index
------------
These are the plugins in the amazon.aws collection
### Callback Plugins
* [aws\_resource\_actions](aws_resource_actions_callback#ansible-collections-amazon-aws-aws-resource-actions-callback) – summarizes all “resource:actions” completed
### Inventory Plugins
* [aws\_ec2](aws_ec2_inventory#ansible-collections-amazon-aws-aws-ec2-inventory) – EC2 inventory source
* [aws\_rds](aws_rds_inventory#ansible-collections-amazon-aws-aws-rds-inventory) – rds instance source
### Lookup Plugins
* [aws\_account\_attribute](aws_account_attribute_lookup#ansible-collections-amazon-aws-aws-account-attribute-lookup) – Look up AWS account attributes.
* [aws\_secret](aws_secret_lookup#ansible-collections-amazon-aws-aws-secret-lookup) – Look up secrets stored in AWS Secrets Manager.
* [aws\_service\_ip\_ranges](aws_service_ip_ranges_lookup#ansible-collections-amazon-aws-aws-service-ip-ranges-lookup) – Look up the IP ranges for services provided in AWS such as EC2 and S3.
* [aws\_ssm](aws_ssm_lookup#ansible-collections-amazon-aws-aws-ssm-lookup) – Get the value for a SSM parameter or all parameters under a path.
### Modules
* [aws\_az\_info](aws_az_info_module#ansible-collections-amazon-aws-aws-az-info-module) – Gather information about availability zones in AWS.
* [aws\_caller\_info](aws_caller_info_module#ansible-collections-amazon-aws-aws-caller-info-module) – Get information about the user and account being used to make AWS calls.
* [aws\_s3](aws_s3_module#ansible-collections-amazon-aws-aws-s3-module) – manage objects in S3.
* [cloudformation](cloudformation_module#ansible-collections-amazon-aws-cloudformation-module) – Create or delete an AWS CloudFormation stack
* [cloudformation\_info](cloudformation_info_module#ansible-collections-amazon-aws-cloudformation-info-module) – Obtain information about an AWS CloudFormation stack
* [ec2](ec2_module#ansible-collections-amazon-aws-ec2-module) – create, terminate, start or stop an instance in ec2
* [ec2\_ami](ec2_ami_module#ansible-collections-amazon-aws-ec2-ami-module) – Create or destroy an image (AMI) in ec2
* [ec2\_ami\_info](ec2_ami_info_module#ansible-collections-amazon-aws-ec2-ami-info-module) – Gather information about ec2 AMIs
* [ec2\_elb\_lb](ec2_elb_lb_module#ansible-collections-amazon-aws-ec2-elb-lb-module) – Creates, updates or destroys an Amazon ELB.
* [ec2\_eni](ec2_eni_module#ansible-collections-amazon-aws-ec2-eni-module) – Create and optionally attach an Elastic Network Interface (ENI) to an instance
* [ec2\_eni\_info](ec2_eni_info_module#ansible-collections-amazon-aws-ec2-eni-info-module) – Gather information about ec2 ENI interfaces in AWS
* [ec2\_group](ec2_group_module#ansible-collections-amazon-aws-ec2-group-module) – maintain an ec2 VPC security group.
* [ec2\_group\_info](ec2_group_info_module#ansible-collections-amazon-aws-ec2-group-info-module) – Gather information about ec2 security groups in AWS.
* [ec2\_key](ec2_key_module#ansible-collections-amazon-aws-ec2-key-module) – create or delete an ec2 key pair
* [ec2\_metadata\_facts](ec2_metadata_facts_module#ansible-collections-amazon-aws-ec2-metadata-facts-module) – gathers facts (instance metadata) about remote hosts within EC2
* [ec2\_snapshot](ec2_snapshot_module#ansible-collections-amazon-aws-ec2-snapshot-module) – Creates a snapshot from an existing volume
* [ec2\_snapshot\_info](ec2_snapshot_info_module#ansible-collections-amazon-aws-ec2-snapshot-info-module) – Gather information about ec2 volume snapshots in AWS
* [ec2\_tag](ec2_tag_module#ansible-collections-amazon-aws-ec2-tag-module) – create and remove tags on ec2 resources
* [ec2\_tag\_info](ec2_tag_info_module#ansible-collections-amazon-aws-ec2-tag-info-module) – list tags on ec2 resources
* [ec2\_vol](ec2_vol_module#ansible-collections-amazon-aws-ec2-vol-module) – Create and attach a volume, return volume id and device map
* [ec2\_vol\_info](ec2_vol_info_module#ansible-collections-amazon-aws-ec2-vol-info-module) – Gather information about ec2 volumes in AWS
* [ec2\_vpc\_dhcp\_option](ec2_vpc_dhcp_option_module#ansible-collections-amazon-aws-ec2-vpc-dhcp-option-module) – Manages DHCP Options, and can ensure the DHCP options for the given VPC match what’s requested
* [ec2\_vpc\_dhcp\_option\_info](ec2_vpc_dhcp_option_info_module#ansible-collections-amazon-aws-ec2-vpc-dhcp-option-info-module) – Gather information about dhcp options sets in AWS
* [ec2\_vpc\_net](ec2_vpc_net_module#ansible-collections-amazon-aws-ec2-vpc-net-module) – Configure AWS virtual private clouds
* [ec2\_vpc\_net\_info](ec2_vpc_net_info_module#ansible-collections-amazon-aws-ec2-vpc-net-info-module) – Gather information about ec2 VPCs in AWS
* [ec2\_vpc\_subnet](ec2_vpc_subnet_module#ansible-collections-amazon-aws-ec2-vpc-subnet-module) – Manage subnets in AWS virtual private clouds
* [ec2\_vpc\_subnet\_info](ec2_vpc_subnet_info_module#ansible-collections-amazon-aws-ec2-vpc-subnet-info-module) – Gather information about ec2 VPC subnets in AWS
* [s3\_bucket](s3_bucket_module#ansible-collections-amazon-aws-s3-bucket-module) – Manage S3 buckets in AWS, DigitalOcean, Ceph, Walrus, FakeS3 and StorageGRID
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible amazon.aws.ec2_vpc_net_info – Gather information about ec2 VPCs in AWS amazon.aws.ec2\_vpc\_net\_info – Gather information about ec2 VPCs in AWS
=========================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_vpc_net_info`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about ec2 VPCs in AWS
* This module was called `ec2_vpc_net_facts` before Ansible 2.9. The usage did not change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **filters** dictionary | | A dict of filters to apply. Each dict item consists of a filter key and a filter value. See <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html> for possible filters. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **vpc\_ids** list / elements=string | | A list of VPC IDs that exist in your account. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Gather information about all VPCs
- amazon.aws.ec2_vpc_net_info:
# Gather information about a particular VPC using VPC ID
- amazon.aws.ec2_vpc_net_info:
vpc_ids: vpc-00112233
# Gather information about any VPC with a tag key Name and value Example
- amazon.aws.ec2_vpc_net_info:
filters:
"tag:Name": Example
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **vpcs** complex | success | Returns an array of complex objects as described below. |
| | **cidr\_block** string | always | The IPv4 CIDR block assigned to the VPC. |
| | **cidr\_block\_association\_set** complex | always | An array of IPv4 cidr block association set information. |
| | | **association\_id** string | always | The association ID |
| | | **cidr\_block** string | always | The IPv4 CIDR block that is associated with the VPC. |
| | | **cidr\_block\_state** dictionary | always | A hash/dict that contains a single item. The state of the cidr block association. |
| | | | **state** string | always | The CIDR block association state. |
| | **classic\_link\_dns\_supported** boolean | always | True/False depending on attribute setting for classic link DNS support. |
| | **classic\_link\_enabled** boolean | always | True/False depending on if classic link support is enabled. |
| | **dhcp\_options\_id** string | always | The ID of the DHCP options associated with this VPC. **Sample:** dopt-12345678 |
| | **enable\_dns\_hostnames** boolean | always | True/False depending on attribute setting for DNS hostnames support. |
| | **enable\_dns\_support** boolean | always | True/False depending on attribute setting for DNS support. |
| | **id** string | always | The ID of the VPC (for backwards compatibility). |
| | **instance\_tenancy** string | always | The instance tenancy setting for the VPC. |
| | **ipv6\_cidr\_block\_association\_set** complex | always | An array of IPv6 cidr block association set information. |
| | | **association\_id** string | always | The association ID |
| | | **ipv6\_cidr\_block** string | always | The IPv6 CIDR block that is associated with the VPC. |
| | | **ipv6\_cidr\_block\_state** dictionary | always | A hash/dict that contains a single item. The state of the cidr block association. |
| | | | **state** string | always | The CIDR block association state. |
| | **is\_default** boolean | always | True if this is the default VPC for account. |
| | **owner\_id** string | always | The AWS account which owns the VPC. **Sample:** 123456789012 |
| | **state** string | always | The state of the VPC. |
| | **tags** dictionary | always | A dict of tags associated with the VPC. |
| | **vpc\_id** string | always | The ID of the VPC . |
### Authors
* Rob White (@wimnat)
ansible amazon.aws.aws_ec2 – EC2 inventory source amazon.aws.aws\_ec2 – EC2 inventory source
==========================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.aws_ec2`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Get inventory hosts from Amazon Web Services EC2.
* Uses a YAML configuration file that ends with `aws_ec2.(yml|yaml`).
Requirements
------------
The below requirements are needed on the local controller node that executes this inventory.
* boto3
* botocore
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **aws\_access\_key** string | | env:EC2\_ACCESS\_KEY env:AWS\_ACCESS\_KEY env:AWS\_ACCESS\_KEY\_ID | The AWS access key to use.
aliases: aws\_access\_key\_id |
| **aws\_profile** string | | env:AWS\_DEFAULT\_PROFILE env:AWS\_PROFILE | The AWS profile
aliases: boto\_profile |
| **aws\_secret\_key** string | | env:EC2\_SECRET\_KEY env:AWS\_SECRET\_KEY env:AWS\_SECRET\_ACCESS\_KEY | The AWS secret key that corresponds to the access key.
aliases: aws\_secret\_access\_key |
| **aws\_security\_token** string | | env:EC2\_SECURITY\_TOKEN env:AWS\_SESSION\_TOKEN env:AWS\_SECURITY\_TOKEN | The AWS security token if using temporary access and secret keys. |
| **cache** boolean | **Choices:*** **no** ←
* yes
| 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 = None [inventory]cache\_connection = None 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** string | **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. |
| **exclude\_filters** list / elements=string | **Default:**[] | | A list of filters. Any instances matching one of the filters are excluded from the result. The filters from `exclude_filters` take priority over the `include_filters` and `filters` keys Available filters are listed here <http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html#options>. Every entry in this list triggers a search query. As such, from a performance point of view, it's better to keep the list as short as possible. |
| **filters** dictionary | **Default:**{} | | A dictionary of filter value pairs. Available filters are listed here <http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html#options>. |
| **groups** dictionary | **Default:**{} | | Add hosts to group based on Jinja2 conditionals. |
| **hostnames** list / elements=string | **Default:**[] | | A list in order of precedence for hostname variables. You can use the options specified in <http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html#options>. To use tags as hostnames use the syntax tag:Name=Value to use the hostname Name\_Value, or tag:Name to use the value of the Name tag. |
| **iam\_role\_arn** string | | | The ARN of the IAM role to assume to perform the inventory lookup. You should still provide AWS credentials with enough privilege to perform the AssumeRole action. |
| **include\_extra\_api\_calls** boolean | **Choices:*** **no** ←
* yes
| | Add two additional API calls for every instance to include 'persistent' and 'events' host variables. Spot instances may be persistent and instances may have associated events. |
| **include\_filters** list / elements=string | **Default:**[] | | A list of filters. Any instances matching at least one of the filters are included in the result. Available filters are listed here <http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html#options>. Every entry in this list triggers a search query. As such, from a performance point of view, it's better to keep the list as short as possible. |
| **keyed\_groups** list / elements=string | **Default:**[] | | Add hosts to group based on the values of a variable. |
| **leading\_separator** boolean added in 2.11 of ansible.builtin | **Choices:*** no
* **yes** ←
| | Use in conjunction with keyed\_groups. By default, a keyed group that does not have a prefix or a separator provided will have a name that starts with an underscore. This is because the default prefix is "" and the default separator is "\_". Set this option to False to omit the leading underscore (or other separator) if no prefix is given. If the group name is derived from a mapping the separator is still used to concatenate the items. To not use a separator in the group name at all, set the separator for the keyed group to an empty string instead. |
| **plugin** string / required | **Choices:*** aws\_ec2
* amazon.aws.aws\_ec2
| | Token that ensures this is a source file for the plugin. |
| **regions** list / elements=string | **Default:**[] | | A list of regions in which to describe EC2 instances. If empty (the default) default this will include all regions, except possibly restricted ones like us-gov-west-1 and cn-north-1. |
| **strict** boolean | **Choices:*** **no** ←
* yes
| | 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. |
| **strict\_permissions** boolean | **Choices:*** no
* **yes** ←
| | By default if a 403 (Forbidden) error code is encountered this plugin will fail. You can set this option to False in the inventory config file which will allow 403 errors to be gracefully skipped. |
| **use\_contrib\_script\_compatible\_ec2\_tag\_keys** boolean | **Choices:*** **no** ←
* yes
| | Expose the host tags with ec2\_tag\_TAGNAME keys like the old ec2.py inventory script. The use of this feature is discouraged and we advise to migrate to the new ``tags`` structure. |
| **use\_contrib\_script\_compatible\_sanitization** boolean | **Choices:*** **no** ←
* yes
| | 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 and matches the sanitization of groups when the script's ``replace\_dash\_in\_groups`` option is set to ``False``. To replicate behavior of ``replace\_dash\_in\_groups = True`` with constructed groups, you will need to replace hyphens with underscores via the regex\_replace filter for those entries. 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. |
| **use\_extra\_vars** boolean added in 2.11 of ansible.builtin | **Choices:*** **no** ←
* yes
| ini entries: [inventory\_plugins]use\_extra\_vars = no env:ANSIBLE\_INVENTORY\_USE\_EXTRA\_VARS | Merge extra vars into the available variables for composition (highest precedence). |
Notes
-----
Note
* If no credentials are provided and the control node has an associated IAM instance profile then the role will be used for authentication.
Examples
--------
```
# Minimal example using environment vars or instance role credentials
# Fetch all hosts in us-east-1, the hostname is the public DNS if it exists, otherwise the private IP address
plugin: aws_ec2
regions:
- us-east-1
# Example using filters, ignoring permission errors, and specifying the hostname precedence
plugin: aws_ec2
# The values for profile, access key, secret key and token can be hardcoded like:
boto_profile: aws_profile
# or you could use Jinja as:
# boto_profile: "{{ lookup('env', 'AWS_PROFILE') | default('aws_profile', true) }}"
# Populate inventory with instances in these regions
regions:
- us-east-1
- us-east-2
filters:
# All instances with their `Environment` tag set to `dev`
tag:Environment: dev
# All dev and QA hosts
tag:Environment:
- dev
- qa
instance.group-id: sg-xxxxxxxx
# Ignores 403 errors rather than failing
strict_permissions: False
# Note: I(hostnames) sets the inventory_hostname. To modify ansible_host without modifying
# inventory_hostname use compose (see example below).
hostnames:
- tag:Name=Tag1,Name=Tag2 # Return specific hosts only
- tag:CustomDNSName
- dns-name
- name: 'tag:Name=Tag1,Name=Tag2'
- name: 'private-ip-address'
separator: '_'
prefix: 'tag:Name'
# Example using constructed features to create groups and set ansible_host
plugin: aws_ec2
regions:
- us-east-1
- us-west-1
# keyed_groups may be used to create custom groups
strict: False
keyed_groups:
# Add e.g. x86_64 hosts to an arch_x86_64 group
- prefix: arch
key: 'architecture'
# Add hosts to tag_Name_Value groups for each Name/Value tag pair
- prefix: tag
key: tags
# Add hosts to e.g. instance_type_z3_tiny
- prefix: instance_type
key: instance_type
# Create security_groups_sg_abcd1234 group for each SG
- key: 'security_groups|json_query("[].group_id")'
prefix: 'security_groups'
# Create a group for each value of the Application tag
- key: tags.Application
separator: ''
# Create a group per region e.g. aws_region_us_east_2
- key: placement.region
prefix: aws_region
# Create a group (or groups) based on the value of a custom tag "Role" and add them to a metagroup called "project"
- key: tags['Role']
prefix: foo
parent_group: "project"
# Set individual variables with compose
compose:
# Use the private IP address to connect to the host
# (note: this does not modify inventory_hostname, which is set via I(hostnames))
ansible_host: private_ip_address
# Example using include_filters and exclude_filters to compose the inventory.
plugin: aws_ec2
regions:
- us-east-1
- us-west-1
include_filters:
- tag:Name:
- 'my_second_tag'
- tag:Name:
- 'my_third_tag'
exclude_filters:
- tag:Name:
- 'my_first_tag'
```
### Authors
* Sloane Hertel (@s-hertel)
| programming_docs |
ansible amazon.aws.ec2_snapshot – Creates a snapshot from an existing volume amazon.aws.ec2\_snapshot – Creates a snapshot from an existing volume
=====================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_snapshot`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates an EC2 snapshot from an existing EBS volume.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.6
* boto
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **description** string | | Description to be applied to the snapshot. |
| **device\_name** string | | Device name of a mounted volume to be snapshotted. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **instance\_id** string | | Instance that has the required volume to snapshot mounted. |
| **last\_snapshot\_min\_age** integer | **Default:**0 | If the volume's most recent snapshot has started less than `last\_snapshot\_min\_age' minutes ago, a new snapshot will not be created. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **snapshot\_id** string | | Snapshot id to remove. |
| **snapshot\_tags** dictionary | | A dictionary of tags to add to the snapshot. |
| **state** string | **Choices:*** absent
* **present** ←
| Whether to add or create a snapshot. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **volume\_id** string | | Volume from which to take the snapshot. |
| **wait** boolean | **Choices:*** no
* **yes** ←
| Wait for the snapshot to be ready. |
| **wait\_timeout** integer | **Default:**0 | How long before wait gives up, in seconds. Specify 0 to wait forever. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Simple snapshot of volume using volume_id
- amazon.aws.ec2_snapshot:
volume_id: vol-abcdef12
description: snapshot of /data from DB123 taken 2013/11/28 12:18:32
# Snapshot of volume mounted on device_name attached to instance_id
- amazon.aws.ec2_snapshot:
instance_id: i-12345678
device_name: /dev/sdb1
description: snapshot of /data from DB123 taken 2013/11/28 12:18:32
# Snapshot of volume with tagging
- amazon.aws.ec2_snapshot:
instance_id: i-12345678
device_name: /dev/sdb1
snapshot_tags:
frequency: hourly
source: /data
# Remove a snapshot
- amazon.aws.ec2_snapshot:
snapshot_id: snap-abcd1234
state: absent
# Create a snapshot only if the most recent one is older than 1 hour
- amazon.aws.ec2_snapshot:
volume_id: vol-abcdef12
last_snapshot_min_age: 60
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **snapshot\_id** string | always | The ID of the snapshot. Each snapshot receives a unique identifier when it is created. **Sample:** snap-01234567 |
| **tags** dictionary | always | Any tags assigned to the snapshot. **Sample:** { 'Name': 'instance-name' } |
| **volume\_id** string | always | The ID of the volume that was used to create the snapshot. **Sample:** vol-01234567 |
| **volume\_size** integer | always | The size of the volume, in GiB. **Sample:** 8 |
### Authors
* Will Thames (@willthames)
ansible amazon.aws.ec2_vpc_net – Configure AWS virtual private clouds amazon.aws.ec2\_vpc\_net – Configure AWS virtual private clouds
===============================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_vpc_net`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, modify, and terminate AWS virtual private clouds.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **cidr\_block** list / elements=string / required | | The primary CIDR of the VPC. After 2.5 a list of CIDRs can be provided. The first in the list will be used as the primary CIDR and is used in conjunction with the `name` to ensure idempotence. |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **dhcp\_opts\_id** string | | The id of the DHCP options to use for this VPC. |
| **dns\_hostnames** boolean | **Choices:*** no
* **yes** ←
| Whether to enable AWS hostname support. |
| **dns\_support** boolean | **Choices:*** no
* **yes** ←
| Whether to enable AWS DNS support. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **ipv6\_cidr** boolean | **Choices:*** **no** ←
* yes
| Request an Amazon-provided IPv6 CIDR block with /56 prefix length. You cannot specify the range of IPv6 addresses, or the size of the CIDR block. |
| **multi\_ok** boolean | **Choices:*** **no** ←
* yes
| By default the module will not create another VPC if there is another VPC with the same name and CIDR block. Specify this as true if you want duplicate VPCs created. |
| **name** string / required | | The name to give your VPC. This is used in combination with `cidr_block` to determine if a VPC already exists. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **purge\_cidrs** boolean | **Choices:*** **no** ←
* yes
| Remove CIDRs that are associated with the VPC and are not specified in `cidr_block`. |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **state** string | **Choices:*** **present** ←
* absent
| The state of the VPC. Either absent or present. |
| **tags** dictionary | | The tags you want attached to the VPC. This is independent of the name value, note if you pass a 'Name' key it would override the Name of the VPC if it's different.
aliases: resource\_tags |
| **tenancy** string | **Choices:*** **default** ←
* dedicated
| Whether to be default or dedicated tenancy. This cannot be changed after the VPC has been created. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
- name: create a VPC with dedicated tenancy and a couple of tags
amazon.aws.ec2_vpc_net:
name: Module_dev2
cidr_block: 10.10.0.0/16
region: us-east-1
tags:
module: ec2_vpc_net
this: works
tenancy: dedicated
- name: create a VPC with dedicated tenancy and request an IPv6 CIDR
amazon.aws.ec2_vpc_net:
name: Module_dev2
cidr_block: 10.10.0.0/16
ipv6_cidr: True
region: us-east-1
tenancy: dedicated
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **vpc** complex | always | info about the VPC that was created or deleted |
| | **cidr\_block** string | always | The CIDR of the VPC **Sample:** 10.0.0.0/16 |
| | **cidr\_block\_association\_set** list / elements=string | success | IPv4 CIDR blocks associated with the VPC **Sample:** {'cidr\_block\_association\_set': [{'association\_id': 'vpc-cidr-assoc-97aeeefd', 'cidr\_block': '10.0.0.0/24', 'cidr\_block\_state': {'state': 'associated'}}]} |
| | **classic\_link\_enabled** boolean | always | indicates whether ClassicLink is enabled |
| | **dhcp\_options\_id** string | always | the id of the DHCP options associated with this VPC **Sample:** dopt-12345678 |
| | **id** string | always | VPC resource id **Sample:** vpc-12345678 |
| | **instance\_tenancy** string | always | indicates whether VPC uses default or dedicated tenancy **Sample:** default |
| | **ipv6\_cidr\_block\_association\_set** list / elements=string | success | IPv6 CIDR blocks associated with the VPC **Sample:** {'ipv6\_cidr\_block\_association\_set': [{'association\_id': 'vpc-cidr-assoc-97aeeefd', 'ipv6\_cidr\_block': '2001:db8::/56', 'ipv6\_cidr\_block\_state': {'state': 'associated'}}]} |
| | **is\_default** boolean | always | indicates whether this is the default VPC |
| | **owner\_id** string | always | The AWS account which owns the VPC. **Sample:** 123456789012 |
| | **state** string | always | state of the VPC **Sample:** available |
| | **tags** complex | always | tags attached to the VPC, includes name |
| | | **Name** string | always | name tag for the VPC **Sample:** pk\_vpc4 |
### Authors
* Jonathan Davila (@defionscode)
* Sloane Hertel (@s-hertel)
ansible amazon.aws.ec2_snapshot_info – Gather information about ec2 volume snapshots in AWS amazon.aws.ec2\_snapshot\_info – Gather information about ec2 volume snapshots in AWS
=====================================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_snapshot_info`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about ec2 volume snapshots in AWS.
* This module was called `ec2_snapshot_facts` before Ansible 2.9. The usage did not change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **filters** dictionary | **Default:**{} | A dict of filters to apply. Each dict item consists of a filter key and a filter value. See <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSnapshots.html> for possible filters. Filter names and values are case sensitive. |
| **max\_results** integer | | The maximum number of snapshot results returned in paginated output. When used only a single page along with a `next_token_id` response element will be returned. The remaining results of the initial request can be seen by sending another request with the returned `next_token_id` value. This value can be between 5 and 1000; if *next\_token\_id* is given a value larger than 1000, only 1000 results are returned. If this parameter is not used, then DescribeSnapshots returns all results. This parameter is mutually exclusive with *snapshot\_ids*. |
| **next\_token\_id** string | | Contains the value returned from a previous paginated request where *max\_results* was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the *next\_token\_id* value. This parameter is mutually exclusive with *snapshot\_ids*
|
| **owner\_ids** list / elements=string | **Default:**[] | If you specify one or more snapshot owners, only snapshots from the specified owners and for which you have access are returned. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **restorable\_by\_user\_ids** list / elements=string | **Default:**[] | If you specify a list of restorable users, only snapshots with create snapshot permissions for those users are returned. |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **snapshot\_ids** list / elements=string | **Default:**[] | If you specify one or more snapshot IDs, only snapshots that have the specified IDs are returned. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* By default, the module will return all snapshots, including public ones. To limit results to snapshots owned by the account use the filter ‘owner-id’.
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Gather information about all snapshots, including public ones
- amazon.aws.ec2_snapshot_info:
# Gather information about all snapshots owned by the account 0123456789
- amazon.aws.ec2_snapshot_info:
filters:
owner-id: 0123456789
# Or alternatively...
- amazon.aws.ec2_snapshot_info:
owner_ids:
- 0123456789
# Gather information about a particular snapshot using ID
- amazon.aws.ec2_snapshot_info:
filters:
snapshot-id: snap-00112233
# Or alternatively...
- amazon.aws.ec2_snapshot_info:
snapshot_ids:
- snap-00112233
# Gather information about any snapshot with a tag key Name and value Example
- amazon.aws.ec2_snapshot_info:
filters:
"tag:Name": Example
# Gather information about any snapshot with an error status
- amazon.aws.ec2_snapshot_info:
filters:
status: error
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **next\_token\_id** string | when option `max_results` is set in input | Contains the value returned from a previous paginated request where `max_results` was used and the results exceeded the value of that parameter. This value is null when there are no more results to return. |
| **snapshots** list / elements=dictionary | success | snapshots retrieved |
| | **data\_encryption\_key\_id** string | always | The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or snapshot copy. **Sample:** arn:aws:kms:ap-southeast-2:012345678900:key/74c9742a-a1b2-45cb-b3fe-abcdef123456 |
| | **description** string | always | The description for the snapshot. **Sample:** My important backup |
| | **encrypted** boolean | always | Indicates whether the snapshot is encrypted. **Sample:** True |
| | **kms\_key\_id** string | always | The full ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume encryption key for the parent volume. **Sample:** 74c9742a-a1b2-45cb-b3fe-abcdef123456 |
| | **owner\_alias** string | always | The AWS account alias (for example, amazon, self) or AWS account ID that owns the snapshot. **Sample:** 033440102211 |
| | **owner\_id** string | always | The AWS account ID of the EBS snapshot owner. **Sample:** 099720109477 |
| | **progress** string | always | The progress of the snapshot, as a percentage. **Sample:** 100% |
| | **snapshot\_id** string | always | The ID of the snapshot. Each snapshot receives a unique identifier when it is created. **Sample:** snap-01234567 |
| | **start\_time** string | always | The time stamp when the snapshot was initiated. **Sample:** 2015-02-12T02:14:02+00:00 |
| | **state** string | always | The snapshot state (completed, pending or error). **Sample:** completed |
| | **state\_message** string | always | Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if the proper AWS Key Management Service (AWS KMS) permissions are not obtained) this field displays error state details to help you diagnose why the error occurred. |
| | **tags** dictionary | always | Any tags assigned to the snapshot. **Sample:** { 'my\_tag\_key': 'my\_tag\_value' } |
| | **volume\_id** string | always | The ID of the volume that was used to create the snapshot. **Sample:** vol-01234567 |
| | **volume\_size** integer | always | The size of the volume, in GiB. **Sample:** 8 |
### Authors
* Rob White (@wimnat)
* Aubin Bikouo (@abikouo)
| programming_docs |
ansible amazon.aws.aws_caller_facts amazon.aws.aws\_caller\_facts
=============================
Note
This redirect is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
* This redirect has been **deprecated**. Please update your tasks to use the new name `amazon.aws.aws_caller_info` instead. It will be removed in a major release after 2021-12-01 of amazon.aws.
* This is a redirect to the [amazon.aws.aws\_caller\_info module](aws_caller_info_module#ansible-collections-amazon-aws-aws-caller-info-module).
* This redirect also works with Ansible 2.9.
* The collection contains the following information on this deprecation: aws\_caller\_facts was renamed in Ansible 2.9 to aws\_caller\_info. Please update your tasks.
ansible amazon.aws.aws_s3 – manage objects in S3. amazon.aws.aws\_s3 – manage objects in S3.
==========================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.aws_s3`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module allows the user to manage S3 buckets and the objects within them. Includes support for creating and deleting both objects and buckets, retrieving objects as files or strings and generating download links. This module has a dependency on boto3 and botocore.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **bucket** string / required | | Bucket name. |
| **content** string added in 1.3.0 of amazon.aws | | The content to PUT into an object. The parameter value will be treated as a string and converted to UTF-8 before sending it to S3. To send binary data, use the *content\_base64* parameter instead. Either *content*, *content\_base64* or *src* must be specified for a PUT operation. Ignored otherwise. |
| **content\_base64** string added in 1.3.0 of amazon.aws | | The base64-encoded binary data to PUT into an object. Use this if you need to put raw binary data, and don't forget to encode in base64. Either *content*, *content\_base64* or *src* must be specified for a PUT operation. Ignored otherwise. |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **dest** path | | The destination file path when downloading an object/key with a GET operation. |
| **dualstack** boolean | **Choices:*** **no** ←
* yes
| Enables Amazon S3 Dual-Stack Endpoints, allowing S3 communications using both IPv4 and IPv6. Requires at least botocore version 1.4.45. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **encrypt** boolean | **Choices:*** no
* **yes** ←
| When set for PUT mode, asks for server-side encryption. |
| **encryption\_kms\_key\_id** string | | KMS key id to use when encrypting objects using *encrypting=aws:kms*. Ignored if *encryption* is not `aws:kms`. |
| **encryption\_mode** string | **Choices:*** **AES256** ←
* aws:kms
| What encryption mode to use if *encrypt=true*. |
| **expiry** integer | **Default:**600 | Time limit (in seconds) for the URL generated and returned by S3/Walrus when performing a *mode=put* or *mode=geturl* operation.
aliases: expiration |
| **headers** dictionary | | Custom headers for PUT operation, as a dictionary of `key=value` and `key=value,key=value`. |
| **ignore\_nonexistent\_bucket** boolean | **Choices:*** **no** ←
* yes
| Overrides initial bucket lookups in case bucket or iam policies are restrictive. Example: a user may have the GetObject permission but no other permissions. In this case using the option mode: get will fail without specifying *ignore\_nonexistent\_bucket=true*. |
| **marker** string | | Specifies the key to start with when using list mode. Object keys are returned in alphabetical order, starting with key after the marker in order. |
| **max\_keys** integer | **Default:**1000 | Max number of results to return in list mode, set this if you want to retrieve fewer than the default 1000 keys. |
| **metadata** dictionary | | Metadata for PUT operation, as a dictionary of `key=value` and `key=value,key=value`. |
| **mode** string / required | **Choices:*** get
* put
* delete
* create
* geturl
* getstr
* delobj
* list
| Switches the module behaviour between `put` (upload), `get` (download), `geturl` (return download url, Ansible 1.3+), `getstr` (download object as string (1.3+)), `list` (list keys, Ansible 2.0+), `create` (bucket), `delete` (bucket), and delobj (delete object, Ansible 2.0+). |
| **object** string | | Keyname of the object inside the bucket. Can be used to create "virtual directories", see examples. |
| **overwrite** string | **Default:**"always" | Force overwrite either locally on the filesystem or remotely with the object/key. Used with PUT and GET operations. Must be a Boolean, `always`, `never` or `different`.
`true` is the same as `always`.
`false` is equal to `never`. When this is set to `different` the MD5 sum of the local file is compared with the 'ETag' of the object/key in S3. The ETag may or may not be an MD5 digest of the object data. See the ETag response header here <https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html>.
aliases: force |
| **permission** list / elements=string | **Default:**["private"] | This option lets the user set the canned permissions on the object/bucket that are created. The permissions that can be set are `private`, `public-read`, `public-read-write`, `authenticated-read` for a bucket or `private`, `public-read`, `public-read-write`, `aws-exec-read`, `authenticated-read`, `bucket-owner-read`, `bucket-owner-full-control` for an object. Multiple permissions can be specified as a list. |
| **prefix** string | **Default:**"" | Limits the response to keys that begin with the specified prefix for list mode. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **retries** integer | **Default:**0 | On recoverable failure, how many times to retry before actually failing.
aliases: retry |
| **rgw** boolean | **Choices:*** **no** ←
* yes
| Enable Ceph RGW S3 support. This option requires an explicit url via *s3\_url*. |
| **s3\_url** string | | S3 URL endpoint for usage with Ceph, Eucalyptus and fakes3 etc. Otherwise assumes AWS.
aliases: S3\_URL |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **src** path | | The source file path when performing a PUT operation. Either *content*, *content\_base64* or *src* must be specified for a PUT operation. Ignored otherwise. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **version** string | | Version ID of the object inside the bucket. Can be used to get a specific version of a file if versioning is enabled in the target bucket. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
- name: Simple PUT operation
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
src: /usr/local/myfile.txt
mode: put
- name: PUT operation from a rendered template
amazon.aws.aws_s3:
bucket: mybucket
object: /object.yaml
content: "{{ lookup('template', 'templates/object.yaml.j2') }}"
mode: put
- name: Simple PUT operation in Ceph RGW S3
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
src: /usr/local/myfile.txt
mode: put
rgw: true
s3_url: "http://localhost:8000"
- name: Simple GET operation
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
dest: /usr/local/myfile.txt
mode: get
- name: Get a specific version of an object.
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
version: 48c9ee5131af7a716edc22df9772aa6f
dest: /usr/local/myfile.txt
mode: get
- name: PUT/upload with metadata
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
src: /usr/local/myfile.txt
mode: put
metadata: 'Content-Encoding=gzip,Cache-Control=no-cache'
- name: PUT/upload with custom headers
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
src: /usr/local/myfile.txt
mode: put
headers: '[email protected]'
- name: List keys simple
amazon.aws.aws_s3:
bucket: mybucket
mode: list
- name: List keys all options
amazon.aws.aws_s3:
bucket: mybucket
mode: list
prefix: /my/desired/
marker: /my/desired/0023.txt
max_keys: 472
- name: Create an empty bucket
amazon.aws.aws_s3:
bucket: mybucket
mode: create
permission: public-read
- name: Create a bucket with key as directory, in the EU region
amazon.aws.aws_s3:
bucket: mybucket
object: /my/directory/path
mode: create
region: eu-west-1
- name: Delete a bucket and all contents
amazon.aws.aws_s3:
bucket: mybucket
mode: delete
- name: GET an object but don't download if the file checksums match. New in 2.0
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
dest: /usr/local/myfile.txt
mode: get
overwrite: different
- name: Delete an object from a bucket
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
mode: delobj
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **contents** string | (for getstr operation) | Contents of the object as string. **Sample:** Hello, world! |
| **expiry** integer | (for geturl operation) | Number of seconds the presigned url is valid for. **Sample:** 600 |
| **msg** string | always | Message indicating the status of the operation. **Sample:** PUT operation complete |
| **s3\_keys** list / elements=string | (for list operation) | List of object keys. **Sample:** ['prefix1/', 'prefix1/key1', 'prefix1/key2'] |
| **url** string | (for put and geturl operations) | URL of the object. **Sample:** https://my-bucket.s3.amazonaws.com/my-key.txt?AWSAccessKeyId=<access-key>&Expires=1506888865&Signature=<signature> |
### Authors
* Lester Wade (@lwade)
* Sloane Hertel (@s-hertel)
ansible amazon.aws.ec2_metadata_facts – gathers facts (instance metadata) about remote hosts within EC2 amazon.aws.ec2\_metadata\_facts – gathers facts (instance metadata) about remote hosts within EC2
=================================================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_metadata_facts`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Notes](#notes)
* [Examples](#examples)
* [Returned Facts](#returned-facts)
Synopsis
--------
* This module fetches data from the instance metadata endpoint in EC2 as per <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html>.
* The module must be called from within the EC2 instance itself.
* The module is configured to utilize the session oriented Instance Metadata Service v2 (IMDSv2) <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html>.
* If the HttpEndpoint parameter <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceMetadataOptions.html#API_ModifyInstanceMetadataOptions_RequestParameters> is set to disabled for the EC2 instance, the module will return an error while retrieving a session token.
Notes
-----
Note
* Parameters to filter on ec2\_metadata\_facts may be added later.
Examples
--------
```
# Gather EC2 metadata facts
- amazon.aws.ec2_metadata_facts:
- debug:
msg: "This instance is a t1.micro"
when: ansible_ec2_instance_type == "t1.micro"
```
Returned Facts
--------------
Facts returned by this module are added/updated in the `hostvars` host facts and can be referenced by name just like any other host fact. They do not need to be registered in order to use them.
| Fact | Returned | Description |
| --- | --- | --- |
| **ansible\_ec2\_ami\_id** string / elements=string | success | The AMI ID used to launch the instance. **Sample:** ami-XXXXXXXX |
| **ansible\_ec2\_ami\_launch\_index** string / elements=string | success | If you started more than one instance at the same time, this value indicates the order in which the instance was launched. The value of the first instance launched is 0. **Sample:** 0 |
| **ansible\_ec2\_ami\_manifest\_path** string / elements=string | success | The path to the AMI manifest file in Amazon S3. If you used an Amazon EBS-backed AMI to launch the instance, the returned result is unknown. **Sample:** (unknown) |
| **ansible\_ec2\_ancestor\_ami\_ids** string / elements=string | success | The AMI IDs of any instances that were rebundled to create this AMI. This value will only exist if the AMI manifest file contained an ancestor-amis key. **Sample:** (unknown) |
| **ansible\_ec2\_block\_device\_mapping\_ami** string / elements=string | success | The virtual device that contains the root/boot file system. **Sample:** /dev/sda1 |
| **ansible\_ec2\_block\_device\_mapping\_ebsN** string / elements=string | success | The virtual devices associated with Amazon EBS volumes, if any are present. Amazon EBS volumes are only available in metadata if they were present at launch time or when the instance was last started. The N indicates the index of the Amazon EBS volume (such as ebs1 or ebs2). **Sample:** /dev/xvdb |
| **ansible\_ec2\_block\_device\_mapping\_ephemeralN** string / elements=string | success | The virtual devices associated with ephemeral devices, if any are present. The N indicates the index of the ephemeral volume. **Sample:** /dev/xvdc |
| **ansible\_ec2\_block\_device\_mapping\_root** string / elements=string | success | The virtual devices or partitions associated with the root devices, or partitions on the virtual device, where the root (/ or C) file system is associated with the given instance. **Sample:** /dev/sda1 |
| **ansible\_ec2\_block\_device\_mapping\_swap** string / elements=string | success | The virtual devices associated with swap. Not always present. **Sample:** /dev/sda2 |
| **ansible\_ec2\_fws\_instance\_monitoring** string / elements=string | success | Value showing whether the customer has enabled detailed one-minute monitoring in CloudWatch. **Sample:** enabled |
| **ansible\_ec2\_hostname** string / elements=string | success | The private IPv4 DNS hostname of the instance. In cases where multiple network interfaces are present, this refers to the eth0 device (the device for which the device number is 0). **Sample:** ip-10-0-0-1.ec2.internal |
| **ansible\_ec2\_iam\_info** complex / elements=string | success | If there is an IAM role associated with the instance, contains information about the last time the instance profile was updated, including the instance's LastUpdated date, InstanceProfileArn, and InstanceProfileId. Otherwise, not present. |
| | **InstanceProfileArn** string / elements=string | success | The ARN of the InstanceProfile associated with the Instance. |
| | **InstanceProfileId** string / elements=string | success | The Id of the InstanceProfile associated with the Instance. |
| | **LastUpdated** string / elements=string | success | The last time which InstanceProfile is associated with the Instance changed. |
| **ansible\_ec2\_iam\_info\_instanceprofilearn** string / elements=string | success | The IAM instance profile ARN. **Sample:** arn:aws:iam::<account id>:instance-profile/<role name> |
| **ansible\_ec2\_iam\_info\_instanceprofileid** string / elements=string | success | IAM instance profile ID. |
| **ansible\_ec2\_iam\_info\_lastupdated** string / elements=string | success | IAM info last updated time. **Sample:** 2017-05-12T02:42:27Z |
| **ansible\_ec2\_iam\_instance\_profile\_role** string / elements=string | success | IAM instance role. **Sample:** role\_name |
| **ansible\_ec2\_iam\_security\_credentials\_** string / elements=string | success | If there is an IAM role associated with the instance, role-name is the name of the role, and role-name contains the temporary security credentials associated with the role. Otherwise, not present. |
| **ansible\_ec2\_iam\_security\_credentials\_\_accesskeyid** string / elements=string | success | IAM role access key ID. |
| **ansible\_ec2\_iam\_security\_credentials\_\_code** string / elements=string | success | IAM code. **Sample:** Success |
| **ansible\_ec2\_iam\_security\_credentials\_\_expiration** string / elements=string | success | IAM role credentials expiration time. **Sample:** 2017-05-12T09:11:41Z |
| **ansible\_ec2\_iam\_security\_credentials\_\_lastupdated** string / elements=string | success | IAM role last updated time. **Sample:** 2017-05-12T02:40:44Z |
| **ansible\_ec2\_iam\_security\_credentials\_\_secretaccesskey** string / elements=string | success | IAM role secret access key. |
| **ansible\_ec2\_iam\_security\_credentials\_\_token** string / elements=string | success | IAM role token. |
| **ansible\_ec2\_iam\_security\_credentials\_\_type** string / elements=string | success | IAM role type. **Sample:** AWS-HMAC |
| **ansible\_ec2\_instance\_action** string / elements=string | success | Notifies the instance that it should reboot in preparation for bundling. **Sample:** none |
| **ansible\_ec2\_instance\_id** string / elements=string | success | The ID of this instance. **Sample:** i-XXXXXXXXXXXXXXXXX |
| **ansible\_ec2\_instance\_identity\_document** string / elements=string | success | JSON containing instance attributes, such as instance-id, private IP address, etc. |
| **ansible\_ec2\_instance\_identity\_document\_accountid** string / elements=string | success | **Sample:** 012345678901 |
| **ansible\_ec2\_instance\_identity\_document\_architecture** string / elements=string | success | Instance system architecture. **Sample:** x86\_64 |
| **ansible\_ec2\_instance\_identity\_document\_availabilityzone** string / elements=string | success | The Availability Zone in which the instance launched. **Sample:** us-east-1a |
| **ansible\_ec2\_instance\_identity\_document\_billingproducts** string / elements=string | success | Billing products for this instance. |
| **ansible\_ec2\_instance\_identity\_document\_devpayproductcodes** string / elements=string | success | Product codes for the launched AMI. |
| **ansible\_ec2\_instance\_identity\_document\_imageid** string / elements=string | success | The AMI ID used to launch the instance. **Sample:** ami-01234567 |
| **ansible\_ec2\_instance\_identity\_document\_instanceid** string / elements=string | success | The ID of this instance. **Sample:** i-0123456789abcdef0 |
| **ansible\_ec2\_instance\_identity\_document\_instancetype** string / elements=string | success | The type of instance. **Sample:** m4.large |
| **ansible\_ec2\_instance\_identity\_document\_kernelid** string / elements=string | success | The ID of the kernel launched with this instance, if applicable. |
| **ansible\_ec2\_instance\_identity\_document\_pendingtime** string / elements=string | success | The instance pending time. **Sample:** 2017-05-11T20:51:20Z |
| **ansible\_ec2\_instance\_identity\_document\_privateip** string / elements=string | success | The private IPv4 address of the instance. In cases where multiple network interfaces are present, this refers to the eth0 device (the device for which the device number is 0). **Sample:** 10.0.0.1 |
| **ansible\_ec2\_instance\_identity\_document\_ramdiskid** string / elements=string | success | The ID of the RAM disk specified at launch time, if applicable. |
| **ansible\_ec2\_instance\_identity\_document\_region** string / elements=string | success | The Region in which the instance launched. **Sample:** us-east-1 |
| **ansible\_ec2\_instance\_identity\_document\_version** string / elements=string | success | Identity document version. **Sample:** 2010-08-31 |
| **ansible\_ec2\_instance\_identity\_pkcs7** string / elements=string | success | Used to verify the document's authenticity and content against the signature. |
| **ansible\_ec2\_instance\_identity\_rsa2048** string / elements=string | success | Used to verify the document's authenticity and content against the signature. |
| **ansible\_ec2\_instance\_identity\_signature** string / elements=string | success | Data that can be used by other parties to verify its origin and authenticity. |
| **ansible\_ec2\_instance\_life\_cycle** string / elements=string | success | The purchasing option of the instance. **Sample:** on-demand |
| **ansible\_ec2\_instance\_type** string / elements=string | success | The type of the instance. **Sample:** m4.large |
| **ansible\_ec2\_local\_hostname** string / elements=string | success | The private IPv4 DNS hostname of the instance. In cases where multiple network interfaces are present, this refers to the eth0 device (the device for which the device number is 0). **Sample:** ip-10-0-0-1.ec2.internal |
| **ansible\_ec2\_local\_ipv4** string / elements=string | success | The private IPv4 address of the instance. In cases where multiple network interfaces are present, this refers to the eth0 device (the device for which the device number is 0). **Sample:** 10.0.0.1 |
| **ansible\_ec2\_mac** string / elements=string | success | The instance's media access control (MAC) address. In cases where multiple network interfaces are present, this refers to the eth0 device (the device for which the device number is 0). **Sample:** 00:11:22:33:44:55 |
| **ansible\_ec2\_metrics\_vhostmd** string / elements=string | success | Metrics; no longer available. |
| **ansible\_ec2\_network\_interfaces\_macs\_\_device\_number** string / elements=string | success | The unique device number associated with that interface. The device number corresponds to the device name; for example, a device-number of 2 is for the eth2 device. This category corresponds to the DeviceIndex and device-index fields that are used by the Amazon EC2 API and the EC2 commands for the AWS CLI. **Sample:** 0 |
| **ansible\_ec2\_network\_interfaces\_macs\_\_interface\_id** string / elements=string | success | The elastic network interface ID. **Sample:** eni-12345678 |
| **ansible\_ec2\_network\_interfaces\_macs\_\_ipv4\_associations\_** string / elements=string | success | The private IPv4 addresses that are associated with each public-ip address and assigned to that interface. |
| **ansible\_ec2\_network\_interfaces\_macs\_\_ipv6s** string / elements=string | success | The IPv6 addresses associated with the interface. Returned only for instances launched into a VPC. |
| **ansible\_ec2\_network\_interfaces\_macs\_\_local\_hostname** string / elements=string | success | The interface's local hostname. |
| **ansible\_ec2\_network\_interfaces\_macs\_\_local\_ipv4s** string / elements=string | success | The private IPv4 addresses associated with the interface. |
| **ansible\_ec2\_network\_interfaces\_macs\_\_mac** string / elements=string | success | The instance's MAC address. **Sample:** 00:11:22:33:44:55 |
| **ansible\_ec2\_network\_interfaces\_macs\_\_owner\_id** string / elements=string | success | The ID of the owner of the network interface. In multiple-interface environments, an interface can be attached by a third party, such as Elastic Load Balancing. Traffic on an interface is always billed to the interface owner. **Sample:** 01234567890 |
| **ansible\_ec2\_network\_interfaces\_macs\_\_public\_hostname** string / elements=string | success | The interface's public DNS (IPv4). If the instance is in a VPC, this category is only returned if the enableDnsHostnames attribute is set to true. **Sample:** ec2-1-2-3-4.compute-1.amazonaws.com |
| **ansible\_ec2\_network\_interfaces\_macs\_\_public\_ipv4s** string / elements=string | success | The Elastic IP addresses associated with the interface. There may be multiple IPv4 addresses on an instance. **Sample:** 1.2.3.4 |
| **ansible\_ec2\_network\_interfaces\_macs\_\_security\_group\_ids** string / elements=string | success | The IDs of the security groups to which the network interface belongs. Returned only for instances launched into a VPC. **Sample:** sg-01234567,sg-01234568 |
| **ansible\_ec2\_network\_interfaces\_macs\_\_security\_groups** string / elements=string | success | Security groups to which the network interface belongs. Returned only for instances launched into a VPC. **Sample:** secgroup1,secgroup2 |
| **ansible\_ec2\_network\_interfaces\_macs\_\_subnet\_id** string / elements=string | success | The ID of the subnet in which the interface resides. Returned only for instances launched into a VPC. **Sample:** subnet-01234567 |
| **ansible\_ec2\_network\_interfaces\_macs\_\_subnet\_ipv4\_cidr\_block** string / elements=string | success | The IPv4 CIDR block of the subnet in which the interface resides. Returned only for instances launched into a VPC. **Sample:** 10.0.1.0/24 |
| **ansible\_ec2\_network\_interfaces\_macs\_\_subnet\_ipv6\_cidr\_blocks** string / elements=string | success | The IPv6 CIDR block of the subnet in which the interface resides. Returned only for instances launched into a VPC. |
| **ansible\_ec2\_network\_interfaces\_macs\_\_vpc\_id** string / elements=string | success | The ID of the VPC in which the interface resides. Returned only for instances launched into a VPC. **Sample:** vpc-0123456 |
| **ansible\_ec2\_network\_interfaces\_macs\_\_vpc\_ipv4\_cidr\_block** string / elements=string | success | The IPv4 CIDR block of the VPC in which the interface resides. Returned only for instances launched into a VPC. **Sample:** 10.0.0.0/16 |
| **ansible\_ec2\_network\_interfaces\_macs\_\_vpc\_ipv4\_cidr\_blocks** string / elements=string | success | The IPv4 CIDR block of the VPC in which the interface resides. Returned only for instances launched into a VPC. **Sample:** 10.0.0.0/16 |
| **ansible\_ec2\_network\_interfaces\_macs\_\_vpc\_ipv6\_cidr\_blocks** string / elements=string | success | The IPv6 CIDR block of the VPC in which the interface resides. Returned only for instances launched into a VPC. |
| **ansible\_ec2\_placement\_availability\_zone** string / elements=string | success | The Availability Zone in which the instance launched. **Sample:** us-east-1a |
| **ansible\_ec2\_placement\_region** string / elements=string | success | The Region in which the instance launched. **Sample:** us-east-1 |
| **ansible\_ec2\_product\_codes** string / elements=string | success | Product codes associated with the instance, if any. **Sample:** aw0evgkw8e5c1q413zgy5pjce |
| **ansible\_ec2\_profile** string / elements=string | success | EC2 instance hardware profile. **Sample:** default-hvm |
| **ansible\_ec2\_public\_hostname** string / elements=string | success | The instance's public DNS. If the instance is in a VPC, this category is only returned if the enableDnsHostnames attribute is set to true. **Sample:** ec2-1-2-3-4.compute-1.amazonaws.com |
| **ansible\_ec2\_public\_ipv4** string / elements=string | success | The public IPv4 address. If an Elastic IP address is associated with the instance, the value returned is the Elastic IP address. **Sample:** 1.2.3.4 |
| **ansible\_ec2\_public\_key** string / elements=string | success | Public key. Only available if supplied at instance launch time. |
| **ansible\_ec2\_ramdisk\_id** string / elements=string | success | The ID of the RAM disk specified at launch time, if applicable. |
| **ansible\_ec2\_reservation\_id** string / elements=string | success | The ID of the reservation. **Sample:** r-0123456789abcdef0 |
| **ansible\_ec2\_security\_groups** string / elements=string | success | The names of the security groups applied to the instance. After launch, you can only change the security groups of instances running in a VPC. Such changes are reflected here and in network/interfaces/macs/mac/security-groups. **Sample:** securitygroup1,securitygroup2 |
| **ansible\_ec2\_services\_domain** string / elements=string | success | The domain for AWS resources for the region; for example, amazonaws.com for us-east-1. **Sample:** amazonaws.com |
| **ansible\_ec2\_services\_partition** string / elements=string | success | The partition that the resource is in. For standard AWS regions, the partition is aws. If you have resources in other partitions, the partition is aws-partitionname. For example, the partition for resources in the China (Beijing) region is aws-cn. **Sample:** aws |
| **ansible\_ec2\_spot\_termination\_time** string / elements=string | success | The approximate time, in UTC, that the operating system for your Spot instance will receive the shutdown signal. This item is present and contains a time value only if the Spot instance has been marked for termination by Amazon EC2. The termination-time item is not set to a time if you terminated the Spot instance yourself. **Sample:** 2015-01-05T18:02:00Z |
| **ansible\_ec2\_user\_data** string / elements=string | success | The instance user data. **Sample:** #!/bin/bash |
### Authors
* Silviu Dicu (@silviud)
* Vinay Dandekar (@roadmapper)
| programming_docs |
ansible amazon.aws.aws_account_attribute – Look up AWS account attributes. amazon.aws.aws\_account\_attribute – Look up AWS account attributes.
====================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.aws_account_attribute`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Describes attributes of your AWS account. You can specify one of the listed attribute choices or omit it to see all attributes.
Requirements
------------
The below requirements are needed on the local controller node that executes this lookup.
* boto3
* botocore
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **attribute** string | **Choices:*** supported-platforms
* default-vpc
* max-instances
* vpc-max-security-groups-per-interface
* max-elastic-ips
* vpc-max-elastic-ips
* has-ec2-classic
| | The attribute for which to get the value(s). |
| **aws\_access\_key** string | | env:EC2\_ACCESS\_KEY env:AWS\_ACCESS\_KEY env:AWS\_ACCESS\_KEY\_ID | The AWS access key to use.
aliases: aws\_access\_key\_id |
| **aws\_profile** string | | env:AWS\_DEFAULT\_PROFILE env:AWS\_PROFILE | The AWS profile
aliases: boto\_profile |
| **aws\_secret\_key** string | | env:EC2\_SECRET\_KEY env:AWS\_SECRET\_KEY env:AWS\_SECRET\_ACCESS\_KEY | The AWS secret key that corresponds to the access key.
aliases: aws\_secret\_access\_key |
| **aws\_security\_token** string | | env:EC2\_SECURITY\_TOKEN env:AWS\_SESSION\_TOKEN env:AWS\_SECURITY\_TOKEN | The AWS security token if using temporary access and secret keys. |
| **region** string | | env:EC2\_REGION env:AWS\_REGION | The region for which to create the connection. |
Examples
--------
```
vars:
has_ec2_classic: "{{ lookup('aws_account_attribute', attribute='has-ec2-classic') }}"
# true | false
default_vpc_id: "{{ lookup('aws_account_attribute', attribute='default-vpc') }}"
# vpc-xxxxxxxx | none
account_details: "{{ lookup('aws_account_attribute', wantlist='true') }}"
# {'default-vpc': ['vpc-xxxxxxxx'], 'max-elastic-ips': ['5'], 'max-instances': ['20'],
# 'supported-platforms': ['VPC', 'EC2'], 'vpc-max-elastic-ips': ['5'], 'vpc-max-security-groups-per-interface': ['5']}
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this lookup:
| Key | Returned | Description |
| --- | --- | --- |
| **\_raw** string | success | Returns a boolean when *attribute* is check\_ec2\_classic. Otherwise returns the value(s) of the attribute (or all attributes if one is not specified). |
### Authors
* Sloane Hertel <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#dfacb7baadabbab3f9fcece8e4f9fceaede4f9fcebe7e4adbabbb7beabf9fcebe9e4bcb0b2)>
ansible amazon.aws.ec2_ami – Create or destroy an image (AMI) in ec2 amazon.aws.ec2\_ami – Create or destroy an image (AMI) in ec2
=============================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_ami`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Registers or deregisters ec2 images.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.6
* boto
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **architecture** string | **Default:**"x86\_64" | The target architecture of the image to register |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **billing\_products** list / elements=string | | A list of valid billing codes. To be used with valid accounts by aws marketplace vendors. |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **delete\_snapshot** boolean | **Choices:*** **no** ←
* yes
| Delete snapshots when deregistering the AMI. |
| **description** string | | Human-readable string describing the contents and purpose of the AMI. |
| **device\_mapping** list / elements=dictionary | | List of device hashes/dictionaries with custom configurations (same block-device-mapping parameters). |
| | **delete\_on\_termination** boolean | **Choices:*** no
* yes
| Whether the device should be automatically deleted when the Instance is terminated. |
| | **device\_name** string / required | | The device name. For example `/dev/sda`.
aliases: DeviceName |
| | **encrypted** boolean | **Choices:*** no
* yes
| Whether the volume should be encrypted. |
| | **iops** integer | | When using an `io1` *volume\_type* this sets the number of IOPS provisioned for the volume |
| | **no\_device** boolean | **Choices:*** no
* yes
| Suppresses the specified device included in the block device mapping of the AMI. Alias `NoDevice` has been deprecated and will be removed after 2022-06-01.
aliases: NoDevice |
| | **snapshot\_id** string | | The ID of the Snapshot. |
| | **virtual\_name** string | | The virtual name for the device. See the AWS documentation for more detail <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html>. Alias `VirtualName` has been deprecated and will be removed after 2022-06-01.
aliases: VirtualName |
| | **volume\_size** integer | | The size of the volume (in GiB)
aliases: size |
| | **volume\_type** string | | The volume type. Defaults to `gp2` when not set. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **enhanced\_networking** boolean | **Choices:*** no
* yes
| A boolean representing whether enhanced networking with ENA is enabled or not. |
| **image\_id** string | | Image ID to be deregistered. |
| **image\_location** string | | The s3 location of an image to use for the AMI. |
| **instance\_id** string | | Instance ID to create the AMI from. |
| **kernel\_id** string | | The target kernel id of the image to register. |
| **launch\_permissions** dictionary | | Users and groups that should be able to launch the AMI. Expects dictionary with a key of user\_ids and/or group\_names. user\_ids should be a list of account ids. group\_name should be a list of groups, "all" is the only acceptable value currently. You must pass all desired launch permissions if you wish to modify existing launch permissions (passing just groups will remove all users) |
| **name** string | | The name of the new AMI. |
| **no\_reboot** boolean | **Choices:*** **no** ←
* yes
| Flag indicating that the bundling process should not attempt to shutdown the instance before bundling. If this flag is True, the responsibility of maintaining file system integrity is left to the owner of the instance. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **purge\_tags** boolean | **Choices:*** **no** ←
* yes
| Whether to remove existing tags that aren't passed in the `tags` parameter |
| **ramdisk\_id** string | | The ID of the RAM disk. |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **root\_device\_name** string | | The root device name of the image to register. |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **sriov\_net\_support** string | | Set to simple to enable enhanced networking with the Intel 82599 Virtual Function interface for the AMI and any instances that you launch from the AMI. |
| **state** string | **Choices:*** absent
* **present** ←
| Register or deregister an AMI. |
| **tags** dictionary | | A dictionary of tags to add to the new image; '{"key":"value"}' and '{"key":"value","key":"value"}' |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **virtualization\_type** string | **Default:**"hvm" | The virtualization type of the image to register. |
| **wait** boolean | **Choices:*** **no** ←
* yes
| Wait for the AMI to be in state 'available' before returning. |
| **wait\_timeout** integer | **Default:**1200 | How long before wait gives up, in seconds. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Basic AMI Creation
amazon.aws.ec2_ami:
instance_id: i-xxxxxx
wait: yes
name: newtest
tags:
Name: newtest
Service: TestService
- name: Basic AMI Creation, without waiting
amazon.aws.ec2_ami:
instance_id: i-xxxxxx
wait: no
name: newtest
- name: AMI Registration from EBS Snapshot
amazon.aws.ec2_ami:
name: newtest
state: present
architecture: x86_64
virtualization_type: hvm
root_device_name: /dev/xvda
device_mapping:
- device_name: /dev/xvda
volume_size: 8
snapshot_id: snap-xxxxxxxx
delete_on_termination: true
volume_type: gp2
- name: AMI Creation, with a custom root-device size and another EBS attached
amazon.aws.ec2_ami:
instance_id: i-xxxxxx
name: newtest
device_mapping:
- device_name: /dev/sda1
size: XXX
delete_on_termination: true
volume_type: gp2
- device_name: /dev/sdb
size: YYY
delete_on_termination: false
volume_type: gp2
- name: AMI Creation, excluding a volume attached at /dev/sdb
amazon.aws.ec2_ami:
instance_id: i-xxxxxx
name: newtest
device_mapping:
- device_name: /dev/sda1
size: XXX
delete_on_termination: true
volume_type: gp2
- device_name: /dev/sdb
no_device: yes
- name: Deregister/Delete AMI (keep associated snapshots)
amazon.aws.ec2_ami:
image_id: "{{ instance.image_id }}"
delete_snapshot: False
state: absent
- name: Deregister AMI (delete associated snapshots too)
amazon.aws.ec2_ami:
image_id: "{{ instance.image_id }}"
delete_snapshot: True
state: absent
- name: Update AMI Launch Permissions, making it public
amazon.aws.ec2_ami:
image_id: "{{ instance.image_id }}"
state: present
launch_permissions:
group_names: ['all']
- name: Allow AMI to be launched by another account
amazon.aws.ec2_ami:
image_id: "{{ instance.image_id }}"
state: present
launch_permissions:
user_ids: ['123456789012']
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **architecture** string | when AMI is created or already exists | Architecture of image. **Sample:** x86\_64 |
| **block\_device\_mapping** dictionary | when AMI is created or already exists | Block device mapping associated with image. **Sample:** {'/dev/sda1': {'delete\_on\_termination': True, 'encrypted': False, 'size': 10, 'snapshot\_id': 'snap-1a03b80e7', 'volume\_type': 'standard'}} |
| **creationDate** string | when AMI is created or already exists | Creation date of image. **Sample:** 2015-10-15T22:43:44.000Z |
| **description** string | when AMI is created or already exists | Description of image. **Sample:** nat-server |
| **hypervisor** string | when AMI is created or already exists | Type of hypervisor. **Sample:** xen |
| **image\_id** string | when AMI is created or already exists | ID of the image. **Sample:** ami-1234abcd |
| **is\_public** boolean | when AMI is created or already exists | Whether image is public. |
| **launch\_permission** list / elements=string | when AMI is created or already exists | Permissions allowing other accounts to access the AMI. **Sample:** [{'group': 'all'}] |
| **location** string | when AMI is created or already exists | Location of image. **Sample:** 315210894379/nat-server |
| **name** string | when AMI is created or already exists | AMI name of image. **Sample:** nat-server |
| **ownerId** string | when AMI is created or already exists | Owner of image. **Sample:** 435210894375 |
| **platform** string | when AMI is created or already exists | Platform of image. |
| **root\_device\_name** string | when AMI is created or already exists | Root device name of image. **Sample:** /dev/sda1 |
| **root\_device\_type** string | when AMI is created or already exists | Root device type of image. **Sample:** ebs |
| **snapshots\_deleted** list / elements=string | after AMI is deregistered, if *delete\_snapshot=true* | A list of snapshot ids deleted after deregistering image. **Sample:** ['snap-fbcccb8f', 'snap-cfe7cdb4'] |
| **state** string | when AMI is created or already exists | State of image. **Sample:** available |
| **tags** dictionary | when AMI is created or already exists | A dictionary of tags assigned to image. **Sample:** {'Env': 'devel', 'Name': 'nat-server'} |
| **virtualization\_type** string | when AMI is created or already exists | Image virtualization type. **Sample:** hvm |
### Authors
* Evan Duffield (@scicoin-project) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#583d3c2d3e3e313d343c7e7b6b6f637e7b6d6a637e7b6c606331393b292d312a3d7e7b6c6e633b3735)>
* Constantin Bugneac (@Constantin07) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#ed8e82839e998c83998483cbced9dbd68f988a83888c8ecbcededad6cbced8dfd6cbced9d5d68883898c9b8ccbced9dbd68e8280)>
* Ross Williams (@gunzy83) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#1b7c6e75616223287a6e3d38282c203d382e29203d382f23207c767a72773d382f2d20787476)>
* Willem van Ketwich (@wilvk) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#47302e2b2b312c616474707c616472757c6164737f7c202a262e2b616473717c24282a)>
ansible amazon.aws.aws_az_facts amazon.aws.aws\_az\_facts
=========================
Note
This redirect is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
* This redirect has been **deprecated**. Please update your tasks to use the new name `amazon.aws.aws_az_info` instead. It will be removed in a major release after 2022-06-01 of amazon.aws.
* This is a redirect to the [amazon.aws.aws\_az\_info module](aws_az_info_module#ansible-collections-amazon-aws-aws-az-info-module).
* This redirect also works with Ansible 2.9.
* The collection contains the following information on this deprecation: aws\_az\_facts was renamed in Ansible 2.9 to aws\_az\_info. Please update your tasks.
ansible amazon.aws.ec2_eni_info – Gather information about ec2 ENI interfaces in AWS amazon.aws.ec2\_eni\_info – Gather information about ec2 ENI interfaces in AWS
==============================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_eni_info`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about ec2 ENI interfaces in AWS.
* This module was called `ec2_eni_facts` before Ansible 2.9. The usage did not change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **eni\_id** string added in 1.3.0 of amazon.aws | | The ID of the ENI. This option is mutually exclusive of *filters*. |
| **filters** dictionary | | A dict of filters to apply. Each dict item consists of a filter key and a filter value. See <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html> for possible filters. This option is mutually exclusive of *eni\_id*. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Gather information about all ENIs
- amazon.aws.ec2_eni_info:
# Gather information about a particular ENI
- amazon.aws.ec2_eni_info:
filters:
network-interface-id: eni-xxxxxxx
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **network\_interfaces** complex | always | List of matching elastic network interfaces |
| | **association** dictionary | When an ENI is associated with an EIP | Info of associated elastic IP (EIP) **Sample:** {'allocation\_id': 'eipalloc-5sdf123', 'association\_id': 'eipassoc-8sdf123', 'ip\_owner\_id': '4415120123456', 'public\_dns\_name': 'ec2-52-1-0-63.compute-1.amazonaws.com', 'public\_ip': '52.1.0.63'} |
| | **attachment** dictionary | When an ENI is attached to an ec2 instance | Info about attached ec2 instance **Sample:** {'attach\_time': '2017-08-05T15:25:47+00:00', 'attachment\_id': 'eni-attach-149d21234', 'delete\_on\_termination': False, 'device\_index': 1, 'instance\_id': 'i-15b8d3cadbafa1234', 'instance\_owner\_id': '4415120123456', 'status': 'attached'} |
| | **availability\_zone** string | always | Availability zone of ENI **Sample:** us-east-1b |
| | **description** string | always | Description text for ENI **Sample:** My favourite network interface |
| | **groups** list / elements=string | always | List of attached security groups **Sample:** [{'group\_id': 'sg-26d0f1234', 'group\_name': 'my\_ec2\_security\_group'}] |
| | **id** string | always | The id of the ENI (alias for network\_interface\_id) **Sample:** eni-392fsdf |
| | **interface\_type** string | always | Type of the network interface **Sample:** interface |
| | **ipv6\_addresses** list / elements=string | always | List of IPv6 addresses for this interface |
| | **mac\_address** string | always | MAC address of the network interface **Sample:** 0a:f8:10:2f:ab:a1 |
| | **name** string added in 1.3.0 of amazon.aws | When a Name tag has been set | The Name tag of the ENI, often displayed in the AWS UIs as Name |
| | **network\_interface\_id** string | always | The id of the ENI **Sample:** eni-392fsdf |
| | **owner\_id** string | always | AWS account id of the owner of the ENI **Sample:** 4415120123456 |
| | **private\_dns\_name** string | always | Private DNS name for the ENI **Sample:** ip-172-16-1-180.ec2.internal |
| | **private\_ip\_address** string | always | Private IP address for the ENI **Sample:** 172.16.1.180 |
| | **private\_ip\_addresses** list / elements=string | always | List of private IP addresses attached to the ENI |
| | **requester\_id** string | always | The ID of the entity that launched the ENI **Sample:** AIDAIONYVJQNIAZFT3ABC |
| | **requester\_managed** boolean | always | Indicates whether the network interface is being managed by an AWS service. |
| | **source\_dest\_check** boolean | always | Indicates whether the network interface performs source/destination checking. |
| | **status** string | always | Indicates if the network interface is attached to an instance or not **Sample:** in-use |
| | **subnet\_id** string | always | Subnet ID the ENI is in **Sample:** subnet-7bbf01234 |
| | **tag\_set** dictionary | always | Dictionary of tags added to the ENI |
| | **tags** dictionary added in 1.3.0 of amazon.aws | always | Dictionary of tags added to the ENI |
| | **vpc\_id** string | always | ID of the VPC the network interface it part of **Sample:** vpc-b3f1f123 |
### Authors
* Rob White (@wimnat)
| programming_docs |
ansible amazon.aws.ec2_vol – Create and attach a volume, return volume id and device map amazon.aws.ec2\_vol – Create and attach a volume, return volume id and device map
=================================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_vol`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates an EBS volume and optionally attaches it to an instance.
* If both *instance* and *name* are given and the instance has a device at the device name, then no volume is created and no attachment is made.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3>=1.16.33
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **delete\_on\_termination** boolean | **Choices:*** **no** ←
* yes
| When set to `true`, the volume will be deleted upon instance termination. |
| **device\_name** string | | Device id to override device mapping. Assumes /dev/sdf for Linux/UNIX and /dev/xvdf for Windows. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **encrypted** boolean | **Choices:*** **no** ←
* yes
| Enable encryption at rest for this volume. |
| **id** string | | Volume id if you wish to attach an existing volume (requires instance) or remove an existing volume |
| **instance** string | | Instance ID if you wish to attach the volume. Since 1.9 you can set to None to detach. |
| **iops** integer | | The provisioned IOPs you want to associate with this volume (integer). |
| **kms\_key\_id** string | | Specify the id of the KMS key to use. |
| **modify\_volume** boolean added in 1.4.0 of amazon.aws | **Choices:*** **no** ←
* yes
| The volume won't be modify unless this key is `true`. |
| **name** string | | Volume Name tag if you wish to attach an existing volume (requires instance) |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **purge\_tags** boolean added in 1.5.0 of amazon.aws | **Choices:*** **no** ←
* yes
| Whether to remove existing tags that aren't passed in the *tags* parameter |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **snapshot** string | | Snapshot ID on which to base the volume. |
| **state** string | **Choices:*** absent
* **present** ←
* list
| Whether to ensure the volume is present or absent. The use of *state=list* to interrogate the volume has been deprecated and will be removed after 2022-06-01. The 'list' functionality has been moved to a dedicated module [amazon.aws.ec2\_vol\_info](ec2_vol_info_module). |
| **tags** dictionary | **Default:**{} | tag:value pairs to add to the volume after creation. |
| **throughput** integer added in 1.4.0 of amazon.aws | | Volume throughput in MB/s. This parameter is only valid for gp3 volumes. Valid range is from 125 to 1000. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **volume\_size** integer | | Size of volume (in GiB) to create. |
| **volume\_type** string | **Choices:*** **standard** ←
* gp2
* io1
* st1
* sc1
* gp3
* io2
| Type of EBS volume; standard (magnetic), gp2 (SSD), gp3 (SSD), io1 (Provisioned IOPS), io2 (Provisioned IOPS), st1 (Throughput Optimized HDD), sc1 (Cold HDD). "Standard" is the old EBS default and continues to remain the Ansible default for backwards compatibility. |
| **zone** string | | Zone in which to create the volume, if unset uses the zone the instance is in (if set).
aliases: availability\_zone, aws\_zone, ec2\_zone |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Simple attachment action
- amazon.aws.ec2_vol:
instance: XXXXXX
volume_size: 5
device_name: sdd
region: us-west-2
# Example using custom iops params
- amazon.aws.ec2_vol:
instance: XXXXXX
volume_size: 5
iops: 100
device_name: sdd
region: us-west-2
# Example using snapshot id
- amazon.aws.ec2_vol:
instance: XXXXXX
snapshot: "{{ snapshot }}"
# Playbook example combined with instance launch
- amazon.aws.ec2:
keypair: "{{ keypair }}"
image: "{{ image }}"
wait: yes
count: 3
register: ec2
- amazon.aws.ec2_vol:
instance: "{{ item.id }}"
volume_size: 5
loop: "{{ ec2.instances }}"
register: ec2_vol
# Example: Launch an instance and then add a volume if not already attached
# * Volume will be created with the given name if not already created.
# * Nothing will happen if the volume is already attached.
# * Requires Ansible 2.0
- amazon.aws.ec2:
keypair: "{{ keypair }}"
image: "{{ image }}"
zone: YYYYYY
id: my_instance
wait: yes
count: 1
register: ec2
- amazon.aws.ec2_vol:
instance: "{{ item.id }}"
name: my_existing_volume_Name_tag
device_name: /dev/xvdf
loop: "{{ ec2.instances }}"
register: ec2_vol
# Remove a volume
- amazon.aws.ec2_vol:
id: vol-XXXXXXXX
state: absent
# Detach a volume (since 1.9)
- amazon.aws.ec2_vol:
id: vol-XXXXXXXX
instance: None
region: us-west-2
# List volumes for an instance
- amazon.aws.ec2_vol:
instance: i-XXXXXX
state: list
region: us-west-2
# Create new volume using SSD storage
- amazon.aws.ec2_vol:
instance: XXXXXX
volume_size: 50
volume_type: gp2
device_name: /dev/xvdf
# Attach an existing volume to instance. The volume will be deleted upon instance termination.
- amazon.aws.ec2_vol:
instance: XXXXXX
id: XXXXXX
device_name: /dev/sdf
delete_on_termination: yes
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **device** string | when success | device name of attached volume **Sample:** /def/sdf |
| **volume** string | when success | a dictionary containing detailed attributes of the volume **Sample:** {'attachment\_set': {'attach\_time': '2015-10-23T00:22:29.000Z', 'deleteOnTermination': 'false', 'device': '/dev/sdf', 'instance\_id': 'i-8356263c', 'status': 'attached'}, 'create\_time': '2015-10-21T14:36:08.870Z', 'encrypted': False, 'id': 'vol-35b333d9', 'iops': None, 'size': 1, 'snapshot\_id': '', 'status': 'in-use', 'tags': {'env': 'dev'}, 'type': 'standard', 'zone': 'us-east-1b'} |
| **volume\_id** string | when success | the id of volume **Sample:** vol-35b333d9 |
| **volume\_type** string | when success | the volume type **Sample:** standard |
### Authors
* Lester Wade (@lwade)
ansible amazon.aws.ec2_vol_info – Gather information about ec2 volumes in AWS amazon.aws.ec2\_vol\_info – Gather information about ec2 volumes in AWS
=======================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_vol_info`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about ec2 volumes in AWS.
* This module was called `ec2_vol_facts` before Ansible 2.9. The usage did not change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **filters** dictionary | | A dict of filters to apply. Each dict item consists of a filter key and a filter value. See <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVolumes.html> for possible filters. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Gather information about all volumes
- amazon.aws.ec2_vol_info:
# Gather information about a particular volume using volume ID
- amazon.aws.ec2_vol_info:
filters:
volume-id: vol-00112233
# Gather information about any volume with a tag key Name and value Example
- amazon.aws.ec2_vol_info:
filters:
"tag:Name": Example
# Gather information about any volume that is attached
- amazon.aws.ec2_vol_info:
filters:
attachment.status: attached
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **volumes** list / elements=dictionary | always | Volumes that match the provided filters. Each element consists of a dict with all the information related to that volume. |
| | **attachment\_set** dictionary | success | Information about the volume attachments. **Sample:** {'attach\_time': '2015-10-23T00:22:29.000Z', 'deleteOnTermination': 'false', 'device': '/dev/sdf', 'instance\_id': 'i-8356263c', 'status': 'attached'} |
| | **create\_time** string | success | The time stamp when volume creation was initiated. **Sample:** 2015-10-21T14:36:08.870Z |
| | **encrypted** boolean | success | Indicates whether the volume is encrypted. |
| | **id** string | success | The ID of the volume. **Sample:** vol-35b333d9 |
| | **iops** integer | success | The number of I/O operations per second (IOPS) that the volume supports. |
| | **size** integer | success | The size of the volume, in GiBs. **Sample:** 1 |
| | **snapshot\_id** string | success | The snapshot from which the volume was created, if applicable. |
| | **status** string | success | The volume state. **Sample:** in-use |
| | **tags** dictionary | success | Any tags assigned to the volume. **Sample:** {'env': 'dev'} |
| | **type** string | success | The volume type. This can be gp2, io1, st1, sc1, or standard. **Sample:** standard |
| | **zone** string | success | The Availability Zone of the volume. **Sample:** us-east-1b |
### Authors
* Rob White (@wimnat)
ansible amazon.aws.ec2 – create, terminate, start or stop an instance in ec2 amazon.aws.ec2 – create, terminate, start or stop an instance in ec2
====================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Creates or terminates ec2 instances.
* Note: This module uses the older boto Python module to interact with the EC2 API. [amazon.aws.ec2](#ansible-collections-amazon-aws-ec2-module) will still receive bug fixes, but no new features. Consider using the amazon.aws.ec2\_instance module instead. If amazon.aws.ec2\_instance does not support a feature you need that is available in [amazon.aws.ec2](#ansible-collections-amazon-aws-ec2-module), please file a feature request.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.6
* boto
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **assign\_public\_ip** boolean | **Choices:*** no
* yes
| When provisioning within vpc, assign a public IP address. Boto library must be 2.13.0+. |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **count** integer | **Default:**1 | Number of instances to launch. |
| **count\_tag** raw | | Used with *exact\_count* to determine how many nodes based on a specific tag criteria should be running. This can be expressed in multiple ways and is shown in the EXAMPLES section. For instance, one can request 25 servers that are tagged with `class=webserver`. The specified tag must already exist or be passed in as the *instance\_tags* option. |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ebs\_optimized** boolean | **Choices:*** **no** ←
* yes
| Whether instance is using optimized EBS volumes, see <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html>. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **exact\_count** integer | | An integer value which indicates how many instances that match the 'count\_tag' parameter should be running. Instances are either created or terminated based on this value. |
| **group** list / elements=string | | Security group (or list of groups) to use with the instance.
aliases: groups |
| **group\_id** list / elements=string | | Security group id (or list of ids) to use with the instance. |
| **id** string | | Identifier for this instance or set of instances, so that the module will be idempotent with respect to EC2 instances. This identifier is valid for at least 24 hours after the termination of the instance, and should not be reused for another call later on. For details, see the description of client token at <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html>. |
| **image** string | |
*ami* ID to use for the instance. Required when *state=present*. |
| **instance\_ids** list / elements=string | | list of instance ids, currently used for states: absent, running, stopped
aliases: instance\_id |
| **instance\_initiated\_shutdown\_behavior** string | **Choices:*** **stop** ←
* terminate
| Set whether AWS will Stop or Terminate an instance on shutdown. This parameter is ignored when using instance-store. images (which require termination on shutdown). |
| **instance\_profile\_name** string | | Name of the IAM instance profile (i.e. what the EC2 console refers to as an "IAM Role") to use. Boto library must be 2.5.0+. |
| **instance\_tags** dictionary | | A hash/dictionary of tags to add to the new instance or for instances to start/stop by tag. For example `{"key":"value"}` or `{"key":"value","key2":"value2"}`. |
| **instance\_type** string | | Instance type to use for the instance, see <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html>. Required when creating a new instance.
aliases: type |
| **kernel** string | | Kernel eki to use for the instance. |
| **key\_name** string | | Key pair to use on the instance. The SSH key must already exist in AWS in order to use this argument. Keys can be created / deleted using the [amazon.aws.ec2\_key](ec2_key_module) module.
aliases: keypair |
| **monitoring** boolean | **Choices:*** **no** ←
* yes
| Enable detailed monitoring (CloudWatch) for the instance. |
| **network\_interfaces** list / elements=string | | A list of existing network interfaces to attach to the instance at launch. When specifying existing network interfaces, none of the *assign\_public\_ip*, *private\_ip*, *vpc\_subnet\_id*, *group*, or *group\_id* parameters may be used. (Those parameters are for creating a new network interface at launch.)
aliases: network\_interface |
| **placement\_group** string | | Placement group for the instance when using EC2 Clustered Compute. |
| **private\_ip** string | | The private ip address to assign the instance (from the vpc subnet). |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **ramdisk** string | | Ramdisk eri to use for the instance. |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **source\_dest\_check** boolean | **Choices:*** no
* yes
| Enable or Disable the Source/Destination checks (for NAT instances and Virtual Routers). When initially creating an instance the EC2 API defaults this to `True`. |
| **spot\_launch\_group** string | | Launch group for spot requests, see <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-spot-instances-work.html#spot-launch-group>. |
| **spot\_price** string | | Maximum spot price to bid. If not set, a regular on-demand instance is requested. A spot request is made with this maximum bid. When it is filled, the instance is started. |
| **spot\_type** string | **Choices:*** **one-time** ←
* persistent
| The type of spot request. After being interrupted a `persistent` spot instance will be started once there is capacity to fill the request again. |
| **spot\_wait\_timeout** integer | **Default:**600 | How long to wait for the spot instance request to be fulfilled. Affects 'Request valid until' for setting spot request lifespan. |
| **state** string | **Choices:*** absent
* **present** ←
* restarted
* running
* stopped
| Create, terminate, start, stop or restart instances. The state 'restarted' was added in Ansible 2.2. When *state=absent*, *instance\_ids* is required. When *state=running*, *state=stopped* or *state=restarted* then either *instance\_ids* or *instance\_tags* is required. |
| **tenancy** string | **Choices:*** **default** ←
* dedicated
| An instance with a tenancy of `dedicated` runs on single-tenant hardware and can only be launched into a VPC. Note that to use dedicated tenancy you MUST specify a *vpc\_subnet\_id* as well. Dedicated tenancy is not available for EC2 "micro" instances. |
| **termination\_protection** boolean | **Choices:*** no
* yes
| Enable or Disable the Termination Protection. Defaults to `false`. |
| **user\_data** string | | Opaque blob of data which is made available to the EC2 instance. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **volumes** list / elements=dictionary | | A list of hash/dictionaries of volumes to add to the new instance. |
| | **delete\_on\_termination** boolean | **Choices:*** **no** ←
* yes
| Whether the volume should be automatically deleted when the instance is terminated. |
| | **device\_name** string / required | | A name for the device (For example `/dev/sda`). |
| | **encrypted** boolean | **Choices:*** **no** ←
* yes
| Whether the volume should be encrypted using the 'aws/ebs' KMS CMK. |
| | **ephemeral** string | | Whether the volume should be ephemeral. Data on ephemeral volumes is lost when the instance is stopped. Mutually exclusive with the *snapshot* parameter. |
| | **iops** integer | | The number of IOPS per second to provision for the volume. Required when *volume\_type=io1*. |
| | **snapshot** string | | The ID of an EBS snapshot to copy when creating the volume. Mutually exclusive with the *ephemeral* parameter. |
| | **volume\_size** integer | | The size of the volume (in GiB). |
| | **volume\_type** string | | The type of volume to create. See <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html> for more information on the available volume types. |
| **vpc\_subnet\_id** string | | The subnet ID in which to launch the instance (VPC). |
| **wait** boolean | **Choices:*** **no** ←
* yes
| Wait for the instance to reach its desired state before returning. Does not wait for SSH, see the 'wait\_for\_connection' example for details. |
| **wait\_timeout** integer | **Default:**300 | How long before wait gives up, in seconds. |
| **zone** string | | AWS availability zone in which to launch the instance.
aliases: aws\_zone, ec2\_zone |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Basic provisioning example
- amazon.aws.ec2:
key_name: mykey
instance_type: t2.micro
image: ami-123456
wait: yes
group: webserver
count: 3
vpc_subnet_id: subnet-29e63245
assign_public_ip: yes
# Advanced example with tagging and CloudWatch
- amazon.aws.ec2:
key_name: mykey
group: databases
instance_type: t2.micro
image: ami-123456
wait: yes
wait_timeout: 500
count: 5
instance_tags:
db: postgres
monitoring: yes
vpc_subnet_id: subnet-29e63245
assign_public_ip: yes
# Single instance with additional IOPS volume from snapshot and volume delete on termination
- amazon.aws.ec2:
key_name: mykey
group: webserver
instance_type: c3.medium
image: ami-123456
wait: yes
wait_timeout: 500
volumes:
- device_name: /dev/sdb
snapshot: snap-abcdef12
volume_type: io1
iops: 1000
volume_size: 100
delete_on_termination: true
monitoring: yes
vpc_subnet_id: subnet-29e63245
assign_public_ip: yes
# Single instance with ssd gp2 root volume
- amazon.aws.ec2:
key_name: mykey
group: webserver
instance_type: c3.medium
image: ami-123456
wait: yes
wait_timeout: 500
volumes:
- device_name: /dev/xvda
volume_type: gp2
volume_size: 8
vpc_subnet_id: subnet-29e63245
assign_public_ip: yes
count_tag:
Name: dbserver
exact_count: 1
# Multiple groups example
- amazon.aws.ec2:
key_name: mykey
group: ['databases', 'internal-services', 'sshable', 'and-so-forth']
instance_type: m1.large
image: ami-6e649707
wait: yes
wait_timeout: 500
count: 5
instance_tags:
db: postgres
monitoring: yes
vpc_subnet_id: subnet-29e63245
assign_public_ip: yes
# Multiple instances with additional volume from snapshot
- amazon.aws.ec2:
key_name: mykey
group: webserver
instance_type: m1.large
image: ami-6e649707
wait: yes
wait_timeout: 500
count: 5
volumes:
- device_name: /dev/sdb
snapshot: snap-abcdef12
volume_size: 10
monitoring: yes
vpc_subnet_id: subnet-29e63245
assign_public_ip: yes
# Dedicated tenancy example
- amazon.aws.ec2:
assign_public_ip: yes
group_id: sg-1dc53f72
key_name: mykey
image: ami-6e649707
instance_type: m1.small
tenancy: dedicated
vpc_subnet_id: subnet-29e63245
wait: yes
# Spot instance example
- amazon.aws.ec2:
spot_price: 0.24
spot_wait_timeout: 600
keypair: mykey
group_id: sg-1dc53f72
instance_type: m1.small
image: ami-6e649707
wait: yes
vpc_subnet_id: subnet-29e63245
assign_public_ip: yes
spot_launch_group: report_generators
instance_initiated_shutdown_behavior: terminate
# Examples using pre-existing network interfaces
- amazon.aws.ec2:
key_name: mykey
instance_type: t2.small
image: ami-f005ba11
network_interface: eni-deadbeef
- amazon.aws.ec2:
key_name: mykey
instance_type: t2.small
image: ami-f005ba11
network_interfaces: ['eni-deadbeef', 'eni-5ca1ab1e']
# Launch instances, runs some tasks
# and then terminate them
- name: Create a sandbox instance
hosts: localhost
gather_facts: False
vars:
keypair: my_keypair
instance_type: m1.small
security_group: my_securitygroup
image: my_ami_id
region: us-east-1
tasks:
- name: Launch instance
amazon.aws.ec2:
key_name: "{{ keypair }}"
group: "{{ security_group }}"
instance_type: "{{ instance_type }}"
image: "{{ image }}"
wait: true
region: "{{ region }}"
vpc_subnet_id: subnet-29e63245
assign_public_ip: yes
register: ec2
- name: Add new instance to host group
add_host:
hostname: "{{ item.public_ip }}"
groupname: launched
loop: "{{ ec2.instances }}"
- name: Wait for SSH to come up
delegate_to: "{{ item.public_dns_name }}"
wait_for_connection:
delay: 60
timeout: 320
loop: "{{ ec2.instances }}"
- name: Configure instance(s)
hosts: launched
become: True
gather_facts: True
roles:
- my_awesome_role
- my_awesome_test
- name: Terminate instances
hosts: localhost
tasks:
- name: Terminate instances that were previously launched
amazon.aws.ec2:
state: 'absent'
instance_ids: '{{ ec2.instance_ids }}'
# Start a few existing instances, run some tasks
# and stop the instances
- name: Start sandbox instances
hosts: localhost
gather_facts: false
vars:
instance_ids:
- 'i-xxxxxx'
- 'i-xxxxxx'
- 'i-xxxxxx'
region: us-east-1
tasks:
- name: Start the sandbox instances
amazon.aws.ec2:
instance_ids: '{{ instance_ids }}'
region: '{{ region }}'
state: running
wait: True
vpc_subnet_id: subnet-29e63245
assign_public_ip: yes
roles:
- do_neat_stuff
- do_more_neat_stuff
- name: Stop sandbox instances
hosts: localhost
gather_facts: false
vars:
instance_ids:
- 'i-xxxxxx'
- 'i-xxxxxx'
- 'i-xxxxxx'
region: us-east-1
tasks:
- name: Stop the sandbox instances
amazon.aws.ec2:
instance_ids: '{{ instance_ids }}'
region: '{{ region }}'
state: stopped
wait: True
vpc_subnet_id: subnet-29e63245
assign_public_ip: yes
#
# Start stopped instances specified by tag
#
- amazon.aws.ec2:
instance_tags:
Name: ExtraPower
state: running
#
# Restart instances specified by tag
#
- amazon.aws.ec2:
instance_tags:
Name: ExtraPower
state: restarted
#
# Enforce that 5 instances with a tag "foo" are running
# (Highly recommended!)
#
- amazon.aws.ec2:
key_name: mykey
instance_type: c1.medium
image: ami-40603AD1
wait: yes
group: webserver
instance_tags:
foo: bar
exact_count: 5
count_tag: foo
vpc_subnet_id: subnet-29e63245
assign_public_ip: yes
#
# Enforce that 5 running instances named "database" with a "dbtype" of "postgres"
#
- amazon.aws.ec2:
key_name: mykey
instance_type: c1.medium
image: ami-40603AD1
wait: yes
group: webserver
instance_tags:
Name: database
dbtype: postgres
exact_count: 5
count_tag:
Name: database
dbtype: postgres
vpc_subnet_id: subnet-29e63245
assign_public_ip: yes
#
# count_tag complex argument examples
#
# instances with tag foo
- amazon.aws.ec2:
count_tag:
foo:
# instances with tag foo=bar
- amazon.aws.ec2:
count_tag:
foo: bar
# instances with tags foo=bar & baz
- amazon.aws.ec2:
count_tag:
foo: bar
baz:
# instances with tags foo & bar & baz=bang
- amazon.aws.ec2:
count_tag:
- foo
- bar
- baz: bang
```
### Authors
* Tim Gerla (@tgerla)
* Lester Wade (@lwade)
* Seth Vidal (@skvidal)
| programming_docs |
ansible amazon.aws.ec2_vpc_dhcp_option – Manages DHCP Options, and can ensure the DHCP options for the given VPC match what’s requested amazon.aws.ec2\_vpc\_dhcp\_option – Manages DHCP Options, and can ensure the DHCP options for the given VPC match what’s requested
==================================================================================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_vpc_dhcp_option`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module removes, or creates DHCP option sets, and can associate them to a VPC. Optionally, a new DHCP Options set can be created that converges a VPC’s existing DHCP option set with values provided. When dhcp\_options\_id is provided, the module will 1. remove (with state=’absent’) 2. ensure tags are applied (if state=’present’ and tags are provided 3. attach it to a VPC (if state=’present’ and a vpc\_id is provided. If any of the optional values are missing, they will either be treated as a no-op (i.e., inherit what already exists for the VPC) To remove existing options while inheriting, supply an empty value (e.g. set ntp\_servers to [] if you want to remove them from the VPC’s options) Most of the options should be self-explanatory.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **delete\_old** boolean | **Choices:*** no
* **yes** ←
| Whether to delete the old VPC DHCP option set when associating a new one. This is primarily useful for debugging/development purposes when you want to quickly roll back to the old option set. Note that this setting will be ignored, and the old DHCP option set will be preserved, if it is in use by any other VPC. (Otherwise, AWS will return an error.) |
| **dhcp\_options\_id** string | | The resource\_id of an existing DHCP options set. If this is specified, then it will override other settings, except tags (which will be updated to match) |
| **dns\_servers** list / elements=string | | A list of hosts to set the DNS servers for the VPC to. (Should be a list of IP addresses rather than host names.) |
| **domain\_name** string | | The domain name to set in the DHCP option sets |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **inherit\_existing** boolean | **Choices:*** **no** ←
* yes
| For any DHCP options not specified in these parameters, whether to inherit them from the options set already applied to vpc\_id, or to reset them to be empty. |
| **netbios\_name\_servers** list / elements=string | | List of hosts to advertise as NetBIOS servers. |
| **netbios\_node\_type** integer | | NetBIOS node type to advertise in the DHCP options. The AWS recommendation is to use 2 (when using netbios name services) <https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html>
|
| **ntp\_servers** list / elements=string | | List of hosts to advertise as NTP servers for the VPC. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **state** string | **Choices:*** absent
* **present** ←
| create/assign or remove the DHCP options. If state is set to absent, then a DHCP options set matched either by id, or tags and options will be removed if possible. |
| **tags** dictionary | | Tags to be applied to a VPC options set if a new one is created, or if the resource\_id is provided. (options must match)
aliases: resource\_tags |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **vpc\_id** string | | VPC ID to associate with the requested DHCP option set. If no vpc id is provided, and no matching option set is found then a new DHCP option set is created. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Completely overrides the VPC DHCP options associated with VPC vpc-123456 and deletes any existing
# DHCP option set that may have been attached to that VPC.
- amazon.aws.ec2_vpc_dhcp_option:
domain_name: "foo.example.com"
region: us-east-1
dns_servers:
- 10.0.0.1
- 10.0.1.1
ntp_servers:
- 10.0.0.2
- 10.0.1.2
netbios_name_servers:
- 10.0.0.1
- 10.0.1.1
netbios_node_type: 2
vpc_id: vpc-123456
delete_old: True
inherit_existing: False
# Ensure the DHCP option set for the VPC has 10.0.0.4 and 10.0.1.4 as the specified DNS servers, but
# keep any other existing settings. Also, keep the old DHCP option set around.
- amazon.aws.ec2_vpc_dhcp_option:
region: us-east-1
dns_servers:
- "{{groups['dns-primary']}}"
- "{{groups['dns-secondary']}}"
vpc_id: vpc-123456
inherit_existing: True
delete_old: False
## Create a DHCP option set with 4.4.4.4 and 8.8.8.8 as the specified DNS servers, with tags
## but do not assign to a VPC
- amazon.aws.ec2_vpc_dhcp_option:
region: us-east-1
dns_servers:
- 4.4.4.4
- 8.8.8.8
tags:
Name: google servers
Environment: Test
## Delete a DHCP options set that matches the tags and options specified
- amazon.aws.ec2_vpc_dhcp_option:
region: us-east-1
dns_servers:
- 4.4.4.4
- 8.8.8.8
tags:
Name: google servers
Environment: Test
state: absent
## Associate a DHCP options set with a VPC by ID
- amazon.aws.ec2_vpc_dhcp_option:
region: us-east-1
dhcp_options_id: dopt-12345678
vpc_id: vpc-123456
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Whether the dhcp options were changed |
| **dhcp\_options\_id** string | when available | The aws resource id of the primary DCHP options set created, found or removed |
| **new\_options** dictionary | when appropriate | The DHCP options created, associated or found **Sample:** {'domain-name': 'my.example.com', 'domain-name-servers': ['10.0.0.1', '10.0.1.1'], 'netbios-node-type': 2, 'netbois-name-servers': ['10.0.0.1', '10.0.1.1']} |
### Authors
* Joel Thompson (@joelthompson)
ansible amazon.aws.ec2_group – maintain an ec2 VPC security group. amazon.aws.ec2\_group – maintain an ec2 VPC security group.
===========================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_group`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Maintains ec2 security groups.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **description** string | | Description of the security group. Required when `state` is `present`. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **group\_id** string | | Id of group to delete (works only with absent). One of and only one of *name* or *group\_id* is required. |
| **name** string | | Name of the security group. One of and only one of *name* or *group\_id* is required. Required if *state=present*. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **purge\_rules** boolean | **Choices:*** no
* yes
**Default:**"true" | Purge existing rules on security group that are not found in rules. |
| **purge\_rules\_egress** boolean | **Choices:*** no
* yes
**Default:**"true" | Purge existing rules\_egress on security group that are not found in rules\_egress. |
| **purge\_tags** boolean | **Choices:*** no
* **yes** ←
| If yes, existing tags will be purged from the resource to match exactly what is defined by *tags* parameter. If the *tags* parameter is not set then tags will not be modified. |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **rules** list / elements=dictionary | | List of firewall inbound rules to enforce in this group (see example). If none are supplied, no inbound rules will be enabled. Rules list may include its own name in `group\_name`. This allows idempotent loopback additions (e.g. allow group to access itself). Rule sources list support was added in version 2.4. This allows to define multiple sources per source type as well as multiple source types per rule. Prior to 2.4 an individual source is allowed. In version 2.5 support for rule descriptions was added. |
| | **cidr\_ip** string | | The IPv4 CIDR range traffic is coming from. You can specify only one of *cidr\_ip*, *cidr\_ipv6*, *ip\_prefix*, *group\_id* and *group\_name*. |
| | **cidr\_ipv6** string | | The IPv6 CIDR range traffic is coming from. You can specify only one of *cidr\_ip*, *cidr\_ipv6*, *ip\_prefix*, *group\_id* and *group\_name*. |
| | **from\_port** integer | | The start of the range of ports that traffic is coming from. A value of `-1` indicates all ports. |
| | **group\_desc** string | | If the *group\_name* is set and the Security Group doesn't exist a new Security Group will be created with *group\_desc* as the description. |
| | **group\_id** string | | The ID of the Security Group that traffic is coming from. You can specify only one of *cidr\_ip*, *cidr\_ipv6*, *ip\_prefix*, *group\_id* and *group\_name*. |
| | **group\_name** string | | Name of the Security Group that traffic is coming from. If the Security Group doesn't exist a new Security Group will be created with *group\_desc* as the description. You can specify only one of *cidr\_ip*, *cidr\_ipv6*, *ip\_prefix*, *group\_id* and *group\_name*. |
| | **ip\_prefix** string | | The IP Prefix <https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-prefix-lists.html> that traffic is coming from. You can specify only one of *cidr\_ip*, *cidr\_ipv6*, *ip\_prefix*, *group\_id* and *group\_name*. |
| | **proto** string | | The IP protocol name (`tcp`, `udp`, `icmp`, `icmpv6`) or number (<https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers>) |
| | **rule\_desc** string | | A description for the rule. |
| | **to\_port** integer | | The end of the range of ports that traffic is coming from. A value of `-1` indicates all ports. |
| **rules\_egress** list / elements=dictionary | | List of firewall outbound rules to enforce in this group (see example). If none are supplied, a default all-out rule is assumed. If an empty list is supplied, no outbound rules will be enabled. Rule Egress sources list support was added in version 2.4. In version 2.5 support for rule descriptions was added. |
| | **cidr\_ip** string | | The IPv4 CIDR range traffic is going to. You can specify only one of *cidr\_ip*, *cidr\_ipv6*, *ip\_prefix*, *group\_id* and *group\_name*. |
| | **cidr\_ipv6** string | | The IPv6 CIDR range traffic is going to. You can specify only one of *cidr\_ip*, *cidr\_ipv6*, *ip\_prefix*, *group\_id* and *group\_name*. |
| | **from\_port** integer | | The start of the range of ports that traffic is going to. A value of `-1` indicates all ports. |
| | **group\_desc** string | | If the *group\_name* is set and the Security Group doesn't exist a new Security Group will be created with *group\_desc* as the description. |
| | **group\_id** string | | The ID of the Security Group that traffic is going to. You can specify only one of *cidr\_ip*, *cidr\_ipv6*, *ip\_prefix*, *group\_id* and *group\_name*. |
| | **group\_name** string | | Name of the Security Group that traffic is going to. If the Security Group doesn't exist a new Security Group will be created with *group\_desc* as the description. You can specify only one of *cidr\_ip*, *cidr\_ipv6*, *ip\_prefix*, *group\_id* and *group\_name*. |
| | **ip\_prefix** string | | The IP Prefix <https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-prefix-lists.html> that traffic is going to. You can specify only one of *cidr\_ip*, *cidr\_ipv6*, *ip\_prefix*, *group\_id* and *group\_name*. |
| | **proto** string | | The IP protocol name (`tcp`, `udp`, `icmp`, `icmpv6`) or number (<https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers>) |
| | **rule\_desc** string | | A description for the rule. |
| | **to\_port** integer | | The end of the range of ports that traffic is going to. A value of `-1` indicates all ports. |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **state** string | **Choices:*** **present** ←
* absent
| Create or delete a security group. |
| **tags** dictionary | | A dictionary of one or more tags to assign to the security group.
aliases: resource\_tags |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **vpc\_id** string | | ID of the VPC to create the group in. |
Notes
-----
Note
* If a rule declares a group\_name and that group doesn’t exist, it will be automatically created. In that case, group\_desc should be provided as well. The module will refuse to create a depended-on group without a description.
* Preview diff mode support is added in version 2.7.
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
- name: example using security group rule descriptions
amazon.aws.ec2_group:
name: "{{ name }}"
description: sg with rule descriptions
vpc_id: vpc-xxxxxxxx
profile: "{{ aws_profile }}"
region: us-east-1
rules:
- proto: tcp
ports:
- 80
cidr_ip: 0.0.0.0/0
rule_desc: allow all on port 80
- name: example ec2 group
amazon.aws.ec2_group:
name: example
description: an example EC2 group
vpc_id: 12345
region: eu-west-1
aws_secret_key: SECRET
aws_access_key: ACCESS
rules:
- proto: tcp
from_port: 80
to_port: 80
cidr_ip: 0.0.0.0/0
- proto: tcp
from_port: 22
to_port: 22
cidr_ip: 10.0.0.0/8
- proto: tcp
from_port: 443
to_port: 443
# this should only be needed for EC2 Classic security group rules
# because in a VPC an ELB will use a user-account security group
group_id: amazon-elb/sg-87654321/amazon-elb-sg
- proto: tcp
from_port: 3306
to_port: 3306
group_id: 123412341234/sg-87654321/exact-name-of-sg
- proto: udp
from_port: 10050
to_port: 10050
cidr_ip: 10.0.0.0/8
- proto: udp
from_port: 10051
to_port: 10051
group_id: sg-12345678
- proto: icmp
from_port: 8 # icmp type, -1 = any type
to_port: -1 # icmp subtype, -1 = any subtype
cidr_ip: 10.0.0.0/8
- proto: all
# the containing group name may be specified here
group_name: example
- proto: all
# in the 'proto' attribute, if you specify -1, all, or a protocol number other than tcp, udp, icmp, or 58 (ICMPv6),
# traffic on all ports is allowed, regardless of any ports you specify
from_port: 10050 # this value is ignored
to_port: 10050 # this value is ignored
cidr_ip: 10.0.0.0/8
rules_egress:
- proto: tcp
from_port: 80
to_port: 80
cidr_ip: 0.0.0.0/0
cidr_ipv6: 64:ff9b::/96
group_name: example-other
# description to use if example-other needs to be created
group_desc: other example EC2 group
- name: example2 ec2 group
amazon.aws.ec2_group:
name: example2
description: an example2 EC2 group
vpc_id: 12345
region: eu-west-1
rules:
# 'ports' rule keyword was introduced in version 2.4. It accepts a single port value or a list of values including ranges (from_port-to_port).
- proto: tcp
ports: 22
group_name: example-vpn
- proto: tcp
ports:
- 80
- 443
- 8080-8099
cidr_ip: 0.0.0.0/0
# Rule sources list support was added in version 2.4. This allows to define multiple sources per source type as well as multiple source types per rule.
- proto: tcp
ports:
- 6379
- 26379
group_name:
- example-vpn
- example-redis
- proto: tcp
ports: 5665
group_name: example-vpn
cidr_ip:
- 172.16.1.0/24
- 172.16.17.0/24
cidr_ipv6:
- 2607:F8B0::/32
- 64:ff9b::/96
group_id:
- sg-edcd9784
diff: True
- name: "Delete group by its id"
amazon.aws.ec2_group:
region: eu-west-1
group_id: sg-33b4ee5b
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **description** string | on create/update | Description of security group **Sample:** My Security Group |
| **group\_id** string | on create/update | Security group id **Sample:** sg-abcd1234 |
| **group\_name** string | on create/update | Security group name **Sample:** My Security Group |
| **ip\_permissions** list / elements=string | on create/update | Inbound rules associated with the security group. **Sample:** [{'from\_port': 8182, 'ip\_protocol': 'tcp', 'ip\_ranges': [{'cidr\_ip': '198.51.100.1/32'}], 'ipv6\_ranges': [], 'prefix\_list\_ids': [], 'to\_port': 8182, 'user\_id\_group\_pairs': []}] |
| **ip\_permissions\_egress** list / elements=string | on create/update | Outbound rules associated with the security group. **Sample:** [{'ip\_protocol': -1, 'ip\_ranges': [{'cidr\_ip': '0.0.0.0/0', 'ipv6\_ranges': [], 'prefix\_list\_ids': [], 'user\_id\_group\_pairs': []}]}] |
| **owner\_id** integer | on create/update | AWS Account ID of the security group **Sample:** 123456789012 |
| **tags** dictionary | on create/update | Tags associated with the security group **Sample:** {'Name': 'My Security Group', 'Purpose': 'protecting stuff'} |
| **vpc\_id** string | on create/update | ID of VPC to which the security group belongs **Sample:** vpc-abcd1234 |
### Authors
* Andrew de Quincey (@adq)
| programming_docs |
ansible amazon.aws.ec2_eni – Create and optionally attach an Elastic Network Interface (ENI) to an instance amazon.aws.ec2\_eni – Create and optionally attach an Elastic Network Interface (ENI) to an instance
====================================================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_eni`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create and optionally attach an Elastic Network Interface (ENI) to an instance. If an ENI ID or private\_ip is provided, the existing ENI (if any) will be modified. The ‘attached’ parameter controls the attachment status of the network interface.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.6
* boto
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **allow\_reassignment** boolean | **Choices:*** **no** ←
* yes
| Indicates whether to allow an IP address that is already assigned to another network interface or instance to be reassigned to the specified network interface. |
| **attached** boolean | **Choices:*** no
* yes
| Specifies if network interface should be attached or detached from instance. If omitted, attachment status won't change |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **delete\_on\_termination** boolean | **Choices:*** no
* yes
| Delete the interface when the instance it is attached to is terminated. You can only specify this flag when the interface is being modified, not on creation. |
| **description** string | | Optional description of the ENI. |
| **device\_index** integer | **Default:**0 | The index of the device for the network interface attachment on the instance. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **eni\_id** string | | The ID of the ENI (to modify). If *eni\_id=None* and *state=present*, a new eni will be created. |
| **force\_detach** boolean | **Choices:*** **no** ←
* yes
| Force detachment of the interface. This applies either when explicitly detaching the interface by setting *instance\_id=None* or when deleting an interface with *state=absent*. |
| **instance\_id** string | | Instance ID that you wish to attach ENI to. Since version 2.2, use the *attached* parameter to attach or detach an ENI. Prior to 2.2, to detach an ENI from an instance, use `None`. |
| **name** string | | Name for the ENI. This will create a tag called "Name" with the value assigned here. This can be used in conjunction with *subnet\_id* as another means of identifiying a network interface. AWS does not enforce unique Name tags, so duplicate names are possible if you configure it that way. If that is the case, you will need to provide other identifying information such as *private\_ip\_address* or *eni\_id*. |
| **private\_ip\_address** string | | Private IP address. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **purge\_secondary\_private\_ip\_addresses** boolean | **Choices:*** **no** ←
* yes
| To be used with *secondary\_private\_ip\_addresses* to determine whether or not to remove any secondary IP addresses other than those specified. Set *secondary\_private\_ip\_addresses=[]* to purge all secondary addresses. |
| **purge\_tags** boolean added in 1.3.0 of amazon.aws | **Choices:*** no
* **yes** ←
| Indicates whether to remove tags not specified in *tags* or *name*. This means you have to specify all the desired tags on each task affecting a network interface. If *tags* is omitted or None this option is disregarded. |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **secondary\_private\_ip\_address\_count** integer | | The number of secondary IP addresses to assign to the network interface. This option is mutually exclusive of *secondary\_private\_ip\_addresses*
|
| **secondary\_private\_ip\_addresses** list / elements=string | | A list of IP addresses to assign as secondary IP addresses to the network interface. This option is mutually exclusive of *secondary\_private\_ip\_address\_count*
|
| **security\_groups** list / elements=string | | List of security groups associated with the interface. Only used when *state=present*. Since version 2.2, you can specify security groups by ID or by name or a combination of both. Prior to 2.2, you can specify only by ID. |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **source\_dest\_check** boolean | **Choices:*** no
* yes
| By default, interfaces perform source/destination checks. NAT instances however need this check to be disabled. You can only specify this flag when the interface is being modified, not on creation. |
| **state** string | **Choices:*** **present** ←
* absent
| Create or delete ENI. |
| **subnet\_id** string | | ID of subnet in which to create the ENI. |
| **tags** dictionary added in 1.3.0 of amazon.aws | | A hash/dictionary of tags to add to the new ENI or to add/remove from an existing one. Please note that the name field sets the "Name" tag. To clear all tags, set this option to an empty dictionary to use in conjunction with *purge\_tags*. If you provide *name*, that tag will not be removed. To prevent removing any tags set *purge\_tags* to false. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* This module identifies and ENI based on either the *eni\_id*, a combination of *private\_ip\_address* and *subnet\_id*, or a combination of *instance\_id* and *device\_id*. Any of these options will let you specify a particular ENI.
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Create an ENI. As no security group is defined, ENI will be created in default security group
- amazon.aws.ec2_eni:
private_ip_address: 172.31.0.20
subnet_id: subnet-xxxxxxxx
state: present
# Create an ENI and attach it to an instance
- amazon.aws.ec2_eni:
instance_id: i-xxxxxxx
device_index: 1
private_ip_address: 172.31.0.20
subnet_id: subnet-xxxxxxxx
state: present
# Create an ENI with two secondary addresses
- amazon.aws.ec2_eni:
subnet_id: subnet-xxxxxxxx
state: present
secondary_private_ip_address_count: 2
# Assign a secondary IP address to an existing ENI
# This will purge any existing IPs
- amazon.aws.ec2_eni:
subnet_id: subnet-xxxxxxxx
eni_id: eni-yyyyyyyy
state: present
secondary_private_ip_addresses:
- 172.16.1.1
# Remove any secondary IP addresses from an existing ENI
- amazon.aws.ec2_eni:
subnet_id: subnet-xxxxxxxx
eni_id: eni-yyyyyyyy
state: present
secondary_private_ip_address_count: 0
# Destroy an ENI, detaching it from any instance if necessary
- amazon.aws.ec2_eni:
eni_id: eni-xxxxxxx
force_detach: true
state: absent
# Update an ENI
- amazon.aws.ec2_eni:
eni_id: eni-xxxxxxx
description: "My new description"
state: present
# Update an ENI using name and subnet_id
- amazon.aws.ec2_eni:
name: eni-20
subnet_id: subnet-xxxxxxx
description: "My new description"
state: present
# Update an ENI identifying it by private_ip_address and subnet_id
- amazon.aws.ec2_eni:
subnet_id: subnet-xxxxxxx
private_ip_address: 172.16.1.1
description: "My new description"
# Detach an ENI from an instance
- amazon.aws.ec2_eni:
eni_id: eni-xxxxxxx
instance_id: None
state: present
### Delete an interface on termination
# First create the interface
- amazon.aws.ec2_eni:
instance_id: i-xxxxxxx
device_index: 1
private_ip_address: 172.31.0.20
subnet_id: subnet-xxxxxxxx
state: present
register: eni
# Modify the interface to enable the delete_on_terminaton flag
- amazon.aws.ec2_eni:
eni_id: "{{ eni.interface.id }}"
delete_on_termination: true
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **interface** complex | when state != absent | Network interface attributes |
| | **description** string | success | interface description **Sample:** Firewall network interface |
| | **groups** list / elements=dictionary | success | list of security groups **Sample:** [{'sg-f8a8a9da': 'default'}] |
| | **id** string | success | network interface id **Sample:** eni-1d889198 |
| | **mac\_address** string | success | interface's physical address **Sample:** 00:00:5E:00:53:23 |
| | **name** string | success | The name of the ENI **Sample:** my-eni-20 |
| | **owner\_id** string | success | aws account id **Sample:** 812381371 |
| | **private\_ip\_address** string | success | primary ip address of this interface **Sample:** 10.20.30.40 |
| | **private\_ip\_addresses** list / elements=dictionary | success | list of all private ip addresses associated to this interface **Sample:** [{'primary\_address': True, 'private\_ip\_address': '10.20.30.40'}] |
| | **source\_dest\_check** boolean | success | value of source/dest check flag **Sample:** True |
| | **status** string | success | network interface status **Sample:** pending |
| | **subnet\_id** string | success | which vpc subnet the interface is bound **Sample:** subnet-b0a0393c |
| | **tags** dictionary | success | The dictionary of tags associated with the ENI **Sample:** {'Name': 'my-eni', 'group': 'Finance'} |
| | **vpc\_id** string | success | which vpc this network interface is bound **Sample:** vpc-9a9a9da |
### Authors
* Rob White (@wimnat)
* Mike Healey (@healem)
ansible amazon.aws.aws_resource_actions – summarizes all “resource:actions” completed amazon.aws.aws\_resource\_actions – summarizes all “resource:actions” completed
===============================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.aws_resource_actions`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Examples](#examples)
Synopsis
--------
* Ansible callback plugin for collecting the AWS actions completed by all boto3 modules using AnsibleAWSModule in a playbook. Botocore endpoint logs need to be enabled for those modules, which can be done easily by setting debug\_botocore\_endpoint\_logs to True for group/aws using module\_defaults.
Requirements
------------
The below requirements are needed on the local controller node that executes this callback.
* whitelisting in configuration - see examples section below for details.
Examples
--------
```
example: >
To enable, add this to your ansible.cfg file in the defaults block
[defaults]
callback_whitelist = aws_resource_actions
sample output: >
#
# AWS ACTIONS: ['s3:PutBucketAcl', 's3:HeadObject', 's3:DeleteObject', 's3:PutObjectAcl', 's3:CreateMultipartUpload',
# 's3:DeleteBucket', 's3:GetObject', 's3:DeleteObjects', 's3:CreateBucket', 's3:CompleteMultipartUpload',
# 's3:ListObjectsV2', 's3:HeadBucket', 's3:UploadPart', 's3:PutObject']
#
sample output: >
#
# AWS ACTIONS: ['ec2:DescribeVpcAttribute', 'ec2:DescribeVpcClassicLink', 'ec2:ModifyVpcAttribute', 'ec2:CreateTags',
# 'sts:GetCallerIdentity', 'ec2:DescribeSecurityGroups', 'ec2:DescribeTags', 'ec2:DescribeVpcs', 'ec2:CreateVpc']
#
```
ansible amazon.aws.s3_bucket – Manage S3 buckets in AWS, DigitalOcean, Ceph, Walrus, FakeS3 and StorageGRID amazon.aws.s3\_bucket – Manage S3 buckets in AWS, DigitalOcean, Ceph, Walrus, FakeS3 and StorageGRID
====================================================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.s3_bucket`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Manage S3 buckets in AWS, DigitalOcean, Ceph, Walrus, FakeS3 and StorageGRID.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **ceph** boolean | **Choices:*** **no** ←
* yes
| Enable API compatibility with Ceph. It takes into account the S3 API subset working with Ceph in order to provide the same module behaviour where possible. |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **delete\_public\_access** boolean added in 1.3.0 of amazon.aws | **Choices:*** **no** ←
* yes
| Delete public access block configuration from bucket. This option cannot be used together with a *public\_access* definition. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **encryption** string | **Choices:*** none
* AES256
* aws:kms
| Describes the default server-side encryption to apply to new objects in the bucket. In order to remove the server-side encryption, the encryption needs to be set to 'none' explicitly. |
| **encryption\_key\_id** string | | KMS master key ID to use for the default encryption. This parameter is allowed if *encryption* is `aws:kms`. If not specified then it will default to the AWS provided KMS key. |
| **force** boolean | **Choices:*** **no** ←
* yes
| When trying to delete a bucket, delete all keys (including versions and delete markers) in the bucket first (an S3 bucket must be empty for a successful deletion). |
| **name** string / required | | Name of the S3 bucket. |
| **policy** json | | The JSON policy as a string. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **public\_access** dictionary added in 1.3.0 of amazon.aws | | Configure public access block for S3 bucket. This option cannot be used together with *delete\_public\_access*. |
| | **block\_public\_acls** boolean | **Choices:*** **no** ←
* yes
| Sets BlockPublicAcls value. |
| | **block\_public\_policy** boolean | **Choices:*** **no** ←
* yes
| Sets BlockPublicPolicy value. |
| | **ignore\_public\_acls** boolean | **Choices:*** **no** ←
* yes
| Sets IgnorePublicAcls value. |
| | **restrict\_public\_buckets** boolean | **Choices:*** **no** ←
* yes
| Sets RestrictPublicAcls value. |
| **purge\_tags** boolean | **Choices:*** no
* **yes** ←
| Whether to remove tags that aren't present in the *tags* parameter. |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **requester\_pays** boolean | **Choices:*** no
* yes
| With Requester Pays buckets, the requester instead of the bucket owner pays the cost of the request and the data download from the bucket. |
| **s3\_url** string | | S3 URL endpoint for usage with DigitalOcean, Ceph, Eucalyptus and FakeS3 etc. Assumes AWS if not specified. For Walrus, use FQDN of the endpoint without scheme nor path.
aliases: S3\_URL |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **state** string | **Choices:*** **present** ←
* absent
| Create or remove the S3 bucket. |
| **tags** dictionary | | Tags dict to apply to bucket. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **versioning** boolean | **Choices:*** no
* yes
| Whether versioning is enabled or disabled (note that once versioning is enabled, it can only be suspended). |
Notes
-----
Note
* If `requestPayment`, `policy`, `tagging` or `versioning` operations/API aren’t implemented by the endpoint, module doesn’t fail if each parameter satisfies the following condition. *requester\_pays* is `False`, *policy*, *tags*, and *versioning* are `None`.
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Create a simple S3 bucket
- amazon.aws.s3_bucket:
name: mys3bucket
state: present
# Create a simple S3 bucket on Ceph Rados Gateway
- amazon.aws.s3_bucket:
name: mys3bucket
s3_url: http://your-ceph-rados-gateway-server.xxx
ceph: true
# Remove an S3 bucket and any keys it contains
- amazon.aws.s3_bucket:
name: mys3bucket
state: absent
force: yes
# Create a bucket, add a policy from a file, enable requester pays, enable versioning and tag
- amazon.aws.s3_bucket:
name: mys3bucket
policy: "{{ lookup('file','policy.json') }}"
requester_pays: yes
versioning: yes
tags:
example: tag1
another: tag2
# Create a simple DigitalOcean Spaces bucket using their provided regional endpoint
- amazon.aws.s3_bucket:
name: mydobucket
s3_url: 'https://nyc3.digitaloceanspaces.com'
# Create a bucket with AES256 encryption
- amazon.aws.s3_bucket:
name: mys3bucket
state: present
encryption: "AES256"
# Create a bucket with aws:kms encryption, KMS key
- amazon.aws.s3_bucket:
name: mys3bucket
state: present
encryption: "aws:kms"
encryption_key_id: "arn:aws:kms:us-east-1:1234/5678example"
# Create a bucket with aws:kms encryption, default key
- amazon.aws.s3_bucket:
name: mys3bucket
state: present
encryption: "aws:kms"
# Create a bucket with public policy block configuration
- amazon.aws.s3_bucket:
name: mys3bucket
state: present
public_access:
block_public_acls: true
ignore_public_acls: true
## keys == 'false' can be ommited, undefined keys defaults to 'false'
# block_public_policy: false
# restrict_public_buckets: false
# Delete public policy block from bucket
- amazon.aws.s3_bucket:
name: mys3bucket
state: present
delete_public_access: true
```
### Authors
* Rob White (@wimnat)
| programming_docs |
ansible amazon.aws.cloudformation – Create or delete an AWS CloudFormation stack amazon.aws.cloudformation – Create or delete an AWS CloudFormation stack
========================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.cloudformation`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Launches or updates an AWS CloudFormation stack and waits for it complete.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore>=1.5.45
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **backoff\_delay** integer | **Default:**3 | Number of seconds to wait for the next retry. |
| **backoff\_max\_delay** integer | **Default:**30 | Maximum amount of time to wait between retries. |
| **backoff\_retries** integer | **Default:**10 | Number of times to retry operation. AWS API throttling mechanism fails CloudFormation module so we have to retry a couple of times. |
| **capabilities** list / elements=string | **Default:**["CAPABILITY\_IAM", "CAPABILITY\_NAMED\_IAM"] | Specify capabilities that stack template contains. Valid values are `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM` and `CAPABILITY_AUTO_EXPAND`. |
| **changeset\_name** string | | Name given to the changeset when creating a changeset. Only used when *create\_changeset=true*. By default a name prefixed with Ansible-STACKNAME is generated based on input parameters. See the AWS Change Sets docs for more information <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html>
|
| **create\_changeset** boolean | **Choices:*** **no** ←
* yes
| If stack already exists create a changeset instead of directly applying changes. See the AWS Change Sets docs <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html>. WARNING: if the stack does not exist, it will be created without changeset. If *state=absent*, the stack will be deleted immediately with no changeset. |
| **create\_timeout** integer | | The amount of time (in minutes) that can pass before the stack status becomes CREATE\_FAILED |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **disable\_rollback** boolean | **Choices:*** **no** ←
* yes
| If a stacks fails to form, rollback will remove the stack. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **events\_limit** integer | **Default:**200 | Maximum number of CloudFormation events to fetch from a stack when creating or updating it. |
| **notification\_arns** string | | A comma separated list of Simple Notification Service (SNS) topic ARNs to publish stack related events. |
| **on\_create\_failure** string | **Choices:*** DO\_NOTHING
* ROLLBACK
* DELETE
| Action to take upon failure of stack creation. Incompatible with the *disable\_rollback* option. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **role\_arn** string | | The role that AWS CloudFormation assumes to create the stack. See the AWS CloudFormation Service Role docs <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-servicerole.html>
|
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **stack\_name** string / required | | Name of the CloudFormation stack. |
| **stack\_policy** string | | The path of the file containing the CloudFormation stack policy. A policy cannot be removed once placed, but it can be modified. for instance, allow all updates <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html#d0e9051>
|
| **stack\_policy\_body** json added in 1.5.0 of amazon.aws | | The CloudFormation stack policy in JSON. A policy cannot be removed once placed, but it can be modified. for instance, allow all updates <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html#d0e9051>
|
| **stack\_policy\_on\_update\_body** json added in 1.5.0 of amazon.aws | | the body of the cloudformation stack policy only applied during this update. |
| **state** string | **Choices:*** **present** ←
* absent
| If *state=present*, stack will be created. If *state=present* and if stack exists and template has changed, it will be updated. If *state=absent*, stack will be removed. |
| **tags** dictionary | | Dictionary of tags to associate with stack and its resources during stack creation. Can be updated later, updating tags removes previous entries. |
| **template** path | | The local path of the CloudFormation template. This must be the full path to the file, relative to the working directory. If using roles this may look like `roles/cloudformation/files/cloudformation-example.json`. If *state=present* and the stack does not exist yet, either *template*, *template\_body* or *template\_url* must be specified (but only one of them). If *state=present*, the stack does exist, and neither *template*, *template\_body* nor *template\_url* are specified, the previous template will be reused. |
| **template\_body** string | | Template body. Use this to pass in the actual body of the CloudFormation template. If *state=present* and the stack does not exist yet, either *template*, *template\_body* or *template\_url* must be specified (but only one of them). If *state=present*, the stack does exist, and neither *template*, *template\_body* nor *template\_url* are specified, the previous template will be reused. |
| **template\_format** string | | This parameter is ignored since Ansible 2.3 and will be removed after 2022-06-01. Templates are now passed raw to CloudFormation regardless of format. |
| **template\_parameters** dictionary | **Default:**{} | A list of hashes of all the template variables for the stack. The value can be a string or a dict. Dict can be used to set additional template parameter attributes like UsePreviousValue (see example). |
| **template\_url** string | | Location of file containing the template body. The URL must point to a template (max size 307,200 bytes) located in an S3 bucket in the same region as the stack. If *state=present* and the stack does not exist yet, either *template*, *template\_body* or *template\_url* must be specified (but only one of them). If *state=present*, the stack does exist, and neither *template*, *template\_body* nor *template\_url* are specified, the previous template will be reused. |
| **termination\_protection** boolean | **Choices:*** no
* yes
| Enable or disable termination protection on the stack. Only works with botocore >= 1.7.18. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* CloudFormation features change often, and this module tries to keep up. That means your botocore version should be fresh. The version listed in the requirements is the oldest version that works with the module as a whole. Some features may require recent versions, and we do not pinpoint a minimum version for each feature. Instead of relying on the minimum version, keep botocore up to date. AWS is always releasing features and fixing bugs.
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
- name: create a cloudformation stack
amazon.aws.cloudformation:
stack_name: "ansible-cloudformation"
state: "present"
region: "us-east-1"
disable_rollback: true
template: "files/cloudformation-example.json"
template_parameters:
KeyName: "jmartin"
DiskType: "ephemeral"
InstanceType: "m1.small"
ClusterSize: 3
tags:
Stack: "ansible-cloudformation"
# Basic role example
- name: create a stack, specify role that cloudformation assumes
amazon.aws.cloudformation:
stack_name: "ansible-cloudformation"
state: "present"
region: "us-east-1"
disable_rollback: true
template: "roles/cloudformation/files/cloudformation-example.json"
role_arn: 'arn:aws:iam::123456789012:role/cloudformation-iam-role'
- name: delete a stack
amazon.aws.cloudformation:
stack_name: "ansible-cloudformation-old"
state: "absent"
# Create a stack, pass in template from a URL, disable rollback if stack creation fails,
# pass in some parameters to the template, provide tags for resources created
- name: create a stack, pass in the template via an URL
amazon.aws.cloudformation:
stack_name: "ansible-cloudformation"
state: present
region: us-east-1
disable_rollback: true
template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template
template_parameters:
KeyName: jmartin
DiskType: ephemeral
InstanceType: m1.small
ClusterSize: 3
tags:
Stack: ansible-cloudformation
# Create a stack, passing in template body using lookup of Jinja2 template, disable rollback if stack creation fails,
# pass in some parameters to the template, provide tags for resources created
- name: create a stack, pass in the template body via lookup template
amazon.aws.cloudformation:
stack_name: "ansible-cloudformation"
state: present
region: us-east-1
disable_rollback: true
template_body: "{{ lookup('template', 'cloudformation.j2') }}"
template_parameters:
KeyName: jmartin
DiskType: ephemeral
InstanceType: m1.small
ClusterSize: 3
tags:
Stack: ansible-cloudformation
# Pass a template parameter which uses CloudFormation's UsePreviousValue attribute
# When use_previous_value is set to True, the given value will be ignored and
# CloudFormation will use the value from a previously submitted template.
# If use_previous_value is set to False (default) the given value is used.
- amazon.aws.cloudformation:
stack_name: "ansible-cloudformation"
state: "present"
region: "us-east-1"
template: "files/cloudformation-example.json"
template_parameters:
DBSnapshotIdentifier:
use_previous_value: True
value: arn:aws:rds:es-east-1:000000000000:snapshot:rds:my-db-snapshot
DBName:
use_previous_value: True
tags:
Stack: "ansible-cloudformation"
# Enable termination protection on a stack.
# If the stack already exists, this will update its termination protection
- name: enable termination protection during stack creation
amazon.aws.cloudformation:
stack_name: my_stack
state: present
template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template
termination_protection: yes
# Configure TimeoutInMinutes before the stack status becomes CREATE_FAILED
# In this case, if disable_rollback is not set or is set to false, the stack will be rolled back.
- name: enable termination protection during stack creation
amazon.aws.cloudformation:
stack_name: my_stack
state: present
template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template
create_timeout: 5
# Configure rollback behaviour on the unsuccessful creation of a stack allowing
# CloudFormation to clean up, or do nothing in the event of an unsuccessful
# deployment
# In this case, if on_create_failure is set to "DELETE", it will clean up the stack if
# it fails to create
- name: create stack which will delete on creation failure
amazon.aws.cloudformation:
stack_name: my_stack
state: present
template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template
on_create_failure: DELETE
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **change\_set\_id** string | *state=present* and *create\_changeset=true* | The ID of the stack change set if one was created **Sample:** arn:aws:cloudformation:us-east-1:012345678901:changeSet/Ansible-StackName-f4496805bd1b2be824d1e315c6884247ede41eb0 |
| **events** list / elements=string | always | Most recent events in CloudFormation's event log. This may be from a previous run in some cases. **Sample:** ['StackEvent AWS::CloudFormation::Stack stackname UPDATE\_COMPLETE', 'StackEvent AWS::CloudFormation::Stack stackname UPDATE\_COMPLETE\_CLEANUP\_IN\_PROGRESS'] |
| **log** list / elements=string | always | Debugging logs. Useful when modifying or finding an error. **Sample:** ['updating stack'] |
| **stack\_outputs** dictionary | state == present | A key:value dictionary of all the stack outputs currently defined. If there are no stack outputs, it is an empty dictionary. **Sample:** {'MySg': 'AnsibleModuleTestYAML-CFTestSg-C8UVS567B6NS'} |
| **stack\_resources** list / elements=string | state == present | AWS stack resources and their status. List of dictionaries, one dict per resource. **Sample:** [{'last\_updated\_time': '2016-10-11T19:40:14.979000+00:00', 'logical\_resource\_id': 'CFTestSg', 'physical\_resource\_id': 'cloudformation2-CFTestSg-16UQ4CYQ57O9F', 'resource\_type': 'AWS::EC2::SecurityGroup', 'status': 'UPDATE\_COMPLETE', 'status\_reason': None}] |
### Authors
* James S. Martin (@jsmartin)
ansible amazon.aws.aws_service_ip_ranges – Look up the IP ranges for services provided in AWS such as EC2 and S3. amazon.aws.aws\_service\_ip\_ranges – Look up the IP ranges for services provided in AWS such as EC2 and S3.
============================================================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.aws_service_ip_ranges`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* AWS publishes IP ranges used on the public internet by EC2, S3, CloudFront, CodeBuild, Route53, and Route53 Health Checking.
* This module produces a list of all the ranges (by default) or can narrow down the list to the specified region or service.
Requirements
------------
The below requirements are needed on the local controller node that executes this lookup.
* must have public internet connectivity
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **region** string | | | The AWS region to narrow the ranges to. Examples: us-east-1, eu-west-2, ap-southeast-1 |
| **service** string | | | The service to filter ranges by. Options: EC2, S3, CLOUDFRONT, CODEbUILD, ROUTE53, ROUTE53\_HEALTHCHECKS |
Examples
--------
```
vars:
ec2_ranges: "{{ lookup('aws_service_ip_ranges', region='ap-southeast-2', service='EC2', wantlist=True) }}"
tasks:
- name: "use list return option and iterate as a loop"
debug: msg="{% for cidr in ec2_ranges %}{{ cidr }} {% endfor %}"
# "52.62.0.0/15 52.64.0.0/17 52.64.128.0/17 52.65.0.0/16 52.95.241.0/24 52.95.255.16/28 54.66.0.0/16 "
- name: "Pull S3 IP ranges, and print the default return style"
debug: msg="{{ lookup('aws_service_ip_ranges', region='us-east-1', service='S3') }}"
# "52.92.16.0/20,52.216.0.0/15,54.231.0.0/17"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this lookup:
| Key | Returned | Description |
| --- | --- | --- |
| **\_raw** string | success | comma-separated list of CIDR ranges |
### Authors
* James Turner <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#84f0f1f6eae1f6eef7e9a2a7b7b3bfa2a7b1b6bfa2a7b0bcbfe3e9e5ede8a2a7b0b2bfe7ebe9)>
| programming_docs |
ansible amazon.aws.ec2_ami_info – Gather information about ec2 AMIs amazon.aws.ec2\_ami\_info – Gather information about ec2 AMIs
=============================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_ami_info`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about ec2 AMIs
* This module was called `amazon.aws.ec2_ami_facts` before Ansible 2.9. The usage did not change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **describe\_image\_attributes** boolean | **Choices:*** **no** ←
* yes
| Describe attributes (like launchPermission) of the images found. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **executable\_users** list / elements=string | | Filter images by users with explicit launch permissions. Valid options are an AWS account ID, self, or all (public AMIs).
aliases: executable\_user |
| **filters** dictionary | | A dict of filters to apply. Each dict item consists of a filter key and a filter value. See <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html> for possible filters. Filter names and values are case sensitive. |
| **image\_ids** list / elements=string | | One or more image IDs.
aliases: image\_id |
| **owners** list / elements=string | | Filter the images by the owner. Valid options are an AWS account ID, self, or an AWS owner alias ( amazon | aws-marketplace | microsoft ).
aliases: owner |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
- name: gather information about an AMI using ami-id
amazon.aws.ec2_ami_info:
image_ids: ami-5b488823
- name: gather information about all AMIs with tag key Name and value webapp
amazon.aws.ec2_ami_info:
filters:
"tag:Name": webapp
- name: gather information about an AMI with 'AMI Name' equal to foobar
amazon.aws.ec2_ami_info:
filters:
name: foobar
- name: gather information about Ubuntu 17.04 AMIs published by Canonical (099720109477)
amazon.aws.ec2_ami_info:
owners: 099720109477
filters:
name: "ubuntu/images/ubuntu-zesty-17.04-*"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **images** list / elements=dictionary | always | A list of images. |
| | **architecture** string | always | The architecture of the image. **Sample:** x86\_64 |
| | **block\_device\_mappings** list / elements=dictionary | always | Any block device mapping entries. |
| | | **device\_name** string | always | The device name exposed to the instance. **Sample:** /dev/sda1 |
| | | **ebs** complex | always | EBS volumes |
| | **creation\_date** string | always | The date and time the image was created. **Sample:** 2017-10-16T19:22:13.000Z |
| | **description** string | always | The description of the AMI. |
| | **ena\_support** boolean | always | Whether enhanced networking with ENA is enabled. **Sample:** True |
| | **hypervisor** string | always | The hypervisor type of the image. **Sample:** xen |
| | **image\_id** string | always | The ID of the AMI. **Sample:** ami-5b466623 |
| | **image\_location** string | always | The location of the AMI. **Sample:** 408466080000/Webapp |
| | **image\_type** string | always | The type of image. **Sample:** machine |
| | **launch\_permissions** list / elements=dictionary | When image is owned by calling account and *describe\_image\_attributes* is yes. | A List of AWS accounts may launch the AMI. **Sample:** [{'group': 'all'}, {'user\_id': '408466080000'}] |
| | | **group** string | success | A value of 'all' means the AMI is public. |
| | | **user\_id** string | success | An AWS account ID with permissions to launch the AMI. |
| | **name** string | always | The name of the AMI that was provided during image creation. **Sample:** Webapp |
| | **owner\_id** string | always | The AWS account ID of the image owner. **Sample:** 408466080000 |
| | **public** boolean | always | Whether the image has public launch permissions. **Sample:** True |
| | **root\_device\_name** string | always | The device name of the root device. **Sample:** /dev/sda1 |
| | **root\_device\_type** string | always | The type of root device used by the AMI. **Sample:** ebs |
| | **sriov\_net\_support** string | always | Whether enhanced networking is enabled. **Sample:** simple |
| | **state** string | always | The current state of the AMI. **Sample:** available |
| | **tags** dictionary | always | Any tags assigned to the image. |
| | **virtualization\_type** string | always | The type of virtualization of the AMI. **Sample:** hvm |
### Authors
* Prasad Katti (@prasadkatti)
ansible amazon.aws.ec2_tag – create and remove tags on ec2 resources amazon.aws.ec2\_tag – create and remove tags on ec2 resources
=============================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_tag`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates, modifies and removes tags for any EC2 resource.
* Resources are referenced by their resource id (for example, an instance being i-XXXXXXX, a VPC being vpc-XXXXXXX).
* This module is designed to be used with complex args (tags), see the examples.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **purge\_tags** boolean | **Choices:*** **no** ←
* yes
| Whether unspecified tags should be removed from the resource. Note that when combined with *state=absent*, specified tags with non-matching values are not purged. |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **resource** string / required | | The EC2 resource id. |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **state** string | **Choices:*** **present** ←
* absent
* list
| Whether the tags should be present or absent on the resource. The use of *state=list* to interrogate the tags of an instance has been deprecated and will be removed after 2022-06-01. The 'list' functionality has been moved to a dedicated module [amazon.aws.ec2\_tag\_info](ec2_tag_info_module). |
| **tags** dictionary | | A dictionary of tags to add or remove from the resource. If the value provided for a key is not set and *state=absent*, the tag will be removed regardless of its current value. Required when *state=present* or *state=absent*. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
- name: Ensure tags are present on a resource
amazon.aws.ec2_tag:
region: eu-west-1
resource: vol-XXXXXX
state: present
tags:
Name: ubervol
env: prod
- name: Ensure all volumes are tagged
amazon.aws.ec2_tag:
region: eu-west-1
resource: '{{ item.id }}'
state: present
tags:
Name: dbserver
Env: production
loop: '{{ ec2_vol.volumes }}'
- name: Remove the Env tag
amazon.aws.ec2_tag:
region: eu-west-1
resource: i-xxxxxxxxxxxxxxxxx
tags:
Env:
state: absent
- name: Remove the Env tag if it's currently 'development'
amazon.aws.ec2_tag:
region: eu-west-1
resource: i-xxxxxxxxxxxxxxxxx
tags:
Env: development
state: absent
- name: Remove all tags except for Name from an instance
amazon.aws.ec2_tag:
region: eu-west-1
resource: i-xxxxxxxxxxxxxxxxx
tags:
Name: ''
state: absent
purge_tags: true
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **added\_tags** dictionary | If tags were added | A dict of tags that were added to the resource |
| **removed\_tags** dictionary | If tags were removed | A dict of tags that were removed from the resource |
| **tags** dictionary | always | A dict containing the tags on the resource |
### Authors
* Lester Wade (@lwade)
* Paul Arthur (@flowerysong)
ansible amazon.aws.aws_az_info – Gather information about availability zones in AWS. amazon.aws.aws\_az\_info – Gather information about availability zones in AWS.
==============================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.aws_az_info`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about availability zones in AWS.
* This module was called [amazon.aws.aws\_az\_facts](aws_az_facts_module#ansible-collections-amazon-aws-aws-az-facts-module) before Ansible 2.9. The usage did not change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **filters** dictionary | **Default:**{} | A dict of filters to apply. Each dict item consists of a filter key and a filter value. See <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html> for possible filters. Filter names and values are case sensitive. You can use underscores instead of dashes (-) in the filter keys. Filter keys with underscores will take precedence in case of conflict. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Gather information about all availability zones
amazon.aws.aws_az_info:
- name: Gather information about a single availability zone
amazon.aws.aws_az_info:
filters:
zone-name: eu-west-1a
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **availability\_zones** list / elements=string | on success | Availability zones that match the provided filters. Each element consists of a dict with all the information related to that available zone. **Sample:** [ { 'messages': [], 'region\_name': 'us-west-1', 'state': 'available', 'zone\_name': 'us-west-1b' }, { 'messages': [], 'region\_name': 'us-west-1', 'state': 'available', 'zone\_name': 'us-west-1c' } ] |
### Authors
* Henrique Rodrigues (@Sodki)
| programming_docs |
ansible amazon.aws.ec2_vpc_dhcp_option_info – Gather information about dhcp options sets in AWS amazon.aws.ec2\_vpc\_dhcp\_option\_info – Gather information about dhcp options sets in AWS
===========================================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_vpc_dhcp_option_info`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about dhcp options sets in AWS.
* This module was called `ec2_vpc_dhcp_option_facts` before Ansible 2.9. The usage did not change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **dhcp\_options\_ids** list / elements=string | | Get details of specific DHCP Option IDs.
aliases: DhcpOptionIds |
| **dry\_run** boolean | **Choices:*** **no** ←
* yes
| Checks whether you have the required permissions to view the DHCP Options.
aliases: DryRun |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **filters** dictionary | | A dict of filters to apply. Each dict item consists of a filter key and a filter value. See <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeDhcpOptions.html> for possible filters. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# # Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Gather information about all DHCP Option sets for an account or profile
amazon.aws.ec2_vpc_dhcp_option_info:
region: ap-southeast-2
profile: production
register: dhcp_info
- name: Gather information about a filtered list of DHCP Option sets
amazon.aws.ec2_vpc_dhcp_option_info:
region: ap-southeast-2
profile: production
filters:
"tag:Name": "abc-123"
register: dhcp_info
- name: Gather information about a specific DHCP Option set by DhcpOptionId
amazon.aws.ec2_vpc_dhcp_option_info:
region: ap-southeast-2
profile: production
DhcpOptionsIds: dopt-123fece2
register: dhcp_info
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | True if listing the dhcp options succeeds |
| **dhcp\_options** list / elements=string | always | The dhcp option sets for the account |
### Authors
* Nick Aslanidis (@naslanidis)
ansible amazon.aws.ec2_vpc_subnet – Manage subnets in AWS virtual private clouds amazon.aws.ec2\_vpc\_subnet – Manage subnets in AWS virtual private clouds
==========================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_vpc_subnet`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage subnets in AWS virtual private clouds.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **assign\_instances\_ipv6** boolean | **Choices:*** **no** ←
* yes
| Specify `yes` to indicate that instances launched into the subnet should be automatically assigned an IPv6 address. |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **az** string | | The availability zone for the subnet. |
| **cidr** string / required | | The CIDR block for the subnet. E.g. 192.0.2.0/24. |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **ipv6\_cidr** string | | The IPv6 CIDR block for the subnet. The VPC must have a /56 block assigned and this value must be a valid IPv6 /64 that falls in the VPC range. Required if *assign\_instances\_ipv6=true*
|
| **map\_public** boolean | **Choices:*** **no** ←
* yes
| Specify `yes` to indicate that instances launched into the subnet should be assigned public IP address by default. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **purge\_tags** boolean | **Choices:*** no
* **yes** ←
| Whether or not to remove tags that do not appear in the *tags* list. |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **state** string | **Choices:*** **present** ←
* absent
| Create or remove the subnet. |
| **tags** dictionary | | A dict of tags to apply to the subnet. Any tags currently applied to the subnet and not present here will be removed.
aliases: resource\_tags |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **vpc\_id** string / required | | VPC ID of the VPC in which to create or delete the subnet. |
| **wait** boolean | **Choices:*** no
* **yes** ←
| When *wait=true* and *state=present*, module will wait for subnet to be in available state before continuing. |
| **wait\_timeout** integer | **Default:**300 | Number of seconds to wait for subnet to become available *wait=True*. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Create subnet for database servers
amazon.aws.ec2_vpc_subnet:
state: present
vpc_id: vpc-123456
cidr: 10.0.1.16/28
tags:
Name: Database Subnet
register: database_subnet
- name: Remove subnet for database servers
amazon.aws.ec2_vpc_subnet:
state: absent
vpc_id: vpc-123456
cidr: 10.0.1.16/28
- name: Create subnet with IPv6 block assigned
amazon.aws.ec2_vpc_subnet:
state: present
vpc_id: vpc-123456
cidr: 10.1.100.0/24
ipv6_cidr: 2001:db8:0:102::/64
- name: Remove IPv6 block assigned to subnet
amazon.aws.ec2_vpc_subnet:
state: present
vpc_id: vpc-123456
cidr: 10.1.100.0/24
ipv6_cidr: ''
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **subnet** complex | *state=present* | Dictionary of subnet values |
| | **assign\_ipv6\_address\_on\_creation** boolean | *state=present* | whether IPv6 address is auto-assigned to new instances |
| | **availability\_zone** string | *state=present* | Availability zone of the Subnet **Sample:** us-east-1a |
| | **available\_ip\_address\_count** string | *state=present* | number of available IPv4 addresses **Sample:** 251 |
| | **cidr\_block** string | *state=present* | The IPv4 CIDR of the Subnet **Sample:** 10.0.0.0/16 |
| | **default\_for\_az** boolean | *state=present* | indicates whether this is the default Subnet for this Availability Zone |
| | **id** string | *state=present* | Subnet resource id **Sample:** subnet-b883b2c4 |
| | **ipv6\_association\_id** string | *state=present* | The IPv6 association ID for the currently associated CIDR **Sample:** subnet-cidr-assoc-b85c74d2 |
| | **ipv6\_cidr\_block** string | *state=present* | The IPv6 CIDR block actively associated with the Subnet **Sample:** 2001:db8:0:102::/64 |
| | **ipv6\_cidr\_block\_association\_set** complex | *state=present* | An array of IPv6 cidr block association set information. |
| | | **association\_id** string | always | The association ID |
| | | **ipv6\_cidr\_block** string | always | The IPv6 CIDR block that is associated with the subnet. |
| | | **ipv6\_cidr\_block\_state** dictionary | always | A hash/dict that contains a single item. The state of the cidr block association. |
| | | | **state** string | always | The CIDR block association state. |
| | **map\_public\_ip\_on\_launch** boolean | *state=present* | whether public IP is auto-assigned to new instances |
| | **state** string | *state=present* | state of the Subnet **Sample:** available |
| | **tags** dictionary | *state=present* | tags attached to the Subnet, includes name **Sample:** {'Name': 'My Subnet', 'env': 'staging'} |
| | **vpc\_id** string | *state=present* | the id of the VPC where this Subnet exists **Sample:** vpc-67236184 |
### Authors
* Robert Estelle (@erydo)
* Brad Davidson (@brandond)
ansible amazon.aws.ec2_key – create or delete an ec2 key pair amazon.aws.ec2\_key – create or delete an ec2 key pair
======================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_key`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* create or delete an ec2 key pair.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **force** boolean | **Choices:*** no
* **yes** ←
| Force overwrite of already existing key pair if key has changed. |
| **key\_material** string | | Public key material. |
| **name** string / required | | Name of the key pair. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **state** string | **Choices:*** **present** ←
* absent
| create or delete keypair |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **wait** boolean | **Choices:*** no
* yes
| This option has no effect since version 2.5 and will be removed after 2022-06-01. |
| **wait\_timeout** integer | | This option has no effect since version 2.5 and will be removed after 2022-06-01. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
- name: create a new ec2 key pair, returns generated private key
amazon.aws.ec2_key:
name: my_keypair
- name: create key pair using provided key_material
amazon.aws.ec2_key:
name: my_keypair
key_material: 'ssh-rsa AAAAxyz...== [email protected]'
- name: create key pair using key_material obtained using 'file' lookup plugin
amazon.aws.ec2_key:
name: my_keypair
key_material: "{{ lookup('file', '/path/to/public_key/id_rsa.pub') }}"
# try creating a key pair with the name of an already existing keypair
# but don't overwrite it even if the key is different (force=false)
- name: try creating a key pair with name of an already existing keypair
amazon.aws.ec2_key:
name: my_existing_keypair
key_material: 'ssh-rsa AAAAxyz...== [email protected]'
force: false
- name: remove key pair by name
amazon.aws.ec2_key:
name: my_keypair
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | whether a keypair was created/deleted **Sample:** True |
| **key** complex | always | details of the keypair (this is set to null when state is absent) |
| | **fingerprint** string | when state is present | fingerprint of the key **Sample:** b0:22:49:61:d9:44:9d:0c:7e:ac:8a:32:93:21:6c:e8:fb:59:62:43 |
| | **name** string | when state is present | name of the keypair **Sample:** my\_keypair |
| | **private\_key** string | when a new keypair is created by AWS (key\_material is not provided) | private key of a newly created keypair **Sample:** -----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKC... -----END RSA PRIVATE KEY----- |
| **msg** string | always | short message describing the action taken **Sample:** key pair created |
### Authors
* Vincent Viallet (@zbal)
* Prasad Katti (@prasadkatti)
| programming_docs |
ansible amazon.aws.ec2_vpc_subnet_info – Gather information about ec2 VPC subnets in AWS amazon.aws.ec2\_vpc\_subnet\_info – Gather information about ec2 VPC subnets in AWS
===================================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_vpc_subnet_info`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about ec2 VPC subnets in AWS
* This module was called `ec2_vpc_subnet_facts` before Ansible 2.9. The usage did not change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **filters** dictionary | | A dict of filters to apply. Each dict item consists of a filter key and a filter value. See <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html> for possible filters. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **subnet\_ids** list / elements=string | | A list of subnet IDs to gather information for.
aliases: subnet\_id |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Gather information about all VPC subnets
- amazon.aws.ec2_vpc_subnet_info:
# Gather information about a particular VPC subnet using ID
- amazon.aws.ec2_vpc_subnet_info:
subnet_ids: subnet-00112233
# Gather information about any VPC subnet with a tag key Name and value Example
- amazon.aws.ec2_vpc_subnet_info:
filters:
"tag:Name": Example
# Gather information about any VPC subnet within VPC with ID vpc-abcdef00
- amazon.aws.ec2_vpc_subnet_info:
filters:
vpc-id: vpc-abcdef00
# Gather information about a set of VPC subnets, publicA, publicB and publicC within a
# VPC with ID vpc-abcdef00 and then use the jinja map function to return the
# subnet_ids as a list.
- amazon.aws.ec2_vpc_subnet_info:
filters:
vpc-id: vpc-abcdef00
"tag:Name": "{{ item }}"
loop:
- publicA
- publicB
- publicC
register: subnet_info
- set_fact:
subnet_ids: "{{ subnet_info.subnets|map(attribute='id')|list }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **subnets** complex | success | Returns an array of complex objects as described below. |
| | **assign\_ipv6\_address\_on\_creation** boolean | always | True/False depending on attribute setting for IPv6 address assignment. |
| | **availability\_zone** string | always | The availability zone where the subnet exists. |
| | **available\_ip\_address\_count** string | always | Count of available IPs in subnet. |
| | **cidr\_block** string | always | The IPv4 CIDR block assigned to the subnet. |
| | **default\_for\_az** boolean | always | True if this is the default subnet for AZ. |
| | **id** string | always | The ID of the Subnet (for backwards compatibility). |
| | **ipv6\_cidr\_block\_association\_set** complex | always | An array of IPv6 cidr block association set information. |
| | | **association\_id** string | always | The association ID |
| | | **ipv6\_cidr\_block** string | always | The IPv6 CIDR block that is associated with the subnet. |
| | | **ipv6\_cidr\_block\_state** dictionary | always | A hash/dict that contains a single item. The state of the cidr block association. |
| | | | **state** string | always | The CIDR block association state. |
| | **map\_public\_ip\_on\_launch** boolean | always | True/False depending on attribute setting for public IP mapping. |
| | **state** string | always | The state of the subnet. |
| | **subnet\_id** string | always | The ID of the Subnet. |
| | **tags** dictionary | always | A dict of tags associated with the Subnet. |
| | **vpc\_id** string | always | The ID of the VPC . |
### Authors
* Rob White (@wimnat)
ansible amazon.aws.aws_caller_info – Get information about the user and account being used to make AWS calls. amazon.aws.aws\_caller\_info – Get information about the user and account being used to make AWS calls.
=======================================================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.aws_caller_info`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module returns information about the account and user / role from which the AWS access tokens originate.
* The primary use of this is to get the account id for templating into ARNs or similar to avoid needing to specify this information in inventory.
* This module was called [amazon.aws.aws\_caller\_facts](aws_caller_facts_module#ansible-collections-amazon-aws-aws-caller-facts-module) before Ansible 2.9. The usage did not change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Get the current caller identity information
amazon.aws.aws_caller_info:
register: caller_info
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **account** string | success | The account id the access credentials are associated with. **Sample:** 123456789012 |
| **account\_alias** string | when caller has the iam:ListAccountAliases permission | The account alias the access credentials are associated with. **Sample:** acme-production |
| **arn** string | success | The arn identifying the user the credentials are associated with. **Sample:** arn:aws:sts::123456789012:federated-user/my-federated-user-name |
| **user\_id** string | success | The user id the access credentials are associated with. Note that this may not correspond to anything you can look up in the case of roles or federated identities. **Sample:** 123456789012:my-federated-user-name |
### Authors
* Ed Costello (@orthanc)
* Stijn Dubrul (@sdubrul)
ansible amazon.aws.ec2_tag_info – list tags on ec2 resources amazon.aws.ec2\_tag\_info – list tags on ec2 resources
======================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_tag_info`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Lists tags for any EC2 resource.
* Resources are referenced by their resource id (e.g. an instance being i-XXXXXXX, a vpc being vpc-XXXXXX).
* Resource tags can be managed using the [amazon.aws.ec2\_tag](ec2_tag_module#ansible-collections-amazon-aws-ec2-tag-module) module.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **resource** string / required | | The EC2 resource id (for example i-XXXXXX or vpc-XXXXXX). |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
- name: Retrieve all tags on an instance
amazon.aws.ec2_tag_info:
region: eu-west-1
resource: i-xxxxxxxxxxxxxxxxx
register: instance_tags
- name: Retrieve all tags on a VPC
amazon.aws.ec2_tag_info:
region: eu-west-1
resource: vpc-xxxxxxxxxxxxxxxxx
register: vpc_tags
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **tags** dictionary | always | A dict containing the tags on the resource |
### Authors
* Mark Chappell (@tremble)
| programming_docs |
ansible amazon.aws.aws_secret – Look up secrets stored in AWS Secrets Manager. amazon.aws.aws\_secret – Look up secrets stored in AWS Secrets Manager.
=======================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.aws_secret`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Look up secrets stored in AWS Secrets Manager provided the caller has the appropriate permissions to read the secret.
* Lookup is based on the secret’s *Name* value.
* Optional parameters can be passed into this lookup; *version\_id* and *version\_stage*
Requirements
------------
The below requirements are needed on the local controller node that executes this lookup.
* boto3
* botocore>=1.10.0
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **\_terms** string / required | | | Name of the secret to look up in AWS Secrets Manager. |
| **aws\_access\_key** string | | env:EC2\_ACCESS\_KEY env:AWS\_ACCESS\_KEY env:AWS\_ACCESS\_KEY\_ID | The AWS access key to use.
aliases: aws\_access\_key\_id |
| **aws\_profile** string | | env:AWS\_DEFAULT\_PROFILE env:AWS\_PROFILE | The AWS profile
aliases: boto\_profile |
| **aws\_secret\_key** string | | env:EC2\_SECRET\_KEY env:AWS\_SECRET\_KEY env:AWS\_SECRET\_ACCESS\_KEY | The AWS secret key that corresponds to the access key.
aliases: aws\_secret\_access\_key |
| **aws\_security\_token** string | | env:EC2\_SECURITY\_TOKEN env:AWS\_SESSION\_TOKEN env:AWS\_SECURITY\_TOKEN | The AWS security token if using temporary access and secret keys. |
| **bypath** boolean added in 1.4.0 of amazon.aws | **Choices:*** **no** ←
* yes
| | A boolean to indicate whether the parameter is provided as a hierarchy. |
| **join** boolean | **Choices:*** **no** ←
* yes
| | Join two or more entries to form an extended secret. This is useful for overcoming the 4096 character limit imposed by AWS. No effect when used with *bypath*. |
| **nested** boolean added in 1.4.0 of amazon.aws | **Choices:*** **no** ←
* yes
| | A boolean to indicate the secret contains nested values. |
| **on\_denied** string | **Choices:*** **error** ←
* skip
* warn
| | Action to take if access to the secret is denied.
`error` will raise a fatal error when access to the secret is denied.
`skip` will silently ignore the denied secret.
`warn` will skip over the denied secret but issue a warning. |
| **on\_missing** string | **Choices:*** **error** ←
* skip
* warn
| | Action to take if the secret is missing.
`error` will raise a fatal error when the secret is missing.
`skip` will silently ignore the missing secret.
`warn` will skip over the missing secret but issue a warning. |
| **region** string | | env:EC2\_REGION env:AWS\_REGION | The region for which to create the connection. |
| **version\_id** string | | | Version of the secret(s). |
| **version\_stage** string | | | Stage of the secret version. |
Examples
--------
```
- name: lookup secretsmanager secret in the current region
debug: msg="{{ lookup('amazon.aws.aws_secret', '/path/to/secrets', bypath=true) }}"
- name: Create RDS instance with aws_secret lookup for password param
rds:
command: create
instance_name: app-db
db_engine: MySQL
size: 10
instance_type: db.m1.small
username: dbadmin
password: "{{ lookup('amazon.aws.aws_secret', 'DbSecret') }}"
tags:
Environment: staging
- name: skip if secret does not exist
debug: msg="{{ lookup('amazon.aws.aws_secret', 'secret-not-exist', on_missing='skip')}}"
- name: warn if access to the secret is denied
debug: msg="{{ lookup('amazon.aws.aws_secret', 'secret-denied', on_denied='warn')}}"
- name: lookup secretsmanager secret in the current region using the nested feature
debug: msg="{{ lookup('amazon.aws.aws_secret', 'secrets.environments.production.password', nested=true) }}"
# The secret can be queried using the following syntax: `aws_secret_object_name.key1.key2.key3`.
# If an object is of the form `{"key1":{"key2":{"key3":1}}}` the query would return the value `1`.
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this lookup:
| Key | Returned | Description |
| --- | --- | --- |
| **\_raw** string | success | Returns the value of the secret stored in AWS Secrets Manager. |
### Authors
* Aaron Smith <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#c3a2a9b0aeaab7abf2f3f0fbf2e5e0f0f4f8e5e0f6f1f8e5e0f7fbf8a4aea2aaafe5e0f7f5f8a0acae)>
ansible amazon.aws.aws_ssm – Get the value for a SSM parameter or all parameters under a path. amazon.aws.aws\_ssm – Get the value for a SSM parameter or all parameters under a path.
=======================================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.aws_ssm`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Get the value for an Amazon Simple Systems Manager parameter or a hierarchy of parameters. The first argument you pass the lookup can either be a parameter name or a hierarchy of parameters. Hierarchies start with a forward slash and end with the parameter name. Up to 5 layers may be specified.
* If looking up an explicitly listed parameter by name which does not exist then the lookup will return a None value which will be interpreted by Jinja2 as an empty string. You can use the ``default`` filter to give a default value in this case but must set the second parameter to true (see examples below)
* When looking up a path for parameters under it a dictionary will be returned for each path. If there is no parameter under that path then the return will be successful but the dictionary will be empty.
* If the lookup fails due to lack of permissions or due to an AWS client error then the aws\_ssm will generate an error, normally crashing the current ansible task. This is normally the right thing since ignoring a value that IAM isn’t giving access to could cause bigger problems and wrong behaviour or loss of data. If you want to continue in this case then you will have to set up two ansible tasks, one which sets a variable and ignores failures one which uses the value of that variable with a default. See the examples below.
Requirements
------------
The below requirements are needed on the local controller node that executes this lookup.
* boto3
* botocore
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **bypath** boolean | **Choices:*** **no** ←
* yes
| | A boolean to indicate whether the parameter is provided as a hierarchy. |
| **decrypt** boolean | **Choices:*** no
* **yes** ←
| | A boolean to indicate whether to decrypt the parameter. |
| **recursive** boolean | **Choices:*** **no** ←
* yes
| | A boolean to indicate whether to retrieve all parameters within a hierarchy. |
| **shortnames** boolean | **Choices:*** **no** ←
* yes
| | Indicates whether to return the name only without path if using a parameter hierarchy. |
Examples
--------
```
# lookup sample:
- name: lookup ssm parameter store in the current region
debug: msg="{{ lookup('aws_ssm', 'Hello' ) }}"
- name: lookup ssm parameter store in nominated region
debug: msg="{{ lookup('aws_ssm', 'Hello', region='us-east-2' ) }}"
- name: lookup ssm parameter store without decrypted
debug: msg="{{ lookup('aws_ssm', 'Hello', decrypt=False ) }}"
- name: lookup ssm parameter store in nominated aws profile
debug: msg="{{ lookup('aws_ssm', 'Hello', aws_profile='myprofile' ) }}"
- name: lookup ssm parameter store using explicit aws credentials
debug: msg="{{ lookup('aws_ssm', 'Hello', aws_access_key=my_aws_access_key, aws_secret_key=my_aws_secret_key, aws_security_token=my_security_token ) }}"
- name: lookup ssm parameter store with all options.
debug: msg="{{ lookup('aws_ssm', 'Hello', decrypt=false, region='us-east-2', aws_profile='myprofile') }}"
- name: lookup a key which doesn't exist, returns ""
debug: msg="{{ lookup('aws_ssm', 'NoKey') }}"
- name: lookup a key which doesn't exist, returning a default ('root')
debug: msg="{{ lookup('aws_ssm', 'AdminID') | default('root', true) }}"
- name: lookup a key which doesn't exist failing to store it in a fact
set_fact:
temp_secret: "{{ lookup('aws_ssm', '/NoAccess/hiddensecret') }}"
ignore_errors: true
- name: show fact default to "access failed" if we don't have access
debug: msg="{{ 'the secret was:' ~ temp_secret | default('could not access secret') }}"
- name: return a dictionary of ssm parameters from a hierarchy path
debug: msg="{{ lookup('aws_ssm', '/PATH/to/params', region='ap-southeast-2', bypath=true, recursive=true ) }}"
- name: return a dictionary of ssm parameters from a hierarchy path with shortened names (param instead of /PATH/to/param)
debug: msg="{{ lookup('aws_ssm', '/PATH/to/params', region='ap-southeast-2', shortnames=true, bypath=true, recursive=true ) }}"
- name: Iterate over a parameter hierarchy (one iteration per parameter)
debug: msg='Key contains {{ item.key }} , with value {{ item.value }}'
loop: '{{ lookup("aws_ssm", "/demo/", region="ap-southeast-2", bypath=True) | dict2items }}'
- name: Iterate over multiple paths as dictionaries (one iteration per path)
debug: msg='Path contains {{ item }}'
loop: '{{ lookup("aws_ssm", "/demo/", "/demo1/", bypath=True)}}'
```
### Authors
* Bill Wang <ozbillwang(at)gmail.com>
* Marat Bakeev <hawara(at)gmail.com>
* Michael De La Rue <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#e7948e858b828a8e9384888ac1c4d3d1dc8a83838b95c1c4d4d0dcc1c4d2d5dcc1c4d3dfdc9497868a808892958a8293c1c4d3d1dc84888a)>
ansible amazon.aws.aws_rds – rds instance source amazon.aws.aws\_rds – rds instance source
=========================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.aws_rds`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Get instances and clusters from Amazon Web Services RDS.
* Uses a YAML configuration file that ends with aws\_rds.(yml|yaml).
Requirements
------------
The below requirements are needed on the local controller node that executes this inventory.
* boto3
* botocore
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **aws\_access\_key** string | | env:EC2\_ACCESS\_KEY env:AWS\_ACCESS\_KEY env:AWS\_ACCESS\_KEY\_ID | The AWS access key to use.
aliases: aws\_access\_key\_id |
| **aws\_profile** string | | env:AWS\_DEFAULT\_PROFILE env:AWS\_PROFILE | The AWS profile
aliases: boto\_profile |
| **aws\_secret\_key** string | | env:EC2\_SECRET\_KEY env:AWS\_SECRET\_KEY env:AWS\_SECRET\_ACCESS\_KEY | The AWS secret key that corresponds to the access key.
aliases: aws\_secret\_access\_key |
| **aws\_security\_token** string | | env:EC2\_SECURITY\_TOKEN env:AWS\_SESSION\_TOKEN env:AWS\_SECURITY\_TOKEN | The AWS security token if using temporary access and secret keys. |
| **cache** boolean | **Choices:*** **no** ←
* yes
| 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 = None [inventory]cache\_connection = None 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** string | **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** string | **Default:**{} | | A dictionary of filter value pairs. Available filters are listed here <https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-instances.html#options>. If you filter by db-cluster-id and *include\_clusters* is True it will apply to clusters as well. |
| **groups** dictionary | **Default:**{} | | Add hosts to group based on Jinja2 conditionals. |
| **iam\_role\_arn** string | | | The ARN of the IAM role to assume to perform the inventory lookup. You should still provide AWS credentials with enough privilege to perform the AssumeRole action. |
| **include\_clusters** boolean | **Choices:*** **no** ←
* yes
| | Whether or not to query for Aurora clusters as well as instances |
| **keyed\_groups** list / elements=string | **Default:**[] | | Add hosts to group based on the values of a variable. |
| **leading\_separator** boolean added in 2.11 of ansible.builtin | **Choices:*** no
* **yes** ←
| | Use in conjunction with keyed\_groups. By default, a keyed group that does not have a prefix or a separator provided will have a name that starts with an underscore. This is because the default prefix is "" and the default separator is "\_". Set this option to False to omit the leading underscore (or other separator) if no prefix is given. If the group name is derived from a mapping the separator is still used to concatenate the items. To not use a separator in the group name at all, set the separator for the keyed group to an empty string instead. |
| **regions** string | **Default:**[] | | A list of regions in which to describe RDS instances and clusters. Available regions are listed here <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html>
|
| **statuses** list / elements=string | **Default:**["creating", "available"] | | A list of desired states for instances/clusters to be added to inventory. Set to ['all'] as a shorthand to find everything. |
| **strict** boolean | **Choices:*** **no** ←
* yes
| | 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. |
| **strict\_permissions** boolean | **Choices:*** no
* **yes** ←
| | By default if an AccessDenied exception is encountered this plugin will fail. You can set strict\_permissions to False in the inventory config file which will allow the restrictions to be gracefully skipped. |
| **use\_extra\_vars** boolean added in 2.11 of ansible.builtin | **Choices:*** **no** ←
* yes
| ini entries: [inventory\_plugins]use\_extra\_vars = no env:ANSIBLE\_INVENTORY\_USE\_EXTRA\_VARS | Merge extra vars into the available variables for composition (highest precedence). |
Examples
--------
```
plugin: aws_rds
regions:
- us-east-1
- ca-central-1
keyed_groups:
- key: 'db_parameter_groups|json_query("[].db_parameter_group_name")'
prefix: rds_parameter_group
- key: engine
prefix: rds
- key: tags
- key: region
```
### Authors
* Sloane Hertel (@s-hertel)
ansible amazon.aws.ec2_elb_lb – Creates, updates or destroys an Amazon ELB. amazon.aws.ec2\_elb\_lb – Creates, updates or destroys an Amazon ELB.
=====================================================================
Note
This plugin is part of the [amazon.aws collection](https://galaxy.ansible.com/amazon/aws) (version 1.5.1).
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 amazon.aws`.
To use it in a playbook, specify: `amazon.aws.ec2_elb_lb`.
New in version 1.0.0: of amazon.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Returns information about the load balancer.
* Will be marked changed when called only if state is changed.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.6
* boto
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_logs** dictionary | | An associative array of access logs configuration settings (see examples). |
| **aws\_access\_key** string | | AWS access key. If not set then the value of the AWS\_ACCESS\_KEY\_ID, AWS\_ACCESS\_KEY or EC2\_ACCESS\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_access\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_access\_key, access\_key |
| **aws\_ca\_bundle** path | | The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. |
| **aws\_config** dictionary | | A dictionary to modify the botocore configuration. Parameters can be found at <https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config>. Only the 'user\_agent' key is used for boto modules. See <http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto> for more boto configuration. |
| **aws\_secret\_key** string | | AWS secret key. If not set then the value of the AWS\_SECRET\_ACCESS\_KEY, AWS\_SECRET\_KEY, or EC2\_SECRET\_KEY environment variable is used. If *profile* is set this parameter is ignored. Passing the *aws\_secret\_key* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2\_secret\_key, secret\_key |
| **connection\_draining\_timeout** integer | | Wait a specified timeout allowing connections to drain before terminating an instance. |
| **cross\_az\_load\_balancing** boolean | **Choices:*** no
* yes
| Distribute load across all configured Availability Zones. Defaults to `false`. |
| **debug\_botocore\_endpoint\_logs** boolean | **Choices:*** **no** ←
* yes
| Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource\_actions key in the task results. Use the aws\_resource\_action callback to output to total list made during a playbook. The ANSIBLE\_DEBUG\_BOTOCORE\_LOGS environment variable may also be used. |
| **ec2\_url** string | | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2\_URL environment variable, if any, is used.
aliases: aws\_endpoint\_url, endpoint\_url |
| **health\_check** dictionary | | An associative array of health check configuration settings (see examples). |
| **idle\_timeout** integer | | ELB connections from clients and to servers are timed out after this amount of time. |
| **instance\_ids** list / elements=string | | List of instance ids to attach to this ELB. |
| **listeners** list / elements=dictionary | | List of ports/protocols for this ELB to listen on (see examples). |
| **name** string / required | | The name of the ELB. |
| **profile** string | | Uses a boto profile. Only works with boto >= 2.24.0. Using *profile* will override *aws\_access\_key*, *aws\_secret\_key* and *security\_token* and support for passing them at the same time as *profile* has been deprecated.
*aws\_access\_key*, *aws\_secret\_key* and *security\_token* will be made mutually exclusive with *profile* after 2022-06-01.
aliases: aws\_profile |
| **purge\_instance\_ids** boolean | **Choices:*** **no** ←
* yes
| Purge existing instance ids on ELB that are not found in instance\_ids. |
| **purge\_listeners** boolean | **Choices:*** no
* **yes** ←
| Purge existing listeners on ELB that are not found in listeners. |
| **purge\_subnets** boolean | **Choices:*** **no** ←
* yes
| Purge existing subnet on ELB that are not found in subnets. |
| **purge\_zones** boolean | **Choices:*** **no** ←
* yes
| Purge existing availability zones on ELB that are not found in zones. |
| **region** string | | The AWS region to use. If not specified then the value of the AWS\_REGION or EC2\_REGION environment variable, if any, is used. See <http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region>
aliases: aws\_region, ec2\_region |
| **scheme** string | **Choices:*** internal
* **internet-facing** ←
| The scheme to use when creating the ELB. For a private VPC-visible ELB use `internal`. If you choose to update your scheme with a different value the ELB will be destroyed and recreated. To update scheme you must use the option *wait*. |
| **security\_group\_ids** list / elements=string | | A list of security groups to apply to the ELB. |
| **security\_group\_names** list / elements=string | | A list of security group names to apply to the ELB. |
| **security\_token** string | | AWS STS security token. If not set then the value of the AWS\_SECURITY\_TOKEN or EC2\_SECURITY\_TOKEN environment variable is used. If *profile* is set this parameter is ignored. Passing the *security\_token* and *profile* options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws\_security\_token, access\_token |
| **state** string / required | **Choices:*** absent
* present
| Create or destroy the ELB. |
| **stickiness** dictionary | | An associative array of stickiness policy settings. Policy will be applied to all listeners (see examples). |
| **subnets** list / elements=string | | A list of VPC subnets to use when creating ELB. Zones should be empty if using this. |
| **tags** dictionary | | An associative array of tags. To delete all tags, supply an empty dict (`{}`). |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **wait** boolean | **Choices:*** **no** ←
* yes
| When specified, Ansible will check the status of the load balancer to ensure it has been successfully removed from AWS. |
| **wait\_timeout** integer | **Default:**60 | Used in conjunction with wait. Number of seconds to wait for the ELB to be terminated. A maximum of 600 seconds (10 minutes) is allowed. |
| **zones** list / elements=string | | List of availability zones to enable on this ELB. |
Notes
-----
Note
* If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence `AWS_URL` or `EC2_URL`, `AWS_PROFILE` or `AWS_DEFAULT_PROFILE`, `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` or `EC2_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` or `EC2_SECRET_KEY`, `AWS_SECURITY_TOKEN` or `EC2_SECURITY_TOKEN`, `AWS_REGION` or `EC2_REGION`, `AWS_CA_BUNDLE`
* Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See <https://boto.readthedocs.io/en/latest/boto_config_tut.html>
* `AWS_REGION` or `EC2_REGION` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples
--------
```
# Note: None of these examples set aws_access_key, aws_secret_key, or region.
# It is assumed that their matching environment variables are set.
# Basic provisioning example (non-VPC)
- amazon.aws.ec2_elb_lb:
name: "test-please-delete"
state: present
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http # options are http, https, ssl, tcp
load_balancer_port: 80
instance_port: 80
proxy_protocol: True
- protocol: https
load_balancer_port: 443
instance_protocol: http # optional, defaults to value of protocol setting
instance_port: 80
# ssl certificate required for https or ssl
ssl_certificate_id: "arn:aws:iam::123456789012:server-certificate/company/servercerts/ProdServerCert"
# Internal ELB example
- amazon.aws.ec2_elb_lb:
name: "test-vpc"
scheme: internal
state: present
instance_ids:
- i-abcd1234
purge_instance_ids: true
subnets:
- subnet-abcd1234
- subnet-1a2b3c4d
listeners:
- protocol: http # options are http, https, ssl, tcp
load_balancer_port: 80
instance_port: 80
# Configure a health check and the access logs
- amazon.aws.ec2_elb_lb:
name: "test-please-delete"
state: present
zones:
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
health_check:
ping_protocol: http # options are http, https, ssl, tcp
ping_port: 80
ping_path: "/index.html" # not required for tcp or ssl
response_timeout: 5 # seconds
interval: 30 # seconds
unhealthy_threshold: 2
healthy_threshold: 10
access_logs:
interval: 5 # minutes (defaults to 60)
s3_location: "my-bucket" # This value is required if access_logs is set
s3_prefix: "logs"
# Ensure ELB is gone
- amazon.aws.ec2_elb_lb:
name: "test-please-delete"
state: absent
# Ensure ELB is gone and wait for check (for default timeout)
- amazon.aws.ec2_elb_lb:
name: "test-please-delete"
state: absent
wait: yes
# Ensure ELB is gone and wait for check with timeout value
- amazon.aws.ec2_elb_lb:
name: "test-please-delete"
state: absent
wait: yes
wait_timeout: 600
# Normally, this module will purge any listeners that exist on the ELB
# but aren't specified in the listeners parameter. If purge_listeners is
# false it leaves them alone
- amazon.aws.ec2_elb_lb:
name: "test-please-delete"
state: present
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
purge_listeners: no
# Normally, this module will leave availability zones that are enabled
# on the ELB alone. If purge_zones is true, then any extraneous zones
# will be removed
- amazon.aws.ec2_elb_lb:
name: "test-please-delete"
state: present
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
purge_zones: yes
# Creates a ELB and assigns a list of subnets to it.
- amazon.aws.ec2_elb_lb:
state: present
name: 'New ELB'
security_group_ids: 'sg-123456, sg-67890'
region: us-west-2
subnets: 'subnet-123456,subnet-67890'
purge_subnets: yes
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
# Create an ELB with connection draining, increased idle timeout and cross availability
# zone load balancing
- amazon.aws.ec2_elb_lb:
name: "New ELB"
state: present
connection_draining_timeout: 60
idle_timeout: 300
cross_az_load_balancing: "yes"
region: us-east-1
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
# Create an ELB with load balancer stickiness enabled
- amazon.aws.ec2_elb_lb:
name: "New ELB"
state: present
region: us-east-1
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
stickiness:
type: loadbalancer
enabled: yes
expiration: 300
# Create an ELB with application stickiness enabled
- amazon.aws.ec2_elb_lb:
name: "New ELB"
state: present
region: us-east-1
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
stickiness:
type: application
enabled: yes
cookie: SESSIONID
# Create an ELB and add tags
- amazon.aws.ec2_elb_lb:
name: "New ELB"
state: present
region: us-east-1
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
tags:
Name: "New ELB"
stack: "production"
client: "Bob"
# Delete all tags from an ELB
- amazon.aws.ec2_elb_lb:
name: "New ELB"
state: present
region: us-east-1
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
tags: {}
```
### Authors
* Jim Dalton (@jsdalton)
| programming_docs |
ansible Collections in the Cyberark Namespace Collections in the Cyberark Namespace
=====================================
These are the collections with docs hosted on [docs.ansible.com](https://docs.ansible.com/) in the **cyberark** namespace.
* [cyberark.conjur](conjur/index#plugins-in-cyberark-conjur)
* [cyberark.pas](pas/index#plugins-in-cyberark-pas)
ansible Cyberark.Conjur Cyberark.Conjur
===============
Collection version 1.1.0
Plugin Index
------------
These are the plugins in the cyberark.conjur collection
### Lookup Plugins
* [conjur\_variable](conjur_variable_lookup#ansible-collections-cyberark-conjur-conjur-variable-lookup) – Fetch credentials from CyberArk Conjur.
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible cyberark.conjur.conjur_variable – Fetch credentials from CyberArk Conjur. cyberark.conjur.conjur\_variable – Fetch credentials from CyberArk Conjur.
==========================================================================
Note
This plugin is part of the [cyberark.conjur collection](https://galaxy.ansible.com/cyberark/conjur) (version 1.1.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 cyberark.conjur`.
To use it in a playbook, specify: `cyberark.conjur.conjur_variable`.
New in version 2.5: of cyberark.conjur
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Retrieves credentials from Conjur using the controlling host’s Conjur identity or environment variables. Environment variables could be CONJUR\_ACCOUNT, CONJUR\_APPLIANCE\_URL, CONJUR\_CERT\_FILE, CONJUR\_AUTHN\_LOGIN, CONJUR\_AUTHN\_API\_KEY, CONJUR\_AUTHN\_TOKEN\_FILE Conjur info - <https://www.conjur.org/>.
Requirements
------------
The below requirements are needed on the local controller node that executes this lookup.
* The controlling host running Ansible has a Conjur identity. (More: <https://docs.conjur.org/latest/en/Content/Get%20Started/key_concepts/machine_identity.html>)
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **\_terms** string / required | | | Variable path |
| **as\_file** boolean | **Choices:*** **no** ←
* yes
| | Store lookup result in a temporary file and returns the file path. Thus allowing it to be consumed as an ansible file parameter (eg ansible\_ssh\_private\_key\_file). |
| **authn\_token\_file** path | **Default:**"/var/run/conjur/access-token" | ini entries: [conjur,]authn\_token\_file = /var/run/conjur/access-token env:CONJUR\_AUTHN\_TOKEN\_FILE | Path to the access token file. |
| **config\_file** path | **Default:**"/etc/conjur.conf" | ini entries: [conjur,]config\_file\_path = /etc/conjur.conf env:CONJUR\_CONFIG\_FILE | Path to the Conjur configuration file. The configuration file is a YAML file. |
| **identity\_file** path | **Default:**"/etc/conjur.identity" | ini entries: [conjur,]identity\_file\_path = /etc/conjur.identity env:CONJUR\_IDENTITY\_FILE | Path to the Conjur identity file. The identity file follows the netrc file format convention. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| | Flag to control SSL certificate validation |
Examples
--------
```
---
- hosts: localhost
collections:
- cyberark.conjur
tasks:
- name: Lookup variable in Conjur
debug:
msg: "{{ lookup('cyberark.conjur.conjur_variable', '/path/to/secret') }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this lookup:
| Key | Returned | Description |
| --- | --- | --- |
| **\_raw** string | success | Value stored in Conjur. |
### Authors
* CyberArk BizDev (@cyberark-bizdev)
* CyberArk Community and Integrations Team (@cyberark/community-and-integrations-team)
ansible cyberark.pas.cyberark_authentication – CyberArk Authentication using PAS Web Services SDK. cyberark.pas.cyberark\_authentication – CyberArk Authentication using PAS Web Services SDK.
===========================================================================================
Note
This plugin is part of the [cyberark.pas collection](https://galaxy.ansible.com/cyberark/pas) (version 1.0.7).
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 cyberark.pas`.
To use it in a playbook, specify: `cyberark.pas.cyberark_authentication`.
New in version 2.4: of cyberark.pas
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Authenticates to CyberArk Vault using Privileged Account Security Web Services SDK and creates a session fact that can be used by other modules. It returns an Ansible fact called *cyberark\_session*. Every module can use this fact as `cyberark_session` parameter.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_base\_url** string | | A string containing the base URL of the server hosting CyberArk's Privileged Account Security Web Services SDK. |
| **connection\_number** integer | | To support multiple connections for same user specify different value for this parameter. |
| **cyberark\_session** dictionary | | Dictionary set by a CyberArk authentication containing the different values to perform actions on a logged-on CyberArk session. |
| **new\_password** string | | The new password of the user. This parameter is optional, and enables you to change a password. |
| **password** string | | The password of the user. |
| **state** string | **Choices:*** **present** ←
* absent
| Specifies if an authentication logon/logoff and a cyberark\_session should be added/removed. |
| **use\_cyberark\_authentication** boolean | **Choices:*** **no** ←
* yes
| Whether or not LDAP will be used. |
| **use\_ldap\_authentication** boolean | **Choices:*** **no** ←
* yes
| Whether or not LDAP will be used. |
| **use\_radius\_authentication** boolean | **Choices:*** **no** ←
* yes
| Whether or not users will be authenticated via a RADIUS server. Valid values are true/false. |
| **use\_windows\_authentication** boolean | **Choices:*** **no** ←
* yes
| Whether or not Windows will be used. |
| **username** string | | The name of the user who will logon to the Vault. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `false`, SSL certificates will not be validated. This should only set to `false` used on personally controlled sites using self-signed certificates. |
Examples
--------
```
- name: Logon - use_shared_logon_authentication
cyberark_authentication:
api_base_url: "{{ web_services_base_url }}"
use_shared_logon_authentication: yes
- name: Logon - Not use_shared_logon_authentication
cyberark_authentication:
api_base_url: "{{ web_services_base_url }}"
username: "{{ password_object.password }}"
password: "{{ password_object.passprops.username }}"
use_shared_logon_authentication: no
- name: Logoff from CyberArk Vault
cyberark_authentication:
state: absent
cyberark_session: "{{ cyberark_session }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **cyberark\_session** complex | success | Authentication facts. |
| | **api\_base\_url** string | always | Base URL for API calls. Returned in the cyberark\_session, so it can be used in subsequent calls. |
| | **token** string | always | The token that identifies the session, encoded in BASE 64. |
| | **use\_shared\_logon\_authentication** boolean | always | Whether or not Shared Logon Authentication was used to establish the session. |
| | **validate\_certs** boolean | always | Whether or not SSL certificates should be validated. |
### Authors
* Edward Nunez (@enunez-cyberark) CyberArk BizDev
* Cyberark Bizdev (@cyberark-bizdev)
* Edgar Mota
ansible Cyberark.Pas Cyberark.Pas
============
Collection version 1.0.7
Plugin Index
------------
These are the plugins in the cyberark.pas collection
### Modules
* [cyberark\_account](cyberark_account_module#ansible-collections-cyberark-pas-cyberark-account-module) – Module for CyberArk Account object creation, deletion, and modification using PAS Web Services SDK.
* [cyberark\_authentication](cyberark_authentication_module#ansible-collections-cyberark-pas-cyberark-authentication-module) – CyberArk Authentication using PAS Web Services SDK.
* [cyberark\_credential](cyberark_credential_module#ansible-collections-cyberark-pas-cyberark-credential-module) – Credential retrieval using AAM Central Credential Provider.
* [cyberark\_user](cyberark_user_module#ansible-collections-cyberark-pas-cyberark-user-module) – CyberArk User Management using PAS Web Services SDK.
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible cyberark.pas.cyberark_credential – Credential retrieval using AAM Central Credential Provider. cyberark.pas.cyberark\_credential – Credential retrieval using AAM Central Credential Provider.
===============================================================================================
Note
This plugin is part of the [cyberark.pas collection](https://galaxy.ansible.com/cyberark/pas) (version 1.0.7).
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 cyberark.pas`.
To use it in a playbook, specify: `cyberark.pas.cyberark_credential`.
New in version 2.4: of cyberark.pas
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates a URI for retrieving a credential from a password object stored in the Cyberark Vault. The request uses the Privileged Account Security Web Services SDK through the Central Credential Provider by requesting access with an Application ID.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_base\_url** string / required | | A string containing the base URL of the server hosting the Central Credential Provider. |
| **app\_id** string / required | | A string containing the Application ID authorized for retrieving the credential. |
| **client\_cert** string | | A string containing the file location and name of the client certificate used for authentication. |
| **client\_key** string | | A string containing the file location and name of the private key of the client certificate used for authentication. |
| **connection\_timeout** integer | **Default:**"30" | An integer value of the allowed time before the request returns failed. |
| **fail\_request\_on\_password\_change** boolean | **Choices:*** **no** ←
* yes
| A boolean parameter for completing the request in the middle of a password change of the requested credential. |
| **query** string / required | | A string containing details of the object being queried; Possible parameters could be Safe, Folder, Object (internal account name), UserName, Address, Database, PolicyID. |
| **query\_format** string | **Choices:*** **Exact** ←
* Regexp
| The format for which your Query will be received by the CCP. |
| **reason** string | | Reason for requesting credential if required by policy; It must be specified if the Policy managing the object requires it. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `false`, SSL certificate chain will not be validated. This should only set to `true` if you have a root CA certificate installed on each node. |
Examples
--------
```
tasks:
- name: credential retrieval basic
cyberark_credential:
api_base_url: "http://10.10.0.1"
app_id: "TestID"
query: "Safe=test;UserName=admin"
register: result
- name: credential retrieval advanced
cyberark_credential:
api_base_url: "https://components.cyberark.local"
validate_certs: yes
client_cert: /etc/pki/ca-trust/source/client.pem
client_key: /etc/pki/ca-trust/source/priv-key.pem
app_id: "TestID"
query: "Safe=test;UserName=admin"
connection_timeout: 60
query_format: Exact
fail_request_on_password_change: True
reason: "requesting credential for Ansible deployment"
register: result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Identify if the playbook run resulted in a change to the account in any way. |
| **failed** boolean | always | Whether playbook run resulted in a failure of any kind. |
| **result** complex | success | A json dump of the resulting action. |
| | **Address** string | if required | The target address of the credential being queried |
| | **Content** string | always | The password for the object being queried |
| | **CPMDisabled** string | if CPM management is disabled and a reason is given | A description of why this vaulted credential is not being managed by the CPM. |
| | **CreationMethod** string | always | This is how the object was created in the Vault |
| | **DeviceType** string | always | An internal File Category for more granular management of Platforms. |
| | **Folder** string | always | The folder within the Safe where the credential is stored. |
| | **LogonDomain** string | if populated | The Address friendly name resolved by the CPM |
| | **Name** string | always | The Cyberark unique object ID of the credential being queried. |
| | **PasswordChangeInProcess** boolean | always | If the password has a change flag placed by the CPM |
| | **PolicyID** string | if assigned to a policy | Whether or not SSL certificates should be validated. |
| | **Safe** string | always | The safe where the queried credential is stored |
| | **Username** string | if required | The username of the credential being queried |
| **status\_code** integer | success | Result HTTP Status code. **Sample:** 200, 201, -1, 204 |
### Authors
* Edward Nunez (@enunez-cyberark)
* CyberArk BizDev (@cyberark-bizdev)
* Erasmo Acosta (@erasmix)
* James Stutes (@JimmyJamCABD)
ansible cyberark.pas.cyberark_account – Module for CyberArk Account object creation, deletion, and modification using PAS Web Services SDK. cyberark.pas.cyberark\_account – Module for CyberArk Account object creation, deletion, and modification using PAS Web Services SDK.
====================================================================================================================================
Note
This plugin is part of the [cyberark.pas collection](https://galaxy.ansible.com/cyberark/pas) (version 1.0.7).
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 cyberark.pas`.
To use it in a playbook, specify: `cyberark.pas.cyberark_account`.
New in version 2.4: of cyberark.pas
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates a URI for adding, deleting, modifying a privileged credential within the Cyberark Vault. The request uses the Privileged Account Security Web Services SDK.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **address** string | | The address of the endpoint where the privileged account is located. |
| **api\_base\_url** string / required | | A string containing the base URL of the server hosting CyberArk's Privileged Account Security Web Services SDK. Example [https://<IIS\_Server\_Ip>/PasswordVault/api/](#)
|
| **cyberark\_session** dictionary / required | | Dictionary set by a CyberArk authentication containing the different values to perform actions on a logged-on CyberArk session, please see M(cyberark\_authentication) module for an example of cyberark\_session. |
| **identified\_by** string | **Default:**"username,address,platform\_id" | When an API call is made to Get Accounts, often times the default parameters passed will identify more than one account. This parameter is used to confidently identify a single account when the default query can return multiple results. |
| **logging\_file** string | **Default:**"/tmp/ansible\_cyberark.log" | Setting the log file name and location for troubleshooting logs. |
| **logging\_level** string / required | **Choices:*** NOTSET
* DEBUG
* INFO
| Parameter used to define the level of troubleshooting output to the `logging_file` value. |
| **name** string | | The ObjectID of the account |
| **new\_secret** string | | The new secret/password to be stored in CyberArk Vault. |
| **platform\_account\_properties** dictionary | | Object containing key-value pairs to associate with the account, as defined by the account platform. These properties are validated against the mandatory and optional properties of the specified platform's definition. Optional properties that do not exist on the account will not be returned here. Internal properties are not returned. |
| | **KEY** string | | Freeform key value associated to the mandatory or optional property assigned to the specified Platform's definition.
aliases: Port, ExtrPass1Name, database |
| **platform\_id** string | | The PolicyID of the Platform that is to be managing the account |
| **remote\_machines\_access** dictionary | | Set of parameters for defining PSM endpoint access targets. |
| | **access\_restricted\_to\_remote\_machines** boolean | **Choices:*** no
* yes
| Whether or not to restrict access only to specified remote machines. |
| | **remote\_machines** string | | List of targets allowed for this account. |
| **safe** string / required | | The safe in the Vault where the privileged account is to be located. |
| **secret** string | | The initial password for the creation of the account |
| **secret\_management** dictionary | | Set of parameters associated with the management of the credential. |
| | **automatic\_management\_enabled** boolean | **Choices:*** **no** ←
* yes
| Parameter that indicates whether the CPM will manage the password or not. |
| | **management\_action** string | **Choices:*** change
* change\_immediately
* reconcile
| CPM action flag to be placed on the account object for credential rotation. |
| | **manual\_management\_reason** string | | String value indicating why the CPM will NOT manage the password. |
| | **new\_secret** string | | The actual password value that will be assigned for the CPM action to be taken. |
| | **perform\_management\_action** string | **Choices:*** **always** ←
* on\_create
|
`always` will perform the management action in every action.
`on_create` will only perform the management action right after the account is created. |
| **secret\_type** string | **Choices:*** **password** ←
* key
| The value that identifies what type of account it will be. |
| **state** string / required | **Choices:*** **present** ←
* absent
| Assert the desired state of the account `present` to creat or update and account object. Set to `absent` for deletion of an account object. |
| **username** string | | The username associated with the account. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `false`, SSL certificate chain will not be validated. This should only set to `true` if you have a root CA certificate installed on each node. |
Examples
--------
```
collections:
- cyberark.pas
tasks:
- name: Logon to CyberArk Vault using PAS Web Services SDK
cyberark_authentication:
api_base_url: "http://components.cyberark.local"
validate_certs: no
username: "bizdev"
password: "Cyberark1"
- name: Creating an Account using the PAS WebServices SDK
cyberark_account:
logging_level: DEBUG
identified_by: "address,username"
safe: "Test"
address: "cyberark.local"
username: "administrator-x"
platform_id: WinServerLocal
secret: "@N&Ibl3!"
platform_account_properties:
LogonDomain: "cyberark"
OwnerName: "ansible_user"
secret_management:
automatic_management_enabled: true
state: present
cyberark_session: "{{ cyberark_session }}"
register: cyberarkaction
- name:
- Rotate credential via reconcile and providing the password to
bechanged to.
cyberark_account:
identified_by: "address,username"
safe: "Domain_Admins"
address: "prod.cyberark.local"
username: "admin"
platform_id: WinDomain
platform_account_properties:
LogonDomain: "PROD"
secret_management:
new_secret: "Ama123ah12@#!Xaamdjbdkl@#112"
management_action: "reconcile"
automatic_management_enabled: true
state: present
cyberark_session: "{{ cyberark_session }}"
register: reconcileaccount
- name: Logoff from CyberArk Vault
cyberark_authentication:
state: absent
cyberark_session: "{{ cyberark_session }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Identify if the playbook run resulted in a change to the account in any way. |
| **failed** boolean | always | Whether playbook run resulted in a failure of any kind. |
| **result** complex | success | A json dump of the resulting action. |
| | **address** string | successful addition and modification | The adress of the endpoint where the privileged account is located. **Sample:** dev.local |
| | **createdTime** integer | successful addition and modification | Timeframe calculation of the timestamp of account creation. **Sample:** 1567824520 |
| | **id** integer | successful addition and modification | Internal ObjectID for the account object identified **Sample:** 25\_21 |
| | **name** string | successful addition and modification | The external ObjectID of the account **Sample:** ['Operating System-WinServerLocal-cyberark.local-administrator'] |
| | **platformAccountProperties** complex | successful addition and modification | Object containing key-value pairs to associate with the account, as defined by the account platform. |
| | | **KEY VALUE** string | successful addition and modification | Object containing key-value pairs to associate with the account, as defined by the account platform. **Sample:** [{'LogonDomain': 'cyberark'}, {'Port': '22'}] |
| | **platformId** string | successful addition and modification | The PolicyID of the Platform that is to be managing the account. **Sample:** WinServerLocal |
| | **safeName** string | successful addition and modification | The safe in the Vault where the privileged account is to be located. **Sample:** Domain\_Admins |
| | **secretManagement** complex | successful addition and modification | Set of parameters associated with the management of the credential. **Sample:** {'automaticManagementEnabled': {'description': ['Parameter that indicates whether the CPM will manage the password or not.'], 'returned': 'successful addition and modification', 'type': 'bool'}, 'lastModifiedTime': {'description': ['Timeframe calculation of the timestamp of account modification.'], 'returned': 'successful addition and modification', 'sample': '1567824520', 'type': 'int'}, 'manualManagementReason': {'description': None, 'returned': 'if `automaticManagementEnabled` is set to false', 'sample': 'This is a static account', 'type': 'str'}} |
| | **secretType** list / elements=string | successful addition and modification | The value that identifies what type of account it will be **Sample:** ['key', 'password'] |
| | **userName** string | successful addition and modification | The username associated with the account **Sample:** administrator |
| **status\_code** integer | success | Result HTTP Status code. **Sample:** 200, 201, -1, 204 |
### Authors
* CyberArk BizDev (@cyberark-bizdev)
* Edward Nunez (@enunez-cyberark)
* James Stutes (@jimmyjamcabd)
| programming_docs |
ansible cyberark.pas.cyberark_user – CyberArk User Management using PAS Web Services SDK. cyberark.pas.cyberark\_user – CyberArk User Management using PAS Web Services SDK.
==================================================================================
Note
This plugin is part of the [cyberark.pas collection](https://galaxy.ansible.com/cyberark/pas) (version 1.0.7).
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 cyberark.pas`.
To use it in a playbook, specify: `cyberark.pas.cyberark_user`.
New in version 2.4: of cyberark.pas
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* CyberArk User Management using PAS Web Services SDK, It currently supports the following actions Get User Details, Add User, Update User, Delete User.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **change\_password\_on\_the\_next\_logon** boolean | **Choices:*** **no** ←
* yes
| Whether or not the user must change their password in their next logon. |
| **cyberark\_session** dictionary / required | | Dictionary set by a CyberArk authentication containing the different values to perform actions on a logged-on CyberArk session, please see M(cyberark\_authentication) module for an example of cyberark\_session. |
| **disabled** boolean | **Choices:*** **no** ←
* yes
| Whether or not the user will be disabled. |
| **email** string | | The user email address. |
| **expiry\_date** string | | The date and time when the user account will expire and become disabled. |
| **first\_name** string | | The user first name. |
| **group\_name** string | | The name of the group the user will be added to. |
| **initial\_password** string | | The password that the new user will use to log on the first time. This password must meet the password policy requirements. This parameter is required when state is present -- Add User. |
| **last\_name** string | | The user last name. |
| **location** string | | The Vault Location for the user. |
| **logging\_file** string | **Default:**"/tmp/ansible\_cyberark.log" | Setting the log file name and location for troubleshooting logs. |
| **logging\_level** string / required | **Choices:*** **NOTSET** ←
* DEBUG
* INFO
| Parameter used to define the level of troubleshooting output to the `logging_file` value. |
| **new\_password** string | | The user updated password. Make sure that this password meets the password policy requirements. |
| **state** string | **Choices:*** absent
* **present** ←
| Specifies the state needed for the user present for create user, absent for delete user. |
| **user\_type\_name** string | | The type of user. The parameter defaults to `EPVUser`. |
| **username** string / required | | The name of the user who will be queried (for details), added, updated or deleted. |
Examples
--------
```
- name: Logon to CyberArk Vault using PAS Web Services SDK
cyberark_authentication:
api_base_url: https://components.cyberark.local
use_shared_logon_authentication: yes
- name: Create user & immediately add it to a group
cyberark_user:
username: username
initial_password: password
user_type_name: EPVUser
change_password_on_the_next_logon: no
group_name: GroupOfUser
state: present
cyberark_session: '{{ cyberark_session }}'
- name: Make sure user is present and reset user credential if present
cyberark_user:
username: Username
new_password: password
disabled: no
state: present
cyberark_session: '{{ cyberark_session }}'
- name: Logoff from CyberArk Vault
cyberark_authentication:
state: absent
cyberark_session: '{{ cyberark_session }}'
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Whether there was a change done. |
| **cyberark\_user** complex | always | Dictionary containing result properties. |
| | **result** dictionary | success | user properties when state is present |
| **status\_code** integer | success | Result HTTP Status code **Sample:** 200 |
### Authors
* Edward Nunez (@enunez-cyberark)
* Cyberark Bizdev (@cyberark-bizdev)
* Erasmo Acosta (@erasmix)
* James Stutes (@jimmyjamcabd)
ansible Collections in the Azure Namespace Collections in the Azure Namespace
==================================
These are the collections with docs hosted on [docs.ansible.com](https://docs.ansible.com/) in the **azure** namespace.
* [azure.azcollection](azcollection/index#plugins-in-azure-azcollection)
ansible azure.azcollection.azure_rm_virtualmachinescaleset – Manage Azure virtual machine scale sets azure.azcollection.azure\_rm\_virtualmachinescaleset – Manage Azure virtual machine scale sets
==============================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualmachinescaleset`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create and update a virtual machine scale set.
* Note that this module was called M(azure\_rm\_virtualmachine\_scaleset) before Ansible 2.8. The usage did not change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **admin\_password** string | | Password for the admin username. Not required if the os\_type is Linux and SSH password authentication is disabled by setting *ssh\_password\_enabled=false*. |
| **admin\_username** string | | Admin username used to access the host after it is created. Required when creating a VM. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **application\_gateway** string | | Application gateway name. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **capacity** string | **Default:**1 | Capacity of VMSS. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **custom\_data** string | | Data which is made available to the virtual machine and used by e.g., `cloud-init`. Many images in the marketplace are not cloud-init ready. Thus, data sent to *custom\_data* would be ignored. If the image you are attempting to use is not listed in <https://docs.microsoft.com/en-us/azure/virtual-machines/linux/using-cloud-init#cloud-init-overview>, follow these steps <https://docs.microsoft.com/en-us/azure/virtual-machines/linux/cloudinit-prepare-custom-image>. |
| **data\_disks** string | | Describes list of data disks. |
| | **caching** string | **Choices:*** **ReadOnly** ←
* ReadWrite
| Type of data disk caching. |
| | **disk\_size\_gb** string | | The initial disk size in GB for blank data disks. |
| | **lun** string | **Default:**0 | The logical unit number for data disk. |
| | **managed\_disk\_type** string | **Choices:*** Standard\_LRS
* Premium\_LRS
| Managed data disk type. |
| **enable\_accelerated\_networking** boolean | **Choices:*** no
* yes
| Indicates whether user wants to allow accelerated networking for virtual machines in scaleset being created. |
| **ephemeral\_os\_disk** boolean | **Choices:*** no
* yes
| Parameters of ephemeral disk settings that can be specified for operating system disk. Ephemeral OS disk is only supported for VMS Instances using Managed Disk. |
| **eviction\_policy** string | **Choices:*** Deallocate
* Delete
| Specifies the eviction policy for the Azure Spot virtual machine. Requires priority to be set to Spot. |
| **image** string / required | | Specifies the image used to build the VM. If a string, the image is sourced from a custom image based on the name. If a dict with the keys *publisher*, *offer*, *sku*, and *version*, the image is sourced from a Marketplace image. Note that set *version=latest* to get the most recent version of a given image. If a dict with the keys *name* and *resource\_group*, the image is sourced from a custom image based on the *name* and *resource\_group* set. Note that the key *resource\_group* is optional and if omitted, all images in the subscription will be searched for by *name*. Custom image support was added in Ansible 2.5. |
| **load\_balancer** string | | Load balancer name. |
| **location** string | | Valid Azure location. Defaults to location of the resource group. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **managed\_disk\_type** string | **Choices:*** Standard\_LRS
* Premium\_LRS
| Managed disk type. |
| **max\_price** string | **Default:**-1 | Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars.
`-1` indicates default price to be up-to on-demand. Requires priority to be set to Spot. |
| **name** string / required | | Name of the virtual machine. |
| **os\_disk\_caching** string | **Choices:*** **ReadOnly** ←
* ReadWrite
| Type of OS disk caching.
aliases: disk\_caching |
| **os\_type** string | **Choices:*** Windows
* **Linux** ←
| Base type of operating system. |
| **overprovision** boolean | **Choices:*** no
* **yes** ←
| Specifies whether the Virtual Machine Scale Set should be overprovisioned. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **plan** dictionary | | Third-party billing plan for the VM. |
| | **name** string / required | | Billing plan name. |
| | **product** string / required | | Product name. |
| | **promotion\_code** string | | Optional promotion code. |
| | **publisher** string / required | | Publisher offering the plan. |
| **priority** string | **Choices:*** None
* Spot
| Priority of the VMSS.
`None` is the equivalent of Regular VM. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **public\_ip\_per\_vm** boolean | **Choices:*** **no** ←
* yes
| Assign a public IP to each virtual machine of the scale set |
| **remove\_on\_absent** string | **Default:**["all"] | When removing a VM using *state=absent*, also remove associated resources. It can be `all` or a list with any of the following ['network\_interfaces', 'virtual\_storage', 'public\_ips']. Any other input will be ignored. |
| **resource\_group** string / required | | Name of the resource group containing the virtual machine scale set. |
| **scale\_in\_policy** string | **Choices:*** Default
* NewestVM
* OldestVM
| define the order in which vmss instances are scaled-in |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **security\_group** string | | Existing security group with which to associate the subnet. It can be the security group name which is in the same resource group. It can be the resource ID. It can be a dict which contains *name* and *resource\_group* of the security group.
aliases: security\_group\_name |
| **short\_hostname** string | | Short host name. |
| **single\_placement\_group** boolean | **Choices:*** no
* **yes** ←
| When true this limits the scale set to a single placement group, of max size 100 virtual machines. |
| **ssh\_password\_enabled** boolean | **Choices:*** no
* **yes** ←
| When the os\_type is Linux, setting *ssh\_password\_enabled=false* will disable SSH password authentication and require use of SSH keys. |
| **ssh\_public\_keys** string | | For *os\_type=Linux* provide a list of SSH keys. Each item in the list should be a dictionary where the dictionary contains two keys, `path` and `key_data`. Set the `path` to the default location of the authorized\_keys files. On an Enterprise Linux host, for example, the *path=/home/<admin username>/.ssh/authorized\_keys*. Set `key_data` to the actual value of the public key. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the virtual machine scale set. State `present` will check that the machine exists with the requested configuration. If the configuration of the existing machine does not match, the machine will be updated. State `absent` will remove the virtual machine scale set. |
| **subnet\_name** string | | Subnet name.
aliases: subnet |
| **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. |
| **terminate\_event\_timeout\_minutes** string | | timeout time for termination notification event in range between 5 and 15 |
| **tier** string | **Choices:*** Basic
* Standard
| SKU Tier. |
| **upgrade\_policy** string | **Choices:*** Manual
* Automatic
| Upgrade policy. Required when creating the Azure virtual machine scale sets. |
| **virtual\_network\_name** string | | Virtual Network name.
aliases: virtual\_network |
| **virtual\_network\_resource\_group** string | | When creating a virtual machine, if a specific virtual network from another resource group should be used. Use this parameter to specify the resource group to use. |
| **vm\_size** string | | A valid Azure VM size value. For example, `Standard_D4`. The list of choices varies depending on the subscription and location. Check your subscription for available choices. |
| **zones** list / elements=string | | A list of Availability Zones for your virtual machine scale set. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create VMSS
azure_rm_virtualmachinescaleset:
resource_group: myResourceGroup
name: testvmss
vm_size: Standard_DS1_v2
capacity: 2
virtual_network_name: testvnet
upgrade_policy: Manual
subnet_name: testsubnet
terminate_event_timeout_minutes: 10
scale_in_policy: NewestVM
admin_username: "{{ username }}"
ssh_password_enabled: false
ssh_public_keys:
- path: /home/adminUser/.ssh/authorized_keys
key_data: < insert yor ssh public key here... >
managed_disk_type: Standard_LRS
image:
offer: CoreOS
publisher: CoreOS
sku: Stable
version: latest
data_disks:
- lun: 0
disk_size_gb: 64
caching: ReadWrite
managed_disk_type: Standard_LRS
- name: Create VMSS with an image that requires plan information
azure_rm_virtualmachinescaleset:
resource_group: myResourceGroup
name: testvmss
vm_size: Standard_DS1_v2
capacity: 3
virtual_network_name: testvnet
upgrade_policy: Manual
subnet_name: testsubnet
admin_username: "{{ username }}"
ssh_password_enabled: false
ssh_public_keys:
- path: /home/adminUser/.ssh/authorized_keys
key_data: < insert yor ssh public key here... >
managed_disk_type: Standard_LRS
image:
offer: cis-ubuntu-linux-1804-l1
publisher: center-for-internet-security-inc
sku: Stable
version: latest
plan:
name: cis-ubuntu-linux-1804-l1
product: cis-ubuntu-linux-1804-l1
publisher: center-for-internet-security-inc
data_disks:
- lun: 0
disk_size_gb: 64
caching: ReadWrite
managed_disk_type: Standard_LRS
- name: Create a VMSS with a custom image
azure_rm_virtualmachinescaleset:
resource_group: myResourceGroup
name: testvmss
vm_size: Standard_DS1_v2
capacity: 2
virtual_network_name: testvnet
upgrade_policy: Manual
subnet_name: testsubnet
admin_username: "{{ username }}"
admin_password: "{{ password }}"
managed_disk_type: Standard_LRS
image: customimage001
- name: Create a VMSS with over 100 instances
azure_rm_virtualmachinescaleset:
resource_group: myResourceGroup
name: testvmss
vm_size: Standard_DS1_v2
capacity: 120
single_placement_group: False
virtual_network_name: testvnet
upgrade_policy: Manual
subnet_name: testsubnet
admin_username: "{{ username }}"
admin_password: "{{ password }}"
managed_disk_type: Standard_LRS
image: customimage001
- name: Create a VMSS with a custom image from a particular resource group
azure_rm_virtualmachinescaleset:
resource_group: myResourceGroup
name: testvmss
vm_size: Standard_DS1_v2
capacity: 2
virtual_network_name: testvnet
upgrade_policy: Manual
subnet_name: testsubnet
admin_username: "{{ username }}"
admin_password: "{{ password }}"
managed_disk_type: Standard_LRS
image:
name: customimage001
resource_group: myResourceGroup
- name: Create a VMSS with Spot Instance
azure_rm_virtualmachinescaleset:
resource_group: myResourceGroup
name: testvmss
vm_size: Standard_DS1_v2
capacity: 5
priority: Spot
eviction_policy: Deallocate
virtual_network_name: testvnet
upgrade_policy: Manual
subnet_name: testsubnet
admin_username: "{{ username }}"
admin_password: "{{ password }}"
managed_disk_type: Standard_LRS
image: customimage001
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_vmss** dictionary | always | Facts about the current state of the object. Note that facts are not part of the registered output but available directly. **Sample:** {'properties': {'overprovision': True, 'scaleInPolicy': {'rules': ['NewestVM']}, 'singlePlacementGroup': True, 'upgradePolicy': {'mode': 'Manual'}, 'virtualMachineProfile': {'networkProfile': {'networkInterfaceConfigurations': [{'name': 'testvmss', 'properties': {'dnsSettings': {'dnsServers': []}, 'enableAcceleratedNetworking': False, 'ipConfigurations': [{'name': 'default', 'properties': {'privateIPAddressVersion': 'IPv4', 'subnet': {'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet'}}}], 'primary': True}}]}, 'osProfile': {'adminUsername': 'testuser', 'computerNamePrefix': 'testvmss', 'linuxConfiguration': {'disablePasswordAuthentication': True, 'ssh': {'publicKeys': [{'keyData': '', 'path': '/home/testuser/.ssh/authorized\_keys'}]}}, 'secrets': []}, 'scheduledEventsProfile': {'terminateNotificationProfile': {'enable': True, 'notBeforeTimeout': 'PT10M'}}, 'storageProfile': {'dataDisks': [{'caching': 'ReadWrite', 'createOption': 'empty', 'diskSizeGB': 64, 'lun': 0, 'managedDisk': {'storageAccountType': 'Standard\_LRS'}}], 'imageReference': {'offer': 'CoreOS', 'publisher': 'CoreOS', 'sku': 'Stable', 'version': '899.17.0'}, 'osDisk': {'caching': 'ReadWrite', 'createOption': 'fromImage', 'managedDisk': {'storageAccountType': 'Standard\_LRS'}}}}}, 'sku': {'capacity': 2, 'name': 'Standard\_DS1\_v2', 'tier': 'Standard'}, 'tags': None, 'type': 'Microsoft.Compute/virtualMachineScaleSets'} |
### Authors
* Sertac Ozercan (@sozercan)
| programming_docs |
ansible azure.azcollection.azure_rm_image_info – Get facts about azure custom images azure.azcollection.azure\_rm\_image\_info – Get facts about azure custom images
===============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_image_info`.
New in version 0.0.1: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* List azure custom images. The images can be listed where scope of listing can be based on subscription, resource group, name or tags.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Name of the image to filter from existing images. |
| **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 | | Name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | List of tags to be matched. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: List images with name
azure_rm_image_info:
name: test-image
resource_group: myResourceGroup
- name: List images by resource group
azure_rm_image_info:
resource_group: myResourceGroup
tags:
- testing
- foo:bar
- name: List all available images under current subscription
azure_rm_image_info:
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **images** complex | always | List of image dicts. |
| | **data\_disks** complex | always | List of data disks associated with the image. |
| | | **blob\_uri** string | success | The virtual hard disk. |
| | | **caching** string | success | Type of caching of data disk. **Sample:** read\_only |
| | | **disk\_size\_gb** integer | always | Specifies the size of empty data disks in gigabytes. **Sample:** 50 |
| | | **lun** integer | always | Specifies the logical unit number of the data disk. |
| | | **managed\_disk\_id** string | success | Id of managed disk. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/xx |
| | | **storage\_account\_type** string | success | Specifies the storage account type for the managed disk data disk. **Sample:** Standard\_LRS |
| | **id** string | always | Id of the image. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/xx |
| | **location** string | always | Location of the image. |
| | **name** string | always | Name of the image. |
| | **os\_disk** string | success | Id of os disk for image. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/xx |
| | **os\_disk\_caching** string | always | Specifies caching requirements for the image. |
| | **os\_state** string | always | Specifies image operating system state. Possible values are `Generalized` or `Specialized`. **Sample:** Generalized |
| | **os\_storage\_account\_type** string | success | Specifies the storage account type for the managed disk. **Sample:** Standard\_LRS |
| | **os\_type** string | always | Type of OS for image. **Sample:** Linux |
| | **provisioning\_state** string | always | State of image. **Sample:** Succeeded |
| | **resource\_group** string | always | Resource group of the image. **Sample:** myResourceGroup |
| | **source** string | success | Resource id of source VM from which the image is created. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/xx |
| | **tags** complex | success | Dictionary of tags associated with the image. |
### Authors
* Madhura Naniwadekar (@Madhura-CSI)
ansible azure.azcollection.azure_rm_virtualnetworkgateway – Manage Azure virtual network gateways azure.azcollection.azure\_rm\_virtualnetworkgateway – Manage Azure virtual network gateways
===========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualnetworkgateway`.
New in version 0.0.1: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete a virtual network gateway(VPN Gateway).
* When creating a VPN Gateway you must provide the name of an existing virtual network.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **bgp\_settings** string | | Virtual network gateway's BGP speaker settings. |
| | **asn** string / required | | The BGP speaker's ASN. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **enable\_bgp** string | **Default:**"no" | Whether BGP is enabled for this virtual network gateway or not. |
| **gateway\_type** string | **Choices:*** **vpn** ←
* express\_route
| The type of this virtual network gateway. |
| **ip\_configurations** string | | List of IP configurations. |
| | **name** string / required | | Name of the IP configuration. |
| | **private\_ip\_allocation\_method** string | **Choices:*** **dynamic** ←
* static
| Private IP allocation method. |
| | **public\_ip\_address\_name** string | | Name of the public IP address. Use 'None' to disable the public IP address. |
| | **subnet** string | **Default:**"GatewaySubnet" | ID of the gateway subnet for VPN. |
| **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 VPN Gateway. |
| **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 / required | | Name of a resource group where VPN Gateway exists or will be created. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | **Choices:*** **VpnGw1** ←
* VpnGw2
* VpnGw3
* Standard
* Basic
* HighPerformance
| The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the VPN Gateway. Use `present` to create or update VPN gateway and `absent` to delete VPN gateway. |
| **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. |
| **virtual\_network** string / required | | An existing virtual network with which the VPN Gateway will be associated. Required when creating a VPN Gateway. Can be the name of the virtual network. Must be in the same resource group as VPN gateway when specified by name. Can be the resource ID of the virtual network. Can be a dict which contains *name* and *resource\_group* of the virtual network.
aliases: virtual\_network\_name |
| **vpn\_type** string | **Choices:*** **route\_based** ←
* policy\_based
| The type of this virtual private network. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create virtual network gateway without bgp settings
azure_rm_virtualnetworkgateway:
resource_group: myResourceGroup
name: myVirtualNetworkGateway
ip_configurations:
- name: testipconfig
private_ip_allocation_method: Dynamic
public_ip_address_name: testipaddr
virtual_network: myVirtualNetwork
tags:
common: "xyz"
- name: Create virtual network gateway with bgp
azure_rm_virtualnetworkgateway:
resource_group: myResourceGroup
name: myVirtualNetworkGateway
sku: vpn_gw1
ip_configurations:
- name: testipconfig
private_ip_allocation_method: Dynamic
public_ip_address_name: testipaddr
enable_bgp: yes
virtual_network: myVirtualNetwork
bgp_settings:
asn: 65515
bgp_peering_address: "169.254.54.209"
tags:
common: "xyz"
- name: Delete instance of virtual network gateway
azure_rm_virtualnetworkgateway:
resource_group: myResourceGroup
name: myVirtualNetworkGateway
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Virtual Network Gateway resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworkGateways/myV irtualNetworkGateway |
### Authors
* Madhura Naniwadekar (@Madhura-CSI)
| programming_docs |
ansible azure.azcollection.azure_rm_containerregistrywebhook_info – Get Webhook facts. azure.azcollection.azure\_rm\_containerregistrywebhook\_info – Get Webhook facts.
=================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_containerregistrywebhook_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
Synopsis
--------
* Get facts of Webhook.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **registry\_name** string / required | | The name of the container registry. |
| **resource\_group** string / required | | The name of the resource group to which the container registry belongs. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **webhook\_name** string / required | | The name of the webhook. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of Webhook
azure_rm_containerregistrywebhook_info:
resource_group: resource_group_name
registry_name: registry_name
webhook_name: webhook_name
```
### Authors
* Zim Kalinowski (@zikalino)
There were some errors parsing the documentation for this plugin. Please file a bug with the collection.
The errors were:
* ```
Unable to normalize azure_rm_containerregistrywebhook_info: return due to: 1 validation error for PluginReturnSchema
return -> webhooks -> contains -> webhook_name -> contains -> scope -> returned
none is not an allowed value (type=type_error.none.not_allowed)
```
ansible azure.azcollection.azure_rm_virtualnetwork – Manage Azure virtual networks azure.azcollection.azure\_rm\_virtualnetwork – Manage Azure virtual networks
============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualnetwork`.
New in version 0.1.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete a virtual networks. Allows setting and updating the available IPv4 address ranges and setting custom DNS servers. Use the M(azure\_rm\_subnet) module to associate subnets with a virtual network.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **ad\_user** string | | Active Directory username. Use when authenticating with an Active Directory user rather than service principal. |
| **address\_prefixes\_cidr** string | | List of IPv4 address ranges where each is formatted using CIDR notation. Required when creating a new virtual network or using *purge\_address\_prefixes*.
aliases: address\_prefixes |
| **adfs\_authority\_url** string added in 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **dns\_servers** string | | Custom list of DNS servers. Maximum length of two. The first server in the list will be treated as the Primary server. This is an explicit list. Existing DNS servers will be replaced with the specified list. Use the *purge\_dns\_servers* option to remove all custom DNS servers and revert to default Azure servers. |
| **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 virtual network. |
| **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. |
| **purge\_address\_prefixes** boolean | **Choices:*** **no** ←
* yes
| Use with *state=present* to remove any existing *address\_prefixes*.
aliases: purge |
| **purge\_dns\_servers** boolean | **Choices:*** **no** ←
* yes
| Use with *state=present* to remove existing DNS servers, reverting to default Azure servers. Mutually exclusive with DNS servers. |
| **resource\_group** string / required | | Name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the virtual network. Use `present` to create or update and `absent` to delete. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a virtual network
azure_rm_virtualnetwork:
resource_group: myResourceGroup
name: myVirtualNetwork
address_prefixes_cidr:
- "10.1.0.0/16"
- "172.100.0.0/16"
dns_servers:
- "127.0.0.1"
- "127.0.0.2"
tags:
testing: testing
delete: on-exit
- name: Delete a virtual network
azure_rm_virtualnetwork:
resource_group: myResourceGroup
name: myVirtualNetwork
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | always | Current state of the virtual network. |
| | **address\_prefixes** list / elements=string | always | The virtual network IPv4 address ranges. **Sample:** ['10.1.0.0/16', '172.100.0.0/16'] |
| | **dns\_servers** list / elements=string | always | DNS servers. **Sample:** ['127.0.0.1', '127.0.0.3'] |
| | **etag** string | always | A unique read-only string that changes whenever the resource is update. **Sample:** W/"0712e87c-f02f-4bb3-8b9e-2da0390a3886" |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/ Microsoft.Network/virtualNetworks/myVirtualNetwork |
| | **location** string | always | The Geo-location where the resource lives. **Sample:** eastus |
| | **name** string | always | Resource name. **Sample:** my\_test\_network |
| | **provisioning\_state** string | always | Provisioning state of the virtual network. **Sample:** Succeeded |
| | **tags** dictionary | always | Resource tags, such as { 'tags1':'value1' }. **Sample:** {'key1': 'value1'} |
| | **type** string | always | Resource type. **Sample:** Microsoft.Network/virtualNetworks |
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
ansible azure.azcollection.azure_rm_dnszone – Manage Azure DNS zones azure.azcollection.azure\_rm\_dnszone – Manage Azure DNS zones
==============================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_dnszone`.
New in version 0.1.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates and deletes Azure DNS zones.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the DNS zone. |
| **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. |
| **registration\_virtual\_networks** list / elements=string | | A list of references to virtual networks that register hostnames in this DNS zone. This is a only when *type=private*. Each element can be the name or resource id, or a dict contains `name`, `resource_group` information of the virtual network. |
| **resolution\_virtual\_networks** list / elements=string | | A list of references to virtual networks that resolve records in this DNS zone. This is a only when *type=private*. Each element can be the name or resource id, or a dict contains `name`, `resource_group` information of the virtual network. |
| **resource\_group** string / required | | name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the zone. Use `present` to create or update and `absent` to delete. |
| **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. |
| **type** string | **Choices:*** public
* private
| The type of this DNS zone (`public` or `private`). |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a DNS zone
azure_rm_dnszone:
resource_group: myResourceGroup
name: example.com
- name: Delete a DNS zone
azure_rm_dnszone:
resource_group: myResourceGroup
name: example.com
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** dictionary | always | Current state of the zone. **Sample:** {'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup', 'location': 'global', 'name': 'Testing', 'name\_servers': ['ns1-07.azure-dns.com.', 'ns2-07.azure-dns.net.', 'ns3-07.azure-dns.org.', 'ns4-07.azure-dns.info.'], 'number\_of\_record\_sets': 2, 'resolution\_virtual\_networks': ['/subscriptions/XXXX/resourceGroup/myResourceGroup/providers/Microsoft.Network/virtualNetworks/foo'], 'type': 'private'} |
### Authors
* Obezimnaka Boms (@ozboms)
| programming_docs |
ansible azure.azcollection.azure_rm_backupazurevm_info – Back up an Azure Virtual Machine using Azure Backup Information azure.azcollection.azure\_rm\_backupazurevm\_info – Back up an Azure Virtual Machine using Azure Backup Information
===================================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_backupazurevm_info`.
New in version 1.1.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get Recovery point details for protected items.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **recovery\_vault\_name** string / required | | The name of the Azure Recovery Service Vault. |
| **resource\_group** string / required | | The name of the resource group. |
| **resource\_id** string / required | | Azure Virtual Machine Resource ID. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get Recovery Point Details
azure_rm_backupazurevm_info:
resource_group: 'myResourceGroup'
recovery_vault_name: 'testVault'
resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM'
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | VM Protection details. **Sample:** {"response":{"id":"protection\_id","name":"protection\_item\_name","properties":{}}} |
### Authors
* Suyeb Ansari (@suyeb786)
* Pallavi Chaudhari (@PallaviC2510)
ansible azure.azcollection.azure_rm_webappslot – Manage Azure Web App slot azure.azcollection.azure\_rm\_webappslot – Manage Azure Web App slot
====================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_webappslot`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete Azure Web App slot.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **app\_settings** string | | Configure web app slot application settings. Suboptions are in key value pair format. |
| **app\_state** string | **Choices:*** **started** ←
* stopped
* restarted
| Start/Stop/Restart the slot. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **auto\_swap\_slot\_name** string | | Used to configure target slot name to auto swap, or disable auto swap. Set it target slot name to auto swap. Set it to False to disable auto slot swap. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **configuration\_source** string | | Source slot to clone configurations from when creating slot. Use webapp's name to refer to the production slot. |
| **container\_settings** string | | Web app slot container settings. |
| | **name** string | | Name of container, for example `imagename:tag`. |
| | **registry\_server\_password** string | | The container registry server password. |
| | **registry\_server\_url** string | | Container registry server URL, for example `mydockerregistry.io`. |
| | **registry\_server\_user** string | | The container registry server user name. |
| **deployment\_source** string | | Deployment source for git. |
| | **branch** string | | The branch name of the repository. |
| | **url** string | | Repository URL of deployment source. |
| **frameworks** string | | Set of run time framework settings. Each setting is a dictionary. See <https://docs.microsoft.com/en-us/azure/app-service/app-service-web-overview> for more info. |
| | **name** string | **Choices:*** java
* net\_framework
* php
* python
* ruby
* dotnetcore
* node
| Name of the framework. Supported framework list for Windows web app and Linux web app is different. Windows web apps support `java`, `net_framework`, `php`, `python`, and `node` from June 2018. Windows web apps support multiple framework at same time. Linux web apps support `java`, `ruby`, `php`, `dotnetcore`, and `node` from June 2018. Linux web apps support only one framework. Java framework is mutually exclusive with others. |
| | **settings** string | | List of settings of the framework. |
| | | **java\_container** string | | Name of Java container. This is supported by specific framework `java` onlys, for example `Tomcat`, `Jetty`. |
| | | **java\_container\_version** string | | Version of Java container. This is supported by specific framework `java` only. For `Tomcat`, for example `8.0`, `8.5`, `9.0`. For `Jetty`, for example `9.1`, `9.3`. |
| | **version** string | | Version of the framework. For Linux web app supported value, see <https://aka.ms/linux-stacks> for more info.
`net_framework` supported value sample, `v4.0` for .NET 4.6 and `v3.0` for .NET 3.5.
`php` supported value sample, `5.5`, `5.6`, `7.0`.
`python` supported value sample, `5.5`, `5.6`, `7.0`.
`node` supported value sample, `6.6`, `6.9`.
`dotnetcore` supported value sample, `1.0`, `1.1`, `1.2`.
`ruby` supported value sample, 2.3.
`java` supported value sample, `1.9` for Windows web app. `1.8` for Linux web app. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Unique name of the deployment slot to create or update. |
| **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. |
| **purge\_app\_settings** boolean | **Choices:*** **no** ←
* yes
| Purge any existing application settings. Replace slot application settings with app\_settings. |
| **resource\_group** string / required | | Name of the resource group to which the resource belongs. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **startup\_file** string | | The slot startup file. This only applies for Linux web app slot. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the Web App deployment slot. Use `present` to create or update a slot and `absent` to delete it. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **swap** string | | Swap deployment slots of a web app. |
| | **action** string | **Choices:*** **preview** ←
* swap
* reset
| Swap types.
`preview` is to apply target slot settings on source slot first.
`swap` is to complete swapping.
`reset` is to reset the swap. |
| | **preserve\_vnet** boolean | **Choices:*** no
* **yes** ←
|
`True` to preserve virtual network to the slot during swap. Otherwise `False`. |
| | **target\_slot** string | | Name of target slot to swap. If set to None, then swap with production slot. |
| **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. |
| **webapp\_name** string / required | | Web app name which this deployment slot belongs to. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a webapp slot
azure_rm_webappslot:
resource_group: myResourceGroup
webapp_name: myJavaWebApp
name: stage
configuration_source: myJavaWebApp
app_settings:
testkey: testvalue
- name: swap the slot with production slot
azure_rm_webappslot:
resource_group: myResourceGroup
webapp_name: myJavaWebApp
name: stage
swap:
action: swap
- name: stop the slot
azure_rm_webappslot:
resource_group: myResourceGroup
webapp_name: myJavaWebApp
name: stage
app_state: stopped
- name: udpate a webapp slot app settings
azure_rm_webappslot:
resource_group: myResourceGroup
webapp_name: myJavaWebApp
name: stage
app_settings:
testkey: testvalue2
- name: udpate a webapp slot frameworks
azure_rm_webappslot:
resource_group: myResourceGroup
webapp_name: myJavaWebApp
name: stage
frameworks:
- name: "node"
version: "10.1"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | ID of current slot. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/testapp/slots/stage1 |
### Authors
* Yunge Zhu(@yungezz)
| programming_docs |
ansible azure.azcollection.azure_rm_registrationdefinition – Manage Azure RegistrationDefinition instance azure.azcollection.azure\_rm\_registrationdefinition – Manage Azure RegistrationDefinition instance
===================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_registrationdefinition`.
New in version 1.3.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure RegistrationDefinition.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **plan** dictionary | | Plan details for the managed services. |
| | **name** string / required | | The plan name. |
| | **product** string / required | | The product code. |
| | **publisher** string / required | | The publisher ID. |
| | **version** string / required | | The plan's version. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **properties** dictionary | | Properties of a registration definition. |
| | **authorizations** list / elements=string / required | | Authorization tuple containing principal ID of the user/security group or service principal and ID of the build-in role. |
| | | **principal\_id** string / required | | Principal ID of the security group/service principal/user that would be assigned permissions to the projected subscription. |
| | | **role\_definition\_id** string / required | | The role definition identifier. This role will define all the permissions that the security group/service principal/user must have on the projected subscription. This role cannot be an owner role. |
| | **description** string | | Description of the registration definition. |
| | **managed\_by\_tenant\_id** string / required | | ID of the managedBy tenant. |
| | **registration\_definition\_name** string | | Name of the registration definition. |
| **registration\_definition\_id** string | | ID of the registration definition. If is not specified, an UUID will be generated for it. |
| **scope** string | | The subscription ID defines the subscription in which the registration definition will be created. If not specified, will use the subscription derived from AzureRMAuth. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the RegistrationDefinition. Use `present` to create or update an RegistrationDefinition and `absent` to delete it. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create Registration Definition without scope
azure_rm_registrationdefinition:
registration_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
properties:
description: test
authorizations:
- principal_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
role_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
managed_by_tenant_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
registration_definition_name: def4
- name: Create Registration Definition with scope
azure_rm_registrationdefinition:
scope: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
registration_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
properties:
description: test
authorizations:
- principal_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
role_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
managed_by_tenant_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
registration_definition_name: def5
- name: Delete Registration Definition
azure_rm_registrationdefinition:
registration_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | always | The state info of the registration assignment. |
| | **id** string | always | Fully qualified path of the registration definition. |
| | **name** string | always | Name of the registration definition. **Sample:** /subscriptions/xxx-xxx/providers/Microsoft.ManagedServices/registrationDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | **plan** complex | always | Plan details for the managed services. |
| | | **name** string | always | The plan name. |
| | | **product** string | always | The product code. |
| | | **publisher** string | always | The publisher ID. |
| | | **version** string | always | The plan's version. |
| | **properties** complex | always | Properties of a registration definition. |
| | | **authorizations** complex | always | Authorization tuple containing principal ID of the user/security group or service principal and ID of the build-in role. |
| | | | **principal\_id** string | always | Principal ID of the security group/service principal/user that would be assigned permissions to the projected subscription **Sample:** 99e3227f-8701-4099-869f-bc3efc7f1e64 |
| | | | **role\_definition\_id** string | always | The role definition identifier. This role will define all the permissions that the security group/service principal/user must have on the subscription. This role cannot be an owner role. **Sample:** b24988ac-6180-42a0-ab88-20f7382dd24c |
| | | **description** string | always | Description of the registration definition. **Sample:** test |
| | | **managed\_by\_tenant\_id** string | always | ID of the managedBy tenant. |
| | | **registration\_definition\_name** string | always | Name of the registration definition. |
| | **type** string | always | Type of the resource. **Sample:** Microsoft.ManagedServices/registrationDefinitions |
### Authors
* Fred-Sun (@Fred-Sun)
ansible azure.azcollection.azure_rm_mariadbdatabase – Manage MariaDB Database instance azure.azcollection.azure\_rm\_mariadbdatabase – Manage MariaDB Database instance
================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_mariadbdatabase`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of MariaDB Database.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **charset** string | | The charset of the database. Check MariaDB documentation for possible values. This is only set on creation, use *force\_update* to recreate a database if the values don't match. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **collation** string | | The collation of the database. Check MariaDB documentation for possible values. This is only set on creation, use *force\_update* to recreate a database if the values don't match. |
| **force\_update** boolean | **Choices:*** **no** ←
* yes
| When set to `true`, will delete and recreate the existing MariaDB database if any of the properties don't match what is set. When set to `false`, no change will occur to the database even if any of the properties do not match. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the database. |
| **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 / required | | The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string / required | | The name of the server. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the MariaDB Database. Use `present` to create or update a database and `absent` to delete it. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) MariaDB Database
azure_rm_mariadbdatabase:
resource_group: myResourceGroup
server_name: testserver
name: db1
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DBforMariaDB/servers/testserver/databases/db1 |
| **name** string | always | Resource name. **Sample:** db1 |
### Authors
* Zim Kalinowski (@zikalino)
* Matti Ranta (@techknowlogick)
| programming_docs |
ansible azure.azcollection.azure_rm_adgroup_info – Get Azure Active Directory group info azure.azcollection.azure\_rm\_adgroup\_info – Get Azure Active Directory group info
===================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_adgroup_info`.
New in version 1.6.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get Azure Active Directory group info.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **all** boolean | **Choices:*** **no** ←
* yes
| If True, will return all groups in tenant. If False will return no users. It is recommended that you instead identify a subset of groups and use filter. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **attribute\_name** string | | The name of an attribute that you want to match to attribute\_value. If attribute\_name is not a collection type it will return groups where attribute\_name is equal to attribute\_value. If attribute\_name is a collection type it will return groups where attribute\_value is in attribute\_name. |
| **attribute\_value** string | | The value to match attribute\_name to. If attribute\_name is not a collection type it will return groups where attribute\_name is equal to attribute\_value. If attribute\_name is a collection type it will groups users where attribute\_value is in attribute\_name. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **check\_membership** string | | The object ID of the contact, group, user, or service principal to check for membership against returned groups. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **object\_id** string | | The object id for the ad group. returns the group which has this object ID. |
| **odata\_filter** string | | returns groups based on the the OData filter passed into this parameter. |
| **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. |
| **return\_group\_members** boolean | **Choices:*** **no** ←
* yes
| Indicate whether the members of a group should be returned with the returned groups. |
| **return\_member\_groups** boolean | **Choices:*** **no** ←
* yes
| Indicate whether the groups in which a groups is a member should be returned with the returned groups. |
| **return\_owners** boolean | **Choices:*** **no** ←
* yes
| Indicate whether the owners of a group should be returned with the returned groups. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string / required | | The tenant ID. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Return a specific group using object_id
azure_rm_adgroup_info:
object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- name: Return a specific group using object_id and return the owners of the group
azure_rm_adgroup_info:
object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
return_owners: True
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- name: Return a specific group using object_id and return the owners and members of the group
azure_rm_adgroup_info:
object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
return_owners: True
return_group_members: True
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- name: Return a specific group using object_id and return the groups the group is a member of
azure_rm_adgroup_info:
object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
return_member_groups: True
tenant: "{{ tenant_id }}"
- name: Return a specific group using object_id and check an ID for membership
azure_rm_adgroup_info:
object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
check_membership: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- name: Return a specific group using displayName for attribute_name
azure_rm_adgroup_info:
attribute_name: "displayName"
attribute_value: "Display-Name-Of-AD-Group"
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- name: Return groups matching odata_filter
azure_rm_adgroup_info:
odata_filter: "mailNickname eq 'Mail-Nickname-Of-AD-Group'"
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- name: Return all groups
azure_rm_adgroup_info:
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
all: True
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **display\_name** string | always | The display name of the group. **Sample:** GroupName |
| **group\_members** list / elements=string | always | The members of the group. |
| **group\_owners** list / elements=string | always | The owners of the group. |
| **mail** string | always | The primary email address of the group. **Sample:** [email protected] |
| **mail\_enabled** boolean | always | Whether the group is mail-enabled. Must be false. This is because only pure security groups can be created using the Graph API. |
| **mail\_nickname** string | always | The mail alias for the group. **Sample:** groupname |
| **object\_id** string | always | The object\_id for the group. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| **security\_enabled** boolean | always | Whether the group is security-enable. |
### Authors
* Cole Neubauer(@coleneubauer)
ansible azure.azcollection.azure_rm_mariadbconfiguration_info – Get Azure MariaDB Configuration facts azure.azcollection.azure\_rm\_mariadbconfiguration\_info – Get Azure MariaDB Configuration facts
================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_mariadbconfiguration_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure MariaDB Configuration.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Setting name. |
| **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 / required | | The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string / required | | The name of the server. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get specific setting of MariaDB Server
azure_rm_mariadbconfiguration_info:
resource_group: myResourceGroup
server_name: testserver
name: deadlock_timeout
- name: Get all settings of MariaDB Server
azure_rm_mariadbconfiguration_info:
resource_group: myResourceGroup
server_name: server_name
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **settings** complex | always | A list of dictionaries containing MariaDB Server settings. |
| | **description** string | always | Description of the configuration. **Sample:** Deadlock timeout. |
| | **id** string | always | Setting resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DBforMariaDB/servers/testserver /configurations/deadlock\_timeout |
| | **name** string | always | Setting name. **Sample:** deadlock\_timeout |
| | **source** string | always | Source of the configuration. **Sample:** system-default |
| | **value** any | always | Setting value. **Sample:** 1000 |
### Authors
* Zim Kalinowski (@zikalino)
* Matti Ranta (@techknowlogick)
ansible azure.azcollection.azure_rm_virtualmachinescalesetextension – Manage Azure Virtual Machine Scale Set (VMSS) extensions azure.azcollection.azure\_rm\_virtualmachinescalesetextension – Manage Azure Virtual Machine Scale Set (VMSS) extensions
========================================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualmachinescalesetextension`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete Azure Virtual Machine Scale Set (VMSS) extensions.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **auto\_upgrade\_minor\_version** boolean | **Choices:*** no
* yes
| Whether the extension handler should be automatically upgraded across minor versions. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **location** string | | Valid Azure location. Defaults to location of the resource group. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Name of the VMSS extension. |
| **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. |
| **protected\_settings** string | | A dictionary containing protected extension settings. Settings depend on extension type. Refer to <https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/overview> for more information. |
| **publisher** string | | The name of the extension handler publisher. |
| **resource\_group** string / required | | Name of a resource group where the VMSS extension exists or will be created. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **settings** string | | A dictionary containing extension settings. Settings depend on extension type. Refer to <https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/overview> for more information. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the extension. Use `present` to create or update an extension and `absent` to delete it. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **type** string | | The type of the extension handler. |
| **type\_handler\_version** string | | The type version of the extension handler. |
| **vmss\_name** string / required | | The name of the virtual machine where the extension should be create or updated. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Install VMSS Extension
azure_rm_virtualmachinescalesetextension:
name: myvmssextension
location: eastus
resource_group: myResourceGroup
vmss_name: myvm
publisher: Microsoft.Azure.Extensions
type: CustomScript
type_handler_version: 2.0
settings: '{"commandToExecute": "hostname"}'
auto_upgrade_minor_version: true
- name: Remove VMSS Extension
azure_rm_virtualmachinescalesetextension:
name: myvmssextension
location: eastus
resource_group: myResourceGroup
vmss_name: myvm
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | VMSS extension resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/scalesets/myscaleset/extensions/myext |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible azure.azcollection.azure_rm_servicebustopicsubscription – Manage Azure Service Bus subscription azure.azcollection.azure\_rm\_servicebustopicsubscription – Manage Azure Service Bus subscription
=================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_servicebustopicsubscription`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete an Azure Service Bus subscriptions.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **auto\_delete\_on\_idle\_in\_seconds** integer | | Time idle interval after which a subscription is automatically deleted. The minimum duration is 5 minutes. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **dead\_lettering\_on\_filter\_evaluation\_exceptions** boolean | **Choices:*** no
* yes
| Value that indicates whether a subscription has dead letter support on filter evaluation exceptions. |
| **dead\_lettering\_on\_message\_expiration** boolean | **Choices:*** no
* yes
| A value that indicates whether a subscription has dead letter support when a message expires. |
| **default\_message\_time\_to\_live\_seconds** integer | | Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. |
| **duplicate\_detection\_time\_in\_seconds** integer | | TimeSpan structure that defines the duration of the duplicate detection history. |
| **enable\_batched\_operations** boolean | **Choices:*** no
* yes
| Value that indicates whether server-side batched operations are enabled. |
| **forward\_dead\_lettered\_messages\_to** string | | Queue or topic name to forward the Dead Letter message for a subscription. |
| **forward\_to** string | | Queue or topic name to forward the messages for a subscription. |
| **lock\_duration\_in\_seconds** integer | | Timespan duration of a peek-lock. The amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **max\_delivery\_count** integer | | he maximum delivery count. A message is automatically deadlettered after this number of deliveries. |
| **name** string / required | | Name of the servicebus subscription. |
| **namespace** string / required | | Servicebus namespace name. A namespace is a scoping container for all messaging components. Multiple subscriptions and topics can reside within a single namespace, and namespaces often serve as application containers. |
| **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. |
| **requires\_session** boolean | **Choices:*** no
* yes
| A value that indicates whether the subscription supports the concept of sessions. |
| **resource\_group** string / required | | Name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the servicebus subscription. Use `present` to create or update and use `absent` to delete. |
| **status** string | **Choices:*** active
* disabled
* send\_disabled
* receive\_disabled
| Status of the entity. |
| **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. |
| **topic** string / required | | Topic name which the subscription subscribe to. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a subscription
azure_rm_servicebustopicsubscription:
name: sbsub
resource_group: myResourceGroup
namespace: bar
topic: subtopic
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | success | Current state of the subscription. **Sample:** /subscriptions/xxx...xxx/resourceGroups/myResourceGroup/providers/Microsoft.ServiceBus/ namespaces/nsb57dc95979/topics/topicb57dc95979/subscriptions/subsb57dc95979 |
### Authors
* Yuwei Zhou (@yuwzho)
ansible azure.azcollection.azure_rm_notificationhub – Manage Notification Hub azure.azcollection.azure\_rm\_notificationhub – Manage Notification Hub
=======================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_notificationhub`.
New in version 1.7.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Notification Hub.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Unique name of the Notification Hub. |
| **namespace\_name** string / required | | Name of the namespace in which to create notification hub. |
| **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 / required | | Name of the resource group to which the resource belongs. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | **Choices:*** **free** ←
* basic
* standard
| The name of the SKU. Please see L(https://azure.microsoft.com/en-in/pricing/details/notification-hubs/). |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Notification Hub. Use `present` to create or update an notification hub and `absent` to delete it. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: "Create Notification Hub"
azure_rm_notificationhub:
resource_group: testgroupans
location: eastus
namespace_name: myNamespace
name: myhub
tags:
- a: b
sku: free
- name: Delete Notification Hub
azure_rm_notificationhub:
resource_group: testgroupans
name: myNamespace
state: absent
- name: "Create Notification Hub Namespace"
azure_rm_notificationhub:
resource_group: testgroupans
location: eastus
namespace_name: myNamespace
tags:
- a: b
sku: free
- name: Delete Notification Hub Namespace
azure_rm_notificationhub:
resource_group: testgroupans
namespace_name: myNamespace
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** dictionary | always | Current state of the Notification Hub namesapce or Notification Hub. **Sample:** {'additional\_properties': {}, 'critical': False, 'data\_center': None, 'enabled': True, 'location': 'eastus2', 'metric\_id': None, 'name': 'testnaedd3d22d3w', 'namespace\_type': 'NotificationHub', 'provisioning\_state': 'Succeeded', 'region': None, 'scale\_unit': None, 'service\_bus\_endpoint': 'https://testnaedd3d22d3w.servicebus.windows.net:443/', 'sku': 'Free', 'tags': {'a': 'b'}, 'type': 'Microsoft.NotificationHubs/namespaces'} |
### Authors
* Praveen Ghuge (@praveenghuge)
* Karl Dasan (@karldas30)
ansible azure.azcollection.azure_rm_notificationhub_info – Get Azure Notification Hub azure.azcollection.azure\_rm\_notificationhub\_info – Get Azure Notification Hub
================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_notificationhub_info`.
New in version 1.7.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure Notification Hub
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the Notification hub. |
| **namespace\_name** string | | The name of the namspace. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts of specific notification hub
community.azure.azure_rm_notificationhub_info:
resource_group: myResourceGroup
name: myNotificationHub
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** dictionary | always | Current state of the Notification Hub namesapce or Notification Hub. **Sample:** {'additional\_properties': {}, 'critical': False, 'data\_center': None, 'enabled': True, 'location': 'eastus2', 'metric\_id': None, 'name': 'testnaedd3d22d3w', 'namespace\_type': 'NotificationHub', 'provisioning\_state': 'Succeeded', 'region': None, 'scale\_unit': None, 'service\_bus\_endpoint': 'https://testnaedd3d22d3w.servicebus.windows.net:443/', 'sku': 'Free', 'tags': {'a': 'b'}, 'type': 'Microsoft.NotificationHubs/namespaces'} |
### Authors
* Praveen Ghuge (@praveenghuge)
* Karl Dasan (@karldas30)
| programming_docs |
ansible azure.azcollection.azure_rm_recoveryservicesvault_info – Get Azure Recovery Services vault Details azure.azcollection.azure\_rm\_recoveryservicesvault\_info – Get Azure Recovery Services vault Details
=====================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_recoveryservicesvault_info`.
New in version 1.1.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get Azure Recovery Services vault Details.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the Azure Recovery Service Vault. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get Azure Recovery Services Vault Details.
azure_rm_recoveryservicesvault_info:
resource_group: 'myResourceGroup'
name: 'testVault'
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **response** complex | always | The response about the current state of the recovery services vault. |
| | **etag** string | always | A unique read-only string that changes whenever the resource create. **Sample:** datetime'2020-09-16T02%3A44%3A27.834293Z' |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxx/resourceGroups/resourcegroup\_name/ providers/Microsoft.RecoveryServices/vaults/rev\_name |
| | **location** string | always | The location of the resource. **Sample:** eastus |
| | **name** string | always | Name of the recovery services vault name. **Sample:** revault\_name |
| | **properties** dictionary | always | The recovery service vault properties. **Sample:** {'privateEndpointStateForBackup': 'None', 'privateEndpointStateForSiteRecovery': 'None', 'provisioningState': 'Succeeded'} |
| | **sku** string | always | The sku type of the recovery service vault. **Sample:** Standard |
| | **type** string | always | The type of the recovery service vault. **Sample:** Microsoft.RecoveryServices/vaults |
### Authors
* Suyeb Ansari (@suyeb786)
ansible azure.azcollection.azure_rm_postgresqlserver_info – Get Azure PostgreSQL Server facts azure.azcollection.azure\_rm\_postgresqlserver\_info – Get Azure PostgreSQL Server facts
========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_postgresqlserver_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of PostgreSQL Server.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the server. |
| **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 / required | | The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of PostgreSQL Server
azure_rm_postgresqlserver_info:
resource_group: myResourceGroup
name: server_name
- name: List instances of PostgreSQL Server
azure_rm_postgresqlserver_info:
resource_group: myResourceGroup
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **servers** complex | always | A list of dictionaries containing facts for PostgreSQL servers. |
| | **admin\_username** string | always | The administrator's login name of a server. **Sample:** serveradmin |
| | **backup\_retention\_days** integer | always | Backup retention period between 7 and 35 days. 7 days by default if not set. **Sample:** 7 |
| | **enforce\_ssl** boolean | always | Enable SSL enforcement. |
| | **fully\_qualified\_domain\_name** string | always | The fully qualified domain name of a server. **Sample:** postgreabdud1223.postgres.database.azure.com |
| | **geo\_redundant\_backup** string | always | Choose between locally redundant(default) or geo-redundant backup. This cannot be updated after first deployment. **Sample:** Disabled |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/po stgreabdud1223 |
| | **location** string | always | The location the resource resides in. **Sample:** eastus |
| | **name** string | always | Resource name. **Sample:** postgreabdud1223 |
| | **resource\_group** string | always | Resource group name. **Sample:** myResourceGroup |
| | **sku** complex | always | The SKU of the server. |
| | | **capacity** integer | always | The scale capacity. **Sample:** 2 |
| | | **name** string | always | The name of the SKU. **Sample:** GP\_Gen4\_2 |
| | | **tier** string | always | The tier of the particular SKU. **Sample:** GeneralPurpose |
| | **storage\_mb** integer | always | The maximum storage allowed for a server. **Sample:** 128000 |
| | **tags** dictionary | success | Tags assigned to the resource. Dictionary of string:string pairs. **Sample:** {'tag1': 'abc'} |
| | **user\_visible\_state** string | always | A state of a server that is visible to user. **Sample:** Ready |
| | **version** string | always | Server version. **Sample:** 9.6 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_containerregistry – Manage an Azure Container Registry azure.azcollection.azure\_rm\_containerregistry – Manage an Azure Container Registry
====================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_containerregistry`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete an Azure Container Registry.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **admin\_user\_enabled** boolean | **Choices:*** **no** ←
* yes
| If enabled, you can use the registry name as username and admin user access key as password to docker login to your container registry. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **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 Container Registry. |
| **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 / required | | Name of a resource group where the Container Registry exists or will be created. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | **Choices:*** Basic
* **Standard** ←
* Premium
| Specifies the SKU to use. Currently can be either `Basic`, `Standard` or `Premium`. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the container registry. Use `present` to create or update an container registry and `absent` to delete it. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create an azure container registry
azure_rm_containerregistry:
name: myRegistry
location: eastus
resource_group: myResourceGroup
admin_user_enabled: true
sku: Premium
tags:
Release: beta1
Environment: Production
- name: Remove an azure container registry
azure_rm_containerregistry:
name: myRegistry
resource_group: myResourceGroup
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **admin\_user\_enabled** boolean | always | Is admin user enabled. **Sample:** True |
| **credentials** complex | always | Passwords defined for the registry. |
| | **password** string | when registry exists and `admin_user_enabled` is set | password value. **Sample:** pass1value |
| | **password2** string | when registry exists and `admin_user_enabled` is set | password2 value. **Sample:** pass2value |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry |
| **location** string | always | Resource location. **Sample:** westus |
| **login\_server** string | always | Registry login server. **Sample:** myregistry.azurecr.io |
| **name** string | always | Registry name. **Sample:** myregistry |
| **provisioning\_state** string | always | Provisioning state. **Sample:** Succeeded |
| **sku** string | always | The SKU name of the container registry. **Sample:** Standard |
| **tags** dictionary | always | Tags assigned to the resource. Dictionary of string:string pairs. |
### Authors
* Yawei Wang (@yaweiw)
| programming_docs |
ansible azure.azcollection.azure_rm_loganalyticsworkspace_info – Get facts of Azure Log Analytics workspaces azure.azcollection.azure\_rm\_loganalyticsworkspace\_info – Get facts of Azure Log Analytics workspaces
=======================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_loganalyticsworkspace_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get, query Azure Log Analytics workspaces.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Name of the workspace. |
| **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 / required | | Name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **show\_intelligence\_packs** string | | Show the intelligence packs for a workspace. Note this will cost one more network overhead for each workspace, expected slow response. |
| **show\_management\_groups** string | | Show the management groups for a workspace. Note this will cost one more network overhead for each workspace, expected slow response. |
| **show\_shared\_keys** string | | Show the shared keys for a workspace. Note this will cost one more network overhead for each workspace, expected slow response. |
| **show\_usages** string | | Show the list of usages for a workspace. Note this will cost one more network overhead for each workspace, expected slow response. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Query a workspace
azure_rm_loganalyticsworkspace_info:
resource_group: myResourceGroup
name: myLogAnalyticsWorkspace
show_intelligence_packs: true
show_management_groups: true
show_shared_keys: true
show_usages: true
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | success | Workspace resource path. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/m yLogAnalyticsWorkspace |
| **intelligence\_packs** list / elements=string | success | Lists all the intelligence packs possible and whether they are enabled or disabled for a given workspace. **Sample:** [{'enabled': True, 'name': 'CapacityPerformance'}] |
| **location** string | success | Resource location. **Sample:** eastus |
| **management\_groups** dictionary | success | Management groups connected to the workspace. **Sample:** {'value': []} |
| **retention\_in\_days** integer | success | The workspace data retention in days. -1 means Unlimited retention for *sku=unlimited*. 730 days is the maximum allowed for all other SKUs. **Sample:** 40 |
| **shared\_keys** dictionary | success | Shared keys for the workspace. **Sample:** {'primarySharedKey': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'secondarySharedKey': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} |
| **sku** string | success | The SKU of the workspace. **Sample:** per\_gb2018 |
| **usages** dictionary | success | Usage metrics for the workspace. **Sample:** {'value': [{'currentValue': 0, 'limit': 524288000, 'name': {'localizedValue': 'Data Analyzed', 'value': 'DataAnalyzed'}, 'nextResetTime': '2017-10-03T00:00:00Z', 'quotaPeriod': 'P1D', 'unit': 'Bytes'}]} |
### Authors
* Yuwei Zhou (@yuwzho)
ansible azure.azcollection.azure_rm_dnsrecordset – Create, delete and update DNS record sets and records azure.azcollection.azure\_rm\_dnsrecordset – Create, delete and update DNS record sets and records
==================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_dnsrecordset`.
New in version 0.1.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
Synopsis
--------
* Creates, deletes, and updates DNS records sets and records within an existing Azure DNS Zone.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **record\_mode** string | **Choices:*** append
* **purge** ←
| Whether existing record values not sent to the module should be purged. |
| **record\_type** string / required | **Choices:*** A
* AAAA
* CNAME
* MX
* NS
* SRV
* TXT
* PTR
* CAA
* SOA
| The type of record set to create or delete. |
| **records** string | | List of records to be created depending on the type of record (set). |
| | **entry** string | | Primary data value for all record types. |
| | **port** string | | Used for creating an `SRV` record set/records. |
| | **preference** string | | Used for creating an `MX` record set/records. |
| | **priority** string | | Used for creating an `SRV` record set/records. |
| | **weight** string | | Used for creating an `SRV` record set/records. |
| **relative\_name** string / required | | Relative name of the record set. |
| **resource\_group** string / required | | Name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the record set. Use `present` to create or update and `absent` to delete. |
| **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. |
| **time\_to\_live** string | **Default:**3600 | Time to live of the record set in seconds. |
| **zone\_name** string / required | | Name of the existing DNS zone in which to manage the record set. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: ensure an "A" record set with multiple records
azure_rm_dnsrecordset:
resource_group: myResourceGroup
relative_name: www
zone_name: testing.com
record_type: A
records:
- entry: 192.168.100.101
- entry: 192.168.100.102
- entry: 192.168.100.103
- name: delete a record set
azure_rm_dnsrecordset:
resource_group: myResourceGroup
record_type: A
relative_name: www
zone_name: testing.com
state: absent
- name: create multiple "A" record sets with multiple records
azure_rm_dnsrecordset:
resource_group: myResourceGroup
zone_name: testing.com
relative_name: "{{ item.name }}"
record_type: "{{ item.type }}"
records: "{{ item.records }}"
with_items:
- { name: 'servera', type: 'A', records: [ { entry: '10.10.10.20' }, { entry: '10.10.10.21' }] }
- { name: 'serverb', type: 'A', records: [ { entry: '10.10.10.30' }, { entry: '10.10.10.41' }] }
- { name: 'serverc', type: 'A', records: [ { entry: '10.10.10.40' }, { entry: '10.10.10.41' }] }
- name: create SRV records in a new record set
azure_rm_dnsrecordset:
resource_group: myResourceGroup
relative_name: _sip._tcp.testing.com
zone_name: testing.com
time_to_live: 7200
record_type: SRV
records:
- entry: sip.testing.com
preference: 10
priority: 20
weight: 10
port: 5060
- name: create PTR record in a new record set
azure_rm_dnsrecordset:
resource_group: myResourceGroup
relative_name: 192.168.100.101.in-addr.arpa
zone_name: testing.com
record_type: PTR
records:
- entry: servera.testing.com
- name: create TXT record in a new record set
azure_rm_dnsrecordset:
resource_group: myResourceGroup
relative_name: mail.testing.com
zone_name: testing.com
record_type: TXT
records:
- entry: 'v=spf1 a -all'
```
### Authors
* Obezimnaka Boms (@ozboms)
* Matt Davis (@nitzmahone)
There were some errors parsing the documentation for this plugin. Please file a bug with the collection.
The errors were:
* ```
Unable to normalize azure_rm_dnsrecordset: return due to: 7 validation errors for PluginReturnSchema
return -> state -> contains -> arecords -> return
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> etag -> return
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> fqdn -> return
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> provisioning_state -> return
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> target_resource -> return
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> ttl -> return
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> type -> return
extra fields not permitted (type=value_error.extra)
```
| programming_docs |
ansible azure.azcollection.azure_rm_containerinstance_info – Get Azure Container Instance facts azure.azcollection.azure\_rm\_containerinstance\_info – Get Azure Container Instance facts
==========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_containerinstance_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Container Instance.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the container instance. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** dictionary | | Limit results by providing of tags. Format tags 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get specific Container Instance facts
azure_rm_containerinstance_info:
resource_group: myResourceGroup
name: myContainer
- name: List Container Instances in a specified resource group name
azure_rm_containerinstance_info:
resource_group: myResourceGroup
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **container\_groups** complex | always | A list of Container Instance dictionaries. |
| | **containers** complex | always | The containers within the container group. **Sample:** containers |
| | | **commands** list / elements=string | always | List of commands to execute within the container instance in exec form. **Sample:** ['pip install abc'] |
| | | **cpu** integer | always | The required number of CPU cores of the containers. **Sample:** 1 |
| | | **environment\_variables** complex | success | List of container environment variables. |
| | | | **name** string | success | Environment variable name. |
| | | | **value** string | success | Environment variable value. |
| | | **image** string | always | The container image name. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ContainerInstance /containerGroups/myContainer |
| | | **memory** float | always | The required memory of the containers in GB. **Sample:** 1.5 |
| | | **name** string | always | The name of the container instance. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ContainerInstance /containerGroups/myContainer |
| | | **ports** list / elements=string | always | List of ports exposed within the container group. **Sample:** [80, 81] |
| | | **volume\_mounts** list / elements=string | If volumes mounted in container instance | The list of volumes mounted in container instance **Sample:** [{'mount\_path': '/mnt/repo', 'name': 'myvolume1'}] |
| | **dns\_name\_label** string | always | The Dns name label for the IP. **Sample:** mydomain |
| | **id** string | always | The resource id. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ContainerInstance/contain erGroups/myContainer |
| | **ip\_address** string | always | IP address of the container instance. **Sample:** 173.15.18.1 |
| | **location** string | always | The resource location. **Sample:** westus |
| | **name** string | always | The resource name. **Sample:** mycontainers |
| | **os\_type** string | always | The OS type of containers. **Sample:** linux |
| | **ports** list / elements=string | always | List of ports exposed by the container instance. **Sample:** [80, 81] |
| | **resource\_group** string | always | Resource group where the container exists. **Sample:** testrg |
| | **tags** dictionary | success | Tags assigned to the resource. Dictionary of string:string pairs. **Sample:** {'tag1': 'abc'} |
| | **volumes** list / elements=string | If container group has volumes | The list of Volumes that can be mounted by container instances **Sample:** [{'git\_repo': {'repository': 'https://github.com/Azure-Samples/aci-helloworld.git'}, 'name': 'myvolume1'}] |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_keyvaultkey – Use Azure KeyVault keys azure.azcollection.azure\_rm\_keyvaultkey – Use Azure KeyVault keys
===================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_keyvaultkey`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create or delete a key within a given keyvault.
* By using Key Vault, you can encrypt keys and secrets.
* Such as authentication keys, storage account keys, data encryption keys, .PFX files, and passwords.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **byok\_file** string | | BYOK file. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **key\_name** string / required | | Name of the keyvault key. |
| **keyvault\_uri** string / required | | URI of the keyvault endpoint. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **pem\_file** string | | PEM file. |
| **pem\_password** string | | PEM password. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the key. Use `present` to create a key and `absent` to delete a key. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a key
azure_rm_keyvaultkey:
key_name: MyKey
keyvault_uri: https://contoso.vault.azure.net/
- name: Delete a key
azure_rm_keyvaultkey:
key_name: MyKey
keyvault_uri: https://contoso.vault.azure.net/
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | success | Current state of the key. |
| | **key\_id** string | success | key resource path. **Sample:** https://contoso.vault.azure.net/keys/hello/e924f053839f4431b35bc54393f98423 |
### Authors
* Ian Philpot (@iphilpot)
ansible azure.azcollection.azure_rm_mariadbconfiguration – Manage Configuration instance azure.azcollection.azure\_rm\_mariadbconfiguration – Manage Configuration instance
==================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_mariadbconfiguration`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Configuration.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the server configuration. |
| **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 / required | | The name of the resource group that contains the resource. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string / required | | The name of the server. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the MariaDB configuration. Use `present` to update setting, or `absent` to reset to default value. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **value** string | | Value of the configuration. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Update SQL Server setting
azure_rm_mariadbconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: event_scheduler
value: "ON"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DBforMariaDB/servers/myServer/confi gurations/event\_scheduler |
### Authors
* Zim Kalinowski (@zikalino)
* Matti Ranta (@techknowlogick)
| programming_docs |
ansible azure.azcollection.azure_rm_roleassignment_info – Gets Azure Role Assignment facts azure.azcollection.azure\_rm\_roleassignment\_info – Gets Azure Role Assignment facts
=====================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_roleassignment_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gets facts of Azure Role Assignment.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **assignee** string | | Object id of a user, group or service principal. Mutually exclusive with *name* and *id*.
aliases: assignee\_object\_id |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **id** string | | Fqid of role assignment to look up. If set, *role\_definition\_id* and *scope* will be silently ignored. Mutually exclusive with *assignee* and *name*. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Name of role assignment. Requires that *scope* also be set. Mutual exclusive with *assignee* and *id*. |
| **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. |
| **role\_definition\_id** string | | Resource id of role definition. |
| **scope** string | | The scope to query for role assignments. For example, use /subscriptions/{subscription-id}/ for a subscription. /subscriptions/{subscription-id}/resourceGroups/{resourcegroup-name} for a resource group. /subscriptions/{subscription-id}/resourceGroups/{resourcegroup-name}/providers/{resource-provider}/{resource-type}/{resource-name} for a resource. By default will return all inhereted assignments from parent scopes, see *strict\_scope\_match*. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **strict\_scope\_match** boolean | **Choices:*** **no** ←
* yes
| If strict\_scope\_match is True, role assignments will only be returned for the exact scope defined. Inherited role assignments will be excluded from results. Option will be silently ignored if no scope is provided. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get role assignments for specific service principal
azure_rm_roleassignment_info:
assignee: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- name: Get role assignments for specific scope that matches specific role definition
azure_rm_roleassignment_info:
scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
role_definition_id: /subscriptions/xxx-sub-guid-xxx/providers/Microsoft.Authorization/roleDefinitions/xxx-role-guid-xxxx
- name: Get role assignments for specific scope with no inherited assignments
azure_rm_roleassignment_info:
scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
strict_scope_match: True
- name: Get role assignments by name
azure_rm_roleassignment_info:
scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
name: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- name: Get role assignments by id
azure_rm_roleassignment_info:
id: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleAssignments/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **roleassignments** complex | always | List of role assignments. |
| | **id** string | always | Id of role assignment. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleAssignments/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | **name** string | always | Name of role assignment. **Sample:** myRoleAssignment |
| | **principal\_id** string | always | Principal Id of the role assigned to. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | **principal\_type** string | always | Principal type of the role assigned to. **Sample:** ServicePrincipal |
| | **role\_definition\_id** string | always | Role definition id that was assigned to principal\_id. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | **scope** string | always | The role assignment scope. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | **type** string | always | Type of role assignment. **Sample:** custom |
### Authors
* Yunge Zhu(@yungezz)
* Paul Aiton(@paultaiton)
ansible azure.azcollection.azure_rm_virtualmachine_info – Get virtual machine facts azure.azcollection.azure\_rm\_virtualmachine\_info – Get virtual machine facts
==============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualmachine_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for one or all virtual machines in a resource group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Name of the virtual machine. |
| **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 | | Name of the resource group containing the virtual machines (required when filtering by vm name). |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for all virtual machines of a resource group
azure_rm_virtualmachine_info:
resource_group: myResourceGroup
- name: Get facts by name
azure_rm_virtualmachine_info:
resource_group: myResourceGroup
name: myVm
- name: Get facts by tags
azure_rm_virtualmachine_info:
resource_group: myResourceGroup
tags:
- testing
- foo:bar
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **vms** complex | always | List of virtual machines. |
| | **admin\_username** string | always | Administrator user name. **Sample:** admin |
| | **boot\_diagnostics** complex | always | Information about the boot diagnostics settings. |
| | | **console\_screenshot\_uri** string | always | Contains a URI to grab a console screenshot. Only present if enabled. **Sample:** https://mystorageaccountname.blob.core.windows.net/bootdiagnostics-myvm01-a4db09a6-ab7f-4d80-9da8-fbceaef9288a/ myVm.a4db09a6-ab7f-4d80-9da8-fbceaef9288a.screenshot.bmp |
| | | **enabled** boolean | always | Indicates if boot diagnostics are enabled. **Sample:** True |
| | | **serial\_console\_log\_uri** string | always | Contains a URI to grab the serial console log. Only present if enabled. **Sample:** https://mystorageaccountname.blob.core.windows.net/bootdiagnostics-myvm01-a4db09a6-ab7f-4d80-9da8-fbceaef9288a/ myVm.a4db09a6-ab7f-4d80-9da8-fbceaef9288a.serialconsole.log |
| | | **storage\_uri** string | always | Indicates the storage account used by boot diagnostics. **Sample:** https://mystorageaccountname.blob.core.windows.net/ |
| | **data\_disks** complex | always | List of attached data disks. |
| | | **caching** string | always | Type of data disk caching. **Sample:** ReadOnly |
| | | **disk\_size\_gb** integer | always | The initial disk size in GB for blank data disks. **Sample:** 64 |
| | | **lun** integer | always | The logical unit number for data disk. |
| | | **managed\_disk\_type** string | always | Managed data disk type. **Sample:** Standard\_LRS |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm |
| | **image** complex | always | Image specification. |
| | | **id** string | when created from custom image | Custom image resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage |
| | | **offer** string | when created from marketplace image | The offer of the platform image or marketplace image used to create the virtual machine. **Sample:** RHEL |
| | | **publisher** string | when created from marketplace image | Publisher name. **Sample:** RedHat |
| | | **sku** string | when created from marketplace image | SKU name. **Sample:** 7-RAW |
| | | **version** string | when created from marketplace image | Image version. **Sample:** 7.5.2018050901 |
| | **location** string | always | Resource location. **Sample:** japaneast |
| | **name** string | always | Resource name. **Sample:** myVm |
| | **network\_interface\_names** list / elements=string | always | List of attached network interfaces. **Sample:** ['myNetworkInterface'] |
| | **os\_disk\_caching** string | always | Type of OS disk caching. **Sample:** ReadOnly |
| | **os\_type** string | always | Base type of operating system. **Sample:** Linux |
| | **power\_state** string | always | Power state of the virtual machine. **Sample:** running |
| | **resource\_group** string | always | Resource group. **Sample:** myResourceGroup |
| | **state** string | always | State of the resource. **Sample:** present |
| | **tags** dictionary | always | Resource tags. **Sample:** {'key1': 'value1'} |
| | **vm\_size** string | always | Virtual machine size. **Sample:** Standard\_D4 |
| | **zones** list / elements=string | success | A list of Availability Zones for your VM. **Sample:** [1] |
### Authors
* Gustavo Muniz do Carmo (@gustavomcarmo)
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible azure.azcollection.azure_rm_virtualmachinescaleset_info – Get Virtual Machine Scale Set facts azure.azcollection.azure\_rm\_virtualmachinescaleset\_info – Get Virtual Machine Scale Set facts
================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualmachinescaleset_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a virtual machine scale set.
* Note that this module was called M(azure\_rm\_virtualmachine\_scaleset\_facts) before Ansible 2.8. The usage did not change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **format** string | **Choices:*** curated
* **raw** ←
| Format of the data returned. If `raw` is selected information will be returned in raw format from Azure Python SDK. If `curated` is selected the structure will be identical to input parameters of M(azure\_rm\_virtualmachinescaleset) module. In Ansible 2.5 and lower facts are always returned in raw format. Please note that this option will be deprecated in 2.10 when curated format will become the only supported format. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Limit results to a specific virtual machine scale set. |
| **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 | | The resource group to search for the desired virtual machine scale set. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | List of tags to be matched. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for a virtual machine scale set
azure_rm_virtualmachinescaleset_info:
resource_group: myResourceGroup
name: testvmss001
format: curated
- name: Get facts for all virtual networks
azure_rm_virtualmachinescaleset_info:
resource_group: myResourceGroup
- name: Get facts by tags
azure_rm_virtualmachinescaleset_info:
resource_group: myResourceGroup
tags:
- testing
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **vmss** complex | always | List of virtual machine scale sets. |
| | **admin\_username** string | always | Admin username used to access the host after it is created. **Sample:** adminuser |
| | **capacity** integer | always | Capacity of VMSS. **Sample:** 2 |
| | **data\_disks** complex | always | List of attached data disks. |
| | | **caching** string | always | Type of data disk caching. **Sample:** ReadOnly |
| | | **disk\_size\_gb** integer | always | The initial disk size in GB for blank data disks. **Sample:** 64 |
| | | **lun** integer | always | The logical unit number for data disk. |
| | | **managed\_disk\_type** string | always | Managed data disk type. **Sample:** Standard\_LRS |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/scalesets/myscaleset |
| | **image** complex | always | Image specification. |
| | | **offer** string | always | The offer of the platform image or marketplace image used to create the virtual machine. **Sample:** RHEL |
| | | **publisher** string | always | Publisher name. **Sample:** RedHat |
| | | **sku** string | always | SKU name. **Sample:** 7-RAW |
| | | **version** string | always | Image version. **Sample:** 7.5.2018050901 |
| | **load\_balancer** string | always | Load balancer name. **Sample:** testlb |
| | **location** string | always | Resource location. **Sample:** japaneast |
| | **managed\_disk\_type** string | always | Managed data disk type. **Sample:** Standard\_LRS |
| | **name** string | always | Resource name. **Sample:** myvmss |
| | **os\_disk\_caching** string | always | Type of OS disk caching. **Sample:** ReadOnly |
| | **os\_type** string | always | Base type of operating system. **Sample:** Linux |
| | **overprovision** boolean | success | Specifies whether the Virtual Machine Scale Set should be overprovisioned. **Sample:** True |
| | **resource\_group** string | always | Resource group. **Sample:** myResourceGroup |
| | **ssh\_password\_enabled** boolean | always | Is SSH password authentication enabled. Valid only for Linux. **Sample:** True |
| | **subnet\_name** string | always | Subnet name. **Sample:** testsubnet |
| | **tags** dictionary | always | Tags assigned to the resource. Dictionary of string:string pairs. **Sample:** {'tag1': 'abc'} |
| | **tier** string | always | SKU Tier. **Sample:** Basic |
| | **upgrade\_policy** string | always | Upgrade policy. **Sample:** Manual |
| | **virtual\_network\_name** string | always | Associated virtual network name. **Sample:** testvn |
| | **vm\_size** string | always | Virtual machine size. **Sample:** Standard\_D4 |
### Authors
* Sertac Ozercan (@sozercan)
ansible azure.azcollection.azure_rm_proximityplacementgroup – Create, delete and update proximity placement group azure.azcollection.azure\_rm\_proximityplacementgroup – Create, delete and update proximity placement group
===========================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_proximityplacementgroup`.
New in version 1.6.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates, deletes, and updates proximity placement group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **location** string | | Valid Azure location for proximity placement group. Defaults to location of resource group. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the proximity placement group. |
| **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 / required | | Name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the placement group. Use `present` to create or update and `absent` to delete. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a proximity placement group
azure_rm_proximityplacementgroup:
resource_group: myAzureResourceGroup
location: eastus
name: myppg
state: present
- name: Update proximity placement group
azure_rm_proximityplacementgroup:
resource_group: myAzureResourceGroup
location: eastus
name: myppg
tags:
key1: "value1"
state: present
- name: Delete a proximity placement group
azure_rm_proximityplacementgroup:
resource_group: myAzureResourceGroup
name: myppg
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | always | Current state of the proximity placement group. |
| | **id** string | always | The proximity placement group ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myAzureResourceGroup/providers/ Microsoft.Compute/proximityPlacementGroups/myppg |
| | **location** string | always | The Azure Region where the resource lives. **Sample:** eastus |
| | **name** string | always | The proximity placement group name. **Sample:** myppg |
| | **proximity\_placement\_group\_type** string | always | The type of proximity placement group. **Sample:** Standard |
| | **tags** list / elements=string | always | Resource tags. **Sample:** [{'key1': 'value1'}] |
| | **type** string | always | The type of resource. **Sample:** Microsoft.Compute/proximityPlacementGroups |
### Authors
* Aparna Patil (@techcon65)
ansible azure.azcollection.azure_rm_devtestlabvirtualnetwork_info – Get Azure DevTest Lab Virtual Network facts azure.azcollection.azure\_rm\_devtestlabvirtualnetwork\_info – Get Azure DevTest Lab Virtual Network facts
==========================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabvirtualnetwork_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure DevTest Lab Virtual Network.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **lab\_name** string / required | | The name of DevTest Lab. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of DevTest Lab Virtual Network. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of DevTest Lab Virtual Network
azure_rm_devtestlabvirtualnetwork_info:
resource_group: myResourceGroup
lab_name: myLab
name: myVirtualNetwork
- name: List all Virtual Networks in DevTest Lab
azure_rm_devtestlabvirtualnetwork_info:
resource_group: myResourceGroup
lab_name: myLab
name: myVirtualNetwork
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **virtualnetworks** complex | always | A list of dictionaries containing facts for DevTest Lab Virtual Network. |
| | **description** string | always | Description of the virtual network. **Sample:** My Virtual Network |
| | **external\_provider\_resource\_id** string | always | Resource id of an external virtual network. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/my VirtualNetwork |
| | **id** string | always | The identifier of the virtual network. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/myLab/virt ualnetworks/myVirtualNetwork |
| | **lab\_name** string | always | Name of the lab. **Sample:** myLab |
| | **name** string | always | Name of the virtual network. **Sample:** myVirtualNetwork |
| | **provisioning\_state** string | always | Provisioning state of the virtual network. **Sample:** Succeeded |
| | **resource\_group** string | always | Name of the resource group. **Sample:** myResourceGroup |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible azure.azcollection.azure_rm_mysqlfirewallrule – Manage MySQL firewall rule instance azure.azcollection.azure\_rm\_mysqlfirewallrule – Manage MySQL firewall rule instance
=====================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_mysqlfirewallrule`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of MySQL firewall rule.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **end\_ip\_address** string / required | | The end IP address of the MySQL firewall rule. Must be IPv4 format. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the MySQL firewall rule. |
| **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 / required | | The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string / required | | The name of the server. |
| **start\_ip\_address** string / required | | The start IP address of the MySQL firewall rule. Must be IPv4 format. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the MySQL firewall rule. Use `present` to create or update a rule and `absent` to ensure it is not present. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) MySQL firewall rule
azure_rm_mysqlfirewallrule:
resource_group: myResourceGroup
server_name: testserver
name: rule1
start_ip_address: 10.0.0.17
end_ip_address: 10.0.0.20
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DBforMySQL/servers/testserver/fire wallRules/rule1 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_aks – Manage a managed Azure Container Service (AKS) instance azure.azcollection.azure\_rm\_aks – Manage a managed Azure Container Service (AKS) instance
===========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_aks`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete a managed Azure Container Service (AKS) instance.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aad\_profile** string | | Profile of Azure Active Directory configuration. |
| | **client\_app\_id** string | | The client AAD application ID. |
| | **server\_app\_id** string | | The server AAD application ID. |
| | **server\_app\_secret** string | | The server AAD application secret. |
| | **tenant\_id** string | | The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. |
| **ad\_user** string | | Active Directory username. Use when authenticating with an Active Directory user rather than service principal. |
| **addon** dictionary | | Profile of managed cluster add-on. Key can be `http_application_routing`, `monitoring`, `virtual_node`. Value must be a dict contains a bool variable `enabled`. |
| | **http\_application\_routing** dictionary | | The HTTP application routing solution makes it easy to access applications that are deployed to your cluster. |
| | | **enabled** boolean | **Choices:*** no
* yes
| Whether the solution enabled. |
| | **monitoring** dictionary | | It gives you performance visibility by collecting memory and processor metrics from controllers, nodes, and containers that are available in Kubernetes through the Metrics API. |
| | | **enabled** boolean | **Choices:*** no
* yes
| Whether the solution enabled. |
| | | **log\_analytics\_workspace\_resource\_id** string / required | | Where to store the container metrics. |
| | **virtual\_node** dictionary | | With virtual nodes, you have quick provisioning of pods, and only pay per second for their execution time. You don't need to wait for Kubernetes cluster autoscaler to deploy VM compute nodes to run the additional pods. |
| | | **enabled** boolean | **Choices:*** no
* yes
| Whether the solution enabled. |
| | | **subnet\_resource\_id** string / required | | Subnet associated to the cluster. |
| **adfs\_authority\_url** string added in 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **agent\_pool\_profiles** string | | The agent pool profile suboptions. |
| | **availability\_zones** list / elements=string | **Choices:*** 1
* 2
* 3
| Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. |
| | **count** string / required | | Number of agents (VMs) to host docker containers. Allowed values must be in the range of `1` to `100` (inclusive). |
| | **enable\_auto\_scaling** boolean | **Choices:*** no
* yes
| To enable auto-scaling. |
| | **max\_count** integer | | Maximum number of nodes for auto-scaling. Required if *enable\_auto\_scaling=True*. |
| | **max\_pods** integer | | Maximum number of pods schedulable on nodes. |
| | **min\_count** integer | | Minmum number of nodes for auto-scaling. Required if *enable\_auto\_scaling=True*. |
| | **mode** string | **Choices:*** System
* User
| AgentPoolMode represents mode of an agent pool. Possible values include `System` and `User`. System AgentPoolMode requires a minimum VM SKU of at least 2 vCPUs and 4GB memory. |
| | **name** string / required | | Unique name of the agent pool profile in the context of the subscription and resource group. |
| | **node\_labels** dictionary | | Agent pool node labels to be persisted across all nodes in agent pool. |
| | **os\_disk\_size\_gb** string | | Size of the OS disk. |
| | **type** string | **Choices:*** VirtualMachineScaleSets
* AvailabilitySet
| AgentPoolType represents types of an agent pool. Possible values include `VirtualMachineScaleSets` and `AvailabilitySet`. |
| | **vm\_size** string / required | | The VM Size of each of the Agent Pool VM's (e.g. `Standard_F1` / `Standard_D2v2`). |
| | **vnet\_subnet\_id** string | | Specifies the VNet's subnet identifier. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **dns\_prefix** string | | DNS prefix specified when creating the managed cluster. |
| **enable\_rbac** boolean | **Choices:*** **no** ←
* yes
| Enable RBAC. Existing non-RBAC enabled AKS clusters cannot currently be updated for RBAC use. |
| **kubernetes\_version** string | | Version of Kubernetes specified when creating the managed cluster. |
| **linux\_profile** string | | The Linux profile suboptions. Optional, provide if you need an ssh access to the cluster nodes. |
| | **admin\_username** string / required | | The Admin Username for the cluster. |
| | **ssh\_key** string / required | | The Public SSH Key used to access the cluster. |
| **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 managed Azure Container Services (AKS) instance. |
| **network\_profile** string | | Profile of network configuration. |
| | **dns\_service\_ip** string | **Default:**"10.0.0.10" | An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. |
| | **docker\_bridge\_cidr** string | **Default:**"172.17.0.1/16" | A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. |
| | **load\_balancer\_sku** string | **Choices:*** standard
* basic
| The load balancer sku for the managed cluster. |
| | **network\_plugin** string | **Choices:*** azure
* **kubenet** ←
| Network plugin used for building Kubernetes network. This property cannot been changed. With `kubenet`, nodes get an IP address from the Azure virtual network subnet. AKS features such as Virtual Nodes or network policies aren't supported with `kubenet`.
`azure` enables Azure Container Networking Interface(CNI), every pod gets an IP address from the subnet and can be accessed directly. |
| | **network\_policy** string | **Choices:*** azure
* calico
| Network policy used for building Kubernetes network. |
| | **pod\_cidr** string | **Default:**"10.244.0.0/16" | A CIDR notation IP range from which to assign pod IPs when *network\_plugin=kubenet* is used. It should be a large address space that isn't in use elsewhere in your network environment. This address range must be large enough to accommodate the number of nodes that you expect to scale up to. |
| | **service\_cidr** string | **Default:**"10.0.0.0/16" | A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. It should be the \*.10 address of your service IP address range. |
| **node\_resource\_group** string | | Name of the resource group containing agent pool nodes. Unable to update. |
| **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 / required | | Name of a resource group where the managed Azure Container Services (AKS) exists or will be created. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **service\_principal** string | | The service principal suboptions. If not provided - use system-assigned managed identity. |
| | **client\_id** string / required | | The ID for the Service Principal. |
| | **client\_secret** string | | The secret password associated with the service principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the AKS. Use `present` to create or update an AKS and `absent` to delete it. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create an AKS instance With A System Node Pool & A User Node Pool
azure_rm_aks:
name: myAKS
resource_group: myResourceGroup
location: eastus
dns_prefix: akstest
kubernetes_version: 1.14.6
linux_profile:
admin_username: azureuser
ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAA...
service_principal:
client_id: "cf72ca99-f6b9-4004-b0e0-bee10c521948"
client_secret: "Password1234!"
agent_pool_profiles:
- name: default
count: 1
vm_size: Standard_B2s
enable_auto_scaling: True
type: VirtualMachineScaleSets
mode: System
max_count: 3
min_count: 1
enable_rbac: yes
- name: user
count: 1
vm_size: Standard_D2_v2
enable_auto_scaling: True
type: VirtualMachineScaleSets
mode: User
max_count: 3
min_count: 1
enable_rbac: yes
- name: Create a managed Azure Container Services (AKS) instance
azure_rm_aks:
name: myAKS
location: eastus
resource_group: myResourceGroup
dns_prefix: akstest
kubernetes_version: 1.14.6
linux_profile:
admin_username: azureuser
ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAA...
service_principal:
client_id: "cf72ca99-f6b9-4004-b0e0-bee10c521948"
client_secret: "Password123!"
agent_pool_profiles:
- name: default
count: 5
mode: System
vm_size: Standard_B2s
tags:
Environment: Production
- name: Use minimal parameters and system-assigned identity
azure_rm_aks:
name: myMinimalCluster
location: eastus
resource_group: myExistingResourceGroup
dns_prefix: akstest
agent_pool_profiles:
- name: default
count: 1
vm_size: Standard_D2_v2
- name: Remove a managed Azure Container Services (AKS) instance
azure_rm_aks:
name: myAKS
resource_group: myResourceGroup
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** dictionary | always | Current state of the Azure Container Service (AKS). **Sample:** {'agent\_pool\_profiles': [{'count': 1, 'dns\_prefix': None, 'moode': 'System', 'name': 'default', 'node\_labels': {'environment': 'dev', 'release': 'stable'}, 'os\_disk\_size\_gb': None, 'os\_type': 'Linux', 'ports': None, 'storage\_profile': 'ManagedDisks', 'vm\_size': 'Standard\_B2s', 'vnet\_subnet\_id': None}], 'changed': False, 'dns\_prefix': 'aks9860bdcd89', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/aks9860bdc', 'kube\_config': '......', 'kubernetes\_version': '1.14.6', 'linux\_profile': {'admin\_username': 'azureuser', 'ssh\_key': 'ssh-rsa AAAAB3NzaC1yc2EAAAADA.....'}, 'location': 'eastus', 'name': 'aks9860bdc', 'provisioning\_state': 'Succeeded', 'service\_principal\_profile': {'client\_id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'}, 'tags': {}, 'type': 'Microsoft.ContainerService/ManagedClusters'} |
### Authors
* Sertac Ozercan (@sozercan)
* Yuwei Zhou (@yuwzho)
| programming_docs |
ansible azure.azcollection.azure_rm_vmbackuppolicy – Create or Delete Azure VM Backup Policy azure.azcollection.azure\_rm\_vmbackuppolicy – Create or Delete Azure VM Backup Policy
======================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_vmbackuppolicy`.
New in version 1.1.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create or Delete Azure VM Backup Policy.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **count** integer | **Default:**1 | Count of duration types. Retention duration is obtained by the counting the duration type Count times. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **months** list / elements=string | **Default:**["January"] | List of months of year of yearly retention policy. |
| **name** string / required | | Policy Name. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** **present** ←
* absent
| Assert the state of the protection item. Use `present` for Creating Backup Policy. Use `absent` for Deleting Backup Policy. |
| **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. |
| **time** string | **Default:**"12:00" | Retention times of retention policy in UTC. |
| **vault\_name** string / required | | Recovery Service Vault Name. |
| **weekdays** list / elements=string | **Default:**["Monday"] | List of days of the week. |
| **weeks** list / elements=string | **Default:**["First"] | List of weeks of month. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create VM Backup Policy
azure_rm_backvmuppolicy:
name: 'myBackupPolicy'
vault_name: 'myVault'
resource_group: 'myResourceGroup'
time: '18:00'
weekdays: ['Monday', 'Thursday', 'Friday']
weeks: ['First', 'Fourth']
months: ['February', 'November']
count: 4
state: present
- name: Delete VM Backup Policy
azure_rm_backvmuppolicy:
name: 'myBackupPolicy'
vault_name: 'myVault'
resource_group: 'myResourceGroup'
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **response** complex | always | The response about the current state of the backup policy. |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxx/resourceGroups/resourcegroup\_name/ providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myBackup |
| | **name** string | always | Backup Policy Name. **Sample:** myBackup |
| | **properties** dictionary | always | The backup policy properties. **Sample:** {'backupManagementType': 'AzureIaasVM', 'protectedItemsCount': 0, 'retentionPolicy': {'monthlySchedule': {'retentionDuration': {'count': 2, 'durationType': 'Months'}, 'retentionScheduleFormatType': 'Weekly', 'retentionScheduleWeekly': {'daysOfTheWeek': ['Wednesday', 'Thursday'], 'weeksOfTheMonth': ['First', 'Third']}, 'retentionTimes': ['2018-01-24T10:00:00Z']}, 'retentionPolicyType': 'LongTermRetentionPolicy', 'weeklySchedule': {'daysOfTheWeek': ['Monday', 'Wednesday', 'Thursday'], 'retentionDuration': {'count': 1, 'durationType': 'Weeks'}, 'retentionTimes': ['2018-01-24T10:00:00Z']}, 'yearlySchedule': {'monthsOfYear': ['February', 'November'], 'retentionDuration': {'count': 4, 'durationType': 'Years'}, 'retentionScheduleFormatType': 'Weekly', 'retentionScheduleWeekly': {'daysOfTheWeek': ['Monday', 'Thursday'], 'weeksOfTheMonth': ['Fourth']}, 'retentionTimes': ['2018-01-24T10:00:00Z']}}, 'schedulePolicy': {'schedulePolicyType': 'SimpleSchedulePolicy', 'scheduleRunDays': ['Monday', 'Wednesday', 'Thursday'], 'scheduleRunFrequency': 'Weekly', 'scheduleRunTimes': ['2018-01-24T10:00:00Z'], 'scheduleWeeklyFrequency': 0}, 'timeZone': 'Pacific Standard Time'} |
| | **type** string | always | Resource type. **Sample:** Microsoft.RecoveryServices/vaults/backupPolicies |
### Authors
* Suyeb Ansari (@suyeb786)
ansible azure.azcollection.azure_rm_containerregistryreplication – Manage Replication instance. azure.azcollection.azure\_rm\_containerregistryreplication – Manage Replication instance.
=========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_containerregistryreplication`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Replication.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **registry\_name** string / required | | The name of the container registry. |
| **replication** string | | The parameters for creating a replication. |
| **replication\_name** string / required | | The name of the *replication*. |
| **resource\_group** string / required | | The name of the resource group to which the container registry belongs. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) Replication
azure_rm_containerregistryreplication:
resource_group: myResourceGroup
registry_name: myRegistry
replication_name: myReplication
replication: replication
location: eastus
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | The resource ID. **Sample:** /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/r eplications/myReplication |
| **status** string | always | The status of the replication at the time the operation was called. **Sample:** Ready |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_resource_info – Generic facts of Azure resources azure.azcollection.azure\_rm\_resource\_info – Generic facts of Azure resources
===============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_resource_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Obtain facts of any resource using Azure REST API.
* This module gives access to resources that are not supported via Ansible modules.
* Refer to <https://docs.microsoft.com/en-us/rest/api/> regarding details related to specific resource REST API.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **api\_version** string | | Specific API version to be used. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **provider** string | | Provider type, should be specified in no URL is given. |
| **resource\_group** string | | Resource group to be used. Required if URL is not specified. |
| **resource\_name** string | | Resource name. |
| **resource\_type** string | | Resource type. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subresource** string | | List of subresources. |
| | **name** string | | Subresource name. |
| | **namespace** string | | Subresource namespace. |
| | **type** string | | Subresource type. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **url** string | | Azure RM Resource URL. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get scaleset info
azure_rm_resource_info:
resource_group: myResourceGroup
provider: compute
resource_type: virtualmachinescalesets
resource_name: myVmss
api_version: "2017-12-01"
- name: Query all the resources in the resource group
azure_rm_resource_info:
resource_group: "{{ resource_group }}"
resource_type: resources
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **response** complex | always | Response specific to resource type. |
| | **id** string | always | Id of the Azure resource. **Sample:** /subscriptions/xxxx...xxxx/resourceGroups/v-xisuRG/providers/Microsoft.Compute/virtualMachines/myVM |
| | **location** string | always | Resource location. **Sample:** eastus |
| | **name** string | always | Resource name. **Sample:** myVM |
| | **properties** complex | always | Specifies the virtual machine's property. |
| | | **diagnosticsProfile** complex | always | Specifies the boot diagnostic settings state. |
| | | | **bootDiagnostics** dictionary | always | A debugging feature, which to view Console Output and Screenshot to diagnose VM status. **Sample:** {'enabled': True, 'storageUri': 'https://vxisurgdiag.blob.core.windows.net/'} |
| | | **hardwareProfile** dictionary | always | Specifies the hardware settings for the virtual machine. **Sample:** {'vmSize': 'Standard\_D2s\_v3'} |
| | | **networkProfile** complex | always | Specifies the network interfaces of the virtual machine. |
| | | | **networkInterfaces** list / elements=string | always | Describes a network interface reference. **Sample:** [{'id': '/subscriptions/xxxx...xxxx/resourceGroups/v-xisuRG/providers/Microsoft.Network/networkInterfaces/myvm441'}] |
| | | **osProfile** complex | always | Specifies the operating system settings for the virtual machine. |
| | | | **adminUsername** string | always | Specifies the name of the administrator account. **Sample:** azureuser |
| | | | **allowExtensionOperations** boolean | always | Specifies whether extension operations should be allowed on the virtual machine. This may only be set to False when no extensions are present on the virtual machine. **Sample:** True |
| | | | **computerName** string | always | Specifies the host OS name of the virtual machine. **Sample:** myVM |
| | | | **linuxConfiguration** dictionary | when OS type is Linux | Specifies the Linux operating system settings on the virtual machine. **Sample:** {'disablePasswordAuthentication': False, 'provisionVMAgent': True} |
| | | | **requireGuestProvisionSignale** boolean | always | Specifies the host require guest provision signal or not. **Sample:** True |
| | | | **secrets** list / elements=string | always | Specifies set of certificates that should be installed onto the virtual machine. |
| | | **provisioningState** string | always | The provisioning state. **Sample:** Succeeded |
| | | **storageProfile** complex | always | Specifies the storage account type for the managed disk. |
| | | | **dataDisks** list / elements=string | always | Specifies the parameters that are used to add a data disk to virtual machine. **Sample:** [{'caching': 'None', 'createOption': 'Attach', 'diskSizeGB': 1023, 'lun': 2, 'managedDisk': {'id': '/subscriptions/xxxx....xxxx/resourceGroups/V-XISURG/providers/Microsoft.Compute/disks/testdisk2', 'storageAccountType': 'StandardSSD\_LRS'}, 'name': 'testdisk2'}, {'caching': 'None', 'createOption': 'Attach', 'diskSizeGB': 1023, 'lun': 1, 'managedDisk': {'id': '/subscriptions/xxxx...xxxx/resourceGroups/V-XISURG/providers/Microsoft.Compute/disks/testdisk3', 'storageAccountType': 'StandardSSD\_LRS'}, 'name': 'testdisk3'}] |
| | | | **imageReference** dictionary | always | Specifies information about the image to use. **Sample:** {'offer': 'UbuntuServer', 'publisher': 'Canonical', 'sku': '18.04-LTS', 'version': 'latest'} |
| | | | **osDisk** dictionary | always | Specifies information about the operating system disk used by the virtual machine. **Sample:** {'caching': 'ReadWrite', 'createOption': 'FromImage', 'diskSizeGB': 30, 'managedDisk': {'id': '/subscriptions/xxx...xxxx/resourceGroups/v-xisuRG/providers/Microsoft.Compute/disks/myVM\_disk1\_xxx', 'storageAccountType': 'Premium\_LRS'}, 'name': 'myVM\_disk1\_xxx', 'osType': 'Linux'} |
| | | **vmID** string | always | Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure laaS VMs SMBIOS. It can be read using platform BIOS commands. **Sample:** eb86d9bb-6725-4787-a487-2e497d5b340c |
| | **type** string | always | The type of identity used for the virtual machine. **Sample:** Microsoft.Compute/virtualMachines |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible Azure.Azcollection Azure.Azcollection
==================
Collection version 1.10.0
Plugin Index
------------
These are the plugins in the azure.azcollection collection
### Inventory Plugins
* [azure\_rm](azure_rm_inventory#ansible-collections-azure-azcollection-azure-rm-inventory) – Azure Resource Manager inventory plugin
### Modules
* [azure\_rm\_adapplication](azure_rm_adapplication_module#ansible-collections-azure-azcollection-azure-rm-adapplication-module) – Manage Azure Active Directory application
* [azure\_rm\_adapplication\_info](azure_rm_adapplication_info_module#ansible-collections-azure-azcollection-azure-rm-adapplication-info-module) – Get Azure Active Directory application info
* [azure\_rm\_adgroup](azure_rm_adgroup_module#ansible-collections-azure-azcollection-azure-rm-adgroup-module) – Manage Azure Active Directory group
* [azure\_rm\_adgroup\_info](azure_rm_adgroup_info_module#ansible-collections-azure-azcollection-azure-rm-adgroup-info-module) – Get Azure Active Directory group info
* [azure\_rm\_adpassword](azure_rm_adpassword_module#ansible-collections-azure-azcollection-azure-rm-adpassword-module) – Manage application password
* [azure\_rm\_adpassword\_info](azure_rm_adpassword_info_module#ansible-collections-azure-azcollection-azure-rm-adpassword-info-module) – Get application password info
* [azure\_rm\_adserviceprincipal](azure_rm_adserviceprincipal_module#ansible-collections-azure-azcollection-azure-rm-adserviceprincipal-module) – Manage Azure Active Directory service principal
* [azure\_rm\_adserviceprincipal\_info](azure_rm_adserviceprincipal_info_module#ansible-collections-azure-azcollection-azure-rm-adserviceprincipal-info-module) – Get Azure Active Directory service principal info
* [azure\_rm\_aduser](azure_rm_aduser_module#ansible-collections-azure-azcollection-azure-rm-aduser-module) – Modify an Azure Active Directory user
* [azure\_rm\_aduser\_info](azure_rm_aduser_info_module#ansible-collections-azure-azcollection-azure-rm-aduser-info-module) – Get Azure Active Directory user info
* [azure\_rm\_aks](azure_rm_aks_module#ansible-collections-azure-azcollection-azure-rm-aks-module) – Manage a managed Azure Container Service (AKS) instance
* [azure\_rm\_aks\_info](azure_rm_aks_info_module#ansible-collections-azure-azcollection-azure-rm-aks-info-module) – Get Azure Kubernetes Service facts
* [azure\_rm\_aksupgrade\_info](azure_rm_aksupgrade_info_module#ansible-collections-azure-azcollection-azure-rm-aksupgrade-info-module) – Get the upgrade versions available for a AKS instance
* [azure\_rm\_aksversion\_info](azure_rm_aksversion_info_module#ansible-collections-azure-azcollection-azure-rm-aksversion-info-module) – Get available kubernetes versions supported by Azure Kubernetes Service
* [azure\_rm\_apimanagement](azure_rm_apimanagement_module#ansible-collections-azure-azcollection-azure-rm-apimanagement-module) – Manage Azure api instances
* [azure\_rm\_apimanagement\_info](azure_rm_apimanagement_info_module#ansible-collections-azure-azcollection-azure-rm-apimanagement-info-module) – Get the infomation of the API Instance
* [azure\_rm\_apimanagementservice](azure_rm_apimanagementservice_module#ansible-collections-azure-azcollection-azure-rm-apimanagementservice-module) – Manage Azure ApiManagementService instance
* [azure\_rm\_apimanagementservice\_info](azure_rm_apimanagementservice_info_module#ansible-collections-azure-azcollection-azure-rm-apimanagementservice-info-module) – Get ApiManagementService info
* [azure\_rm\_appgateway](azure_rm_appgateway_module#ansible-collections-azure-azcollection-azure-rm-appgateway-module) – Manage Application Gateway instance
* [azure\_rm\_applicationsecuritygroup](azure_rm_applicationsecuritygroup_module#ansible-collections-azure-azcollection-azure-rm-applicationsecuritygroup-module) – Manage Azure Application Security Group
* [azure\_rm\_applicationsecuritygroup\_info](azure_rm_applicationsecuritygroup_info_module#ansible-collections-azure-azcollection-azure-rm-applicationsecuritygroup-info-module) – Get Azure Application Security Group facts
* [azure\_rm\_appserviceplan](azure_rm_appserviceplan_module#ansible-collections-azure-azcollection-azure-rm-appserviceplan-module) – Manage App Service Plan
* [azure\_rm\_appserviceplan\_info](azure_rm_appserviceplan_info_module#ansible-collections-azure-azcollection-azure-rm-appserviceplan-info-module) – Get azure app service plan facts
* [azure\_rm\_automationaccount](azure_rm_automationaccount_module#ansible-collections-azure-azcollection-azure-rm-automationaccount-module) – Manage Azure Automation account
* [azure\_rm\_automationaccount\_info](azure_rm_automationaccount_info_module#ansible-collections-azure-azcollection-azure-rm-automationaccount-info-module) – Get Azure automation account facts
* [azure\_rm\_autoscale](azure_rm_autoscale_module#ansible-collections-azure-azcollection-azure-rm-autoscale-module) – Manage Azure autoscale setting
* [azure\_rm\_autoscale\_info](azure_rm_autoscale_info_module#ansible-collections-azure-azcollection-azure-rm-autoscale-info-module) – Get Azure Auto Scale Setting facts
* [azure\_rm\_availabilityset](azure_rm_availabilityset_module#ansible-collections-azure-azcollection-azure-rm-availabilityset-module) – Manage Azure Availability Set
* [azure\_rm\_availabilityset\_info](azure_rm_availabilityset_info_module#ansible-collections-azure-azcollection-azure-rm-availabilityset-info-module) – Get Azure Availability Set facts
* [azure\_rm\_azurefirewall](azure_rm_azurefirewall_module#ansible-collections-azure-azcollection-azure-rm-azurefirewall-module) – Manage Azure Firewall instance
* [azure\_rm\_azurefirewall\_info](azure_rm_azurefirewall_info_module#ansible-collections-azure-azcollection-azure-rm-azurefirewall-info-module) – Get AzureFirewall info
* [azure\_rm\_backupazurevm](azure_rm_backupazurevm_module#ansible-collections-azure-azcollection-azure-rm-backupazurevm-module) – Back up an Azure Virtual Machine using Azure Backup
* [azure\_rm\_backupazurevm\_info](azure_rm_backupazurevm_info_module#ansible-collections-azure-azcollection-azure-rm-backupazurevm-info-module) – Back up an Azure Virtual Machine using Azure Backup Information
* [azure\_rm\_backuppolicy](azure_rm_backuppolicy_module#ansible-collections-azure-azcollection-azure-rm-backuppolicy-module) – Manage Azure Backup Policy
* [azure\_rm\_backuppolicy\_info](azure_rm_backuppolicy_info_module#ansible-collections-azure-azcollection-azure-rm-backuppolicy-info-module) – Get Info on Azure Backup Policy
* [azure\_rm\_batchaccount](azure_rm_batchaccount_module#ansible-collections-azure-azcollection-azure-rm-batchaccount-module) – Manages a Batch Account on Azure
* [azure\_rm\_cdnendpoint](azure_rm_cdnendpoint_module#ansible-collections-azure-azcollection-azure-rm-cdnendpoint-module) – Manage a Azure CDN endpoint
* [azure\_rm\_cdnendpoint\_info](azure_rm_cdnendpoint_info_module#ansible-collections-azure-azcollection-azure-rm-cdnendpoint-info-module) – Get Azure CDN endpoint facts
* [azure\_rm\_cdnprofile](azure_rm_cdnprofile_module#ansible-collections-azure-azcollection-azure-rm-cdnprofile-module) – Manage a Azure CDN profile
* [azure\_rm\_cdnprofile\_info](azure_rm_cdnprofile_info_module#ansible-collections-azure-azcollection-azure-rm-cdnprofile-info-module) – Get Azure CDN profile facts
* [azure\_rm\_cognitivesearch](azure_rm_cognitivesearch_module#ansible-collections-azure-azcollection-azure-rm-cognitivesearch-module) – Manage Azure Cognitive Search service
* [azure\_rm\_cognitivesearch\_info](azure_rm_cognitivesearch_info_module#ansible-collections-azure-azcollection-azure-rm-cognitivesearch-info-module) – Get Azure Cognitive Search service info
* [azure\_rm\_containerinstance](azure_rm_containerinstance_module#ansible-collections-azure-azcollection-azure-rm-containerinstance-module) – Manage an Azure Container Instance
* [azure\_rm\_containerinstance\_info](azure_rm_containerinstance_info_module#ansible-collections-azure-azcollection-azure-rm-containerinstance-info-module) – Get Azure Container Instance facts
* [azure\_rm\_containerregistry](azure_rm_containerregistry_module#ansible-collections-azure-azcollection-azure-rm-containerregistry-module) – Manage an Azure Container Registry
* [azure\_rm\_containerregistry\_info](azure_rm_containerregistry_info_module#ansible-collections-azure-azcollection-azure-rm-containerregistry-info-module) – Get Azure Container Registry facts
* [azure\_rm\_containerregistryreplication](azure_rm_containerregistryreplication_module#ansible-collections-azure-azcollection-azure-rm-containerregistryreplication-module) – Manage Replication instance.
* [azure\_rm\_containerregistryreplication\_info](azure_rm_containerregistryreplication_info_module#ansible-collections-azure-azcollection-azure-rm-containerregistryreplication-info-module) – Get Replication facts.
* [azure\_rm\_containerregistrywebhook](azure_rm_containerregistrywebhook_module#ansible-collections-azure-azcollection-azure-rm-containerregistrywebhook-module) – Manage Webhook instance.
* [azure\_rm\_containerregistrywebhook\_info](azure_rm_containerregistrywebhook_info_module#ansible-collections-azure-azcollection-azure-rm-containerregistrywebhook-info-module) – Get Webhook facts.
* [azure\_rm\_cosmosdbaccount](azure_rm_cosmosdbaccount_module#ansible-collections-azure-azcollection-azure-rm-cosmosdbaccount-module) – Manage Azure Database Account instance
* [azure\_rm\_cosmosdbaccount\_info](azure_rm_cosmosdbaccount_info_module#ansible-collections-azure-azcollection-azure-rm-cosmosdbaccount-info-module) – Get Azure Cosmos DB Account facts
* [azure\_rm\_datalakestore](azure_rm_datalakestore_module#ansible-collections-azure-azcollection-azure-rm-datalakestore-module) – Manage Azure data lake store
* [azure\_rm\_datalakestore\_info](azure_rm_datalakestore_info_module#ansible-collections-azure-azcollection-azure-rm-datalakestore-info-module) – Get Azure Data Lake Store info
* [azure\_rm\_ddosprotectionplan](azure_rm_ddosprotectionplan_module#ansible-collections-azure-azcollection-azure-rm-ddosprotectionplan-module) – Manage DDoS protection plan
* [azure\_rm\_ddosprotectionplan\_info](azure_rm_ddosprotectionplan_info_module#ansible-collections-azure-azcollection-azure-rm-ddosprotectionplan-info-module) – Get Azure DDoS protection plan
* [azure\_rm\_deployment](azure_rm_deployment_module#ansible-collections-azure-azcollection-azure-rm-deployment-module) – Create or destroy Azure Resource Manager template deployments
* [azure\_rm\_deployment\_info](azure_rm_deployment_info_module#ansible-collections-azure-azcollection-azure-rm-deployment-info-module) – Get Azure Deployment facts
* [azure\_rm\_devtestlab](azure_rm_devtestlab_module#ansible-collections-azure-azcollection-azure-rm-devtestlab-module) – Manage Azure DevTest Lab instance
* [azure\_rm\_devtestlab\_info](azure_rm_devtestlab_info_module#ansible-collections-azure-azcollection-azure-rm-devtestlab-info-module) – Get Azure DevTest Lab facts
* [azure\_rm\_devtestlabarmtemplate\_info](azure_rm_devtestlabarmtemplate_info_module#ansible-collections-azure-azcollection-azure-rm-devtestlabarmtemplate-info-module) – Get Azure DevTest Lab ARM Template facts
* [azure\_rm\_devtestlabartifact\_info](azure_rm_devtestlabartifact_info_module#ansible-collections-azure-azcollection-azure-rm-devtestlabartifact-info-module) – Get Azure DevTest Lab Artifact facts
* [azure\_rm\_devtestlabartifactsource](azure_rm_devtestlabartifactsource_module#ansible-collections-azure-azcollection-azure-rm-devtestlabartifactsource-module) – Manage Azure DevTest Labs Artifacts Source instance
* [azure\_rm\_devtestlabartifactsource\_info](azure_rm_devtestlabartifactsource_info_module#ansible-collections-azure-azcollection-azure-rm-devtestlabartifactsource-info-module) – Get Azure DevTest Lab Artifact Source facts
* [azure\_rm\_devtestlabcustomimage](azure_rm_devtestlabcustomimage_module#ansible-collections-azure-azcollection-azure-rm-devtestlabcustomimage-module) – Manage Azure DevTest Lab Custom Image instance
* [azure\_rm\_devtestlabcustomimage\_info](azure_rm_devtestlabcustomimage_info_module#ansible-collections-azure-azcollection-azure-rm-devtestlabcustomimage-info-module) – Get Azure DevTest Lab Custom Image facts
* [azure\_rm\_devtestlabenvironment](azure_rm_devtestlabenvironment_module#ansible-collections-azure-azcollection-azure-rm-devtestlabenvironment-module) – Manage Azure DevTest Lab Environment instance
* [azure\_rm\_devtestlabenvironment\_info](azure_rm_devtestlabenvironment_info_module#ansible-collections-azure-azcollection-azure-rm-devtestlabenvironment-info-module) – Get Azure Environment facts
* [azure\_rm\_devtestlabpolicy](azure_rm_devtestlabpolicy_module#ansible-collections-azure-azcollection-azure-rm-devtestlabpolicy-module) – Manage Azure Policy instance
* [azure\_rm\_devtestlabpolicy\_info](azure_rm_devtestlabpolicy_info_module#ansible-collections-azure-azcollection-azure-rm-devtestlabpolicy-info-module) – Get Azure DTL Policy facts
* [azure\_rm\_devtestlabschedule](azure_rm_devtestlabschedule_module#ansible-collections-azure-azcollection-azure-rm-devtestlabschedule-module) – Manage Azure DevTest Lab Schedule instance
* [azure\_rm\_devtestlabschedule\_info](azure_rm_devtestlabschedule_info_module#ansible-collections-azure-azcollection-azure-rm-devtestlabschedule-info-module) – Get Azure Schedule facts
* [azure\_rm\_devtestlabvirtualmachine](azure_rm_devtestlabvirtualmachine_module#ansible-collections-azure-azcollection-azure-rm-devtestlabvirtualmachine-module) – Manage Azure DevTest Lab Virtual Machine instance
* [azure\_rm\_devtestlabvirtualmachine\_info](azure_rm_devtestlabvirtualmachine_info_module#ansible-collections-azure-azcollection-azure-rm-devtestlabvirtualmachine-info-module) – Get Azure DevTest Lab Virtual Machine facts
* [azure\_rm\_devtestlabvirtualnetwork](azure_rm_devtestlabvirtualnetwork_module#ansible-collections-azure-azcollection-azure-rm-devtestlabvirtualnetwork-module) – Manage Azure DevTest Lab Virtual Network instance
* [azure\_rm\_devtestlabvirtualnetwork\_info](azure_rm_devtestlabvirtualnetwork_info_module#ansible-collections-azure-azcollection-azure-rm-devtestlabvirtualnetwork-info-module) – Get Azure DevTest Lab Virtual Network facts
* [azure\_rm\_diskencryptionset](azure_rm_diskencryptionset_module#ansible-collections-azure-azcollection-azure-rm-diskencryptionset-module) – Create, delete and update Disk encryption set
* [azure\_rm\_diskencryptionset\_info](azure_rm_diskencryptionset_info_module#ansible-collections-azure-azcollection-azure-rm-diskencryptionset-info-module) – Get disk encryption set facts
* [azure\_rm\_dnsrecordset](azure_rm_dnsrecordset_module#ansible-collections-azure-azcollection-azure-rm-dnsrecordset-module) – Create, delete and update DNS record sets and records
* [azure\_rm\_dnsrecordset\_info](azure_rm_dnsrecordset_info_module#ansible-collections-azure-azcollection-azure-rm-dnsrecordset-info-module) – Get DNS Record Set facts
* [azure\_rm\_dnszone](azure_rm_dnszone_module#ansible-collections-azure-azcollection-azure-rm-dnszone-module) – Manage Azure DNS zones
* [azure\_rm\_dnszone\_info](azure_rm_dnszone_info_module#ansible-collections-azure-azcollection-azure-rm-dnszone-info-module) – Get DNS zone facts
* [azure\_rm\_eventhub](azure_rm_eventhub_module#ansible-collections-azure-azcollection-azure-rm-eventhub-module) – Manage Event Hub
* [azure\_rm\_eventhub\_info](azure_rm_eventhub_info_module#ansible-collections-azure-azcollection-azure-rm-eventhub-info-module) – Get Azure Event Hub
* [azure\_rm\_expressroute](azure_rm_expressroute_module#ansible-collections-azure-azcollection-azure-rm-expressroute-module) – Manage Express Route Circuits
* [azure\_rm\_expressroute\_info](azure_rm_expressroute_info_module#ansible-collections-azure-azcollection-azure-rm-expressroute-info-module) – Get Azure Express Route
* [azure\_rm\_functionapp](azure_rm_functionapp_module#ansible-collections-azure-azcollection-azure-rm-functionapp-module) – Manage Azure Function Apps
* [azure\_rm\_functionapp\_info](azure_rm_functionapp_info_module#ansible-collections-azure-azcollection-azure-rm-functionapp-info-module) – Get Azure Function App facts
* [azure\_rm\_gallery](azure_rm_gallery_module#ansible-collections-azure-azcollection-azure-rm-gallery-module) – Manage Azure Shared Image Gallery instance
* [azure\_rm\_gallery\_info](azure_rm_gallery_info_module#ansible-collections-azure-azcollection-azure-rm-gallery-info-module) – Get Azure Shared Image Gallery info
* [azure\_rm\_galleryimage](azure_rm_galleryimage_module#ansible-collections-azure-azcollection-azure-rm-galleryimage-module) – Manage Azure SIG Image instance
* [azure\_rm\_galleryimage\_info](azure_rm_galleryimage_info_module#ansible-collections-azure-azcollection-azure-rm-galleryimage-info-module) – Get Azure SIG Image info
* [azure\_rm\_galleryimageversion](azure_rm_galleryimageversion_module#ansible-collections-azure-azcollection-azure-rm-galleryimageversion-module) – Manage Azure SIG Image Version instance
* [azure\_rm\_galleryimageversion\_info](azure_rm_galleryimageversion_info_module#ansible-collections-azure-azcollection-azure-rm-galleryimageversion-info-module) – Get Azure SIG Image Version info
* [azure\_rm\_hdinsightcluster](azure_rm_hdinsightcluster_module#ansible-collections-azure-azcollection-azure-rm-hdinsightcluster-module) – Manage Azure HDInsight Cluster instance
* [azure\_rm\_hdinsightcluster\_info](azure_rm_hdinsightcluster_info_module#ansible-collections-azure-azcollection-azure-rm-hdinsightcluster-info-module) – Get Azure HDInsight Cluster facts
* [azure\_rm\_image](azure_rm_image_module#ansible-collections-azure-azcollection-azure-rm-image-module) – Manage Azure image
* [azure\_rm\_image\_info](azure_rm_image_info_module#ansible-collections-azure-azcollection-azure-rm-image-info-module) – Get facts about azure custom images
* [azure\_rm\_iotdevice](azure_rm_iotdevice_module#ansible-collections-azure-azcollection-azure-rm-iotdevice-module) – Manage Azure IoT hub device
* [azure\_rm\_iotdevice\_info](azure_rm_iotdevice_info_module#ansible-collections-azure-azcollection-azure-rm-iotdevice-info-module) – Facts of Azure IoT hub device
* [azure\_rm\_iotdevicemodule](azure_rm_iotdevicemodule_module#ansible-collections-azure-azcollection-azure-rm-iotdevicemodule-module) – Manage Azure IoT hub device module
* [azure\_rm\_iothub](azure_rm_iothub_module#ansible-collections-azure-azcollection-azure-rm-iothub-module) – Manage Azure IoT hub
* [azure\_rm\_iothub\_info](azure_rm_iothub_info_module#ansible-collections-azure-azcollection-azure-rm-iothub-info-module) – Get IoT Hub facts
* [azure\_rm\_iothubconsumergroup](azure_rm_iothubconsumergroup_module#ansible-collections-azure-azcollection-azure-rm-iothubconsumergroup-module) – Manage Azure IoT hub
* [azure\_rm\_ipgroup](azure_rm_ipgroup_module#ansible-collections-azure-azcollection-azure-rm-ipgroup-module) – Create, delete and update IP group
* [azure\_rm\_ipgroup\_info](azure_rm_ipgroup_info_module#ansible-collections-azure-azcollection-azure-rm-ipgroup-info-module) – Get IP group facts
* [azure\_rm\_keyvault](azure_rm_keyvault_module#ansible-collections-azure-azcollection-azure-rm-keyvault-module) – Manage Key Vault instance
* [azure\_rm\_keyvault\_info](azure_rm_keyvault_info_module#ansible-collections-azure-azcollection-azure-rm-keyvault-info-module) – Get Azure Key Vault facts
* [azure\_rm\_keyvaultkey](azure_rm_keyvaultkey_module#ansible-collections-azure-azcollection-azure-rm-keyvaultkey-module) – Use Azure KeyVault keys
* [azure\_rm\_keyvaultkey\_info](azure_rm_keyvaultkey_info_module#ansible-collections-azure-azcollection-azure-rm-keyvaultkey-info-module) – Get Azure Key Vault key facts
* [azure\_rm\_keyvaultsecret](azure_rm_keyvaultsecret_module#ansible-collections-azure-azcollection-azure-rm-keyvaultsecret-module) – Use Azure KeyVault Secrets
* [azure\_rm\_keyvaultsecret\_info](azure_rm_keyvaultsecret_info_module#ansible-collections-azure-azcollection-azure-rm-keyvaultsecret-info-module) – Get Azure Key Vault secret facts
* [azure\_rm\_loadbalancer](azure_rm_loadbalancer_module#ansible-collections-azure-azcollection-azure-rm-loadbalancer-module) – Manage Azure load balancers
* [azure\_rm\_loadbalancer\_info](azure_rm_loadbalancer_info_module#ansible-collections-azure-azcollection-azure-rm-loadbalancer-info-module) – Get load balancer facts
* [azure\_rm\_lock](azure_rm_lock_module#ansible-collections-azure-azcollection-azure-rm-lock-module) – Manage Azure locks
* [azure\_rm\_lock\_info](azure_rm_lock_info_module#ansible-collections-azure-azcollection-azure-rm-lock-info-module) – Manage Azure locks
* [azure\_rm\_loganalyticsworkspace](azure_rm_loganalyticsworkspace_module#ansible-collections-azure-azcollection-azure-rm-loganalyticsworkspace-module) – Manage Azure Log Analytics workspaces
* [azure\_rm\_loganalyticsworkspace\_info](azure_rm_loganalyticsworkspace_info_module#ansible-collections-azure-azcollection-azure-rm-loganalyticsworkspace-info-module) – Get facts of Azure Log Analytics workspaces
* [azure\_rm\_manageddisk](azure_rm_manageddisk_module#ansible-collections-azure-azcollection-azure-rm-manageddisk-module) – Manage Azure Manage Disks
* [azure\_rm\_manageddisk\_info](azure_rm_manageddisk_info_module#ansible-collections-azure-azcollection-azure-rm-manageddisk-info-module) – Get managed disk facts
* [azure\_rm\_managementgroup](azure_rm_managementgroup_module#ansible-collections-azure-azcollection-azure-rm-managementgroup-module) – Manage Azure ManagementGroup instance
* [azure\_rm\_managementgroup\_info](azure_rm_managementgroup_info_module#ansible-collections-azure-azcollection-azure-rm-managementgroup-info-module) – Get Azure Management Group facts
* [azure\_rm\_mariadbconfiguration](azure_rm_mariadbconfiguration_module#ansible-collections-azure-azcollection-azure-rm-mariadbconfiguration-module) – Manage Configuration instance
* [azure\_rm\_mariadbconfiguration\_info](azure_rm_mariadbconfiguration_info_module#ansible-collections-azure-azcollection-azure-rm-mariadbconfiguration-info-module) – Get Azure MariaDB Configuration facts
* [azure\_rm\_mariadbdatabase](azure_rm_mariadbdatabase_module#ansible-collections-azure-azcollection-azure-rm-mariadbdatabase-module) – Manage MariaDB Database instance
* [azure\_rm\_mariadbdatabase\_info](azure_rm_mariadbdatabase_info_module#ansible-collections-azure-azcollection-azure-rm-mariadbdatabase-info-module) – Get Azure MariaDB Database facts
* [azure\_rm\_mariadbfirewallrule](azure_rm_mariadbfirewallrule_module#ansible-collections-azure-azcollection-azure-rm-mariadbfirewallrule-module) – Manage MariaDB firewall rule instance
* [azure\_rm\_mariadbfirewallrule\_info](azure_rm_mariadbfirewallrule_info_module#ansible-collections-azure-azcollection-azure-rm-mariadbfirewallrule-info-module) – Get Azure MariaDB Firewall Rule facts
* [azure\_rm\_mariadbserver](azure_rm_mariadbserver_module#ansible-collections-azure-azcollection-azure-rm-mariadbserver-module) – Manage MariaDB Server instance
* [azure\_rm\_mariadbserver\_info](azure_rm_mariadbserver_info_module#ansible-collections-azure-azcollection-azure-rm-mariadbserver-info-module) – Get Azure MariaDB Server facts
* [azure\_rm\_monitorlogprofile](azure_rm_monitorlogprofile_module#ansible-collections-azure-azcollection-azure-rm-monitorlogprofile-module) – Manage Azure Monitor log profile
* [azure\_rm\_mysqlconfiguration](azure_rm_mysqlconfiguration_module#ansible-collections-azure-azcollection-azure-rm-mysqlconfiguration-module) – Manage Configuration instance
* [azure\_rm\_mysqlconfiguration\_info](azure_rm_mysqlconfiguration_info_module#ansible-collections-azure-azcollection-azure-rm-mysqlconfiguration-info-module) – Get Azure MySQL Configuration facts
* [azure\_rm\_mysqldatabase](azure_rm_mysqldatabase_module#ansible-collections-azure-azcollection-azure-rm-mysqldatabase-module) – Manage MySQL Database instance
* [azure\_rm\_mysqldatabase\_info](azure_rm_mysqldatabase_info_module#ansible-collections-azure-azcollection-azure-rm-mysqldatabase-info-module) – Get Azure MySQL Database facts
* [azure\_rm\_mysqlfirewallrule](azure_rm_mysqlfirewallrule_module#ansible-collections-azure-azcollection-azure-rm-mysqlfirewallrule-module) – Manage MySQL firewall rule instance
* [azure\_rm\_mysqlfirewallrule\_info](azure_rm_mysqlfirewallrule_info_module#ansible-collections-azure-azcollection-azure-rm-mysqlfirewallrule-info-module) – Get Azure MySQL Firewall Rule facts
* [azure\_rm\_mysqlserver](azure_rm_mysqlserver_module#ansible-collections-azure-azcollection-azure-rm-mysqlserver-module) – Manage MySQL Server instance
* [azure\_rm\_mysqlserver\_info](azure_rm_mysqlserver_info_module#ansible-collections-azure-azcollection-azure-rm-mysqlserver-info-module) – Get Azure MySQL Server facts
* [azure\_rm\_networkinterface](azure_rm_networkinterface_module#ansible-collections-azure-azcollection-azure-rm-networkinterface-module) – Manage Azure network interfaces
* [azure\_rm\_networkinterface\_info](azure_rm_networkinterface_info_module#ansible-collections-azure-azcollection-azure-rm-networkinterface-info-module) – Get network interface facts
* [azure\_rm\_notificationhub](azure_rm_notificationhub_module#ansible-collections-azure-azcollection-azure-rm-notificationhub-module) – Manage Notification Hub
* [azure\_rm\_notificationhub\_info](azure_rm_notificationhub_info_module#ansible-collections-azure-azcollection-azure-rm-notificationhub-info-module) – Get Azure Notification Hub
* [azure\_rm\_openshiftmanagedcluster](azure_rm_openshiftmanagedcluster_module#ansible-collections-azure-azcollection-azure-rm-openshiftmanagedcluster-module) – Manage Azure Red Hat OpenShift Managed Cluster instance
* [azure\_rm\_postgresqlconfiguration](azure_rm_postgresqlconfiguration_module#ansible-collections-azure-azcollection-azure-rm-postgresqlconfiguration-module) – Manage Azure PostgreSQL Configuration
* [azure\_rm\_postgresqlconfiguration\_info](azure_rm_postgresqlconfiguration_info_module#ansible-collections-azure-azcollection-azure-rm-postgresqlconfiguration-info-module) – Get Azure PostgreSQL Configuration facts
* [azure\_rm\_postgresqldatabase](azure_rm_postgresqldatabase_module#ansible-collections-azure-azcollection-azure-rm-postgresqldatabase-module) – Manage PostgreSQL Database instance
* [azure\_rm\_postgresqldatabase\_info](azure_rm_postgresqldatabase_info_module#ansible-collections-azure-azcollection-azure-rm-postgresqldatabase-info-module) – Get Azure PostgreSQL Database facts
* [azure\_rm\_postgresqlfirewallrule](azure_rm_postgresqlfirewallrule_module#ansible-collections-azure-azcollection-azure-rm-postgresqlfirewallrule-module) – Manage PostgreSQL firewall rule instance
* [azure\_rm\_postgresqlfirewallrule\_info](azure_rm_postgresqlfirewallrule_info_module#ansible-collections-azure-azcollection-azure-rm-postgresqlfirewallrule-info-module) – Get Azure PostgreSQL Firewall Rule facts
* [azure\_rm\_postgresqlserver](azure_rm_postgresqlserver_module#ansible-collections-azure-azcollection-azure-rm-postgresqlserver-module) – Manage PostgreSQL Server instance
* [azure\_rm\_postgresqlserver\_info](azure_rm_postgresqlserver_info_module#ansible-collections-azure-azcollection-azure-rm-postgresqlserver-info-module) – Get Azure PostgreSQL Server facts
* [azure\_rm\_privatednsrecordset](azure_rm_privatednsrecordset_module#ansible-collections-azure-azcollection-azure-rm-privatednsrecordset-module) – Create, delete and update Private DNS record sets and records
* [azure\_rm\_privatednsrecordset\_info](azure_rm_privatednsrecordset_info_module#ansible-collections-azure-azcollection-azure-rm-privatednsrecordset-info-module) – Get Private DNS Record Set facts
* [azure\_rm\_privatednszone](azure_rm_privatednszone_module#ansible-collections-azure-azcollection-azure-rm-privatednszone-module) – Manage Azure private DNS zones
* [azure\_rm\_privatednszone\_info](azure_rm_privatednszone_info_module#ansible-collections-azure-azcollection-azure-rm-privatednszone-info-module) – Get private DNS zone facts
* [azure\_rm\_privatednszonelink](azure_rm_privatednszonelink_module#ansible-collections-azure-azcollection-azure-rm-privatednszonelink-module) – Create, delete and update Virtual network link for Private DNS zone
* [azure\_rm\_privatednszonelink\_info](azure_rm_privatednszonelink_info_module#ansible-collections-azure-azcollection-azure-rm-privatednszonelink-info-module) – Get Virtual Network link facts for private DNS zone
* [azure\_rm\_privateendpoint](azure_rm_privateendpoint_module#ansible-collections-azure-azcollection-azure-rm-privateendpoint-module) – Manage Azure private endpoint
* [azure\_rm\_privateendpoint\_info](azure_rm_privateendpoint_info_module#ansible-collections-azure-azcollection-azure-rm-privateendpoint-info-module) – Get private endpoints info
* [azure\_rm\_proximityplacementgroup](azure_rm_proximityplacementgroup_module#ansible-collections-azure-azcollection-azure-rm-proximityplacementgroup-module) – Create, delete and update proximity placement group
* [azure\_rm\_proximityplacementgroup\_info](azure_rm_proximityplacementgroup_info_module#ansible-collections-azure-azcollection-azure-rm-proximityplacementgroup-info-module) – Get proximity placement group facts
* [azure\_rm\_publicipaddress](azure_rm_publicipaddress_module#ansible-collections-azure-azcollection-azure-rm-publicipaddress-module) – Manage Azure Public IP Addresses
* [azure\_rm\_publicipaddress\_info](azure_rm_publicipaddress_info_module#ansible-collections-azure-azcollection-azure-rm-publicipaddress-info-module) – Get public IP facts
* [azure\_rm\_recoveryservicesvault](azure_rm_recoveryservicesvault_module#ansible-collections-azure-azcollection-azure-rm-recoveryservicesvault-module) – Create and Delete Azure Recovery Services vault
* [azure\_rm\_recoveryservicesvault\_info](azure_rm_recoveryservicesvault_info_module#ansible-collections-azure-azcollection-azure-rm-recoveryservicesvault-info-module) – Get Azure Recovery Services vault Details
* [azure\_rm\_rediscache](azure_rm_rediscache_module#ansible-collections-azure-azcollection-azure-rm-rediscache-module) – Manage Azure Cache for Redis instance
* [azure\_rm\_rediscache\_info](azure_rm_rediscache_info_module#ansible-collections-azure-azcollection-azure-rm-rediscache-info-module) – Get Azure Cache for Redis instance facts
* [azure\_rm\_rediscachefirewallrule](azure_rm_rediscachefirewallrule_module#ansible-collections-azure-azcollection-azure-rm-rediscachefirewallrule-module) – Manage Azure Cache for Redis Firewall rules
* [azure\_rm\_registrationassignment](azure_rm_registrationassignment_module#ansible-collections-azure-azcollection-azure-rm-registrationassignment-module) – Manage Azure RegistrationAssignment instance
* [azure\_rm\_registrationassignment\_info](azure_rm_registrationassignment_info_module#ansible-collections-azure-azcollection-azure-rm-registrationassignment-info-module) – Get RegistrationAssignment info
* [azure\_rm\_registrationdefinition](azure_rm_registrationdefinition_module#ansible-collections-azure-azcollection-azure-rm-registrationdefinition-module) – Manage Azure RegistrationDefinition instance
* [azure\_rm\_registrationdefinition\_info](azure_rm_registrationdefinition_info_module#ansible-collections-azure-azcollection-azure-rm-registrationdefinition-info-module) – Get RegistrationDefinition info
* [azure\_rm\_resource](azure_rm_resource_module#ansible-collections-azure-azcollection-azure-rm-resource-module) – Create any Azure resource
* [azure\_rm\_resource\_info](azure_rm_resource_info_module#ansible-collections-azure-azcollection-azure-rm-resource-info-module) – Generic facts of Azure resources
* [azure\_rm\_resourcegroup](azure_rm_resourcegroup_module#ansible-collections-azure-azcollection-azure-rm-resourcegroup-module) – Manage Azure resource groups
* [azure\_rm\_resourcegroup\_info](azure_rm_resourcegroup_info_module#ansible-collections-azure-azcollection-azure-rm-resourcegroup-info-module) – Get resource group facts
* [azure\_rm\_roleassignment](azure_rm_roleassignment_module#ansible-collections-azure-azcollection-azure-rm-roleassignment-module) – Manage Azure Role Assignment
* [azure\_rm\_roleassignment\_info](azure_rm_roleassignment_info_module#ansible-collections-azure-azcollection-azure-rm-roleassignment-info-module) – Gets Azure Role Assignment facts
* [azure\_rm\_roledefinition](azure_rm_roledefinition_module#ansible-collections-azure-azcollection-azure-rm-roledefinition-module) – Manage Azure Role Definition
* [azure\_rm\_roledefinition\_info](azure_rm_roledefinition_info_module#ansible-collections-azure-azcollection-azure-rm-roledefinition-info-module) – Get Azure Role Definition facts
* [azure\_rm\_route](azure_rm_route_module#ansible-collections-azure-azcollection-azure-rm-route-module) – Manage Azure route resource
* [azure\_rm\_route\_info](azure_rm_route_info_module#ansible-collections-azure-azcollection-azure-rm-route-info-module) – Get Route info
* [azure\_rm\_routetable](azure_rm_routetable_module#ansible-collections-azure-azcollection-azure-rm-routetable-module) – Manage Azure route table resource
* [azure\_rm\_routetable\_info](azure_rm_routetable_info_module#ansible-collections-azure-azcollection-azure-rm-routetable-info-module) – Get route table facts
* [azure\_rm\_securitygroup](azure_rm_securitygroup_module#ansible-collections-azure-azcollection-azure-rm-securitygroup-module) – Manage Azure network security groups
* [azure\_rm\_securitygroup\_info](azure_rm_securitygroup_info_module#ansible-collections-azure-azcollection-azure-rm-securitygroup-info-module) – Get security group facts
* [azure\_rm\_servicebus](azure_rm_servicebus_module#ansible-collections-azure-azcollection-azure-rm-servicebus-module) – Manage Azure Service Bus
* [azure\_rm\_servicebus\_info](azure_rm_servicebus_info_module#ansible-collections-azure-azcollection-azure-rm-servicebus-info-module) – Get servicebus facts
* [azure\_rm\_servicebusqueue](azure_rm_servicebusqueue_module#ansible-collections-azure-azcollection-azure-rm-servicebusqueue-module) – Manage Azure Service Bus queue
* [azure\_rm\_servicebussaspolicy](azure_rm_servicebussaspolicy_module#ansible-collections-azure-azcollection-azure-rm-servicebussaspolicy-module) – Manage Azure Service Bus SAS policy
* [azure\_rm\_servicebustopic](azure_rm_servicebustopic_module#ansible-collections-azure-azcollection-azure-rm-servicebustopic-module) – Manage Azure Service Bus
* [azure\_rm\_servicebustopicsubscription](azure_rm_servicebustopicsubscription_module#ansible-collections-azure-azcollection-azure-rm-servicebustopicsubscription-module) – Manage Azure Service Bus subscription
* [azure\_rm\_snapshot](azure_rm_snapshot_module#ansible-collections-azure-azcollection-azure-rm-snapshot-module) – Manage Azure Snapshot instance.
* [azure\_rm\_sqldatabase](azure_rm_sqldatabase_module#ansible-collections-azure-azcollection-azure-rm-sqldatabase-module) – Manage SQL Database instance
* [azure\_rm\_sqldatabase\_info](azure_rm_sqldatabase_info_module#ansible-collections-azure-azcollection-azure-rm-sqldatabase-info-module) – Get Azure SQL Database facts
* [azure\_rm\_sqlfirewallrule](azure_rm_sqlfirewallrule_module#ansible-collections-azure-azcollection-azure-rm-sqlfirewallrule-module) – Manage Firewall Rule instance
* [azure\_rm\_sqlfirewallrule\_info](azure_rm_sqlfirewallrule_info_module#ansible-collections-azure-azcollection-azure-rm-sqlfirewallrule-info-module) – Get Azure SQL Firewall Rule facts
* [azure\_rm\_sqlserver](azure_rm_sqlserver_module#ansible-collections-azure-azcollection-azure-rm-sqlserver-module) – Manage SQL Server instance
* [azure\_rm\_sqlserver\_info](azure_rm_sqlserver_info_module#ansible-collections-azure-azcollection-azure-rm-sqlserver-info-module) – Get SQL Server facts
* [azure\_rm\_storageaccount](azure_rm_storageaccount_module#ansible-collections-azure-azcollection-azure-rm-storageaccount-module) – Manage Azure storage accounts
* [azure\_rm\_storageaccount\_info](azure_rm_storageaccount_info_module#ansible-collections-azure-azcollection-azure-rm-storageaccount-info-module) – Get storage account facts
* [azure\_rm\_storageblob](azure_rm_storageblob_module#ansible-collections-azure-azcollection-azure-rm-storageblob-module) – Manage blob containers and blob objects
* [azure\_rm\_subnet](azure_rm_subnet_module#ansible-collections-azure-azcollection-azure-rm-subnet-module) – Manage Azure subnets
* [azure\_rm\_subnet\_info](azure_rm_subnet_info_module#ansible-collections-azure-azcollection-azure-rm-subnet-info-module) – Get Azure Subnet facts
* [azure\_rm\_subscription\_info](azure_rm_subscription_info_module#ansible-collections-azure-azcollection-azure-rm-subscription-info-module) – Get Azure Subscription facts
* [azure\_rm\_trafficmanager](azure_rm_trafficmanager_module#ansible-collections-azure-azcollection-azure-rm-trafficmanager-module) – Manage a Traffic Manager profile.
* [azure\_rm\_trafficmanagerendpoint](azure_rm_trafficmanagerendpoint_module#ansible-collections-azure-azcollection-azure-rm-trafficmanagerendpoint-module) – Manage Azure Traffic Manager endpoint
* [azure\_rm\_trafficmanagerendpoint\_info](azure_rm_trafficmanagerendpoint_info_module#ansible-collections-azure-azcollection-azure-rm-trafficmanagerendpoint-info-module) – Get Azure Traffic Manager endpoint facts
* [azure\_rm\_trafficmanagerprofile](azure_rm_trafficmanagerprofile_module#ansible-collections-azure-azcollection-azure-rm-trafficmanagerprofile-module) – Manage Azure Traffic Manager profile
* [azure\_rm\_trafficmanagerprofile\_info](azure_rm_trafficmanagerprofile_info_module#ansible-collections-azure-azcollection-azure-rm-trafficmanagerprofile-info-module) – Get Azure Traffic Manager profile facts
* [azure\_rm\_virtualmachine](azure_rm_virtualmachine_module#ansible-collections-azure-azcollection-azure-rm-virtualmachine-module) – Manage Azure virtual machines
* [azure\_rm\_virtualmachine\_info](azure_rm_virtualmachine_info_module#ansible-collections-azure-azcollection-azure-rm-virtualmachine-info-module) – Get virtual machine facts
* [azure\_rm\_virtualmachineextension](azure_rm_virtualmachineextension_module#ansible-collections-azure-azcollection-azure-rm-virtualmachineextension-module) – Managed Azure Virtual Machine extension
* [azure\_rm\_virtualmachineextension\_info](azure_rm_virtualmachineextension_info_module#ansible-collections-azure-azcollection-azure-rm-virtualmachineextension-info-module) – Get Azure Virtual Machine Extension facts
* [azure\_rm\_virtualmachineimage\_info](azure_rm_virtualmachineimage_info_module#ansible-collections-azure-azcollection-azure-rm-virtualmachineimage-info-module) – Get virtual machine image facts
* [azure\_rm\_virtualmachinescaleset](azure_rm_virtualmachinescaleset_module#ansible-collections-azure-azcollection-azure-rm-virtualmachinescaleset-module) – Manage Azure virtual machine scale sets
* [azure\_rm\_virtualmachinescaleset\_info](azure_rm_virtualmachinescaleset_info_module#ansible-collections-azure-azcollection-azure-rm-virtualmachinescaleset-info-module) – Get Virtual Machine Scale Set facts
* [azure\_rm\_virtualmachinescalesetextension](azure_rm_virtualmachinescalesetextension_module#ansible-collections-azure-azcollection-azure-rm-virtualmachinescalesetextension-module) – Manage Azure Virtual Machine Scale Set (VMSS) extensions
* [azure\_rm\_virtualmachinescalesetextension\_info](azure_rm_virtualmachinescalesetextension_info_module#ansible-collections-azure-azcollection-azure-rm-virtualmachinescalesetextension-info-module) – Get Azure Virtual Machine Scale Set Extension facts
* [azure\_rm\_virtualmachinescalesetinstance](azure_rm_virtualmachinescalesetinstance_module#ansible-collections-azure-azcollection-azure-rm-virtualmachinescalesetinstance-module) – Get Azure Virtual Machine Scale Set Instance facts
* [azure\_rm\_virtualmachinescalesetinstance\_info](azure_rm_virtualmachinescalesetinstance_info_module#ansible-collections-azure-azcollection-azure-rm-virtualmachinescalesetinstance-info-module) – Get Azure Virtual Machine Scale Set Instance facts
* [azure\_rm\_virtualmachinesize\_info](azure_rm_virtualmachinesize_info_module#ansible-collections-azure-azcollection-azure-rm-virtualmachinesize-info-module) – Get facts for virtual machine sizes
* [azure\_rm\_virtualnetwork](azure_rm_virtualnetwork_module#ansible-collections-azure-azcollection-azure-rm-virtualnetwork-module) – Manage Azure virtual networks
* [azure\_rm\_virtualnetwork\_info](azure_rm_virtualnetwork_info_module#ansible-collections-azure-azcollection-azure-rm-virtualnetwork-info-module) – Get virtual network facts
* [azure\_rm\_virtualnetworkgateway](azure_rm_virtualnetworkgateway_module#ansible-collections-azure-azcollection-azure-rm-virtualnetworkgateway-module) – Manage Azure virtual network gateways
* [azure\_rm\_virtualnetworkpeering](azure_rm_virtualnetworkpeering_module#ansible-collections-azure-azcollection-azure-rm-virtualnetworkpeering-module) – Manage Azure Virtual Network Peering
* [azure\_rm\_virtualnetworkpeering\_info](azure_rm_virtualnetworkpeering_info_module#ansible-collections-azure-azcollection-azure-rm-virtualnetworkpeering-info-module) – Get facts of Azure Virtual Network Peering
* [azure\_rm\_virtualwan](azure_rm_virtualwan_module#ansible-collections-azure-azcollection-azure-rm-virtualwan-module) – Manage Azure VirtualWan instance
* [azure\_rm\_virtualwan\_info](azure_rm_virtualwan_info_module#ansible-collections-azure-azcollection-azure-rm-virtualwan-info-module) – Get VirtualWan info
* [azure\_rm\_vmbackuppolicy](azure_rm_vmbackuppolicy_module#ansible-collections-azure-azcollection-azure-rm-vmbackuppolicy-module) – Create or Delete Azure VM Backup Policy
* [azure\_rm\_vmbackuppolicy\_info](azure_rm_vmbackuppolicy_info_module#ansible-collections-azure-azcollection-azure-rm-vmbackuppolicy-info-module) – Fetch Backup Policy Details
* [azure\_rm\_vpnsite](azure_rm_vpnsite_module#ansible-collections-azure-azcollection-azure-rm-vpnsite-module) – Manage Azure VpnSite instance
* [azure\_rm\_vpnsite\_info](azure_rm_vpnsite_info_module#ansible-collections-azure-azcollection-azure-rm-vpnsite-info-module) – Get VpnSite info
* [azure\_rm\_vpnsitelink\_info](azure_rm_vpnsitelink_info_module#ansible-collections-azure-azcollection-azure-rm-vpnsitelink-info-module) – Get VpnSiteLink info
* [azure\_rm\_webapp](azure_rm_webapp_module#ansible-collections-azure-azcollection-azure-rm-webapp-module) – Manage Web App instances
* [azure\_rm\_webapp\_info](azure_rm_webapp_info_module#ansible-collections-azure-azcollection-azure-rm-webapp-info-module) – Get Azure web app facts
* [azure\_rm\_webappaccessrestriction](azure_rm_webappaccessrestriction_module#ansible-collections-azure-azcollection-azure-rm-webappaccessrestriction-module) – Manage web app network access restrictions
* [azure\_rm\_webappaccessrestriction\_info](azure_rm_webappaccessrestriction_info_module#ansible-collections-azure-azcollection-azure-rm-webappaccessrestriction-info-module) – Retrieve web app network access restriction facts
* [azure\_rm\_webappslot](azure_rm_webappslot_module#ansible-collections-azure-azcollection-azure-rm-webappslot-module) – Manage Azure Web App slot
* [azure\_rm\_webappvnetconnection](azure_rm_webappvnetconnection_module#ansible-collections-azure-azcollection-azure-rm-webappvnetconnection-module) – Manage web app virtual network connection
* [azure\_rm\_webappvnetconnection\_info](azure_rm_webappvnetconnection_info_module#ansible-collections-azure-azcollection-azure-rm-webappvnetconnection-info-module) – Get Azure web app virtual network connection facts
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
| programming_docs |
ansible azure.azcollection.azure_rm_mysqlserver_info – Get Azure MySQL Server facts azure.azcollection.azure\_rm\_mysqlserver\_info – Get Azure MySQL Server facts
==============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_mysqlserver_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of MySQL Server.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the server. |
| **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 / required | | The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of MySQL Server
azure_rm_mysqlserver_info:
resource_group: myResourceGroup
name: server_name
- name: List instances of MySQL Server
azure_rm_mysqlserver_info:
resource_group: myResourceGroup
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **servers** complex | always | A list of dictionaries containing facts for MySQL servers. |
| | **admin\_username** string | always | The administrator's login name of a server. **Sample:** serveradmin |
| | **enforce\_ssl** boolean | always | Enable SSL enforcement. |
| | **fully\_qualified\_domain\_name** string | always | The fully qualified domain name of a server. **Sample:** myabdud1223.mys.database.azure.com |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DBforMySQL/servers/myabdud1223 |
| | **location** string | always | The location the resource resides in. **Sample:** eastus |
| | **name** string | always | Resource name. **Sample:** myabdud1223 |
| | **resource\_group** string | always | Resource group name. **Sample:** myResourceGroup |
| | **sku** complex | always | The SKU of the server. |
| | | **capacity** integer | always | The scale capacity. **Sample:** 2 |
| | | **name** string | always | The name of the SKU. **Sample:** GP\_Gen4\_2 |
| | | **tier** string | always | The tier of the particular SKU. **Sample:** GeneralPurpose |
| | **storage\_profile** complex | always | Storage Profile properties of a server. |
| | | **backup\_retention\_days** integer | always | Backup retention days for the server **Sample:** 7 |
| | | **geo\_redundant\_backup** string | always | Enable Geo-redundant or not for server backup. **Sample:** Disabled |
| | | **storage\_autogrow** string | always | Enable Storage Auto Grow. **Sample:** Disabled |
| | | **storage\_mb** integer | always | The maximum storage allowed for a server. **Sample:** 128000 |
| | **tags** dictionary | success | Tags assigned to the resource. Dictionary of string:string pairs. **Sample:** {'tag1': 'abc'} |
| | **user\_visible\_state** string | always | A state of a server that is visible to user. **Sample:** Ready |
| | **version** string | always | Server version. **Sample:** 9.6 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_containerregistryreplication_info – Get Replication facts. azure.azcollection.azure\_rm\_containerregistryreplication\_info – Get Replication facts.
=========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_containerregistryreplication_info`.
New in version 0.0.1: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
Synopsis
--------
* Get facts of Replication.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **registry\_name** string / required | | The name of the container registry. |
| **replication\_name** string / required | | The name of the replication. |
| **resource\_group** string / required | | The name of the resource group to which the container registry belongs. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of Replication
azure_rm_containerregistryreplication_info:
resource_group: resource_group_name
registry_name: registry_name
replication_name: replication_name
```
### Authors
* Zim Kalinowski (@zikalino)
There were some errors parsing the documentation for this plugin. Please file a bug with the collection.
The errors were:
* ```
Unable to normalize azure_rm_containerregistryreplication_info: return due to: 2 validation errors for PluginReturnSchema
return -> replications -> contains -> replication_name -> contains -> status -> contains -> message -> returned
none is not an allowed value (type=type_error.none.not_allowed)
return -> replications -> contains -> replication_name -> contains -> status -> contains -> timestamp -> type
string does not match regex "^(any|bits|bool|bytes|complex|dict|float|int|json|jsonarg|list|path|sid|str|pathspec|pathlist)$" (type=value_error.str.regex; pattern=^(any|bits|bool|bytes|complex|dict|float|int|json|jsonarg|list|path|sid|str|pathspec|pathlist)$)
```
ansible azure.azcollection.azure_rm_servicebus – Manage Azure Service Bus azure.azcollection.azure\_rm\_servicebus – Manage Azure Service Bus
===================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_servicebus`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete an Azure Service Bus namespaces.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **location** string | | The servicebus's location. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the servicebus namespace. |
| **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 / required | | Name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | **Choices:*** **standard** ←
* basic
* premium
| Namespace SKU. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the servicebus. Use `present` to create or update and use `absen` to delete. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a namespace
azure_rm_servicebus:
name: deadbeef
location: eastus
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | success | Current state of the service bus. **Sample:** /subscriptions/xxx...xxx/resourceGroups/myResourceGroup/providers/Microsoft.ServiceBus/namespaces/myServicebus |
### Authors
* Yuwei Zhou (@yuwzho)
| programming_docs |
ansible azure.azcollection.azure_rm_appserviceplan – Manage App Service Plan azure.azcollection.azure\_rm\_appserviceplan – Manage App Service Plan
======================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_appserviceplan`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of App Service Plan.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **is\_linux** boolean | **Choices:*** **no** ←
* yes
| Describe whether to host webapp on Linux worker. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Unique name of the app service plan to create or update. |
| **number\_of\_workers** string | | Describe number of workers to be allocated. |
| **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 / required | | Name of the resource group to which the resource belongs. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | | The pricing tiers, e.g., `F1`, `D1`, `B1`, `B2`, `B3`, `S1`, `P1`, `P1V2` etc. Please see <https://azure.microsoft.com/en-us/pricing/details/app-service/plans/> for more detail. For Linux app service plan, please see <https://azure.microsoft.com/en-us/pricing/details/app-service/linux/> for more detail. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the app service plan. Use `present` to create or update an app service plan and `absent` to delete it. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a windows app service plan
azure_rm_appserviceplan:
resource_group: myResourceGroup
name: myAppPlan
location: eastus
sku: S1
- name: Create a linux app service plan
azure_rm_appserviceplan:
resource_group: myResourceGroup
name: myAppPlan
location: eastus
sku: S1
is_linux: true
number_of_workers: 1
- name: update sku of existing windows app service plan
azure_rm_appserviceplan:
resource_group: myResourceGroup
name: myAppPlan
location: eastus
sku: S2
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_appserviceplan** dictionary | always | Facts about the current state of the app service plan. **Sample:** {'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Web/serverfarms/myAppPlan'} |
### Authors
* Yunge Zhu (@yungezz)
ansible azure.azcollection.azure_rm_manageddisk – Manage Azure Manage Disks azure.azcollection.azure\_rm\_manageddisk – Manage Azure Manage Disks
=====================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_manageddisk`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete an Azure Managed Disk.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **attach\_caching** string | **Choices:*** * read\_only
* read\_write
| Disk caching policy controlled by VM. Will be used when attached to the VM defined by `managed_by`. If this option is different from the current caching policy, the managed disk will be deattached and attached with current caching option again. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **create\_option** string | **Choices:*** empty
* import
* copy
|
`import` from a VHD file in *source\_uri* and `copy` from previous managed disk *source\_uri*. |
| **disk\_size\_gb** string | | Size in GB of the managed disk to be created. If *create\_option=copy* then the value must be greater than or equal to the source's size. |
| **location** string | | Valid Azure location. Defaults to location of the resource group. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **lun** integer | | The logical unit number for data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. |
| **managed\_by** string | | Name of an existing virtual machine with which the disk is or will be associated, this VM should be in the same resource group. To detach a disk from a vm, explicitly set to ''. If this option is unset, the value will not be changed. |
| **name** string / required | | Name of the managed disk. |
| **os\_type** string | **Choices:*** linux
* windows
| Type of Operating System. Used when *create\_option=copy* or *create\_option=import* and the source is an OS disk. If omitted during creation, no value is set. If omitted during an update, no change is made. Once set, this value cannot be cleared. |
| **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 / required | | Name of a resource group where the managed disk exists or will be created. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **source\_uri** string | | URI to a valid VHD file to be used or the resource ID of the managed disk to copy.
aliases: source\_resource\_uri |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the managed disk. Use `present` to create or update a managed disk and `absent` to delete a managed disk. |
| **storage\_account\_type** string | **Choices:*** Standard\_LRS
* StandardSSD\_LRS
* Premium\_LRS
* UltraSSD\_LRS
| Type of storage for the managed disk. If not specified, the disk is created as `Standard_LRS`.
`Standard_LRS` is for Standard HDD.
`StandardSSD_LRS` (added in 2.8) is for Standard SSD.
`Premium_LRS` is for Premium SSD.
`UltraSSD_LRS` (added in 2.8) is for Ultra SSD, which is in preview mode, and only available on select instance types. See <https://docs.microsoft.com/en-us/azure/virtual-machines/windows/disks-types> for more information about disk types. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** dictionary | | Tags to assign to the managed disk. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **zone** string | **Choices:*** 1
* 2
* 3
*
| The Azure managed disk's zone. Allowed values are `1`, `2`, `3` and `' '`. |
Notes
-----
Note
* This module was called M(azure\_rm\_managed\_disk) before Ansible 2.8. The usage did not change.
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create managed disk
azure_rm_manageddisk:
name: mymanageddisk
location: eastus
resource_group: myResourceGroup
disk_size_gb: 4
- name: Create managed operating system disk from page blob
azure_rm_manageddisk:
name: mymanageddisk
location: eastus2
resource_group: myResourceGroup
create_option: import
source_uri: https://storageaccountname.blob.core.windows.net/containername/blob-name.vhd
os_type: windows
storage_account_type: Premium_LRS
- name: Mount the managed disk to VM
azure_rm_manageddisk:
name: mymanageddisk
location: eastus
resource_group: myResourceGroup
disk_size_gb: 4
managed_by: testvm001
attach_caching: read_only
- name: Unmount the managed disk to VM
azure_rm_manageddisk:
name: mymanageddisk
location: eastus
resource_group: myResourceGroup
managed_by: ''
disk_size_gb: 4
- name: Delete managed disk
azure_rm_manageddisk:
name: mymanageddisk
location: eastus
resource_group: myResourceGroup
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Whether or not the resource has changed. |
| **state** dictionary | always | Current state of the managed disk. |
| | **create\_option** string | success | Create option of the disk. **Sample:** copy |
| | **disk\_size\_gb** string | success | Size in GB of the managed disk to be created. |
| | **id** string | success | Resource id. |
| | **location** string | success | Valid Azure location. |
| | **managed\_by** string | success | Name of an existing virtual machine with which the disk is or will be associated, this VM should be in the same resource group. |
| | **name** string | success | Name of the managed disk. |
| | **os\_type** string | success | Type of Operating System. **Sample:** linux |
| | **source\_uri** string | success | URI to a valid VHD file to be used or the resource ID of the managed disk to copy. |
| | **storage\_account\_type** string | success | Type of storage for the managed disk. See <https://docs.microsoft.com/en-us/azure/virtual-machines/windows/disks-types> for more information about this type. **Sample:** Standard\_LRS |
| | **tags** dictionary | success | Tags to assign to the managed disk. **Sample:** {'tag': 'value'} |
### Authors
* Bruno Medina (@brusMX)
| programming_docs |
ansible azure.azcollection.azure_rm_hdinsightcluster_info – Get Azure HDInsight Cluster facts azure.azcollection.azure\_rm\_hdinsightcluster\_info – Get Azure HDInsight Cluster facts
========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_hdinsightcluster_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure HDInsight Cluster.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | HDInsight cluster name. |
| **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 | | Name of an Azure resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of HDInsight Cluster
azure_rm_hdinsightcluster_info:
resource_group: myResourceGroup
name: myCluster
- name: List instances of HDInsight Cluster
azure_rm_hdinsightcluster_info:
resource_group: myResourceGroup
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **clusters** complex | always | A list of dictionaries containing facts for HDInsight Cluster. |
| | **cluster\_definition** string | success | The cluster definition. |
| | | **kind** string | always | The type of cluster. **Sample:** spark |
| | **cluster\_version** string | always | The version of the cluster. **Sample:** 3.6.1000.67 |
| | **compute\_profile\_roles** list / elements=string | success | The list of roles in the cluster. |
| | | **linux\_profile** string | success | The Linux OS profile. |
| | | | **username** string | always | User name. **Sample:** myuser |
| | | **name** string | always | The name of the role. **Sample:** headnode |
| | | **target\_instance\_count** integer | always | The instance count of the cluster. **Sample:** 2 |
| | | **vm\_size** string | always | The size of the VM. **Sample:** Standard\_D3 |
| | **connectivity\_endpoints** list / elements=string | success | Cluster's connectivity endpoints. |
| | | **location** string | always | Endpoint location. **Sample:** myCluster-ssh.azurehdinsight.net |
| | | **name** string | always | Endpoint name. **Sample:** SSH |
| | | **port** integer | always | Endpoint port. **Sample:** 22 |
| | | **protocol** string | always | Endpoint protocol. **Sample:** TCP |
| | **id** string | always | The unique resource identifier of the HDInsight Cluster. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.HDInsight/clusters/myCluster |
| | **location** string | always | The location of the resource group to which the resource belongs. **Sample:** westus |
| | **name** string | always | The name of the HDInsight Cluster. **Sample:** testaccount |
| | **os\_type** string | always | The type of operating system. **Sample:** linux |
| | **resource\_group** string | always | Name of an Azure resource group. **Sample:** myResourceGroup |
| | **tags** complex | always | The tags of the resource. |
| | **tier** string | always | The cluster tier. **Sample:** standard |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_devtestlab_info – Get Azure DevTest Lab facts azure.azcollection.azure\_rm\_devtestlab\_info – Get Azure DevTest Lab facts
============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlab_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure DevTest Lab.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the lab. |
| **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 | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** list / elements=string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: List instances of DevTest Lab by resource group
azure_rm_devtestlab_info:
resource_group: testrg
- name: List instances of DevTest Lab in subscription
azure_rm_devtestlab_info:
- name: Get instance of DevTest Lab
azure_rm_devtestlab_info:
resource_group: testrg
name: testlab
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **labs** complex | always | A list of dictionaries containing facts for Lab. |
| | **artifacts\_storage\_account** string | always | Artifacts storage account ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myLab6346 |
| | **default\_premium\_storage\_account** string | always | Default premium storage account ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myLab6346 |
| | **default\_storage\_account** string | always | Default storage account ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myLab6346 |
| | **id** string | always | The identifier of the resource. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/myLab |
| | **location** string | always | The location of the resource. **Sample:** eastus |
| | **name** string | always | The name of the resource. **Sample:** testlab |
| | **premium\_data\_disk\_storage\_account** string | always | Default storage account ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myLab6346 |
| | **premium\_data\_disks** boolean | always | Are premium data disks allowed. |
| | **provisioning\_state** string | always | Lab provisioning state. **Sample:** Succeeded |
| | **resource\_group** string | always | The name of the resource. **Sample:** testrg |
| | **storage\_type** string | always | Lab storage type. **Sample:** standard |
| | **tags** complex | always | The tags of the resource. **Sample:** { 'MyTag': 'MyValue' } |
| | **vault\_name** string | always | Key vault ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myLab6788 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_cdnprofile – Manage a Azure CDN profile azure.azcollection.azure\_rm\_cdnprofile – Manage a Azure CDN profile
=====================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_cdnprofile`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete a Azure CDN profile.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **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 CDN profile. |
| **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 / required | | Name of a resource group where the CDN profile exists or will be created. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | **Choices:*** standard\_verizon
* premium\_verizon
* custom\_verizon
* standard\_akamai
* standard\_chinacdn
* standard\_microsoft
| The pricing tier, defines a CDN provider, feature list and rate of the CDN profile. Detailed pricing can be find at <https://azure.microsoft.com/en-us/pricing/details/cdn/>. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the CDN profile. Use `present` to create or update a CDN profile and `absent` to delete it. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a CDN profile
azure_rm_cdnprofile:
resource_group: myResourceGroup
name: myCDN
sku: standard_akamai
tags:
testing: testing
- name: Delete the CDN profile
azure_rm_cdnprofile:
resource_group: myResourceGroup
name: myCDN
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** dictionary | always | Current state of the CDN profile. **Sample:** {'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/Microsoft.Cdn/profiles/myCDN'} |
### Authors
* Hai Cao (@caohai)
* Yunge Zhu (@yungezz)
| programming_docs |
ansible azure.azcollection.azure_rm_iotdevice_info – Facts of Azure IoT hub device azure.azcollection.azure\_rm\_iotdevice\_info – Facts of Azure IoT hub device
=============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_iotdevice_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Query, get Azure IoT hub device.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **hub** string / required | | Name of IoT Hub. |
| **hub\_policy\_key** string / required | | Key of the *hub\_policy\_name*. |
| **hub\_policy\_name** string / required | | Policy name of the IoT Hub which will be used to query from IoT hub. This policy should have at least 'Registry Read' access. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **module\_id** string | | Name of the IoT hub device module. Must use with *device\_id* defined. |
| **name** string | | Name of the IoT hub device identity.
aliases: device\_id |
| **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. |
| **query** string | | Query an IoT hub to retrieve information regarding device twins using a SQL-like language. See <https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-query-language>. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **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. |
| **top** integer | | Used when *name* not defined. List the top n devices in the query. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get the details of a device
azure_rm_iotdevice_info:
name: Testing
hub: MyIoTHub
hub_policy_name: registryRead
hub_policy_key: XXXXXXXXXXXXXXXXXXXX
- name: Query all device modules in an IoT Hub
azure_rm_iotdevice_info:
query: "SELECT * FROM devices.modules"
hub: MyIoTHub
hub_policy_name: registryRead
hub_policy_key: XXXXXXXXXXXXXXXXXXXX
- name: List all devices in an IoT Hub
azure_rm_iotdevice_info:
hub: MyIoTHub
hub_policy_name: registryRead
hub_policy_key: XXXXXXXXXXXXXXXXXXXX
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **iot\_devices** dictionary | always | IoT Hub device. **Sample:** {'authentication': {'symmetricKey': {'primaryKey': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'secondaryKey': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}, 'type': 'sas', 'x509Thumbprint': {'primaryThumbprint': None, 'secondaryThumbprint': None}}, 'capabilities': {'iotEdge': False}, 'changed': True, 'cloudToDeviceMessageCount': 0, 'connectionState': 'Disconnected', 'connectionStateUpdatedTime': '0001-01-01T00:00:00', 'deviceId': 'Testing', 'etag': 'NzA2NjU2ODc=', 'failed': False, 'generationId': '636903014505613307', 'lastActivityTime': '0001-01-01T00:00:00', 'modules': [{'authentication': {'symmetricKey': {'primaryKey': 'XXXXXXXXXXXXXXXXXXX', 'secondaryKey': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}, 'type': 'sas', 'x509Thumbprint': {'primaryThumbprint': None, 'secondaryThumbprint': None}}, 'cloudToDeviceMessageCount': 0, 'connectionState': 'Disconnected', 'connectionStateUpdatedTime': '0001-01-01T00:00:00', 'deviceId': 'testdevice', 'etag': 'MjgxOTE5ODE4', 'generationId': '636903840872788074', 'lastActivityTime': '0001-01-01T00:00:00', 'managedBy': None, 'moduleId': 'test'}], 'properties': {'desired': {'$metadata': {'$lastUpdated': '2019-04-10T05:00:46.2702079Z', '$lastUpdatedVersion': 8, 'period': {'$lastUpdated': '2019-04-10T05:00:46.2702079Z', '$lastUpdatedVersion': 8}}, '$version': 1, 'period': 100}, 'reported': {'$metadata': {'$lastUpdated': '2019-04-08T06:24:10.5613307Z'}, '$version': 1}}, 'status': 'enabled', 'statusReason': None, 'statusUpdatedTime': '0001-01-01T00:00:00', 'tags': {'location': {'city': 'Redmond', 'country': 'us'}, 'sensor': 'humidity'}} |
### Authors
* Yuwei Zhou (@yuwzho)
ansible azure.azcollection.azure_rm_devtestlabenvironment – Manage Azure DevTest Lab Environment instance azure.azcollection.azure\_rm\_devtestlabenvironment – Manage Azure DevTest Lab Environment instance
===================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabenvironment`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure DevTest Lab Environment.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **deployment\_parameters** list / elements=string | | The parameters of the Azure Resource Manager template. |
| | **name** string | | The name of the template parameter. |
| | **value** string | | The value of the template parameter. |
| **deployment\_template** raw | | The Azure Resource Manager template's identifier. |
| **lab\_name** string / required | | The name of the lab. |
| **location** string | | The location of the resource. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the environment. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Environment. Use `(present` to create or update an Environment and `absent` to delete it. |
| **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. |
| **user\_name** string / required | | The name of the user profile. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create instance of DevTest Lab Environment from public environment repo
azure_rm_devtestlabenvironment:
resource_group: myResourceGroup
lab_name: myLab
user_name: user
name: myEnvironment
location: eastus
deployment_template:
artifact_source_name: public environment repo
name: WebApp
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | The identifier of the resource. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/myLab/environment s/myEnvironment |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_mysqlconfiguration – Manage Configuration instance azure.azcollection.azure\_rm\_mysqlconfiguration – Manage Configuration instance
================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_mysqlconfiguration`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Configuration.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the server configuration. |
| **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 / required | | The name of the resource group that contains the resource. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string / required | | The name of the server. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the MySQL configuration. Use `present` to update setting, or `absent` to reset to default value. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **value** string | | Value of the configuration. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Update SQL Server setting
azure_rm_mysqlconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: event_scheduler
value: "ON"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DBforMySQL/servers/myServer/confi gurations/event\_scheduler |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible azure.azcollection.azure_rm_securitygroup_info – Get security group facts azure.azcollection.azure\_rm\_securitygroup\_info – Get security group facts
============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_securitygroup_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific security group or all security groups within a resource group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Only show results for a specific security group. |
| **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 / required | | Name of the resource group to use. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one security group
azure_rm_securitygroup_info:
resource_group: myResourceGroup
name: secgroup001
- name: Get facts for all security groups
azure_rm_securitygroup_info:
resource_group: myResourceGroup
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **securitygroups** complex | always | List containing security group dicts. |
| | **etag** string | always | A unique read-only string that changes whenever the resource is updated. **Sample:** W/"d036f4d7-d977-429a-a8c6-879bc2523399" |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroup001 |
| | **location** string | always | Resource location. **Sample:** eastus2 |
| | **name** string | always | Resource name. **Sample:** secgroup001 |
| | **properties** dictionary | always | List of security group's properties. **Sample:** {'defaultSecurityRules': [{'etag': 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/AllowVnetInBound', 'name': 'AllowVnetInBound', 'properties': {'access': 'Allow', 'description': 'Allow inbound traffic from all VMs in VNET', 'destinationAddressPrefix': 'VirtualNetwork', 'destinationPortRange': '\*', 'direction': 'Inbound', 'priority': 65000, 'protocol': '\*', 'provisioningState': 'Succeeded', 'sourceAddressPrefix': 'VirtualNetwork', 'sourcePortRange': '\*'}}, {'etag': 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/AllowAzureLoadBalancerInBound', 'name': 'AllowAzureLoadBalancerInBound', 'properties': {'access': 'Allow', 'description': 'Allow inbound traffic from azure load balancer', 'destinationAddressPrefix': '\*', 'destinationPortRange': '\*', 'direction': 'Inbound', 'priority': 65001, 'protocol': '\*', 'provisioningState': 'Succeeded', 'sourceAddressPrefix': 'AzureLoadBalancer', 'sourcePortRange': '\*'}}, {'etag': 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/DenyAllInBound', 'name': 'DenyAllInBound', 'properties': {'access': 'Deny', 'description': 'Deny all inbound traffic', 'destinationAddressPrefix': '\*', 'destinationPortRange': '\*', 'direction': 'Inbound', 'priority': 65500, 'protocol': '\*', 'provisioningState': 'Succeeded', 'sourceAddressPrefix': '\*', 'sourcePortRange': '\*'}}, {'etag': 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/AllowVnetOutBound', 'name': 'AllowVnetOutBound', 'properties': {'access': 'Allow', 'description': 'Allow outbound traffic from all VMs to all VMs in VNET', 'destinationAddressPrefix': 'VirtualNetwork', 'destinationPortRange': '\*', 'direction': 'Outbound', 'priority': 65000, 'protocol': '\*', 'provisioningState': 'Succeeded', 'sourceAddressPrefix': 'VirtualNetwork', 'sourcePortRange': '\*'}}, {'etag': 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/AllowInternetOutBound', 'name': 'AllowInternetOutBound', 'properties': {'access': 'Allow', 'description': 'Allow outbound traffic from all VMs to Internet', 'destinationAddressPrefix': 'Internet', 'destinationPortRange': '\*', 'direction': 'Outbound', 'priority': 65001, 'protocol': '\*', 'provisioningState': 'Succeeded', 'sourceAddressPrefix': '\*', 'sourcePortRange': '\*'}}, {'etag': 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/DenyAllOutBound', 'name': 'DenyAllOutBound', 'properties': {'access': 'Deny', 'description': 'Deny all outbound traffic', 'destinationAddressPrefix': '\*', 'destinationPortRange': '\*', 'direction': 'Outbound', 'priority': 65500, 'protocol': '\*', 'provisioningState': 'Succeeded', 'sourceAddressPrefix': '\*', 'sourcePortRange': '\*'}}], 'networkInterfaces': [{'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nic004'}], 'provisioningState': 'Succeeded', 'resourceGuid': 'ebd00afa-5dc8-446f-810a-50dd6f671588', 'securityRules': []} |
| | **tags** dictionary | always | Tags to assign to the security group. **Sample:** {'tag': 'value'} |
| | **type** string | always | Type of the resource. **Sample:** Microsoft.Network/networkSecurityGroups |
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
ansible azure.azcollection.azure_rm_apimanagement – Manage Azure api instances azure.azcollection.azure\_rm\_apimanagement – Manage Azure api instances
========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_apimanagement`.
New in version 1.6.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create azure api instance.
* Update the existing azure api instance.
* Delete azure api instance.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_id** string / required | | API revision identifier. It must be unique in the current API Management service instance. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **api\_revision** string | | Describes the Revision of the Api. If no value is provided, default revision 1 is created |
| **api\_revision\_description** string | | Description of the Api Revision. |
| **api\_type** string | **Choices:*** soap
* http
| Type of Api to create.
`http` creates a SOAP to REST API.
`soap` creates a SOAP pass-through API. |
| **api\_version** string | | Indicates the Version identifier of the API if the API is versioned |
| **api\_version\_description** string | | Description of the Api Version. |
| **api\_version\_set** dictionary | | Version set details |
| | **description** string | | Description of API Version Set. |
| | **id** string | | Identifier for existing API Version Set Omit this value to create a new Version Set. |
| | **name** string | | The display Name of the API Version Set. |
| | **version\_header\_name** string | | Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. |
| | **version\_query\_name** string | | Name of query parameter that indicates the API Version if versioningScheme is set to `query`. |
| | **versioning\_scheme** string | **Choices:*** Segment
* Query
* Header
| An value that determines where the API Version identifer will be located in a HTTP request. |
| **api\_version\_set\_id** string | | A resource identifier for the related ApiVersionSet. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **authentication\_settings** dictionary | | Collection of authentication settings included into this API. |
| | **o\_auth2** dictionary | | OAuth2 Authentication settings |
| | | **authorization\_server\_id** string | | OAuth authorization server identifier. |
| | | **scope** string | | operations scope. |
| | **openid** dictionary | | OpenID Connect Authentication Settings |
| | | **bearer\_token\_sending\_methods** list / elements=string | **Choices:*** authorizationHeader
* query
| How to send token to the server. |
| | | **openid\_provider\_id** string | | OAuth authorization server identifier. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **description** string | | Description of the API. |
| **display\_name** string | | API Name to be displayed. It must be 1 to 300 characters long. |
| **format** string | **Choices:*** wadl-xml
* wadl-link-json
* swagger-json
* swagger-link-json
* wsdl
* wsdl-link
* openapi
* openapi+json
* openapi-link
| Format of the Content in which the API is getting imported. |
| **is\_current** boolean | **Choices:*** no
* yes
| Indicates if API revision is current api revision. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **path** string | | Relative URL uniquely identifying this API. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **protocols** list / elements=string | **Choices:*** http
* https
| Describes on which protocols the operations in this API can be invoked. |
| **resource\_group** string / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **service\_name** string / required | | The name of the API Management service. |
| **service\_url** string | | Absolute URL of the backend service implementing this API Cannot be more than 2000 characters long. |
| **source\_api\_id** string | | API identifier of the source API. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the Api. Use `present` to create or update an Api and `absent` to delete it. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **subscription\_key\_parameter\_names** dictionary | | Protocols over which API is made available. |
| | **header** string | | Subscription key header name. |
| | **query** string | | Subscription key query string parameter name. |
| **subscription\_required** boolean | **Choices:*** no
* yes
| Specifies whether an API or Product subscription is required for accessing the API. |
| **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. |
| **type** string | **Choices:*** http
* soap
| Type of API |
| **value** string | | Content value when Importing an API. |
| **wsdl\_selector** dictionary | | Criteria to limit import of WSDL to a subset of the document. |
| | **wsdl\_endpoint\_name** string | | Name of endpoint(port) to import from WSDL. |
| | **wsdl\_service\_name** string | | Name of service to import from WSDL. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a new API instance
azure_rm_apimanagement:
resource_group: 'myResourceGroup'
service_name: myService
api_id: testApi
description: testDescription
display_name: TestAPI
service_url: 'http://testapi.example.net/api'
path: myapiPath
protocols:
- https
- name: Update an existing API instance.
azure_rm_apimanagement:
resource_group: myResourceGroup
service_name: myService
api_id: testApi
display_name: newTestAPI
service_url: 'http://testapi.example.net/api'
path: myapiPath
protocols:
- https
- name: ApiManagementDeleteApi
azure_rm_apimanagement:
resource_group: myResourceGroup
service_name: myService
api_id: testApi
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Resource ID. |
### Authors
* Sakar Mehra (@sakar97)
* Nikhil Patne (@nikhilpatne)
| programming_docs |
ansible azure.azcollection.azure_rm_webappvnetconnection – Manage web app virtual network connection azure.azcollection.azure\_rm\_webappvnetconnection – Manage web app virtual network connection
==============================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_webappvnetconnection`.
New in version 1.8.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Add, remove, or update the virtual network connection for a web app.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the web app. |
| **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 / required | | Resource group of the web app. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the virtual network connection. Use `present` to create or update and `absent` to delete. |
| **subnet** string | | Name of the virtual network's subnet. Required if adding or updating. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **vnet\_name** string | | Name of the virtual network. Required if adding or updating. |
| **vnet\_resource\_group** string | | Name of the resource group for the virtual network. Defaults to main `resource_group` value. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Configure web app with virtual network
azure.azcollection.azure_rm_webappvnetconnection:
name: "MyWebapp"
resource_group: "MyResourceGroup"
vnet_name: "MyVnetName"
subnet: "MySubnetName"
- name: Configure web app with virtual network in different resource group
azure.azcollection.azure_rm_webappvnetconnection:
name: "MyWebapp"
resource_group: "MyResourceGroup"
vnet_name: "MyVnetName"
subnet: "MySubnetName"
vnet_resource_group: "MyOtherResourceGroup"
- name: Delete web app virtual network
azure.azcollection.azure_rm_webappvnetconnection:
name: "MyWebapp"
resource_group: "MyResourceGroup"
state: "absent"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **connection** complex | always | The web app's virtual network connection. |
| | **id** string | always | ID of the web app virtual network connection. **Sample:** /subscriptions/xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp/virtualNetworkConnections/yyy-yyy\_subnet |
| | **name** string | always | Name of the web app virtual network connection. **Sample:** yyy-yyy\_subnet |
| | **subnet\_name** string | always | Name of the subnet connected to the web app. **Sample:** mySubnet |
| | **vnet\_name** string | always | Name of the virtual network connected to the web app. **Sample:** myVnet |
| | **vnet\_resource\_group** string | always | Name of the resource group the virtual network is in. **Sample:** myResourceGroup |
| | **vnet\_resource\_id** string | always | ID of the virtual network/subnet connected to the web app. **Sample:** /subscriptions/xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet |
### Authors
* Ross Bender (@l3ender)
ansible azure.azcollection.azure_rm_openshiftmanagedcluster – Manage Azure Red Hat OpenShift Managed Cluster instance azure.azcollection.azure\_rm\_openshiftmanagedcluster – Manage Azure Red Hat OpenShift Managed Cluster instance
===============================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_openshiftmanagedcluster`.
New in version 1.2.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure Red Hat OpenShift Managed Cluster instance.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **api\_server\_profile** dictionary | | API server configuration. |
| | **ip** string | | IP address of api server (immutable), only appears in response. |
| | **url** string | | Url of api server (immutable), only appears in response. |
| | **visibility** string | **Choices:*** **Public** ←
* Private
| API server visibility. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **cluster\_profile** dictionary | **Default:**{} | Configuration for OpenShift cluster. |
| | **cluster\_resource\_group\_id** string | | The ID of the cluster resource group (immutable). |
| | **domain** string | | The domain for the cluster (immutable). |
| | **pull\_secret** string | **Default:**"" | Pull secret for the cluster (immutable). |
| | **version** string | | The Openshift version (immutable). |
| **ingress\_profiles** list / elements=string | | Ingress profiles configuration. only one profile is supported at the current API version. |
| | **ip** string | | IP of the ingress (immutable), only appears in response. |
| | **name** string | **Choices:*** **default** ←
| Name of the ingress (immutable). |
| | **visibility** string | **Choices:*** **Public** ←
* Private
| Ingress visibility. |
| **location** string / required | | Resource location. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **master\_profile** dictionary | | Configuration for OpenShift master VMs. |
| | **subnet\_id** string / required | | The Azure resource ID of the master subnet (immutable). |
| | **vm\_size** string | **Choices:*** Standard\_D2s\_v3
* Standard\_D4s\_v3
* Standard\_D8s\_v3
| Size of agent VMs (immutable). |
| **name** string / required | | Resource name. |
| **network\_profile** dictionary | **Default:**{"pod\_cidr": "10.128.0.0/14", "service\_cidr": "172.30.0.0/16"} | Configuration for OpenShift networking (immutable). |
| | **pod\_cidr** string | | CIDR for the OpenShift Pods (immutable). |
| | **service\_cidr** string | | CIDR for OpenShift Services (immutable). |
| **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. |
| **provisioning\_state** string | | The current deployment or provisioning state, which only appears in the response. |
| **resource\_group** string / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **service\_principal\_profile** dictionary | | service principal. |
| | **client\_id** string / required | | Client ID of the service principal (immutable). |
| | **client\_secret** string / required | | Client secret of the service principal (immutable). |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the OpenShiftManagedCluster. Use `present` to create or update an OpenShiftManagedCluster and `absent` to delete it. |
| **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. |
| **worker\_profiles** list / elements=string | | Configuration for OpenShift worker Vms. |
| | **count** integer | | The number of worker VMs. Must be between 3 and 20 (immutable). |
| | **disk\_size** integer | | The disk size of the worker VMs in GB. Must be 128 or greater (immutable). |
| | **name** string / required | **Choices:*** worker
| name of the worker profile (immutable). |
| | **subnet\_id** string / required | | The Azure resource ID of the worker subnet (immutable). |
| | **vm\_size** string | **Choices:*** Standard\_D2s\_v3
* Standard\_D4s\_v3
* Standard\_D8s\_v3
| The size of the worker Vms (immutable). |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create openshift cluster
azure_rm_openshiftmanagedcluster:
resource_group: "myResourceGroup"
name: "myCluster"
location: "eastus"
cluster_profile:
cluster_resource_group_id: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/clusterResourceGroup"
domain: "mydomain"
service_principal_profile:
client_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
client_secret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
network_profile:
pod_cidr: "10.128.0.0/14"
service_cidr: "172.30.0.0/16"
worker_profiles:
- vm_size : "Standard_D4s_v3"
subnet_id : "/subscriptions/xx-xx-xx-xx-xx/resourceGroups/myResourceGroup/Microsoft.Network/virtualNetworks/myVnet/subnets/worker"
disk_size : 128
count : 3
master_profile:
vm_size : "Standard_D8s_v3"
subnet_id: "/subscriptions/xx-xx-xx-xx-xx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/master"
- name: Delete OpenShift Managed Cluster
azure_rm_openshiftmanagedcluster:
resource_group: myResourceGroup
name: myCluster
location: eastus
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xx-xx-xx-xx/resourceGroups/mycluster-eastus/providers/Microsoft.RedHatOpenShift/openShiftClusters/mycluster |
| **location** string | always | Resource location. **Sample:** eatus |
| **name** string | always | Resource name. **Sample:** mycluster |
| **properties** complex | always | Properties of a OpenShift managed cluster. |
| | **apiserverProfile** complex | always | API server configuration. |
| | | **visibility** string | always | api server visibility. **Sample:** Public |
| | **clusterProfile** complex | always | Configuration for Openshift cluster. |
| | | **domain** string | always | Domain for the cluster. **Sample:** mycluster |
| | | **resourceGroupId** string | always | The ID of the cluster resource group. **Sample:** /subscriptions/xx-xx-xx-xx/resourceGroups/mycluster-eastus-cluster |
| | | **version** string | always | Openshift version. **Sample:** 4.4.17 |
| | **ingressProfiles** list / elements=string | always | Ingress configruation. **Sample:** [{'name': 'default', 'visibility': 'Public'}] |
| | **masterProfile** complex | always | Configuration for OpenShift master VMs. |
| | | **subnetId** string | always | The Azure resource ID of the master subnet (immutable). **Sample:** /subscriptions/xx-xx-xx-xx/resourceGroups/mycluster-eastus/providers/Microsoft.Network/ virtualNetworks/mycluster-vnet/subnets/mycluster-worker |
| | | **vmSize** string | always | Size of agent VMs (immutable). **Sample:** Standard\_D8s\_v3 |
| | **networkProfile** complex | always | Configuration for OpenShift networking. |
| | | **podCidr** string | always | CIDR for the OpenShift Pods. **Sample:** 10.128.0.0/14 |
| | | **serviceCidr** string | always | CIDR for OpenShift Services. **Sample:** 172.30.0.0/16 |
| | **provisioningState** string | always | The current deployment or provisioning state, which only appears in the response. **Sample:** Creating |
| | **servicePrincipalProfile** complex | always | Service principal. |
| | | **clientId** string | always | Client ID of the service principal. **Sample:** xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | **workerProfiles** complex | always | Configuration of OpenShift cluster VMs. |
| | | **count** integer | always | Number of agents (VMs) to host docker containers. **Sample:** 3 |
| | | **diskSizeGB** integer | always | disk size in GB. **Sample:** 128 |
| | | **name** string | always | Unique name of the pool profile in the context of the subscription and resource group. **Sample:** worker |
| | | **subnetId** string | always | Subnet ID for worker pool. **Sample:** /subscriptions/xx-xx-xx-xx/resourceGroups/mycluster-eastus/providers/Microsoft.Network/ virtualNetworks/mycluster-vnet/subnets/mycluster-worker |
| | | **vmSize** string | always | Size of agent VMs. **Sample:** Standard\_D4s\_v3 |
| **type** string | always | Resource type. **Sample:** Microsoft.RedHatOpenShift/openShiftClusters |
### Authors
* Haiyuan Zhang (@haiyuazhang)
| programming_docs |
ansible azure.azcollection.azure_rm_cdnprofile_info – Get Azure CDN profile facts azure.azcollection.azure\_rm\_cdnprofile\_info – Get Azure CDN profile facts
============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_cdnprofile_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific Azure CDN profile or all CDN profiles.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Limit results to a specific CDN profile. |
| **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 | | The resource group to search for the desired CDN profile. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one CDN profile
azure_rm_cdnprofile_info:
name: Testing
resource_group: myResourceGroup
- name: Get facts for all CDN profiles
azure_rm_cdnprofile_info:
- name: Get facts by tags
azure_rm_cdnprofile_info:
tags:
- Environment:Test
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **cdnprofiles** complex | always | List of CDN profiles. |
| | **id** string | success | ID of the CDN profile. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/Microsoft.Cdn/profiles/myCDN |
| | **location** string | success | Location of the CDN profile. **Sample:** WestUS |
| | **name** string | always | Name of the CDN profile. **Sample:** Testing |
| | **provisioning\_state** string | success | Provisioning status of the profile. **Sample:** Succeeded |
| | **resource\_group** string | always | Name of a resource group where the CDN profile exists. **Sample:** myResourceGroup |
| | **resource\_state** string | success | Resource status of the profile. **Sample:** Active |
| | **sku** string | success | The pricing tier, defines a CDN provider, feature list and rate of the CDN profile. **Sample:** standard\_verizon |
| | **tags** list / elements=string | success | The tags of the CDN profile. **Sample:** [{'foo': 'bar'}] |
| | **type** string | success | The type of the CDN profile. **Sample:** Microsoft.Cdn/profiles |
### Authors
* Hai Cao (@caohai)
* Yunge Zhu (@yungezz)
ansible azure.azcollection.azure_rm_devtestlabcustomimage_info – Get Azure DevTest Lab Custom Image facts azure.azcollection.azure\_rm\_devtestlabcustomimage\_info – Get Azure DevTest Lab Custom Image facts
====================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabcustomimage_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure Azure DevTest Lab Custom Image.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **lab\_name** string / required | | The name of the lab. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the custom image. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** list / elements=string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of Custom Image
azure_rm_devtestlabcustomimage_info:
resource_group: myResourceGroup
lab_name: myLab
name: myImage
- name: List instances of Custom Image in the lab
azure_rm_devtestlabcustomimage_info:
resource_group: myResourceGroup
lab_name: myLab
name: myImage
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **custom\_images** complex | always | A list of dictionaries containing facts for Custom Image. |
| | **id** string | always | The identifier of the artifact source. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DevTestLab/labs/myLab/cu stomimages/myImage |
| | **lab\_name** string | always | Name of the lab. **Sample:** myLab |
| | **managed\_shapshot\_id** string | always | Managed snapshot id. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/microsoft.compute/snapshots/myImage |
| | **name** string | always | The name of the image. **Sample:** myImage |
| | **resource\_group** string | always | Name of the resource group. **Sample:** myResourceGroup |
| | **source\_vm\_id** string | always | Source VM id. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx//resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/myLab/v irtualmachines/myLabVm |
| | **tags** complex | always | The tags of the resource. **Sample:** { 'MyTag':'MyValue' } |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_datalakestore – Manage Azure data lake store azure.azcollection.azure\_rm\_datalakestore – Manage Azure data lake store
==========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_datalakestore`.
New in version 1.4.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete a data lake store.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **default\_group** string | | The default owner group for all new folders and files created in the Data Lake Store account. |
| **encryption\_config** dictionary | | The Key Vault encryption configuration. |
| | **key\_vault\_meta\_info** dictionary | | The Key Vault information for connecting to user managed encryption keys. |
| | | **encryption\_key\_name** string / required | | The name of the user managed encryption key. |
| | | **encryption\_key\_version** string / required | | The version of the user managed encryption key. |
| | | **key\_vault\_resource\_id** string / required | | The resource identifier for the user managed Key Vault being used to encrypt. |
| | **type** string / required | **Choices:*** UserManaged
* ServiceManaged
| The type of encryption configuration being used. |
| **encryption\_state** string | **Choices:*** Enabled
* Disabled
| The current state of encryption for this Data Lake Store account. |
| **firewall\_allow\_azure\_ips** string | **Choices:*** Enabled
* Disabled
| The current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. |
| **firewall\_rules** list / elements=string | | The list of firewall rules associated with this Data Lake Store account. |
| | **end\_ip\_address** string / required | | The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. |
| | **name** string / required | | The unique name of the firewall rule to create. |
| | **start\_ip\_address** string / required | | The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. |
| **firewall\_state** string | **Choices:*** Enabled
* Disabled
| The current state of the IP address firewall for this Data Lake Store account. |
| **identity** string | **Choices:*** SystemAssigned
| The Key Vault encryption identity, if any. |
| **location** string | | The resource location. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the Data Lake Store account. |
| **new\_tier** string | **Choices:*** Consumption
* Commitment\_1TB
* Commitment\_10TB
* Commitment\_100TB
* Commitment\_500TB
* Commitment\_1PB
* Commitment\_5PB
| The commitment tier to use for next month. |
| **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 / required | | The name of the Azure resource group to use.
aliases: resource\_group\_name |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the data lake store. Use `present` to create or update a data lake store and use `absent` to delete it. |
| **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. |
| **virtual\_network\_rules** list / elements=string | | The list of virtual network rules associated with this Data Lake Store account. |
| | **name** string / required | | The unique name of the virtual network rule to create. |
| | **subnet\_id** string / required | | The resource identifier for the subnet. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create Azure Data Lake Store
azure_rm_datalakestore:
resource_group: myResourceGroup
name: myDataLakeStore
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | always | Facts for Azure Data Lake Store created/updated. |
| | **account\_id** string | always | The unique identifier associated with this Data Lake Store account. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | **creation\_time** string | always | The account creation time. **Sample:** 2020-01-01T00:00:00.000000+00:00 |
| | **current\_tier** string | always | The commitment tier in use for the current month. **Sample:** Consumption |
| | **default\_group** string | success | The default owner group for all new folders and files created in the Data Lake Store account. |
| | **encryption\_config** complex | success | The Key Vault encryption configuration. |
| | | **key\_vault\_meta\_info** complex | success | The Key Vault information for connecting to user managed encryption keys. |
| | | | **encryption\_key\_name** string | always | The name of the user managed encryption key. **Sample:** KeyName |
| | | | **encryption\_key\_version** string | always | The version of the user managed encryption key. **Sample:** 86a1e3b7406f45afa0d54e21eff47e39 |
| | | | **key\_vault\_resource\_id** string | always | The resource identifier for the user managed Key Vault being used to encrypt. **Sample:** /subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/tstkv |
| | | **type** string | always | The type of encryption configuration being used. **Sample:** ServiceManaged |
| | **encryption\_provisioning\_state** string | success | The current state of encryption provisioning for this Data Lake Store account. **Sample:** Succeeded |
| | **encryption\_state** string | always | The current state of encryption for this Data Lake Store account. **Sample:** Enabled |
| | **endpoint** string | always | The full CName endpoint for this account. **Sample:** testaccount.azuredatalakestore.net |
| | **firewall\_allow\_azure\_ips** string | always | The current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. **Sample:** Disabled |
| | **firewall\_rules** list / elements=string | always | The list of firewall rules associated with this Data Lake Store account. |
| | | **end\_ip\_address** string | always | The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. **Sample:** 192.168.1.254 |
| | | **name** string | always | The resource name. **Sample:** Example Name |
| | | **start\_ip\_address** string | always | The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. **Sample:** 192.168.1.1 |
| | **firewall\_state** string | always | The current state of the IP address firewall for this Data Lake Store account. **Sample:** Enabled |
| | **id** string | always | The resource identifier. **Sample:** /subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.DataLakeStore/accounts/testaccount |
| | **identity** complex | success | The Key Vault encryption identity, if any. |
| | | **principal\_id** string | success | The principal identifier associated with the encryption. **Sample:** 00000000-0000-0000-0000-000000000000 |
| | | **tenant\_id** string | success | The tenant identifier associated with the encryption. **Sample:** 00000000-0000-0000-0000-000000000000 |
| | | **type** string | success | The type of encryption being used. **Sample:** SystemAssigned |
| | **last\_modified\_time** string | always | The account last modified time. **Sample:** 2020-01-01T00:00:00.000000+00:00 |
| | **location** string | always | The resource location. **Sample:** westeurope |
| | **name** string | always | The resource name. **Sample:** testaccount |
| | **new\_tier** string | always | The commitment tier to use for next month. **Sample:** Consumption |
| | **provisioning\_state** string | always | The provisioning status of the Data Lake Store account. **Sample:** Succeeded |
| | **state** string | always | The state of the Data Lake Store account. **Sample:** Active |
| | **tags** dictionary | always | The resource tags. **Sample:** {'tag1': 'abc'} |
| | **trusted\_id\_provider\_state** string | always | The list of trusted identity providers associated with this Data Lake Store account. **Sample:** Enabled |
| | **trusted\_id\_providers** list / elements=string | always | The current state of the trusted identity provider feature for this Data Lake Store account. |
| | | **id** string | success | The resource identifier. |
| | | **id\_provider** string | success | The URL of this trusted identity provider. |
| | | **name** string | success | The resource name. |
| | | **type** string | success | The resource type. |
| | **type** string | always | The resource type. **Sample:** Microsoft.DataLakeStore/accounts |
| | **virtual\_network\_rules** list / elements=string | always | The list of virtual network rules associated with this Data Lake Store account. |
| | | **name** string | success | The resource name. **Sample:** Rule Name |
| | | **subnet\_id** string | success | The resource identifier for the subnet. **Sample:** /subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/default |
### Authors
* David Duque Hernández (@next-davidduquehernandez)
| programming_docs |
ansible azure.azcollection.azure_rm_aksversion_info – Get available kubernetes versions supported by Azure Kubernetes Service azure.azcollection.azure\_rm\_aksversion\_info – Get available kubernetes versions supported by Azure Kubernetes Service
========================================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_aksversion_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get available kubernetes versions supported by Azure Kubernetes Service.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **location** string / required | | Get the versions available for creating a managed Kubernetes cluster. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **version** string | | Get the upgrade versions available for a managed Kubernetes cluster version. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get available versions for AKS in location eastus
azure_rm_aksversion_info:
location: eastus
- name: Get available versions an AKS can be upgrade to
azure_rm_aksversion_info:
location: eastis
version: 1.11.6
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_aks\_versions** list / elements=string | always | List of supported kubernetes versions. |
### Authors
* Yuwei Zhou (@yuwzho)
ansible azure.azcollection.azure_rm_mysqlconfiguration_info – Get Azure MySQL Configuration facts azure.azcollection.azure\_rm\_mysqlconfiguration\_info – Get Azure MySQL Configuration facts
============================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_mysqlconfiguration_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure MySQL Configuration.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Setting name. |
| **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 / required | | The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string / required | | The name of the server. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get specific setting of MySQL Server
azure_rm_mysqlconfiguration_info:
resource_group: myResourceGroup
server_name: testmysqlserver
name: deadlock_timeout
- name: Get all settings of MySQL Server
azure_rm_mysqlconfiguration_info:
resource_group: myResourceGroup
server_name: server_name
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **settings** complex | always | A list of dictionaries containing MySQL Server settings. |
| | **description** string | always | Description of the configuration. **Sample:** Deadlock timeout. |
| | **id** string | always | Setting resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DBforMySQL/servers/testmysqlser ver/configurations/deadlock\_timeout |
| | **name** string | always | Setting name. **Sample:** deadlock\_timeout |
| | **source** string | always | Source of the configuration. **Sample:** system-default |
| | **value** any | always | Setting value. **Sample:** 1000 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_aks_info – Get Azure Kubernetes Service facts azure.azcollection.azure\_rm\_aks\_info – Get Azure Kubernetes Service facts
============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_aks_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific Azure Kubernetes Service or all Azure Kubernetes Services.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Limit results to a specific resource group. |
| **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 | | The resource group to search for the desired Azure Kubernetes Service |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **show\_kubeconfig** string | **Choices:*** user
* admin
| Show kubeconfig of the AKS cluster. Note the operation will cost more network overhead, not recommended when listing AKS. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one Azure Kubernetes Service
azure_rm_aks_info:
name: Testing
resource_group: myResourceGroup
- name: Get facts for all Azure Kubernetes Services
azure_rm_aks_info:
- name: Get facts by tags
azure_rm_aks_info:
tags:
- testing
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_aks** list / elements=string | always | List of Azure Kubernetes Service dicts. |
### Authors
* Yuwei Zhou (@yuwzho)
| programming_docs |
ansible azure.azcollection.azure_rm_servicebus_info – Get servicebus facts azure.azcollection.azure\_rm\_servicebus\_info – Get servicebus facts
=====================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_servicebus_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific servicebus or all servicebus in a resource group or subscription.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Limit results to a specific servicebus. |
| **namespace** string | | Servicebus namespace name. A namespace is a scoping container for all messaging components. Multiple queues and topics can reside within a single namespace, and namespaces often serve as application containers. Required when *type=namespace*. |
| **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 | | Limit results in a specific resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **show\_sas\_policies** boolean | **Choices:*** no
* yes
| Whether to show the SAS policies. Not support when *type=subscription*. Note if enable this option, the facts module will raise two more HTTP call for each resources, need more network overhead. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **topic** string | | Topic name. Required when *type=subscription*. |
| **type** string | **Choices:*** namespace
* queue
* topic
* subscription
| Type of the resource. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get all namespaces under a resource group
azure_rm_servicebus_info:
resource_group: myResourceGroup
type: namespace
- name: Get all topics under a namespace
azure_rm_servicebus_info:
resource_group: myResourceGroup
namespace: bar
type: topic
- name: Get a single queue with SAS policies
azure_rm_servicebus_info:
resource_group: myResourceGroup
namespace: bar
type: queue
name: sbqueue
show_sas_policies: true
- name: Get all subscriptions under a resource group
azure_rm_servicebus_info:
resource_group: myResourceGroup
type: subscription
namespace: bar
topic: sbtopic
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **servicebuses** complex | always | List of servicebus dicts. |
| | **accessed\_at** string | always | Last time the message was sent, or a request was received for this topic. **Sample:** 2019-01-25 02:46:55.543953+00:00 |
| | **auto\_delete\_on\_idle\_in\_seconds** integer | always | ISO 8061 timeSpan idle interval after which the queue or topic is automatically deleted. The minimum duration is 5 minutes. **Sample:** True |
| | **count\_details** complex | always | Message count details. |
| | | **active\_message\_count** integer | always | Number of active messages in the `queue`, `topic`, or `subscription`. |
| | | **dead\_letter\_message\_count** integer | always | Number of messages that are dead lettered. |
| | | **scheduled\_message\_count** integer | always | Number of scheduled messages. |
| | | **transfer\_dead\_letter\_message\_count** integer | always | Number of messages transferred into dead letters. |
| | | **transfer\_message\_count** integer | always | Number of messages transferred to another `queue`, `topic`, or `subscription`. |
| | **created\_at** string | always | Exact time the message was created. **Sample:** 2019-01-25 02:46:55.543953+00:00 |
| | **dead\_lettering\_on\_filter\_evaluation\_exceptions** integer | always | Value that indicates whether a subscription has dead letter support on filter evaluation exceptions. |
| | **dead\_lettering\_on\_message\_expiration** integer | always | A value that indicates whether this `queue` or `topic` has dead letter support when a message expires. |
| | **default\_message\_time\_to\_live\_seconds** integer | always | ISO 8061 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. |
| | **duplicate\_detection\_time\_in\_seconds** integer | always | ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. **Sample:** 600 |
| | **enable\_batched\_operations** boolean | always | Value that indicates whether server-side batched operations are enabled. **Sample:** True |
| | **enable\_express** boolean | always | Value that indicates whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage. **Sample:** True |
| | **enable\_partitioning** boolean | always | Value that indicates whether the `queue` or `topic` to be partitioned across multiple message brokers is enabled. **Sample:** True |
| | **forward\_dead\_lettered\_messages\_to** string | always |
`queue` or `topic` name to forward the Dead Letter message. **Sample:** corge |
| | **forward\_to** string | always |
`queue` or `topic` name to forward the messages. **Sample:** quux |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/foo/providers/Microsoft.ServiceBus/ namespaces/bar/topics/baz/subscriptions/qux |
| | **location** string | always | The Geo-location where the resource lives. **Sample:** eastus |
| | **lock\_duration\_in\_seconds** integer | always | ISO 8601 timespan duration of a peek-lock. The amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes. **Sample:** 60 |
| | **max\_delivery\_count** integer | always | The maximum delivery count. A message is automatically deadlettered after this number of deliveries. **Sample:** 10 |
| | **max\_size\_in\_mb** integer | always | Maximum size of the `queue` or `topic` in megabytes, which is the size of the memory allocated for the `topic`. **Sample:** 5120 |
| | **message\_count** integer | always | Number of messages. **Sample:** 10 |
| | **metric\_id** string | always | Identifier for Azure Insights metrics of namespace. **Sample:** XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:bar |
| | **name** string | always | Resource name. **Sample:** qux |
| | **namespace** string | always |
*namespace* name of the `queue` or `topic`, `subscription`. **Sample:** bar |
| | **provisioning\_state** string | always | Provisioning state of the namespace. **Sample:** Succeeded |
| | **requires\_duplicate\_detection** boolean | always | A value indicating if this `queue` or `topic` requires duplicate detection. **Sample:** True |
| | **requires\_session** boolean | always | A value that indicates whether the `queue` or `topic` supports the concept of sessions. **Sample:** True |
| | **sas\_policies** dictionary | always | Dict of SAS policies. Will not be returned until *show\_sas\_policy* set. **Sample:** {'testpolicy1': {'id': '/subscriptions/XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/ foo/providers/Microsoft.ServiceBus/namespaces/bar/queues/qux/authorizationRules/testpolicy1', 'keys': {'key\_name': 'testpolicy1', 'primary\_connection\_string': 'Endpoint=sb://bar.servicebus.windows.net/; SharedAccessKeyName=testpolicy1;SharedAccessKey=XXXXXXXXXXXXXXXXX;EntityPath=qux', 'primary\_key': 'XXXXXXXXXXXXXXXXX', 'secondary\_connection\_string': 'Endpoint=sb://bar.servicebus.windows.net/; SharedAccessKeyName=testpolicy1;SharedAccessKey=XXXXXXXXXXXXXXX;EntityPath=qux', 'secondary\_key': 'XXXXXXXXXXXXXXX'}, 'name': 'testpolicy1', 'rights': 'listen\_send', 'type': 'Microsoft.ServiceBus/Namespaces/Queues/AuthorizationRules'}} |
| | **service\_bus\_endpoint** string | always | Endpoint you can use to perform Service Bus operations. **Sample:** https://bar.servicebus.windows.net:443/ |
| | **size\_in\_bytes** integer | always | The size of the `queue` or `topic` in bytes. |
| | **sku** string | always | Properties of namespace's SKU. **Sample:** Standard |
| | **status** string | always | The status of a messaging entity. **Sample:** active |
| | **subscription\_count** integer | always | Number of subscriptions under a topic. **Sample:** 1 |
| | **support\_ordering** boolean | always | Value that indicates whether the `topic` supports ordering. **Sample:** True |
| | **tags** dictionary | always | Resource tags. **Sample:** {'env': 'sandbox'} |
| | **topic** string | always | Topic name of a subscription. **Sample:** baz |
| | **type** string | always | Resource type. Namespace is a scoping container for all messaging components. Queue enables you to store messages until the receiving application is available to receive and process them. Topic and subscriptions enable 1:n relationships between publishers and subscribers. **Sample:** Microsoft.ServiceBus/Namespaces/Topics |
| | **updated\_at** string | always | The exact time the message was updated. **Sample:** 2019-01-25 02:46:55.543953+00:00 |
### Authors
* Yuwei Zhou (@yuwzho)
ansible azure.azcollection.azure_rm_aduser – Modify an Azure Active Directory user azure.azcollection.azure\_rm\_aduser – Modify an Azure Active Directory user
============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_aduser`.
New in version 1.5.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, delete, and update an Azure Active Directory user.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **account\_enabled** boolean | **Choices:*** no
* yes
| A boolean determing whether or not the user account is enabled. Used when either creating or updating a user account. |
| **ad\_user** string | | Active Directory username. Use when authenticating with an Active Directory user rather than service principal. |
| **adfs\_authority\_url** string added in 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **attribute\_name** string | | The name of an attribute that you want to match to attribute\_value. If attribute\_name is not a collection type it will update or delete the user where attribute\_name is equal to attribute\_value. If attribute\_name is a collection type it will update or delete the user where attribute\_value is in attribute\_name. Mutually exclusive with *object\_id*, *user\_principal\_name*, and *odata\_filter*. Required together with *attribute\_value*. |
| **attribute\_value** string | | The value to match attribute\_name to. If attribute\_name is not a collection type it will update or delete the user where attribute\_name is equal to attribute\_value. If attribute\_name is a collection type it will update or delete the user where attribute\_value is in attribute\_name. Required together with *attribute\_name*. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **display\_name** string | | The display name of the user. Used when either creating or updating a user account. |
| **given\_name** string | | The given name for the user. Used when either creating or updating a user account. |
| **immutable\_id** string | | The immutable\_id of the user. Used when either creating or updating a user account. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **mail** string | | The primary email address of the user. Used when either creating or updating a user account. |
| **mail\_nickname** string | | The mail alias for the user. Used when either creating or updating a user account. |
| **object\_id** string | | The object id for the user. Updates or deletes the user who has this object ID. Mutually exclusive with *user\_principal\_name*, *attribute\_name*, and *odata\_filter*. |
| **odata\_filter** string | | Filter that can be used to specify a user to update or delete. Mutually exclusive with *object\_id*, *attribute\_name*, and *user\_principal\_name*. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **password\_profile** string | | The password for the user. Used when either creating or updating a user account. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the ad user. Use `present` to create or update an ad user and `absent` to delete an ad user. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **surname** string | | The surname for the user. Used when either creating or updating a user account. |
| **tenant** string / required | | The tenant ID. |
| **usage\_location** string | | A two letter country code, ISO standard 3166. Required for a user that will be assigned licenses due to legal requirement to check for availability of services in countries. Used when either creating or updating a user account. |
| **user\_principal\_name** string | | The principal name of the user. Creates, updates, or deletes the user who has this principal name. Mutually exclusive with *object\_id*, *attribute\_name*, and *odata\_filter*. |
| **user\_type** string | | A string value that can be used to classify user types in your directory, such as Member and Guest. Used when either creating or updating a user account. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create user
azure_rm_aduser:
user_principal_name: "{{ user_id }}"
tenant: "{{ tenant_id }}"
state: "present"
account_enabled: "True"
display_name: "Test_{{ user_principal_name }}_Display_Name"
password_profile: "password"
mail_nickname: "Test_{{ user_principal_name }}_mail_nickname"
immutable_id: "{{ object_id }}"
given_name: "First"
surname: "Last"
user_type: "Member"
usage_location: "US"
mail: "{{ user_principal_name }}@contoso.com"
- name: Update user with new value for account_enabled
azure_rm_aduser:
user_principal_name: "{{ user_id }}"
tenant: "{{ tenant_id }}"
state: "present"
account_enabled: "False"
- name: Delete user
azure_rm_aduser:
user_principal_name: "{{ user_id }}"
tenant: "{{ tenant_id }}"
state: "absent"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **account\_enabled** boolean | always | Whether the account is enabled. |
| **display\_name** string | always | The display name of the user. **Sample:** John Smith |
| **mail** string | always | The primary email address of the user. **Sample:** [email protected] |
| **mail\_nickname** string | always | The mail alias for the user. **Sample:** jsmith |
| **object\_id** string | always | The object\_id for the user. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| **user\_principal\_name** string | always | The principal name of the user. **Sample:** [email protected] |
| **user\_type** string | always | A string value that can be used to classify user types in your directory. **Sample:** Member |
### Authors
* Cole Neubauer(@coleneubauer)
| programming_docs |
ansible azure.azcollection.azure_rm_ipgroup – Create, delete and update IP group azure.azcollection.azure\_rm\_ipgroup – Create, delete and update IP group
==========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_ipgroup`.
New in version 1.6.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates, deletes, and updates IP group in specified resource group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **ip\_addresses** list / elements=string | | The List of IP addresses in IP group. |
| **location** string | | Location for IP group. Defaults to location of resource group if not specified. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the IP group. |
| **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 / required | | Name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the IP group. Use `present` to create or update and `absent` to delete. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create IP Group
azure_rm_ipgroup:
resource_group: MyAzureResourceGroup
name: myipgroup
location: eastus
ip_addresses:
- 13.64.39.16/32
- 40.74.146.80/31
- 40.74.147.32/28
tags:
key1: "value1"
state: present
- name: Update IP Group
azure_rm_ipgroup:
resource_group: MyAzureResourceGroup
name: myipgroup
location: eastus
ip_addresses:
- 10.0.0.0/24
tags:
key2: "value2"
- name: Delete IP Group
azure_rm_ipgroup:
resource_group: MyAzureResourceGroup
name: myipgroup
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | always | Current state of the IP group. |
| | **etag** string | always | The etag of the IP group. **Sample:** c67388ea-6dab-481b-9387-bd441c0d32f8 |
| | **firewalls** list / elements=dictionary | always | List of references to Firewall resources that this IpGroups is associated with. **Sample:** [{'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myAzureResourceGroup/providers/ Microsoft.Network/azureFirewalls/azurefirewall'}] |
| | **id** string | always | The IP group ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MyAzureResourceGroup/providers/ Microsoft.Network/ipGroups/myipgroup |
| | **ip\_addresses** list / elements=string | always | The list of IP addresses in IP group. **Sample:** ['13.64.39.16/32', '40.74.146.80/31', '40.74.147.32/28'] |
| | **location** string | always | The Azure Region where the resource lives. **Sample:** eastus |
| | **name** string | always | The IP group name. **Sample:** myipgroup |
| | **provisioning\_state** string | always | The provisioning state of the resource. **Sample:** Succeeded |
| | **tags** list / elements=string | always | Resource tags. **Sample:** [{'key1': 'value1'}] |
| | **type** string | always | The type of resource. **Sample:** Microsoft.Network/IpGroups |
### Authors
* Aparna Patil (@techcon65)
ansible azure.azcollection.azure_rm_virtualnetworkpeering – Manage Azure Virtual Network Peering azure.azcollection.azure\_rm\_virtualnetworkpeering – Manage Azure Virtual Network Peering
==========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualnetworkpeering`.
New in version 0.0.1: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete Azure Virtual Network Peering.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **allow\_forwarded\_traffic** boolean | **Choices:*** **no** ←
* yes
| Allows forwarded traffic from the VMs in the remote VNet. |
| **allow\_gateway\_transit** boolean | **Choices:*** **no** ←
* yes
| Allows VNet to use the remote VNet's gateway. Remote VNet gateway must have --allow-gateway-transit enabled for remote peering. Only 1 peering can have this flag enabled. Cannot be set if the VNet already has a gateway. |
| **allow\_virtual\_network\_access** boolean | **Choices:*** **no** ←
* yes
| Allows VMs in the remote VNet to access all VMs in the local VNet. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the virtual network peering. |
| **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. |
| **remote\_virtual\_network** string | | Remote virtual network to be peered. It can be name of remote virtual network in same resource group. It can be remote virtual network resource ID. It can be a dict which contains *name* and *resource\_group* of remote virtual network. Required when creating. |
| **resource\_group** string / required | | Name of a resource group where the vnet exists. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the virtual network peering. Use `present` to create or update a peering and `absent` to delete it. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **use\_remote\_gateways** boolean | **Choices:*** **no** ←
* yes
| If remote gateways can be used on this virtual network. |
| **virtual\_network** string / required | | Name or resource ID of the virtual network to be peered. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create virtual network peering
azure_rm_virtualnetworkpeering:
resource_group: myResourceGroup
virtual_network: myVirtualNetwork
name: myPeering
remote_virtual_network:
resource_group: mySecondResourceGroup
name: myRemoteVirtualNetwork
allow_virtual_network_access: false
allow_forwarded_traffic: true
- name: Delete the virtual network peering
azure_rm_virtualnetworkpeering:
resource_group: myResourceGroup
virtual_network: myVirtualNetwork
name: myPeering
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | ID of the Azure virtual network peering. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualN etwork/virtualNetworkPeerings/myPeering |
### Authors
* Yunge Zhu (@yungezz)
ansible azure.azcollection.azure_rm_dnszone_info – Get DNS zone facts azure.azcollection.azure\_rm\_dnszone\_info – Get DNS zone facts
================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_dnszone_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific DNS zone or all DNS zones within a resource group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Only show results for a specific zone. |
| **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 | | Limit results by resource group. Required when filtering by name. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** dictionary | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one zone
azure_rm_dnszone_info:
resource_group: myResourceGroup
name: foobar22
- name: Get facts for all zones in a resource group
azure_rm_dnszone_info:
resource_group: myResourceGroup
- name: Get facts by tags
azure_rm_dnszone_info:
tags:
- testing
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_dnszones** list / elements=string | always | List of zone dicts. **Sample:** [{'etag': '00000002-0000-0000-0dcb-df5776efd201', 'location': 'global', 'properties': {'maxNumberOfRecordSets': 5000, 'numberOfRecordSets': 15}, 'tags': {}}] |
| **dnszones** list / elements=string | always | List of zone dicts, which share the same layout as azure\_rm\_dnszone module parameter. |
| | **id** string | success | id of the DNS Zone. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/dnszones/azure.com |
| | **max\_number\_of\_record\_sets** integer | success | The maximum number of record sets that can be created in this DNS zone. **Sample:** 5000 |
| | **name** string | success | name of the DNS zone. **Sample:** azure.com |
| | **name\_servers** list / elements=string | success | The name servers for this DNS zone. **Sample:** ['ns1-03.azure-dns.com.', 'ns2-03.azure-dns.net.', 'ns3-03.azure-dns.org.', 'ns4-03.azure-dns.info.'] |
| | **number\_of\_record\_sets** integer | success | The current number of record sets in this DNS zone. **Sample:** 2 |
| | **registration\_virtual\_networks** list / elements=string | success | A list of references to virtual networks that register hostnames in this DNS zone. **Sample:** ['/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/bar'] |
| | **resolution\_virtual\_networks** list / elements=string | success | A list of references to virtual networks that resolve records in this DNS zone. **Sample:** ['/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/deadbeef'] |
| | **type** string | success | The type of this DNS zone (`public` or `private`). **Sample:** private |
### Authors
* Obezimnaka Boms (@ozboms)
| programming_docs |
ansible azure.azcollection.azure_rm_servicebusqueue – Manage Azure Service Bus queue azure.azcollection.azure\_rm\_servicebusqueue – Manage Azure Service Bus queue
==============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_servicebusqueue`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete an Azure Service Bus queue.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **auto\_delete\_on\_idle\_in\_seconds** integer | | Time idle interval after which a queue is automatically deleted. The minimum duration is 5 minutes. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **dead\_lettering\_on\_message\_expiration** boolean | **Choices:*** no
* yes
| A value that indicates whether a queue has dead letter support when a message expires. |
| **default\_message\_time\_to\_live\_seconds** integer | | Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. |
| **duplicate\_detection\_time\_in\_seconds** integer | | TimeSpan structure that defines the duration of the duplicate detection history. |
| **enable\_batched\_operations** boolean | **Choices:*** no
* yes
| Value that indicates whether server-side batched operations are enabled. |
| **enable\_express** boolean | **Choices:*** no
* yes
| Value that indicates whether Express Entities are enabled. An express topic or queue holds a message in memory temporarily before writing it to persistent storage. |
| **enable\_partitioning** boolean | **Choices:*** no
* yes
| A value that indicates whether the topic or queue is to be partitioned across multiple message brokers. |
| **forward\_dead\_lettered\_messages\_to** string | | Queue or topic name to forward the Dead Letter message for a queue. |
| **forward\_to** string | | Queue or topic name to forward the messages for a queue. |
| **lock\_duration\_in\_seconds** integer | | Timespan duration of a peek-lock. The amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **max\_delivery\_count** integer | | The maximum delivery count. A message is automatically deadlettered after this number of deliveries. |
| **max\_size\_in\_mb** integer | | The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. |
| **name** string / required | | Name of the queue. |
| **namespace** string / required | | Servicebus namespace name. A namespace is a scoping container for all messaging components. Multiple queues and topics can reside within a single namespace, and namespaces often serve as application containers. |
| **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. |
| **requires\_duplicate\_detection** boolean | **Choices:*** no
* yes
| A value indicating if this queue or topic requires duplicate detection. |
| **requires\_session** boolean | **Choices:*** no
* yes
| A value that indicates whether the queue supports the concept of sessions. |
| **resource\_group** string / required | | Name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the queue. Use `present` to create or update and use `absent` to delete. |
| **status** string | **Choices:*** active
* disabled
* send\_disabled
* receive\_disabled
| Status of the entity. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a queue
azure_rm_servicebusqueue:
name: subqueue
resource_group: myResourceGroup
namespace: bar
duplicate_detection_time_in_seconds: 600
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | success | Current state of the queue. **Sample:** /subscriptions/xxx...xxx/resourceGroups/v-xisuRG/providers/Microsoft.ServiceBus/namespaces/nsb57dc9561/queues/queueb57dc9561 |
### Authors
* Yuwei Zhou (@yuwzho)
ansible azure.azcollection.azure_rm_subnet – Manage Azure subnets azure.azcollection.azure\_rm\_subnet – Manage Azure subnets
===========================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_subnet`.
New in version 0.1.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete a subnet within a given virtual network.
* Allows setting and updating the address prefix CIDR, which must be valid within the context of the virtual network.
* Use the M(azure\_rm\_networkinterface) module to associate interfaces with the subnet and assign specific IP addresses.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **ad\_user** string | | Active Directory username. Use when authenticating with an Active Directory user rather than service principal. |
| **address\_prefix\_cidr** string | | CIDR defining the IPv4 address space of the subnet. Must be valid within the context of the virtual network.
aliases: address\_prefix |
| **address\_prefixes\_cidr** list / elements=string added in 1.0.0 of azure.azcollection | | CIDR defining the IPv4 and IPv6 address space of the subnet. Must be valid within the context of the virtual network. If set *address\_prefix*, It will not set.
aliases: address\_prefixes |
| **adfs\_authority\_url** string added in 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **delegations** list / elements=string | | An array of delegations. |
| | **actions** list / elements=string | | A list of actions. |
| | **name** string / required | | The name of delegation. |
| | **serviceName** string / required | **Choices:*** Microsoft.Web/serverFarms
* Microsoft.ContainerInstance/containerGroups
* Microsoft.Netapp/volumes
* Microsoft.HardwareSecurityModules/dedicatedHSMs
* Microsoft.ServiceFabricMesh/networks
* Microsoft.Logic/integrationServiceEnvironments
* Microsoft.Batch/batchAccounts
* Microsoft.Sql/managedInstances
* Microsoft.Web/hostingEnvironments
* Microsoft.BareMetal/CrayServers
* Microsoft.BareMetal/MonitoringServers
* Microsoft.Databricks/workspaces
* Microsoft.BareMetal/AzureHostedService
* Microsoft.BareMetal/AzureVMware
* Microsoft.BareMetal/AzureHPC
* Microsoft.BareMetal/AzurePaymentHSM
* Microsoft.StreamAnalytics/streamingJobs
* Microsoft.DBforPostgreSQL/serversv2
* Microsoft.AzureCosmosDB/clusters
* Microsoft.MachineLearningServices/workspaces
* Microsoft.DBforPostgreSQL/singleServers
* Microsoft.DBforPostgreSQL/flexibleServers
* Microsoft.DBforMySQL/serversv2
* Microsoft.DBforMySQL/flexibleServers
* Microsoft.ApiManagement/service
* Microsoft.Synapse/workspaces
* Microsoft.PowerPlatform/vnetaccesslinks
* Microsoft.Network/managedResolvers
* Microsoft.Kusto/clusters
| The type of the endpoint service. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the subnet. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **private\_endpoint\_network\_policies** string | **Choices:*** **Enabled** ←
* Disabled
|
`Enabled` or `Disabled` apply network policies on private endpoints in the subnet. |
| **private\_link\_service\_network\_policies** string | **Choices:*** **Enabled** ←
* Disabled
|
`Enabled` or `Disabled` apply network policies on private link service in the subnet. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **resource\_group** string / required | | Name of resource group. |
| **route\_table** string | | The reference of the RouteTable resource. Can be the name or resource ID of the route table. Can be a dict containing the *name* and *resource\_group* of the route table. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **security\_group** string | | Existing security group with which to associate the subnet. It can be the security group name which is in the same resource group. Can be the resource ID of the security group. Can be a dict containing the *name* and *resource\_group* of the security group.
aliases: security\_group\_name |
| **service\_endpoints** list / elements=string | | An array of service endpoints. |
| | **locations** list / elements=string | | A list of locations. |
| | **service** string / required | | The type of the endpoint service. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the subnet. Use `present` to create or update a subnet and use `absent` to delete a subnet. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **virtual\_network\_name** string / required | | Name of an existing virtual network with which the subnet is or will be associated.
aliases: virtual\_network |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a subnet
azure_rm_subnet:
resource_group: myResourceGroup
virtual_network_name: myVirtualNetwork
name: mySubnet
address_prefix_cidr: "10.1.0.0/24"
- name: Create a subnet refer nsg from other resource group
azure_rm_subnet:
resource_group: myResourceGroup
virtual_network_name: myVirtualNetwork
name: mySubnet
address_prefix_cidr: "10.1.0.0/16"
security_group:
name: secgroupfoo
resource_group: mySecondResourceGroup
route_table: route
- name: Create a subnet with service endpoint
azure_rm_subnet:
resource_group: myResourceGroup
virtual_network_name: myVirtualNetwork
name: mySubnet
address_prefix_cidr: "10.1.0.0/16"
service_endpoints:
- service: "Microsoft.Sql"
locations:
- "eastus"
- name: Create a subnet with delegations
azure_rm_subnet:
resource_group: myResourceGroup
virtual_network_name: myVirtualNetwork
name: mySubnet
address_prefix_cidr: "10.1.0.0/16"
delegations:
- name: 'mydeleg'
serviceName: 'Microsoft.ContainerInstance/containerGroups'
- name: Delete a subnet
azure_rm_subnet:
resource_group: myResourceGroup
virtual_network_name: myVirtualNetwork
name: mySubnet
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | success | Current state of the subnet. |
| | **address\_prefix** string | always | IP address CIDR. **Sample:** 10.1.0.0/16 |
| | **address\_prefixes** list / elements=string | always | IP address for IPv4 and IPv6 CIDR. **Sample:** ['10.2.0.0/24', 'fdda:e69b:1587:495e::/64'] |
| | **delegations** list / elements=string | always | Associated delegation of subnets |
| | | **actions** list / elements=string | when delegation is present | list of actions associated with service of delegation **Sample:** ['Microsoft.Network/virtualNetworks/subnets/action'] |
| | | **name** string | when delegation is present | name of delegation **Sample:** delegationname |
| | | **serviceName** string | when delegation is present | service associated to delegation **Sample:** Microsoft.ContainerInstance/containerGroups |
| | **id** string | always | Subnet resource path. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/mySubnet |
| | **name** string | always | Subnet name. **Sample:** foobar |
| | **network\_security\_group** complex | always | Associated network security group of subnets. |
| | | **id** string | always | Security group resource identifier. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroupfoo |
| | | **name** string | always | Name of the security group. **Sample:** secgroupfoo |
| | **private\_endpoint\_network\_policies** string | always |
`Enabled` or `Disabled` apply network policies on private endpoints in the subnet. **Sample:** Enabled |
| | **private\_link\_service\_network\_policies** string | always |
`Enabled` or `Disabled` apply network policies on private link service in the subnet. **Sample:** Disabled |
| | **provisioning\_state** string | always | Success or failure of the provisioning event. **Sample:** Succeeded |
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
| programming_docs |
ansible azure.azcollection.azure_rm_galleryimage_info – Get Azure SIG Image info azure.azcollection.azure\_rm\_galleryimage\_info – Get Azure SIG Image info
===========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_galleryimage_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
Synopsis
--------
* Get info of Azure SIG Image.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **gallery\_name** string / required | | The name of the shared image gallery from which the image definitions are to be retrieved. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Resource name. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: List gallery images in a gallery.
azure_rm_galleryimage_info:
resource_group: myResourceGroup
gallery_name: myGallery
- name: Get a gallery image.
azure_rm_galleryimage_info:
resource_group: myResourceGroup
gallery_name: myGallery
name: myImage
```
### Authors
* Liu Qingyi (@smile37773)
There were some errors parsing the documentation for this plugin. Please file a bug with the collection.
The errors were:
* ```
Unable to normalize azure_rm_galleryimage_info: return due to: 2 validation errors for PluginReturnSchema
return -> images -> contains -> os_state -> type
string does not match regex "^(any|bits|bool|bytes|complex|dict|float|int|json|jsonarg|list|path|sid|str|pathspec|pathlist)$" (type=value_error.str.regex; pattern=^(any|bits|bool|bytes|complex|dict|float|int|json|jsonarg|list|path|sid|str|pathspec|pathlist)$)
return -> images -> contains -> os_type -> type
string does not match regex "^(any|bits|bool|bytes|complex|dict|float|int|json|jsonarg|list|path|sid|str|pathspec|pathlist)$" (type=value_error.str.regex; pattern=^(any|bits|bool|bytes|complex|dict|float|int|json|jsonarg|list|path|sid|str|pathspec|pathlist)$)
```
ansible azure.azcollection.azure_rm_mysqlserver – Manage MySQL Server instance azure.azcollection.azure\_rm\_mysqlserver – Manage MySQL Server instance
========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_mysqlserver`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of MySQL Server.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **admin\_password** string | | The password of the administrator login. |
| **admin\_username** string | | The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **create\_mode** string | **Default:**"Default" | Create mode of SQL Server. |
| **enforce\_ssl** boolean | **Choices:*** **no** ←
* yes
| Enable SSL enforcement. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the server. |
| **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 / required | | The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
| **restarted** boolean | **Choices:*** **no** ←
* yes
| Set to `true` with *state=present* to restart a running mysql server. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** dictionary | | The SKU (pricing tier) of the server. |
| | **capacity** string | | The scale up/out capacity, representing server's compute units. |
| | **name** string | | The name of the sku, typically, tier + family + cores, for example `B_Gen4_1`, `GP_Gen5_8`. |
| | **size** integer | | The size code, to be interpreted by resource as appropriate. |
| | **tier** string | **Choices:*** basic
* standard
| The tier of the particular SKU, for example `Basic`. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the MySQL Server. Use `present` to create or update a server and `absent` to delete it. |
| **storage\_profile** dictionary | | Storage Profile properties of a server. |
| | **backup\_retention\_days** integer | | Backup retention days for the server |
| | **geo\_redundant\_backup** string | **Choices:*** Disabled
* Enabled
| Enable Geo-redundant or not for server backup. |
| | **storage\_autogrow** string | **Choices:*** Disabled
* Enabled
| Enable Storage Auto Grow. |
| | **storage\_mb** integer | | The maximum storage allowed for a server. |
| **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. |
| **version** string | **Choices:*** 5.7
* 8.0
| Server version. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) MySQL Server
azure_rm_mysqlserver:
resource_group: myResourceGroup
name: testserver
sku:
name: B_Gen5_1
tier: Basic
location: eastus
storage_profile:
storage_mb: 51200
backup_retention_days: 7
geo_redundant_backup: Disabled
storage_autogrow: Disabled
enforce_ssl: True
version: 5.7
admin_username: cloudsa
admin_password: password
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **fully\_qualified\_domain\_name** string | always | The fully qualified domain name of a server. **Sample:** mysqlsrv1b6dd89593.mysql.database.azure.com |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DBforMySQL/servers/mysqlsrv1b6dd89593 |
| **state** string | always | A state of a server that is visible to user. Possible values include `Ready`, `Dropping`, `Disabled`. **Sample:** Ready |
| **version** string | always | Server version. Possible values include `5.6`, `5.7`, `8.0`. **Sample:** 5.7 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_networkinterface – Manage Azure network interfaces azure.azcollection.azure\_rm\_networkinterface – Manage Azure network interfaces
================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_networkinterface`.
New in version 0.1.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete a network interface.
* When creating a network interface you must provide the name of an existing virtual network, the name of an existing subnet within the virtual network.
* A default security group and public IP address will be created automatically.
* Or you can provide the name of an existing security group and public IP address.
* See the examples below for more details.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **create\_with\_security\_group** boolean | **Choices:*** no
* **yes** ←
| Whether a security group should be be created with the NIC. If this flag set to `True` and no *security\_group* set, a default security group will be created. |
| **dns\_servers** list / elements=string | | Which DNS servers should the NIC lookup. List of IP addresses. |
| **enable\_accelerated\_networking** boolean | **Choices:*** **no** ←
* yes
| Whether the network interface should be created with the accelerated networking feature or not. |
| **enable\_ip\_forwarding** boolean | **Choices:*** **no** ←
* yes
| Whether to enable IP forwarding.
aliases: ip\_forwarding |
| **ip\_configurations** string | | List of IP configurations. Each configuration object should include field *private\_ip\_address*, *private\_ip\_allocation\_method*, *public\_ip\_address\_name*, *public\_ip*, *public\_ip\_allocation\_method*, *name*. |
| | **application\_security\_groups** string | | List of application security groups in which the IP configuration is included. Element of the list could be a resource id of application security group, or dict of *resource\_group* and *name*. |
| | **load\_balancer\_backend\_address\_pools** string | | List of existing load-balancer backend address pools to associate with the network interface. Can be written as a resource ID. Also can be a dict of *name* and *load\_balancer*. |
| | **name** string / required | | Name of the IP configuration. |
| | **primary** boolean | **Choices:*** **no** ←
* yes
| Whether the IP configuration is the primary one in the list. The first IP configuration default set to *primary=True*. |
| | **private\_ip\_address** string | | Private IP address for the IP configuration. |
| | **private\_ip\_address\_version** string | **Choices:*** **IPv4** ←
* IPv6
| The version of the IP configuration. |
| | **private\_ip\_allocation\_method** string | **Choices:*** **Dynamic** ←
* Static
| Private IP allocation method. |
| | **public\_ip\_address\_name** string | | Name of the public IP address. None for disable IP address.
aliases: public\_ip\_address, public\_ip\_name |
| | **public\_ip\_allocation\_method** string | **Choices:*** **Dynamic** ←
* Static
| Public IP allocation method. |
| **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 network interface. |
| **open\_ports** string | | When a default security group is created for a Linux host a rule will be added allowing inbound TCP connections to the default SSH port `22`, and for a Windows host rules will be added allowing inbound access to RDP ports `3389` and `5986`. Override the default ports by providing a list of open ports. |
| **os\_type** string | **Choices:*** Windows
* **Linux** ←
| Determines any rules to be added to a default security group. When creating a network interface, if no security group name is provided, a default security group will be created. If the *os\_type=Windows*, a rule allowing RDP access will be added. If the *os\_type=Linux*, a rule allowing SSH access will be added. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **private\_ip\_address** string | | (Deprecate) Valid IPv4 address that falls within the specified subnet. This option will be deprecated in 2.9, use *ip\_configurations* instead. |
| **private\_ip\_allocation\_method** string | **Choices:*** **Dynamic** ←
* Static
| (Deprecate) Whether or not the assigned IP address is permanent. When creating a network interface, if you specify *private\_ip\_address=Static*, you must provide a value for *private\_ip\_address*. You can update the allocation method to `Static` after a dynamic private IP address has been assigned. This option will be deprecated in 2.9, use *ip\_configurations* instead. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **public\_ip** boolean | **Choices:*** no
* **yes** ←
| (Deprecate) When creating a network interface, if no public IP address name is provided a default public IP address will be created. Set to `false` if you do not want a public IP address automatically created. This option will be deprecated in 2.9, use *ip\_configurations* instead. |
| **public\_ip\_address\_name** string | | (Deprecate) Name of an existing public IP address object to associate with the security group. This option will be deprecated in 2.9, use *ip\_configurations* instead.
aliases: public\_ip\_address, public\_ip\_name |
| **public\_ip\_allocation\_method** string | **Choices:*** **Dynamic** ←
* Static
| (Deprecate) If a *public\_ip\_address\_name* is not provided, a default public IP address will be created. The allocation method determines whether or not the public IP address assigned to the network interface is permanent. This option will be deprecated in 2.9, use *ip\_configurations* instead. |
| **resource\_group** string / required | | Name of a resource group where the network interface exists or will be created. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **security\_group** string | | An existing security group with which to associate the network interface. If not provided, a default security group will be created when *create\_with\_security\_group=true*. It can be the name of security group. Make sure the security group is in the same resource group when you only give its name. It can be the resource id. It can be a dict contains security\_group's *name* and *resource\_group*.
aliases: security\_group\_name |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the network interface. Use `present` to create or update an interface and `absent` to delete an interface. |
| **subnet\_name** string / required | | Name of an existing subnet within the specified virtual network. Required when creating a network interface. Use the `virtual_network`'s resource group.
aliases: subnet |
| **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. |
| **virtual\_network** string / required | | An existing virtual network with which the network interface will be associated. Required when creating a network interface. It can be the virtual network's name. Make sure your virtual network is in the same resource group as NIC when you give only the name. It can be the virtual network's resource id. It can be a dict which contains *name* and *resource\_group* of the virtual network.
aliases: virtual\_network\_name |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a network interface with minimal parameters
azure_rm_networkinterface:
name: nic001
resource_group: myResourceGroup
virtual_network: vnet001
subnet_name: subnet001
ip_configurations:
- name: ipconfig1
public_ip_address_name: publicip001
primary: True
- name: Create a network interface with private IP address only (no Public IP)
azure_rm_networkinterface:
name: nic001
resource_group: myResourceGroup
virtual_network: vnet001
subnet_name: subnet001
create_with_security_group: False
ip_configurations:
- name: ipconfig1
primary: True
- name: Create a network interface for use in a Windows host (opens RDP port) with custom RDP port
azure_rm_networkinterface:
name: nic002
resource_group: myResourceGroup
virtual_network: vnet001
subnet_name: subnet001
os_type: Windows
rdp_port: 3399
security_group: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurit
yGroups/nsg001"
ip_configurations:
- name: ipconfig1
public_ip_address_name: publicip001
primary: True
- name: Create a network interface using existing security group and public IP
azure_rm_networkinterface:
name: nic003
resource_group: myResourceGroup
virtual_network: vnet001
subnet_name: subnet001
security_group: secgroup001
ip_configurations:
- name: ipconfig1
public_ip_address_name: publicip001
primary: True
- name: Create a network with multiple ip configurations
azure_rm_networkinterface:
name: nic004
resource_group: myResourceGroup
subnet_name: subnet001
virtual_network: vnet001
security_group:
name: testnic002
resource_group: Testing1
ip_configurations:
- name: ipconfig1
public_ip_address_name: publicip001
primary: True
- name: ipconfig2
load_balancer_backend_address_pools:
- "{{ loadbalancer001.state.backend_address_pools[0].id }}"
- name: backendaddrpool1
load_balancer: loadbalancer001
- name: Create a network interface in accelerated networking mode
azure_rm_networkinterface:
name: nic005
resource_group: myResourceGroup
virtual_network_name: vnet001
subnet_name: subnet001
enable_accelerated_networking: True
- name: Create a network interface with IP forwarding
azure_rm_networkinterface:
name: nic001
resource_group: myResourceGroup
virtual_network: vnet001
subnet_name: subnet001
ip_forwarding: True
ip_configurations:
- name: ipconfig1
public_ip_address_name: publicip001
primary: True
- name: Create a network interface with dns servers
azure_rm_networkinterface:
name: nic009
resource_group: myResourceGroup
virtual_network: vnet001
subnet_name: subnet001
dns_servers:
- 8.8.8.8
- name: Delete network interface
azure_rm_networkinterface:
resource_group: myResourceGroup
name: nic003
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | always | The current state of the network interface. |
| | **dns\_server** list / elements=string | success | Which DNS servers should the NIC lookup. List of IP addresses. **Sample:** ['8.9.10.11', '7.8.9.10'] |
| | **dns\_setting** dictionary | success | The DNS settings in network interface. **Sample:** {'applied\_dns\_servers': [], 'dns\_servers': ['8.9.10.11', '7.8.9.10'], 'internal\_dns\_name\_label': None, 'internal\_fqdn': None} |
| | **enable\_accelerated\_networking** boolean | success | Whether the network interface should be created with the accelerated networking feature or not. **Sample:** True |
| | **enable\_ip\_forwarding** boolean | success | Whether to enable IP forwarding. **Sample:** True |
| | **etag** string | success | A unique read-only string that changes whenever the resource is updated. **Sample:** W/"be115a43-2148-4545-a324-f33ad444c926" |
| | **id** string | success | Id of the network interface. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nic003 |
| | **ip\_configurations** complex | success | List of IP configurations. |
| | | **load\_balancer\_backend\_address\_pools** list / elements=string | success | List of existing load-balancer backend address pools to associate with the network interface. |
| | | **name** string | success | Name of the IP configuration. **Sample:** default |
| | | **private\_ip\_address** string | success | Private IP address for the IP configuration. **Sample:** 10.1.0.10 |
| | | **private\_ip\_address\_version** string | success | The version of the IP configuration. **Sample:** IPv4 |
| | | **private\_ip\_allocation\_method** string | success | Private IP allocation method. **Sample:** Static |
| | | **public\_ip\_address** dictionary | success | Name of the public IP address. None for disable IP address. **Sample:** {'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/publicIPAddresse s/publicip001', 'name': 'publicip001'} |
| | | **subnet** dictionary | success | The reference of the subnet resource. **Sample:** {'id': '/subscriptions/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ myresourcegroup/providers/Microsoft.Network/virtualNetworks/tnb57dc95318/subnets/tnb57dc95318', 'name': 'tnb57dc95318', 'resource\_group': 'myresourcegroup', 'virtual\_network\_name': 'tnb57dc95318'} |
| | **location** string | success | The network interface resource location. **Sample:** eastus |
| | **mac\_address** string | success | The MAC address of the network interface. |
| | **name** string | success | Name of the network interface. **Sample:** nic003 |
| | **network\_security\_group** dictionary | success | The reference of the network security group resource. **Sample:** {'id': '/subscriptions//xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/ myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/nsg001', 'name': 'nsg001'} |
| | **primary** boolean | success | Get whether this is a primary network interface on virtual machine. **Sample:** True |
| | **provisioning\_state** string | success | The provisioning state of the public IP resource. **Sample:** Succeeded |
| | **tags** dictionary | success | -Tags of the network interface. **Sample:** {'key': 'value'} |
| | **type** string | success | Type of the resource. **Sample:** Microsoft.Network/networkInterfaces |
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
* Yuwei Zhou (@yuwzho)
| programming_docs |
ansible azure.azcollection.azure_rm_virtualmachineextension_info – Get Azure Virtual Machine Extension facts azure.azcollection.azure\_rm\_virtualmachineextension\_info – Get Azure Virtual Machine Extension facts
=======================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualmachineextension_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure Virtual Machine Extension.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the virtual machine extension. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **virtual\_machine\_name** string / required | | The name of the virtual machine containing the extension. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get information on specific Virtual Machine Extension
azure_rm_virtualmachineextension_info:
resource_group: myResourceGroup
virtual_machine_name: myvm
name: myextension
- name: List installed Virtual Machine Extensions
azure_rm_virtualmachineextension_info:
resource_group: myResourceGroup
virtual_machine_name: myvm
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **extensions** complex | always | A list of dictionaries containing facts for Virtual Machine Extension. |
| | **auto\_upgrade\_minor\_version** boolean | always | Autoupgrade minor version flag. **Sample:** True |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/myvm/testVM/extens ions/myextension |
| | **location** string | always | The resource location. **Sample:** eastus |
| | **name** string | always | Virtual machine name. **Sample:** myextension |
| | **provisioning\_state** string | always | Provisioning state of the extension. **Sample:** Succeeded |
| | **publisher** string | always | Extension publisher. **Sample:** Microsoft.Azure.Extensions |
| | **resource\_group** string | always | Resource group name. **Sample:** myResourceGroup |
| | **settings** dictionary | always | Extension specific settings dictionary. **Sample:** {'commandToExecute': 'hostname'} |
| | **tags** dictionary | always | Resource tags. **Sample:** {'mytag': 'abc'} |
| | **type** string | always | Extension type. **Sample:** CustomScript |
| | **virtual\_machine\_name** string | always | Virtual machine name. **Sample:** myvm |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_apimanagementservice – Manage Azure ApiManagementService instance azure.azcollection.azure\_rm\_apimanagementservice – Manage Azure ApiManagementService instance
===============================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_apimanagementservice`.
New in version 1.5.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create and delete instance of Azure ApiManagementService.
* Updates are not currently supported, this feature should be added in a later release.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **location** string | | Location of the Api management service. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Service name. |
| **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. |
| **publisher\_email** string | | Publisher email. |
| **publisher\_name** string | | Publisher name. |
| **resource\_group** string / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku\_capacity** integer | | Capacity of the SKU (number of deployed units of the SKU). |
| **sku\_name** string | **Choices:*** Developer
* Standard
* Premium
* Basic
* Consumption
| Name of the Sku. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the ApiManagementService. Use `present` to create or update an ApiManagementService. Use `absent` to delete an ApiManagementService. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create Api Management Service
azure_rm_apimanagementservice:
resource_group: myResourceGroup
name: myService
publisher_email: [email protected]
publisher_name: Publisher Name
sku_name: Developer
sku_capacity: 1
- name: Delete Api Management Service
azure_rm_apimanagementservice:
resource_group: myResourceGroup
name: myService
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Resource ID. |
### Authors
* Nikhil Patne (@nikhilpatne)
* Sakar Mehra (@sakar97)
ansible azure.azcollection.azure_rm_cosmosdbaccount_info – Get Azure Cosmos DB Account facts azure.azcollection.azure\_rm\_cosmosdbaccount\_info – Get Azure Cosmos DB Account facts
=======================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_cosmosdbaccount_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure Cosmos DB Account.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Cosmos DB database account name. |
| **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 | | Name of an Azure resource group. |
| **retrieve\_connection\_strings** boolean | **Choices:*** no
* yes
| Retrieve connection strings. |
| **retrieve\_keys** string | **Choices:*** all
* readonly
| Retrieve keys and connection strings. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of Database Account
azure_rm_cosmosdbaccount_info:
resource_group: myResourceGroup
name: testaccount
- name: List instances of Database Account
azure_rm_cosmosdbaccount_info:
resource_group: myResourceGroup
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **accounts** complex | always | A list of dictionaries containing facts for Database Account. |
| | **connection\_strings** list / elements=string | when requested | List of connection strings. |
| | | **connection\_string** string | always | Description of connection string. **Sample:** Primary SQL Connection String |
| | | **description** string | always | Connection string. **Sample:** AccountEndpoint=https://testaccount.documents.azure.com:443/;AccountKey=xxxxx |
| | **consistency\_policy** complex | always | Consistency policy. |
| | | **default\_consistency\_level** string | always | Default consistency level. **Sample:** session |
| | | **max\_interval\_in\_seconds** integer | always | Maximum interval in seconds. **Sample:** 5 |
| | | **max\_staleness\_prefix** integer | always | Maximum staleness prefix. **Sample:** 100 |
| | **database\_account\_offer\_type** string | always | Offer type. **Sample:** Standard |
| | **document\_endpoint** string | always | Document endpoint. **Sample:** https://testaccount.documents.azure.com:443/ |
| | **enable\_automatic\_failover** boolean | always | Enable automatic failover. **Sample:** True |
| | **enable\_cassandra** boolean | always | Enable Cassandra. **Sample:** True |
| | **enable\_gremlin** boolean | always | Enable Gremlin. **Sample:** True |
| | **enable\_multiple\_write\_locations** boolean | always | Enable multiple write locations. **Sample:** True |
| | **enable\_table** boolean | always | Enable Table. **Sample:** True |
| | **failover\_policies** complex | always | The list of new failover policies for the failover priority change. |
| | | **failover\_priority** integer | always | Failover priority. |
| | | **id** string | always | Read location ID. **Sample:** testaccount-eastus |
| | | **name** string | always | Location name. **Sample:** eastus |
| | **id** string | always | The unique resource identifier of the database account. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccount s/testaccount |
| | **ip\_range\_filter** string | always | Enable IP range filter. **Sample:** 10.10.10.10 |
| | **is\_virtual\_network\_filter\_enabled** boolean | always | Enable virtual network filter. **Sample:** True |
| | **kind** string | always | Indicates the type of database account. **Sample:** global\_document\_db |
| | **location** string | always | The location of the resource group to which the resource belongs. **Sample:** westus |
| | **name** string | always | The name of the database account. **Sample:** testaccount |
| | **primary\_master\_key** string | when requested | Primary master key. **Sample:** xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| | **primary\_readonly\_master\_key** string | when requested | Primary master key. **Sample:** xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| | **provisioning\_state** string | always | Provisioning state of Cosmos DB. **Sample:** Succeeded |
| | **read\_locations** complex | always | Read locations. |
| | | **document\_endpoint** string | always | Document endpoint. **Sample:** https://testaccount-eastus.documents.azure.com:443/ |
| | | **failover\_priority** integer | always | Failover priority. |
| | | **id** string | always | Read location ID. **Sample:** testaccount-eastus |
| | | **name** string | always | Location name. **Sample:** eastus |
| | | **provisioning\_state** string | always | Provisioning state. **Sample:** Succeeded |
| | **resource\_group** string | always | Name of an Azure resource group. **Sample:** myResourceGroup |
| | **secondary\_master\_key** string | when requested | Primary master key. **Sample:** xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| | **secondary\_readonly\_master\_key** string | when requested | Primary master key. **Sample:** xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| | **tags** dictionary | always | Tags assigned to the resource. Dictionary of "string":"string" pairs. **Sample:** {'tag1': 'abc'} |
| | **virtual\_network\_rules** list / elements=string | success | List of Virtual Network ACL rules configured for the Cosmos DB account. |
| | | **ignore\_missing\_vnet\_service\_endpoint** boolean | success | Create Cosmos DB account without existing virtual network service endpoint. |
| | | **subnet** string | success | Resource id of a subnet. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNet works/testvnet/subnets/testsubnet1 |
| | **write\_locations** complex | always | Write locations. |
| | | **document\_endpoint** string | always | Document endpoint. **Sample:** https://testaccount-eastus.documents.azure.com:443/ |
| | | **failover\_priority** integer | always | Failover priority. |
| | | **id** string | always | Read location ID. **Sample:** testaccount-eastus |
| | | **name** string | always | Location name. **Sample:** eastus |
| | | **provisioning\_state** string | always | Provisioning state. **Sample:** Succeeded |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible azure.azcollection.azure_rm_trafficmanagerendpoint_info – Get Azure Traffic Manager endpoint facts azure.azcollection.azure\_rm\_trafficmanagerendpoint\_info – Get Azure Traffic Manager endpoint facts
=====================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_trafficmanagerendpoint_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific Traffic Manager endpoints or all endpoints in a Traffic Manager profile.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Limit results to a specific Traffic Manager endpoint. |
| **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. |
| **profile\_name** string / required | | Name of Traffic Manager Profile. |
| **resource\_group** string / required | | The resource group to search for the desired Traffic Manager profile. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **type** string | **Choices:*** azure\_endpoints
* external\_endpoints
* nested\_endpoints
| Type of endpoint. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get endpoints facts of a Traffic Manager profile
azure_rm_trafficmanagerendpoint_info:
resource_group: myResourceGroup
profile_name: Testing
- name: Get specific endpoint of a Traffic Manager profile
azure_rm_trafficmanager_info:
resource_group: myResourceGroup
profile_name: Testing
name: test_external_endpoint
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **endpoints** complex | always | List of Traffic Manager endpoints. |
| | **enabled** string | always | The status of the endpoint. **Sample:** Enabled |
| | **geo\_mapping** list / elements=string | always | The list of countries/regions mapped to this endpoint when using the 'Geographic' traffic routing method. **Sample:** ['GEO-NA', 'GEO-AS'] |
| | **location** string | always | The location of the external or nested endpoints when using the 'Performance' traffic routing method. **Sample:** East US |
| | **min\_child\_endpoints** integer | always | The minimum number of endpoints that must be available in the child profile to make the parent profile available. **Sample:** 3 |
| | **name** string | always | Name of the Traffic Manager endpoint. **Sample:** testendpoint |
| | **priority** string | always | The priority of this endpoint when using the 'Priority' traffic routing method. **Sample:** 3 |
| | **resource\_group** string | always | Name of a resource group. **Sample:** myResourceGroup |
| | **target** string | always | The fully-qualified DNS name of the endpoint. **Sample:** 8.8.8.8 |
| | **target\_resource\_id** string | always | The Azure Resource URI of the of the endpoint. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/vscjavaci |
| | **type** string | always | The type of the endpoint. **Sample:** external\_endpoints |
| | **weight** integer | always | The weight of this endpoint when using the 'Weighted' traffic routing method. **Sample:** 10 |
### Authors
* Hai Cao (@caohai)
* Yunge Zhu (@yungezz)
ansible azure.azcollection.azure_rm_appserviceplan_info – Get azure app service plan facts azure.azcollection.azure\_rm\_appserviceplan\_info – Get azure app service plan facts
=====================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_appserviceplan_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific app service plan or all app service plans in a resource group, or all app service plan in current subscription.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Only show results for a specific app service plan. |
| **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 | | Limit results by resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for app service plan by name
azure_rm_appserviceplan_info:
resource_group: myResourceGroup
name: myAppServicePlan
- name: Get azure_rm_appserviceplan_facts for app service plan in resource group
azure_rm_appserviceplan_info:
resource_group: myResourceGroup
- name: Get facts for app service plan with tags
azure_rm_appserviceplan_info:
tags:
- testtag
- foo:bar
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **appserviceplans** complex | always | List of app service plans. |
| | **id** string | always | Id of the app service plan. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Web/serverfarms/myPlan |
| | **kind** string | always | Kind of the app service plan. **Sample:** app |
| | **location** string | always | Location of the app service plan. |
| | **name** string | always | Name of the app service plan. |
| | **resource\_group** string | always | Resource group of the app service plan. **Sample:** myResourceGroup |
| | **sku** complex | always | Sku of the app service plan. |
| | | **capacity** integer | always | Capacity of sku. **Sample:** 1 |
| | | **family** string | always | Family of sku. **Sample:** S |
| | | **name** string | always | Name of sku. **Sample:** S1 |
| | | **size** string | always | Size of sku. **Sample:** S1 |
| | | **tier** string | always | Tier of sku. **Sample:** Standard |
### Authors
* Yunge Zhu (@yungezz)
ansible azure.azcollection.azure_rm_diskencryptionset – Create, delete and update Disk encryption set azure.azcollection.azure\_rm\_diskencryptionset – Create, delete and update Disk encryption set
===============================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_diskencryptionset`.
New in version 1.9.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates, deletes, and updates Disk encryption set.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **key\_url** string | | The url pointing to the encryption key to be used for disk encryption set. |
| **location** string | | Location for Disk encryption set. Defaults to location of resource group if not specified. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the disk encryption set. |
| **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 / required | | The name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **source\_vault** string | | The name of source key vault containing encryption key. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the disk encryption set. Use `present` to create or update and `absent` to delete. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: create disk encryption set
azure_rm_diskencryptionset:
resource_group: myResourceGroup
name: mydiskencryptionset
source_vault: myvault
key_url: https://myvault.vault.azure.net/keys/Key1/e65090b268ec4c3ba1a0f7a473005768
state: present
- name: Update disk encryption set
azure_rm_diskencryptionset:
resource_group: myResourceGroup
name: mydiskencryptionset
source_vault: myvault
key_url: https://myvault.vault.azure.net/keys/Key1/e65090b268ec4c3ba1a0f7a473005768
state: present
tags:
key1: "value1"
- name: Delete disk encryption set
azure_rm_diskencryptionset:
resource_group: myResourceGroup
name: mydiskencryptionset
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | always | Current state of the Disk Encryption Set. |
| | **active\_key** dictionary | always | Reference to Key vault and key used for disk encryption set. **Sample:** {'key\_url': 'VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER', 'source\_vault': {'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/ Microsoft.KeyVault/vaults/myvault'}} |
| | **id** string | always | The disk encryption set ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/ Microsoft.Compute/diskEncryptionSets/mydiskencryptionset |
| | **identity** dictionary | always | The managed identity for the disk encryption set. **Sample:** {'principal\_id': 'd3abec0a-5818-4bbd-8300-8014198124ca', 'tenant\_id': '7268bab5-aabd-44f9-915f-6bf864e879c6', 'type': 'SystemAssigned'} |
| | **location** string | always | The Azure Region where the resource lives. **Sample:** eastus |
| | **name** string | always | Disk encryption name. **Sample:** mydiskencryptionset |
| | **provisioning\_state** string | always | The provisioning state of the resource. **Sample:** Succeeded |
| | **tags** list / elements=string | always | Resource tags. **Sample:** [{'key1': 'value1'}] |
| | **type** string | always | The type of the resource. **Sample:** Microsoft.Compute/diskEncryptionSets |
### Authors
* Aparna Patil (@techcon65)
| programming_docs |
ansible azure.azcollection.azure_rm_devtestlabenvironment_info – Get Azure Environment facts azure.azcollection.azure\_rm\_devtestlabenvironment\_info – Get Azure Environment facts
=======================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabenvironment_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure Environment.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **lab\_name** string / required | | The name of the lab. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the environment. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** list / elements=string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **user\_name** string / required | | The name of the user profile. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of Environment
azure_rm_devtestlabenvironment_info:
resource_group: myResourceGroup
lab_name: myLab
user_name: myUser
name: myEnvironment
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **environments** complex | always | A list of dictionaries containing facts for Environment. |
| | **deployment\_template** string | always | The identifier of the artifact source. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/mylab/art ifactSources/public environment repo/armTemplates/WebApp |
| | **id** string | always | The identifier of the artifact source. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DevTestLab/labs/myLab/sc hedules/xxxxxxxx-xxxx-xxxx-xxxxx-xxxxxxxxxxxxx/environments/myEnvironment |
| | **lab\_name** string | always | Name of the lab. **Sample:** myLab |
| | **name** string | always | The name of the environment. **Sample:** myEnvironment |
| | **resource\_group** string | always | Name of the resource group. **Sample:** myResourceGroup |
| | **resource\_group\_id** string | always | Target resource group id. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myLab-myEnvironment-982571 |
| | **state** string | always | Deployment state. **Sample:** Succeeded |
| | **tags** complex | always | The tags of the resource. **Sample:** { 'MyTag': 'MyValue' } |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_devtestlabschedule – Manage Azure DevTest Lab Schedule instance azure.azcollection.azure\_rm\_devtestlabschedule – Manage Azure DevTest Lab Schedule instance
=============================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabschedule`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure DecTest Lab Schedule.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **lab\_name** string / required | | The name of the lab. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | **Choices:*** lab\_vms\_startup
* lab\_vms\_shutdown
| The name of the schedule. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Schedule. Use `present` to create or update an Schedule and `absent` to delete it. |
| **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. |
| **time** string | | The time of day the schedule will occur. |
| **time\_zone\_id** string | | The time zone ID. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) DevTest Lab Schedule
azure_rm_devtestlabschedule:
resource_group: myResourceGroup
lab_name: myLab
name: lab_vms_shutdown
time: "1030"
time_zone_id: "UTC+12"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | The identifier of the resource. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/myLab/schedules/l abVmsShutdown |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_functionapp – Manage Azure Function Apps azure.azcollection.azure\_rm\_functionapp – Manage Azure Function Apps
======================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_functionapp`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete an Azure Function App.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **app\_settings** string | | Dictionary containing application settings. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **container\_settings** string | | Web app container settings. |
| | **name** string | | Name of container. For example "imagename:tag". |
| | **registry\_server\_password** string | | The container registry server password. |
| | **registry\_server\_url** string | | Container registry server url. For example `mydockerregistry.io`. |
| | **registry\_server\_user** string | | The container registry server user name. |
| **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 Azure Function App. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **plan** string | | App service plan. It can be name of existing app service plan in same resource group as function app. It can be resource id of existing app service plan. Resource id. For example /subscriptions/<subs\_id>/resourceGroups/<resource\_group>/providers/Microsoft.Web/serverFarms/<plan\_name>. It can be a dict which contains `name`, `resource_group`.
`name`. Name of app service plan.
`resource_group`. Resource group name of app service plan. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **resource\_group** string / required | | Name of resource group.
aliases: resource\_group\_name |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Function App. Use `present` to create or update a Function App and `absent` to delete. |
| **storage\_account** string / required | | Name of the storage account to use.
aliases: storage, storage\_account\_name |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a function app
azure_rm_functionapp:
resource_group: myResourceGroup
name: myFunctionApp
storage_account: myStorageAccount
- name: Create a function app with app settings
azure_rm_functionapp:
resource_group: myResourceGroup
name: myFunctionApp
storage_account: myStorageAccount
app_settings:
setting1: value1
setting2: value2
- name: Create container based function app
azure_rm_functionapp:
resource_group: myResourceGroup
name: myFunctionApp
storage_account: myStorageAccount
plan:
resource_group: myResourceGroup
name: myAppPlan
container_settings:
name: httpd
registry_server_url: index.docker.io
- name: Delete a function app
azure_rm_functionapp:
resource_group: myResourceGroup
name: myFunctionApp
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** dictionary | success | Current state of the Azure Function App. **Sample:** {'availability\_state': 'Normal', 'client\_affinity\_enabled': True, 'client\_cert\_enabled': False, 'container\_size': 1536, 'daily\_memory\_time\_quota': 0, 'default\_host\_name': 'myfunctionapp.azurewebsites.net', 'enabled': True, 'enabled\_host\_names': ['myfunctionapp.azurewebsites.net', 'myfunctionapp.scm.azurewebsites.net'], 'host\_name\_ssl\_states': [{'host\_type': 'Standard', 'name': 'myfunctionapp.azurewebsites.net', 'ssl\_state': 'Disabled'}, {'host\_type': 'Repository', 'name': 'myfunctionapp.scm.azurewebsites.net', 'ssl\_state': 'Disabled'}], 'host\_names': ['myfunctionapp.azurewebsites.net'], 'host\_names\_disabled': False, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/myFunctionApp', 'kind': 'functionapp', 'last\_modified\_time\_utc': '2017-08-22T18:54:01.190Z', 'location': 'East US', 'name': 'myfunctionapp', 'outbound\_ip\_addresses': '............', 'repository\_site\_name': 'myfunctionapp', 'reserved': False, 'resource\_group': 'myResourceGroup', 'scm\_site\_also\_stopped': False, 'server\_farm\_id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Web/serverfarms/EastUSPlan', 'state': 'Running', 'type': 'Microsoft.Web/sites', 'usage\_state': 'Normal'} |
### Authors
* Thomas Stringer (@trstringer)
| programming_docs |
ansible azure.azcollection.azure_rm_securitygroup – Manage Azure network security groups azure.azcollection.azure\_rm\_securitygroup – Manage Azure network security groups
==================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_securitygroup`.
New in version 0.1.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete a network security group.
* A security group contains Access Control List (ACL) rules that allow or deny network traffic to subnets or individual network interfaces.
* A security group is created with a set of default security rules and an empty set of security rules.
* Shape traffic flow by adding rules to the empty set of security rules.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **default\_rules** string | | The set of default rules automatically added to a security group at creation. In general default rules will not be modified. Modify rules to shape the flow of traffic to or from a subnet or NIC. See rules below for the makeup of a rule dict. |
| **location** string | | Valid azure location. Defaults to location of the resource group. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Name of the security group to operate on. |
| **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. |
| **purge\_default\_rules** boolean | **Choices:*** **no** ←
* yes
| Remove any existing rules not matching those defined in the default\_rules parameter. |
| **purge\_rules** boolean | **Choices:*** **no** ←
* yes
| Remove any existing rules not matching those defined in the rules parameters. |
| **resource\_group** string / required | | Name of the resource group the security group belongs to. |
| **rules** string | | Set of rules shaping traffic flow to or from a subnet or NIC. Each rule is a dictionary. |
| | **access** string | **Choices:*** **Allow** ←
* Deny
| Whether or not to allow the traffic flow. |
| | **description** string | | Short description of the rule's purpose. |
| | **destination\_address\_prefix** string | **Default:**"\*" | The destination address prefix. CIDR or destination IP range. Asterisk `*` can also be used to match all source IPs. Default tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. It can accept string type or a list of string type. Asterisk `*` and default tags can only be specified as single string type, not as a list of string. |
| | **destination\_application\_security\_groups** list / elements=string | | List of the destination application security groups. It could be list of resource id. It could be list of names in same resource group. It could be list of dict containing *resource\_group* and *name*. It is mutually exclusive with `destination_address_prefix` and `destination_address_prefixes`. |
| | **destination\_port\_range** string | **Default:**"\*" | Port or range of ports to which traffic is headed. It can accept string type or a list of string type. |
| | **direction** string | **Choices:*** **Inbound** ←
* Outbound
| Indicates the direction of the traffic flow. |
| | **name** string / required | | Unique name for the rule. |
| | **priority** string / required | | Order in which to apply the rule. Must a unique integer between 100 and 4096 inclusive. |
| | **protocol** string | **Choices:*** Udp
* Tcp
* Icmp
* **\*** ←
| Accepted traffic protocol. |
| | **source\_address\_prefix** string | **Default:**"\*" | The CIDR or source IP range. Asterisk `*` can also be used to match all source IPs. Default tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. If this is an ingress rule, specifies where network traffic originates from. It can accept string type or a list of string type. Asterisk `*` and default tags can only be specified as single string type, not as a list of string. |
| | **source\_application\_security\_groups** list / elements=string | | List of the source application security groups. It could be list of resource id. It could be list of names in same resource group. It could be list of dict containing resource\_group and name. It is mutually exclusive with `source_address_prefix` and `source_address_prefixes`. |
| | **source\_port\_range** string | **Default:**"\*" | Port or range of ports from which traffic originates. It can accept string type or a list of string type. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the security group. Set to `present` to create or update a security group. Set to `absent` to remove a security group. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
# Create a security group
- azure_rm_securitygroup:
resource_group: myResourceGroup
name: mysecgroup
purge_rules: yes
rules:
- name: DenySSH
protocol: Tcp
destination_port_range: 22
access: Deny
priority: 100
direction: Inbound
- name: 'AllowSSH'
protocol: Tcp
source_address_prefix:
- '174.109.158.0/24'
- '174.109.159.0/24'
destination_port_range: 22
access: Allow
priority: 101
direction: Inbound
- name: 'AllowMultiplePorts'
protocol: Tcp
source_address_prefix:
- '174.109.158.0/24'
- '174.109.159.0/24'
destination_port_range:
- 80
- 443
access: Allow
priority: 102
# Update rules on existing security group
- azure_rm_securitygroup:
resource_group: myResourceGroup
name: mysecgroup
rules:
- name: DenySSH
protocol: Tcp
destination_port_range: 22-23
access: Deny
priority: 100
direction: Inbound
- name: AllowSSHFromHome
protocol: Tcp
source_address_prefix: '174.109.158.0/24'
destination_port_range: 22-23
access: Allow
priority: 102
direction: Inbound
tags:
testing: testing
delete: on-exit
# Create a securiy group with I(protocol=Icmp)
- azure_rm_securitygroup:
name: mysecgroup
resource_group: myResourceGroup
rules:
- name: SSH
protocol: Tcp
destination_port_range: 22
access: Allow
priority: 105
direction: Inbound
- name: ICMP
protocol: Icmp
priority: 106
# Delete security group
- azure_rm_securitygroup:
resource_group: myResourceGroup
name: mysecgroup
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | always | Current state of the security group. |
| | **default\_rules** list / elements=string | always | The default security rules of network security group. **Sample:** [{'access': 'Allow', 'description': 'Allow inbound traffic from all VMs in VNET', 'destination\_address\_prefix': 'VirtualNetwork', 'destination\_port\_range': '\*', 'direction': 'Inbound', 'etag': 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/defaultSecurityRules/AllowVnetInBound', 'name': 'AllowVnetInBound', 'priority': 65000, 'protocol': '\*', 'provisioning\_state': 'Succeeded', 'source\_address\_prefix': 'VirtualNetwork', 'source\_port\_range': '\*'}, {'access': 'Allow', 'description': 'Allow inbound traffic from azure load balancer', 'destination\_address\_prefix': '\*', 'destination\_port\_range': '\*', 'direction': 'Inbound', 'etag': 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/defaultSecurityRules/AllowAzureLoadBalancerInBound', 'name': 'AllowAzureLoadBalancerInBound', 'priority': 65001, 'protocol': '\*', 'provisioning\_state': 'Succeeded', 'source\_address\_prefix': 'AzureLoadBalancer', 'source\_port\_range': '\*'}, {'access': 'Deny', 'description': 'Deny all inbound traffic', 'destination\_address\_prefix': '\*', 'destination\_port\_range': '\*', 'direction': 'Inbound', 'etag': 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/defaultSecurityRules/DenyAllInBound', 'name': 'DenyAllInBound', 'priority': 65500, 'protocol': '\*', 'provisioning\_state': 'Succeeded', 'source\_address\_prefix': '\*', 'source\_port\_range': '\*'}, {'access': 'Allow', 'description': 'Allow outbound traffic from all VMs to all VMs in VNET', 'destination\_address\_prefix': 'VirtualNetwork', 'destination\_port\_range': '\*', 'direction': 'Outbound', 'etag': 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/defaultSecurityRules/AllowVnetOutBound', 'name': 'AllowVnetOutBound', 'priority': 65000, 'protocol': '\*', 'provisioning\_state': 'Succeeded', 'source\_address\_prefix': 'VirtualNetwork', 'source\_port\_range': '\*'}, {'access': 'Allow', 'description': 'Allow outbound traffic from all VMs to Internet', 'destination\_address\_prefix': 'Internet', 'destination\_port\_range': '\*', 'direction': 'Outbound', 'etag': 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/defaultSecurityRules/AllowInternetOutBound', 'name': 'AllowInternetOutBound', 'priority': 65001, 'protocol': '\*', 'provisioning\_state': 'Succeeded', 'source\_address\_prefix': '\*', 'source\_port\_range': '\*'}, {'access': 'Deny', 'description': 'Deny all outbound traffic', 'destination\_address\_prefix': '\*', 'destination\_port\_range': '\*', 'direction': 'Outbound', 'etag': 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/defaultSecurityRules/DenyAllOutBound', 'name': 'DenyAllOutBound', 'priority': 65500, 'protocol': '\*', 'provisioning\_state': 'Succeeded', 'source\_address\_prefix': '\*', 'source\_port\_range': '\*'}] |
| | **id** string | always | The resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/mysecgroup |
| | **location** string | always | The resource location. **Sample:** westus |
| | **name** string | always | Name of the secrurity group. **Sample:** mysecgroup |
| | **network\_interfaces** list / elements=string | always | A collection of references to network interfaces. |
| | **rules** list / elements=string | always | A collection of security rules of the network security group. **Sample:** [{'access': 'Deny', 'description': None, 'destination\_address\_prefix': '\*', 'destination\_port\_range': '22', 'direction': 'Inbound', 'etag': 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/securityRules/DenySSH', 'name': 'DenySSH', 'priority': 100, 'protocol': 'Tcp', 'provisioning\_state': 'Succeeded', 'source\_address\_prefix': '\*', 'source\_port\_range': '\*'}, {'access': 'Allow', 'description': None, 'destination\_address\_prefix': '\*', 'destination\_port\_range': '22', 'direction': 'Inbound', 'etag': 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/securityRules/AllowSSH', 'name': 'AllowSSH', 'priority': 101, 'protocol': 'Tcp', 'provisioning\_state': 'Succeeded', 'source\_address\_prefix': '174.109.158.0/24', 'source\_port\_range': '\*'}] |
| | **subnets** list / elements=string | always | A collection of references to subnets. |
| | **tags** dictionary | always | Tags to assign to the security group. **Sample:** {'delete': 'on-exit', 'foo': 'bar', 'testing': 'testing'} |
| | **type** string | always | The resource type. **Sample:** Microsoft.Network/networkSecurityGroups |
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
ansible azure.azcollection.azure_rm_postgresqlconfiguration – Manage Azure PostgreSQL Configuration azure.azcollection.azure\_rm\_postgresqlconfiguration – Manage Azure PostgreSQL Configuration
=============================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_postgresqlconfiguration`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Update or reset Azure PostgreSQL Configuration setting.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Setting name. |
| **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 / required | | The name of the resource group that contains the resource. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string / required | | The name of the server. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the PostgreSQL setting. Use `present` to update setting, or `absent` to reset to default value. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **value** string | | Setting value. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Update PostgreSQL Server setting
azure_rm_postgresqlconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: deadlock_timeout
value: 2000
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/myServer/confi gurations/event\_scheduler |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible azure.azcollection.azure_rm_privateendpoint – Manage Azure private endpoint azure.azcollection.azure\_rm\_privateendpoint – Manage Azure private endpoint
=============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_privateendpoint`.
New in version 1.8.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete a private endpoint.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **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 private endpoint. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **private\_dns\_zone\_configs** list / elements=dictionary | | The Private DNS zones configurations. |
| | **name** string | | The name of the private dns zone configs. |
| | **private\_dns\_zone\_group** list / elements=string | | The resource ID of the Private DNS zones. |
| **private\_link\_service\_connections** list / elements=dictionary | | A grouping of information about the connection to the remote resource. This parameter is required for create or update. |
| | **group\_ids** list / elements=string | | The ID(s) of the group(s) obtained from the remote resource that this private endpoint should connect to. |
| | **name** string | | The name of the resource that is unique within a resource group. |
| | **private\_link\_service\_id** string | | The resource id of the private endpoint to connect to. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **resource\_group** string / required | | Name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the virtual network. Use `present` to create or update and `absent` to delete. |
| **subnet** dictionary | | The ID of the subnet from which the private IP will be allocated. This parameter is required for create or update. |
| | **id** string | | The ID of the subnet from which the private IP will be allocated. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create private endpoint
azure_rm_privateendpoint:
name: testprivateendpoint
resource_group: v-xisuRG
private_link_service_connections:
- name: Test_private_link_service
private_link_service_id: /subscriptions/xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateLinkServices/testervice
subnet:
id: /subscriptions/xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/fredvnet/subnets/default
tags:
key1: value1
key2: value2
- name: Delete private endpoint
azure_rm_privateendpoint:
name: testprivateendpoint
resource_group: myResourceGroup
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | always | List of private endpoint dict with same format as M(azure\_rm\_privateendpoint) module paramter. |
| | **etag** string | always | A unique read-only string that changes whenever the resource is updated. **Sample:** W/"20803842-7d51-46b2-a790-ded8971b4d8a |
| | **id** string | always | Resource ID of the private endpoint. **Sample:** /subscriptions/xxx-xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/testprivateendpoint |
| | **location** string | always | Valid Azure location. **Sample:** eastus |
| | **name** string | always | Name of the private endpoint. **Sample:** estprivateendpoint |
| | **network\_interfaces** list / elements=string | always | List ID of the network interfaces. **Sample:** ['/subscriptions/xxx-xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/fredprivateendpoint002.nic'] |
| | **private\_link\_service\_connections** list / elements=string | always | The resource id of the private endpoint to connect. **Sample:** ['/subscriptions/xxx/resourceGroups/myRG/providers/Microsoft.Network/privateEndpoints/point/privateLinkServiceConnections/point'] |
| | **provisioning\_state** string | always | Provisioning state of the resource. **Sample:** Succeeded |
| | **subnets\_id** string | always | Subnets associated with the virtual network. **Sample:** /subscriptions/xxx-xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/fredtestRG-vnet/subnets/default |
| | **tags** dictionary | always | Tags assigned to the resource. Dictionary of string:string pairs. **Sample:** {'tag1': 'abc'} |
| | **type** string | always | Resource type. **Sample:** Microsoft.Network/privateEndpoints |
### Authors
* Fred-sun (@Fred-sun)
ansible azure.azcollection.azure_rm_devtestlab – Manage Azure DevTest Lab instance azure.azcollection.azure\_rm\_devtestlab – Manage Azure DevTest Lab instance
============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlab`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure DevTest Lab.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **location** string | | The location of the resource. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the lab. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **premium\_data\_disks** boolean | **Choices:*** no
* yes
| Allow creation of premium data disks. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **resource\_group** string / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the DevTest Lab. Use `present` to create or update an DevTest Lab and `absent` to delete it. |
| **storage\_type** string | **Choices:*** standard
* premium
| Type of storage used by the lab. It can be either `premium` or `standard`. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) DevTest Lab
azure_rm_devtestlab:
resource_group: myResourceGroup
name: mylab
storage_type: standard
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | The identifier of the resource. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/mylab |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_servicebussaspolicy – Manage Azure Service Bus SAS policy azure.azcollection.azure\_rm\_servicebussaspolicy – Manage Azure Service Bus SAS policy
=======================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_servicebussaspolicy`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete an Azure Service Bus SAS policy.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the SAS policy. |
| **namespace** string / required | | Manage SAS policy for a namespace without `queue` or `topic` set. Manage SAS policy for a queue or topic under this namespace. |
| **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. |
| **queue** string | | Type of the messaging queue. Cannot set `topc` when this field set. |
| **regenerate\_primary\_key** boolean | **Choices:*** **no** ←
* yes
| Regenerate the SAS policy primary key. |
| **regenerate\_secondary\_key** boolean | **Choices:*** **no** ←
* yes
| Regenerate the SAS policy secondary key. |
| **resource\_group** string / required | | Name of resource group. |
| **rights** string / required | **Choices:*** manage
* listen
* send
* listen\_send
| Claim rights of the SAS policy. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the route. Use `present` to create or update and `absent` to delete. |
| **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. |
| **topic** string | | Name of the messaging topic. Cannot set `queue` when this field set. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a namespace
azure_rm_servicebussaspolicy:
name: deadbeef
queue: qux
namespace: bar
resource_group: myResourceGroup
rights: send
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | Successed | Current state of the SAS policy. **Sample:** /subscriptions/xxx...xxx/resourceGroups/myResourceGroup/providers/Microsoft.ServiceBus/ namespaces/nsb57dc95979/topics/topicb57dc95979/authorizationRules/testpolicy |
| **keys** complex | Successed | Key dict of the SAS policy. |
| | **key\_name** string | Successed | Name of the SAS policy. **Sample:** testpolicy |
| | **primary\_connection\_string** string | Successed | Primary connection string. **Sample:** Endpoint=sb://nsb57dc95979.servicebus.windows.net/;SharedAccessKeyName=testpolicy; SharedAccessKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| | **primary\_key** string | Successed | Primary key. **Sample:** xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| | **secondary\_connection\_string** string | Successed | Secondary connection string. **Sample:** Endpoint=sb://nsb57dc95979.servicebus.windows.net/;SharedAccessKeyName=testpolicy; SharedAccessKey=xxxxxxxxxxxxxxxxxxxxxxxxx |
| | **secondary\_key** string | Successed | Secondary key. **Sample:** xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| **name** string | Successed | Name of the SAS policy. **Sample:** testpolicy |
| **rights** string | Successed | Priviledge of the SAS policy. **Sample:** manage |
| **type** string | Successed | Type of the SAS policy. **Sample:** Microsoft.ServiceBus/Namespaces/Topics/AuthorizationRules |
### Authors
* Yuwei Zhou (@yuwzho)
| programming_docs |
ansible azure.azcollection.azure_rm_devtestlabartifactsource – Manage Azure DevTest Labs Artifacts Source instance azure.azcollection.azure\_rm\_devtestlabartifactsource – Manage Azure DevTest Labs Artifacts Source instance
============================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabartifactsource`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure DevTest Labs Artifacts Source.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **arm\_template\_folder\_path** string | | The folder containing Azure Resource Manager templates. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **branch\_ref** string | | The artifact source's branch reference. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **display\_name** string | | The artifact source's display name. |
| **folder\_path** string | | The folder containing artifacts. |
| **is\_enabled** boolean | **Choices:*** no
* yes
| Indicates whether the artifact source is enabled. |
| **lab\_name** string / required | | The name of the lab. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the artifact source. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **security\_token** string | | The security token to authenticate to the artifact source. |
| **source\_type** string | **Choices:*** vso
* github
| The artifact source's type. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the DevTest Labs Artifacts Source. Use `present` to create or update an DevTest Labs Artifacts Source and `absent` to delete it. |
| **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. |
| **uri** string | | The artifact source's URI. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) DevTest Labs Artifacts Source
azure_rm_devtestlabartifactsource:
resource_group: myrg
lab_name: mylab
name: myartifacts
uri: https://github.com/myself/myrepo.git
source_type: github
folder_path: /
security_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | The identifier of the resource. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myrg/providers/microsoft.devtestlab/labs/mylab/artifactsources/myartifacts |
| **is\_enabled** boolean | always | Indicates whether the artifact source is enabled. **Sample:** True |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_managementgroup_info – Get Azure Management Group facts azure.azcollection.azure\_rm\_managementgroup\_info – Get Azure Management Group facts
======================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_managementgroup_info`.
New in version 1.5.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific Management Group or all Management Groups.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **children** boolean | **Choices:*** **no** ←
* yes
| If c(False), then only *name* or *id* group will be fetched, or only the list of root groups. If c(True), then the children groups will also be returned. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **flatten** boolean | **Choices:*** **no** ←
* yes
| If c(True) then child management\_groups and subscriptions will be copied to the root of the management\_groups and subscriptions return list respectively. By default c(False), child elements will only apear in the nested complex. Option only matters when *children* is c(True), and will otherwise be silently ignored. |
| **id** string | | Limit results to a specific management group by id. Mutually exclusive with *name*. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Limit results to a specific management group by name. Mutually exclusive with *id*.
aliases: management\_group\_name |
| **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. |
| **recurse** boolean | **Choices:*** **no** ←
* yes
| By default, c(False), only the direct children are returned if *children* is c(True). If c(True), then all descendants of the heirarchy are returned. Option only matters when *children* is c(True), and will otherwise be silently ignored. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* azure\_rm\_managementgroup\_info - The roles assigned to the principal executing the playbook will determine what is a root management\_group. You may also be able to request the details of a parent management group, but unable to fetch that group. It is highly recommended that if *children* is set c(True) that specific management groups are requested since a list of all groups will require an additional Azure API call for each returned group.
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
M(azure\_rm\_subscription\_info)
module to look up more in depth information on subscriptions; for example tags.
M(azure\_rm\_roleassignment\_info)
module to look up RBAC role assignments, which can use management group id as scope.
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for all root management groups for authenticated principal
azure_rm_managementgroup_info:
- name: Get facts for one management group by id with direct children
azure_rm_managementgroup_info:
id: /providers/Microsoft.Management/managementGroups/contoso-group
children: True
- name: Get facts for one management group by name with all children, flattened into top list
azure_rm_managementgroup_info:
name: "contoso-group"
children: True
recurse: True
flatten: True
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **management\_groups** list / elements=string | always | List of Management Group dicts. |
| | **children** list / elements=string | if *children* is c(True) | Child management groups or subscriptions. **Sample:** Nested list of children. Same as top groups, but without tenant\_id. |
| | **display\_name** string | always | Management Group display name. **Sample:** My Management Group |
| | **id** string | always | Management Group fully qualified id. **Sample:** /providers/Microsoft.Management/managementGroups/group-name |
| | **name** string | always | Management Group display name. **Sample:** group-name |
| | **tenant\_id** string | always | Management Group tenant id **Sample:** 00000000-0000-0000-0000-000000000000 |
| | **type** string | always | Management Group type **Sample:** /providers/Microsoft.Management/managementGroups |
| **subscriptions** list / elements=string | if *children* and *flatten* are both c(True) | List of subscription objects. |
| | **display\_name** string | always | subscription display name. **Sample:** some-subscription-name |
| | **id** string | always | subscription fully qualified id. **Sample:** /subscriptions/00000000-0000-0000-0000-feedc0ffee000000 |
| | **subscription\_id** string | always | subscription guid. **Sample:** 00000000-0000-0000-0000-feedc0ffee000000 |
| | **type** string | always | Management Group type **Sample:** /subscriptions |
### Authors
* Paul Aiton (@paultaiton)
ansible azure.azcollection.azure_rm_mariadbserver – Manage MariaDB Server instance azure.azcollection.azure\_rm\_mariadbserver – Manage MariaDB Server instance
============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_mariadbserver`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of MariaDB Server.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **admin\_password** string | | The password of the administrator login. |
| **admin\_username** string | | The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **create\_mode** string | **Default:**"Default" | Create mode of SQL Server. |
| **enforce\_ssl** boolean | **Choices:*** **no** ←
* yes
| Enable SSL enforcement. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the server. |
| **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 / required | | The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | | The SKU (pricing tier) of the server. |
| | **capacity** integer | | The scale up/out capacity, representing server's compute units. |
| | **name** string | | The name of the SKU, typically, tier + family + cores, for example `B_Gen4_1`, `GP_Gen5_8`. |
| | **size** string | | The size code, to be interpreted by resource as appropriate. |
| | **tier** string | **Choices:*** basic
* standard
| The tier of the particular SKU, for example `Basic`. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the MariaDB Server. Use `present` to create or update a server and `absent` to delete it. |
| **storage\_mb** integer | | The maximum storage allowed for a server. |
| **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. |
| **version** string | **Choices:*** 10.2
* 10.3
| Server version. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) MariaDB Server
azure_rm_mariadbserver:
resource_group: myResourceGroup
name: testserver
sku:
name: B_Gen5_1
tier: Basic
location: eastus
storage_mb: 1024
enforce_ssl: True
version: 10.2
admin_username: cloudsa
admin_password: password
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **fully\_qualified\_domain\_name** string | always | The fully qualified domain name of a server. **Sample:** mariadbsrv1b6dd89593.mariadb.database.azure.com |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DBforMariaDB/servers/mariadbsrv1b6dd89593 |
| **state** string | always | A state of a server that is visible to user. Possible values include `Ready`, `Dropping`, `Disabled`. **Sample:** Ready |
| **version** string | always | Server version. Possible values include `10.2` and `10.3`. **Sample:** 10.2 |
### Authors
* Zim Kalinowski (@zikalino)
* Matti Ranta (@techknowlogick)
| programming_docs |
ansible azure.azcollection.azure_rm_iothub_info – Get IoT Hub facts azure.azcollection.azure\_rm\_iothub\_info – Get IoT Hub facts
==============================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_iothub_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific IoT Hub or all IoT Hubs.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **list\_consumer\_groups** boolean | **Choices:*** no
* yes
| List the consumer group of the built-in event hub. |
| **list\_keys** boolean | **Choices:*** no
* yes
| List the keys of IoT Hub. Note this will have network overhead for each IoT Hub. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Limit results to a specific resource group. |
| **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 | | The resource group to search for the desired IoT Hub. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **show\_endpoint\_health** boolean | **Choices:*** no
* yes
| Get the health for routing endpoints. Note this will have network overhead for each IoT Hub. |
| **show\_quota\_metrics** boolean | **Choices:*** no
* yes
| Get the quota metrics for an IoT hub. Note this will have network overhead for each IoT Hub. |
| **show\_stats** boolean | **Choices:*** no
* yes
| Show the statistics for IoT Hub. Note this will have network overhead for each IoT Hub. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** list / elements=string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **test\_route\_message** string | | Test routes message. It will be used to test all routes. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one IoT Hub
azure_rm_iothub_info:
name: Testing
resource_group: myResourceGroup
- name: Get facts for all IoT Hubs
azure_rm_iothub_info:
- name: Get facts for all IoT Hubs in a specific resource group
azure_rm_iothub_info:
resource_group: myResourceGroup
- name: Get facts by tags
azure_rm_iothub_info:
tags:
- testing
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_iothubs** complex | always | List of IoT Hub dicts. |
| | **cloud\_to\_device** complex | always | Cloud to device message properties. |
| | | **max\_delivery\_count** integer | always | The number of times the IoT hub attempts to deliver a message on the feedback queue. See <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages>. **Sample:** 10 |
| | | **ttl\_as\_iso8601** string | always | The period of time for which a message is available to consume before it is expired by the IoT hub. See <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages>. **Sample:** 1:00:00 |
| | **enable\_file\_upload\_notifications** string | always | Whether file upload notifications are enabled. **Sample:** True |
| | **event\_endpoints** complex | always | Built-in endpoint where to deliver device message. |
| | | **endpoint** string | always | The Event Hub-compatible endpoint. **Sample:** sb://iothub-ns-testing-1478811-9bbc4a15f0.servicebus.windows.net/ |
| | | **partition\_count** integer | always | The number of partitions for receiving device-to-cloud messages in the Event Hub-compatible endpoint. See <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages>. **Sample:** 2 |
| | | **partition\_ids** list / elements=string | always | List of the partition id for the event endpoint. **Sample:** ['0', '1'] |
| | | **retention\_time\_in\_days** integer | always | The retention time for device-to-cloud messages in days. See <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages>. **Sample:** 1 |
| | **host\_name** string | always | Host of the IoT hub. **Sample:** testing.azure-devices.net |
| | **id** string | always | Resource ID of the IoT hub. **Sample:** /subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/Testing |
| | **ip\_filters** complex | always | Configure rules for rejecting or accepting traffic from specific IPv4 addresses. |
| | | **action** string | always | The desired action for requests captured by this rule. **Sample:** Reject |
| | | **ip\_mask** string | always | A string that contains the IP address range in CIDR notation for the rule. **Sample:** 40.54.7.3 |
| | | **name** string | always | Name of the filter. **Sample:** filter |
| | **location** string | always | Location of the IoT hub. **Sample:** eastus |
| | **name** string | always | Name of the IoT hub. **Sample:** Testing |
| | **resource\_group** string | always | Resource group of the IoT hub. **Sample:** myResourceGroup. |
| | **routes** complex | always | Route device-to-cloud messages to service-facing endpoints. |
| | | **condition** boolean | always | The query expression for the routing query that is run against the message application properties, system properties, message body, device twin tags, and device twin properties to determine if it is a match for the endpoint. For more information about constructing a query, see <https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-routing-query-syntax>
**Sample:** true |
| | | **enabled** boolean | always | Whether to enable the route. **Sample:** True |
| | | **endpoint\_name** string | always | The name of the endpoint in *routing\_endpoints* where IoT Hub sends messages that match the query. **Sample:** foo |
| | | **name** string | always | Name of the route. **Sample:** route1 |
| | | **source** string | always | The origin of the data stream to be acted upon. **Sample:** device\_messages |
| | **routing\_endpoints** complex | always | Custom endpoints. |
| | | **event\_hubs** complex | always | List of custom endpoints of event hubs. |
| | | | **connection\_string** string | always | Connection string of the custom endpoint. **Sample:** Endpoint=sb://quux.servicebus.windows.net:5671/;SharedAccessKeyName=qux;SharedAccessKey=\*\*\*\*;EntityPath=foo |
| | | | **name** string | always | Name of the custom endpoint. **Sample:** foo |
| | | | **resource\_group** string | always | Resource group of the endpoint. **Sample:** bar |
| | | | **subscription** string | always | Subscription ID of the endpoint. **Sample:** XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX |
| | | **service\_bus\_queues** complex | always | List of custom endpoints of service bus queue. |
| | | | **connection\_string** string | always | Connection string of the custom endpoint. **Sample:** Endpoint=sb://quux.servicebus.windows.net:5671/;SharedAccessKeyName=qux;SharedAccessKey=\*\*\*\*;EntityPath=foo |
| | | | **name** string | always | Name of the custom endpoint. **Sample:** foo |
| | | | **resource\_group** string | always | Resource group of the endpoint. **Sample:** bar |
| | | | **subscription** string | always | Subscription ID of the endpoint. **Sample:** XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX |
| | | **service\_bus\_topics** complex | always | List of custom endpoints of service bus topic. |
| | | | **connection\_string** string | always | Connection string of the custom endpoint. **Sample:** Endpoint=sb://quux.servicebus.windows.net:5671/;SharedAccessKeyName=qux;SharedAccessKey=\*\*\*\*;EntityPath=foo |
| | | | **name** string | always | Name of the custom endpoint. **Sample:** foo |
| | | | **resource\_group** string | always | Resource group of the endpoint. **Sample:** bar |
| | | | **subscription** string | always | Subscription ID of the endpoint. **Sample:** XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX |
| | | **storage\_containers** complex | always | List of custom endpoints of storage. |
| | | | **connection\_string** string | always | Connection string of the custom endpoint. **Sample:** Endpoint=sb://quux.servicebus.windows.net:5671/;SharedAccessKeyName=qux;SharedAccessKey=\*\*\*\*;EntityPath=foo |
| | | | **name** string | always | Name of the custom endpoint. **Sample:** foo |
| | | | **resource\_group** string | always | Resource group of the endpoint. **Sample:** bar |
| | | | **subscription** string | always | Subscription ID of the endpoint. **Sample:** XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX |
| | **sku** string | always | Pricing tier for Azure IoT Hub. **Sample:** f1 |
| | **tags** dictionary | always | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. **Sample:** {'key1': 'value1'} |
| | **unit** integer | always | Units in the IoT Hub. **Sample:** 1 |
### Authors
* Yuwei Zhou (@yuwzho)
ansible azure.azcollection.azure_rm_storageaccount – Manage Azure storage accounts azure.azcollection.azure\_rm\_storageaccount – Manage Azure storage accounts
============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_storageaccount`.
New in version 0.1.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete a storage account.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_tier** string | **Choices:*** Hot
* Cool
| The access tier for this storage account. Required when *kind=BlobStorage*. |
| **account\_type** string | **Choices:*** Premium\_LRS
* Standard\_GRS
* Standard\_LRS
* Standard\_RAGRS
* Standard\_ZRS
* Premium\_ZRS
| Type of storage account. Required when creating a storage account.
`Standard_ZRS` and `Premium_LRS` accounts cannot be changed to other account types. Other account types cannot be changed to `Standard_ZRS` or `Premium_LRS`.
aliases: type |
| **ad\_user** string | | Active Directory username. Use when authenticating with an Active Directory user rather than service principal. |
| **adfs\_authority\_url** string added in 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **allow\_blob\_public\_access** boolean added in 1.1.0 of azure.azcollection | **Choices:*** no
* yes
| Allows blob containers in account to be set for anonymous public access. If set to false, no containers in this account will be able to allow anonymous public access. If omitted, new account creation will default to null which is currently interpreted to True. Existing accounts will not be modified. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **blob\_cors** list / elements=string | | Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no blob\_cors elements are included in the argument list, nothing about CORS will be changed. If you want to delete all CORS rules and disable CORS for the Blob service, explicitly set *blob\_cors=[]*. |
| | **allowed\_headers** list / elements=string / required | | A list of headers allowed to be part of the cross-origin request. |
| | **allowed\_methods** list / elements=string / required | | A list of HTTP methods that are allowed to be executed by the origin. |
| | **allowed\_origins** list / elements=string / required | | A list of origin domains that will be allowed via CORS, or "\*" to allow all domains. |
| | **exposed\_headers** list / elements=string / required | | A list of response headers to expose to CORS clients. |
| | **max\_age\_in\_seconds** integer / required | | The number of seconds that the client/browser should cache a preflight response. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **custom\_domain** string | | User domain assigned to the storage account. Must be a dictionary with *name* and *use\_sub\_domain* keys where *name* is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. Can be added to an existing storage account. Will be ignored during storage account creation.
aliases: custom\_dns\_domain\_suffix |
| **force\_delete\_nonempty** boolean | **Choices:*** **no** ←
* yes
| Attempt deletion if resource already exists and cannot be updated.
aliases: force |
| **https\_only** boolean | **Choices:*** no
* yes
| Allows https traffic only to storage service when set to `True`. If omitted, new account creation will default to True, while existing accounts will not be change. |
| **kind** string | **Choices:*** **Storage** ←
* StorageV2
* BlobStorage
* BlockBlobStorage
* FileStorage
| The kind of storage. The `FileStorage` and (BlockBlobStorage) only used when *account\_type=Premium\_LRS* or *account\_type=Premium\_ZRS*. |
| **location** string | | Valid Azure location. Defaults to location of the resource group. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **minimum\_tls\_version** string added in 1.0.0 of azure.azcollection | **Choices:*** TLS1\_0
* TLS1\_1
* TLS1\_2
| The minimum required version of Transport Layer Security (TLS) for requests to a storage account. If omitted, new account creation will default to null which is currently interpreted to TLS1\_0. Existing accounts will not be modified. |
| **name** string | | Name of the storage account to update or create. |
| **network\_acls** dictionary | | Manages the Firewall and virtual networks settings of the storage account. |
| | **bypass** string | **Default:**"AzureServices" | When *default\_action=Deny* this controls which Azure components can still reach the Storage Account. The list is comma separated. It can be any combination of the example `AzureServices`, `Logging`, `Metrics`. If no Azure components are allowed, explicitly set *bypass=""*. |
| | **default\_action** string | **Choices:*** **Allow** ←
* Deny
| Default firewall traffic rule. If *default\_action=Allow* no other settings have effect. |
| | **ip\_rules** string | | A list of IP addresses or ranges in CIDR format. |
| | | **action** string | **Default:**"Allow" | The only logical *action=Allow* because this setting is only accessible when *default\_action=Deny*. |
| | | **value** string | | The IP address or range. |
| | **virtual\_network\_rules** string | | A list of subnets and their actions. |
| | | **action** string | **Default:**"Allow" | The only logical *action=Allow* because this setting is only accessible when *default\_action=Deny*. |
| | | **id** string | | The complete path to the subnet. |
| **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 / required | | Name of the resource group to use.
aliases: resource\_group\_name |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the storage account. Use `present` to create or update a storage account and use `absent` to delete an account. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: remove account, if it exists
azure_rm_storageaccount:
resource_group: myResourceGroup
name: clh0002
state: absent
- name: create an account
azure_rm_storageaccount:
resource_group: myResourceGroup
name: clh0002
type: Standard_RAGRS
tags:
testing: testing
delete: on-exit
- name: Create an account with kind of FileStorage
azure_rm_storageaccount:
resource_group: myResourceGroup
name: c1h0002
type: Premium_LRS
kind: FileStorage
tags:
testing: testing
- name: configure firewall and virtual networks
azure_rm_storageaccount:
resource_group: myResourceGroup
name: clh0002
type: Standard_RAGRS
network_acls:
bypass: AzureServices,Metrics
default_action: Deny
virtual_network_rules:
- id: /subscriptions/mySubscriptionId/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet
action: Allow
ip_rules:
- value: 1.2.3.4
action: Allow
- value: 123.234.123.0/24
action: Allow
- name: create an account with blob CORS
azure_rm_storageaccount:
resource_group: myResourceGroup
name: clh002
type: Standard_RAGRS
blob_cors:
- allowed_origins:
- http://www.example.com/
allowed_methods:
- GET
- POST
allowed_headers:
- x-ms-meta-data*
- x-ms-meta-target*
- x-ms-meta-abc
exposed_headers:
- x-ms-meta-*
max_age_in_seconds: 200
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | always | Current state of the storage account. |
| | **account\_type** string | always | Type of storage account. **Sample:** Standard\_RAGRS |
| | **custom\_domain** complex | always | User domain assigned to the storage account. |
| | | **name** string | always | CNAME source. **Sample:** testaccount |
| | | **use\_sub\_domain** boolean | always | Whether to use sub domain. **Sample:** True |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/clh0003 |
| | **location** string | always | Valid Azure location. Defaults to location of the resource group. **Sample:** eastus2 |
| | **name** string | always | Name of the storage account to update or create. **Sample:** clh0003 |
| | **network\_acls** dictionary | always | A set of firewall and virtual network rules **Sample:** {'bypass': 'AzureServices', 'default\_action': 'Deny', 'ip\_rules': [{'action': 'Allow', 'value': '1.2.3.4'}, {'action': 'Allow', 'value': '123.234.123.0/24'}], 'virtual\_network\_rules': [{'action': 'Allow', 'id': '/subscriptions/mySubscriptionId/resourceGroups/myResourceGroup/ providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet'}]} |
| | **primary\_endpoints** dictionary | always | The URLs to retrieve the public *blob*, *queue*, or *table* object from the primary location. **Sample:** {'blob': 'https://clh0003.blob.core.windows.net/', 'queue': 'https://clh0003.queue.core.windows.net/', 'table': 'https://clh0003.table.core.windows.net/'} |
| | **primary\_location** string | always | The location of the primary data center for the storage account. **Sample:** eastus2 |
| | **provisioning\_state** string | always | The status of the storage account. Possible values include `Creating`, `ResolvingDNS`, `Succeeded`. **Sample:** Succeeded |
| | **resource\_group** string | always | The resource group's name. **Sample:** Testing |
| | **secondary\_endpoints** dictionary | always | The URLs to retrieve the public *blob*, *queue*, or *table* object from the secondary location. **Sample:** {'blob': 'https://clh0003-secondary.blob.core.windows.net/', 'queue': 'https://clh0003-secondary.queue.core.windows.net/', 'table': 'https://clh0003-secondary.table.core.windows.net/'} |
| | **secondary\_location** string | always | The location of the geo-replicated secondary for the storage account. **Sample:** centralus |
| | **status\_of\_primary** string | always | The status of the primary location of the storage account; either `available` or `unavailable`. **Sample:** available |
| | **status\_of\_secondary** string | always | The status of the secondary location of the storage account; either `available` or `unavailable`. **Sample:** available |
| | **tags** dictionary | always | Resource tags. **Sample:** {'tags1': 'value1'} |
| | **type** string | always | The storage account type. **Sample:** Microsoft.Storage/storageAccounts |
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
| programming_docs |
ansible azure.azcollection.azure_rm_devtestlabcustomimage – Manage Azure DevTest Lab Custom Image instance azure.azcollection.azure\_rm\_devtestlabcustomimage – Manage Azure DevTest Lab Custom Image instance
====================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabcustomimage`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure DevTest Lab Custom Image.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **author** string | | The author of the custom image. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **description** string | | The description of the custom image. |
| **lab\_name** string / required | | The name of the lab. |
| **linux\_os\_state** string | **Choices:*** non\_deprovisioned
* deprovision\_requested
* deprovision\_applied
| The state of the Linux OS. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the custom image. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **source\_vm** string | | Source DevTest Lab virtual machine name. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Custom Image. Use `present` to create or update an Custom Image and `absent` to delete it. |
| **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. |
| **windows\_os\_state** string | **Choices:*** non\_sysprepped
* sysprep\_requested
* sysprep\_applied
| The state of the Windows OS. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create instance of DevTest Lab Image
azure_rm_devtestlabcustomimage:
resource_group: myResourceGroup
lab_name: myLab
name: myImage
source_vm: myDevTestLabVm
linux_os_state: non_deprovisioned
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | The identifier of the resource. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/myLab/images/myImage |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_networkinterface_info – Get network interface facts azure.azcollection.azure\_rm\_networkinterface\_info – Get network interface facts
==================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_networkinterface_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific network interface or all network interfaces within a resource group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Only show results for a specific network interface. |
| **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 | | Name of the resource group containing the network interface(s). Required when searching by name. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one network interface
azure_rm_networkinterface_info:
resource_group: myResourceGroup
name: nic001
- name: Get network interfaces within a resource group
azure_rm_networkinterface_info:
resource_group: myResourceGroup
- name: Get network interfaces by tag
azure_rm_networkinterface_info:
resource_group: myResourceGroup
tags:
- testing
- foo:bar
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_networkinterfaces** list / elements=string | always | List of network interface dicts. **Sample:** [{'dns\_settings': {'applied\_dns\_servers': [], 'dns\_servers': [], 'internal\_dns\_name\_label': None, 'internal\_fqdn': None}, 'enable\_ip\_forwarding': False, 'etag': 'W/"59726bfc-08c4-44ed-b900-f6a559876a9d"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nic003', 'ip\_configuration': {'name': 'default', 'private\_ip\_address': '10.10.0.4', 'private\_ip\_allocation\_method': 'Dynamic', 'public\_ip\_address': {'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/publicip001', 'name': 'publicip001'}, 'subnet': {'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet001/subnets/subnet001', 'name': 'subnet001', 'virtual\_network\_name': 'vnet001'}}, 'location': 'westus', 'mac\_address': None, 'name': 'nic003', 'network\_security\_group': {'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroup001', 'name': 'secgroup001'}, 'primary': None, 'provisioning\_state': 'Succeeded', 'tags': {}, 'type': 'Microsoft.Network/networkInterfaces'}] |
| **networkinterfaces** list / elements=string | always | List of network interface dicts. Each dict contains parameters can be passed to M(azure\_rm\_networkinterface) module. |
| | **create\_with\_security\_group** boolean | success | Specifies whether a default security group should be be created with the NIC. Only applies when creating a new NIC. |
| | **dns\_servers** string | success | Which DNS servers should the NIC lookup. List of IP addresses. |
| | **dns\_settings** string | success | The DNS settings in network interface. |
| | | **applied\_dns\_servers** string | success | If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs. |
| | | **dns\_servers** string | success | List of DNS servers IP addresses. |
| | | **internal\_dns\_name\_label** string | success | Relative DNS name for this NIC used for internal communications between VMs in the same virtual network. |
| | | **internal\_fqdn** string | success | Fully qualified DNS name supporting internal communications between VMs in the same virtual network. |
| | **enable\_accelerated\_networking** string | success | Specifies whether the network interface should be created with the accelerated networking feature or not. |
| | **enable\_ip\_forwarding** string | success | Whether to enable IP forwarding |
| | **id** string | success | Id of the network interface. |
| | **ip\_configurations** string | success | List of IP configurations, if contains multiple configurations. |
| | | **application\_security\_groups** string | success | List of Application security groups. **Sample:** /subscriptions/<subsid>/resourceGroups/<rg>/providers/Microsoft.Network/applicationSecurityGroups/myASG |
| | | **load\_balancer\_backend\_address\_pools** string | success | List of existing load-balancer backend address pools to associate with the network interface. |
| | | **name** string | success | Name of the IP configuration. |
| | | **primary** string | success | Whether the IP configuration is the primary one in the list. |
| | | **private\_ip\_address** string | success | Private IP address for the IP configuration. |
| | | **private\_ip\_allocation\_method** string | success | Private IP allocation method. |
| | | **public\_ip\_address** string | success | Name of the public IP address. None for disable IP address. |
| | | **public\_ip\_allocation\_method** string | success | Public IP allocation method. |
| | **location** string | success | Azure location. |
| | **mac\_address** string | success | The MAC address of the network interface. |
| | **name** string | success | Name of the network interface. |
| | **provisioning\_state** string | success | The provisioning state of the network interface. |
| | **resource\_group** string | success | Name of a resource group where the network interface exists. |
| | **security\_group** string | success | A security group resource ID with which to associate the network interface. |
| | **subnet** string | success | Name of an existing subnet within the specified virtual network. |
| | **tags** string | success | Tags of the network interface. |
| | **virtual\_network** string | success | An existing virtual network with which the network interface will be associated. It is a dict which contains *name* and *resource\_group* of the virtual network. |
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
| programming_docs |
ansible azure.azcollection.azure_rm_expressroute_info – Get Azure Express Route azure.azcollection.azure\_rm\_expressroute\_info – Get Azure Express Route
==========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_expressroute_info`.
New in version 1.7.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure Express Route.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the express route. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts of specific expressroute
community.azure.azure_rm_expressroute_info:
resource_group: myResourceGroup
name: myExpressRoute
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** dictionary | always | Current state of the express route. **Sample:** {'additional\_properties': {}, 'allow\_classic\_operations': True, 'authorizations': [{'authorization\_key': 'd83e18b5-0200-4e0b-9cdb-6fdf95b00267', 'authorization\_use\_status': 'Available', 'etag': "W/'09572845-c667-410c-b664-ed8e39242c13'", 'id': '/subscriptions/subs\_id/resourceGroups/rg/providers/Microsoft.Network/expressRouteCircuits/exp/authorizations/az', 'name': 'authorization\_test', 'provisioning\_state': 'Succeeded', 'type': 'Microsoft.Network/expressRouteCircuits/authorizations'}], 'bandwidth\_in\_gbps': None, 'circuit\_provisioning\_state': 'Enabled', 'express\_route\_port': None, 'gateway\_manager\_etag': '', 'global\_reach\_enabled': False, 'id': '/subscriptions/subs\_id/resourceGroups/rg/providers/Microsoft.Network/expressRouteCircuits/exp', 'location': 'eastus', 'name': 'exp', 'peerings': [], 'provisioning\_state': 'Succeeded', 'service\_key': 'e1956383-63b6-4709-8baa-3615bbf5d22b', 'service\_provider\_notes': None, 'service\_provider\_provisioning\_state': 'NotProvisioned', 'stag': 27, 'status': 'Deleted', 'tags': {'a': 'b'}, 'type': 'Microsoft.Network/expressRouteCircuits'} |
### Authors
* Praveen Ghuge (@praveenghuge)
* Karl Dasan (@ikarldasan)
* Sakar Mehra (@sakar97)
ansible azure.azcollection.azure_rm_image – Manage Azure image azure.azcollection.azure\_rm\_image – Manage Azure image
========================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_image`.
New in version 0.0.1: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, delete an image from virtual machine, blob uri, managed disk or snapshot.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **data\_disk\_sources** list / elements=string | | List of data disk sources, including unmanaged blob URI, managed disk id or name, or snapshot id or name. |
| **location** string | | Location of the image. Derived from *resource\_group* if not specified. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the image. |
| **os\_type** string | **Choices:*** Windows
* Linux
| The OS type of image. |
| **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 / required | | Name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **source** raw / required | | OS disk source from the same region. It can be a virtual machine, OS disk blob URI, managed OS disk, or OS snapshot. Each type of source except for blob URI can be given as resource id, name or a dict contains `resource_group`, `name` and `type`. If source type is blob URI, the source should be the full URI of the blob in string type. If you specify the *type* in a dict, acceptable value contains `disks`, `virtual_machines` and `snapshots`. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the image. Use `present` to create or update a image and `absent` to delete an image. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create an image from a virtual machine
azure_rm_image:
resource_group: myResourceGroup
name: myImage
source: myVirtualMachine
- name: Create an image from os disk
azure_rm_image:
resource_group: myResourceGroup
name: myImage
source: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Compute/disks/disk001
data_disk_sources:
- datadisk001
- datadisk002
os_type: Linux
- name: Create an image from os disk via dict
azure_rm_image:
resource_group: myResourceGroup
name: myImage
source:
type: disks
resource_group: myResourceGroup
name: disk001
data_disk_sources:
- datadisk001
- datadisk002
os_type: Linux
- name: Delete an image
azure_rm_image:
state: absent
resource_group: myResourceGroup
name: myImage
source: testvm001
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | success | Image resource path. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Compute/images/myImage |
### Authors
* Yuwei Zhou (@yuwzho)
ansible azure.azcollection.azure_rm_routetable_info – Get route table facts azure.azcollection.azure\_rm\_routetable\_info – Get route table facts
======================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_routetable_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific route table or all route table in a resource group or subscription.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Limit results to a specific route table. |
| **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 | | Limit results in a specific resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one route table
azure_rm_routetable_info:
name: Testing
resource_group: myResourceGroup
- name: Get facts for all route tables
azure_rm_routetable_info:
resource_group: myResourceGroup
- name: Get facts by tags
azure_rm_routetable_info:
tags:
- testing
- foo:bar
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **disable\_bgp\_route\_propagation** boolean | success | Whether the routes learned by BGP on that route table disabled. |
| **id** string | success | Resource ID. **Sample:** /subscriptions/xxxx...xxxx/resourceGroups/v-xisuRG/providers/Microsoft.Network/routeTables/tableb57dc95236 |
| **name** string | success | Name of the resource. **Sample:** tableb57dc95236 |
| **resource\_group** string | success | Resource group of the route table. **Sample:** v-xisuRG |
| **routes** list / elements=string | success | Current routes of the route table. **Sample:** [{'address\_prefix': '10.1.0.0/24', 'id': '/subscriptions/xxx...xxx/resourceGroups/v-xisuRG/providers/Microsoft.Network/routeTables/tableb57dc95236/routes/routeb57dc95540', 'name': 'routeb57dc95540', 'next\_hop\_ip\_address': None, 'next\_hop\_type': 'virtual\_network\_gateway', 'resource\_group': 'v-xisuRG', 'route\_table\_name': 'tableb57dc95236'}] |
| **tags** dictionary | success | Tags of the route table. **Sample:** {'key1': 'value1', 'key2': 'value2'} |
### Authors
* Yuwei Zhou (@yuwzho)
| programming_docs |
ansible azure.azcollection.azure_rm_webappaccessrestriction_info – Retrieve web app network access restriction facts azure.azcollection.azure\_rm\_webappaccessrestriction\_info – Retrieve web app network access restriction facts
===============================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_webappaccessrestriction_info`.
New in version 1.8.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a web app’s network access restrictions.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the web app. |
| **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 / required | | Resource group of the web app. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: View web app access restrictions.
azure.azcollection.azure_rm_webappaccessrestriction_info:
name: "MyWebapp"
resource_group: "MyResourceGroup"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **ip\_security\_restrictions** list / elements=dictionary | always | The web app's HTTP access restrictions. |
| | **action** string | always | Traffic action of the access restriction. **Sample:** Allow |
| | **description** string | always | Description of the access restriction. **Sample:** my-access-restriction-description |
| | **ip\_address** string | always | IP address of the access restriction. **Sample:** 1.1.1.1/32 |
| | **name** string | always | Name of the access restriction. **Sample:** my-access-restriction |
| | **priority** integer | always | Numerical priority of the access restriction. **Sample:** 1 |
| **scm\_ip\_security\_restrictions** list / elements=dictionary | always | The web app's SCM access restrictions. |
| | **action** string | always | Traffic action of the access restriction. **Sample:** Allow |
| | **description** string | always | Description of the access restriction. **Sample:** my-access-restriction-description |
| | **ip\_address** string | always | IP address of the access restriction. **Sample:** 1.1.1.1/32 |
| | **name** string | always | Name of the access restriction. **Sample:** my-access-restriction |
| | **priority** integer | always | Numerical priority of the access restriction. **Sample:** 1 |
| **scm\_ip\_security\_restrictions\_use\_main** boolean | always | Whether the HTTP access restrictions are used for SCM access. |
### Authors
* Ross Bender (@l3ender)
ansible azure.azcollection.azure_rm_iothubconsumergroup – Manage Azure IoT hub azure.azcollection.azure\_rm\_iothubconsumergroup – Manage Azure IoT hub
========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_iothubconsumergroup`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, delete an Azure IoT hub.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **event\_hub** string | **Default:**"events" | Event hub endpoint name. |
| **hub** string / required | | Name of the IoT hub. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Name of the consumer group. |
| **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 / required | | Name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the IoT hub. Use `present` to create or update an IoT hub and `absent` to delete an IoT hub. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create an IoT hub consumer group
azure_rm_iothubconsumergroup:
name: test
resource_group: myResourceGroup
hub: Testing
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | success | Resource ID of the consumer group. **Sample:** /subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/myResourceGroup /providers/Microsoft.Devices/IotHubs/Testing/events/ConsumerGroups/%24Default |
| **name** string | success | Name of the consumer group. **Sample:** Testing |
### Authors
* Yuwei Zhou (@yuwzho)
ansible azure.azcollection.azure_rm_automationaccount – Manage Azure Automation account azure.azcollection.azure\_rm\_automationaccount – Manage Azure Automation account
=================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_automationaccount`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, delete an Azure Automation account.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **location** string | | Location of the resource. If not specified, use resource group location. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the automation account. |
| **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 / required | | Name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the automation account. Use `present` to create or update a automation account and `absent` to delete an automation account. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create an automation account
azure_rm_automationaccount:
name: Testing
resource_group: myResourceGroup
- name: Create an automation account
azure_rm_automationaccount:
name: Testing
resource_group: myResourceGroup
location: eastus
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | success | Automation account resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Automation/automationAccounts/Testing |
### Authors
* Yuwei Zhou (@yuwzho)
| programming_docs |
ansible azure.azcollection.azure_rm_devtestlabpolicy_info – Get Azure DTL Policy facts azure.azcollection.azure\_rm\_devtestlabpolicy\_info – Get Azure DTL Policy facts
=================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabpolicy_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure DTL Policy.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **lab\_name** string / required | | The name of the lab. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the policy. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **policy\_set\_name** string / required | | The name of the policy set. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **resource\_group** string / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** list / elements=string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of Policy
azure_rm_devtestlabpolicy_info:
resource_group: myResourceGroup
lab_name: myLab
policy_set_name: myPolicySet
name: myPolicy
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **policies** complex | always | A list of dictionaries containing facts for Policy. |
| | **evaluator\_type** string | always | Evaluator type for policy fact. **Sample:** MaxValuePolicy |
| | **fact\_name** string | always | The name of the policy fact. **Sample:** UserOwnedLabVmCount |
| | **id** string | always | The identifier of the artifact source. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DevTestLab/labs/myLab/po licysets/myPolicySet/policies/myPolicy |
| | **lab\_name** string | always | Name of the lab. **Sample:** myLab |
| | **name** string | always | The name of the artifact source. **Sample:** myArtifactSource |
| | **resource\_group** string | always | Name of the resource group. **Sample:** myResourceGroup |
| | **tags** complex | always | The tags of the resource. **Sample:** { 'MyTag': 'MyValue' } |
| | **threshold** string | always | Fact's threshold. **Sample:** 5 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_autoscale – Manage Azure autoscale setting azure.azcollection.azure\_rm\_autoscale – Manage Azure autoscale setting
========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_autoscale`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, delete an autoscale setting.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **enabled** boolean | **Choices:*** no
* **yes** ←
| Specifies whether automatic scaling is enabled for the resource. |
| **location** string | | location of the resource. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | name of the resource. |
| **notifications** string | | The collection of notifications. |
| | **custom\_emails** string | | The custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. |
| | **send\_to\_subscription\_administrator** boolean | **Choices:*** **no** ←
* yes
| A value indicating whether to send email to subscription administrator. |
| | **send\_to\_subscription\_co\_administrators** boolean | **Choices:*** **no** ←
* yes
| A value indicating whether to send email to subscription co-administrators. |
| | **webhooks** string | | The list of webhook notifications service uri. |
| **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. |
| **profiles** string | | The collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. |
| | **count** string / required | | The number of instances that will be set if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default. |
| | **fixed\_date\_end** string | | The specific date-time end for the profile. This element is not used if the Recurrence element is used. |
| | **fixed\_date\_start** string | | The specific date-time start for the profile. This element is not used if the Recurrence element is used. |
| | **fixed\_date\_timezone** string | | The specific date-time timezone for the profile. This element is not used if the Recurrence element is used. |
| | **max\_count** string | | The maximum number of instances for the resource. The actual maximum number of instances is limited by the cores that are available in the subscription. |
| | **min\_count** string | | The minimum number of instances for the resource. |
| | **name** string / required | | The name of the profile. |
| | **recurrence\_days** string | | The days of repeating times at which this profile begins. This element is not used if the FixedDate element is used. |
| | **recurrence\_frequency** string | **Choices:*** **None** ←
* Second
* Minute
* Hour
* Day
* Week
* Month
* Year
| How often the schedule profile should take effect. If this value is `Week`, meaning each week will have the same set of profiles. This element is not used if the FixedDate element is used. |
| | **recurrence\_hours** string | | The hours of repeating times at which this profile begins. This element is not used if the FixedDate element is used. |
| | **recurrence\_mins** string | | The mins of repeating times at which this profile begins. This element is not used if the FixedDate element is used. |
| | **recurrence\_timezone** string | | The timezone of repeating times at which this profile begins. This element is not used if the FixedDate element is used. |
| | **rules** string | | The collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. |
| | | **cooldown** string | | The amount of time (minutes) to wait since the last scaling action before this action occurs. It must be between 1 ~ 10080. |
| | | **direction** string | **Choices:*** Increase
* Decrease
| Whether the scaling action increases or decreases the number of instances. |
| | | **metric\_name** string / required | | The name of the metric that defines what the rule monitors. |
| | | **metric\_resource\_uri** string | | The resource identifier of the resource the rule monitors. |
| | | **operator** string | **Choices:*** Equals
* NotEquals
* **GreaterThan** ←
* GreaterThanOrEqual
* LessThan
* LessThanOrEqual
| The operator that is used to compare the metric data and the threshold. |
| | | **statistic** string | **Choices:*** **Average** ←
* Min
* Max
* Sum
| How the metrics from multiple instances are combined. |
| | | **threshold** string | **Default:**70 | The threshold of the metric that triggers the scale action. |
| | | **time\_aggregation** string | **Choices:*** **Average** ←
* Minimum
* Maximum
* Total
* Count
| How the data that is collected should be combined over time. |
| | | **time\_grain** string / required | | The granularity(minutes) of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 1 ~ 720. |
| | | **time\_window** string / required | | The range of time(minutes) in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 5 ~ 720. |
| | | **type** string | **Choices:*** PercentChangeCount
* ExactCount
* ChangeCount
| The type of action that should occur when the scale rule fires. |
| | | **value** string | | The number of instances that are involved in the scaling action. This value must be 1 or greater. |
| **resource\_group** string / required | | Resource group of the resource. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** **present** ←
* absent
| Assert the state of the virtual network. Use `present` to create or update and `absent` to delete. |
| **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. |
| **target** string | | The identifier of the resource to apply autoscale setting. It could be the resource id string. It also could be a dict contains the `name`, `subscription_id`, `namespace`, `types`, `resource_group` of the resource. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create an auto scale
azure_rm_autoscale:
target: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss"
enabled: true
profiles:
- count: '1'
recurrence_days:
- Monday
name: Auto created scale condition
recurrence_timezone: China Standard Time
recurrence_mins:
- '0'
min_count: '1'
max_count: '1'
recurrence_frequency: Week
recurrence_hours:
- '18'
name: scale
resource_group: myResourceGroup
- name: Create an auto scale with complicated profile
azure_rm_autoscale:
target: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets
/myVmss"
enabled: true
profiles:
- count: '1'
recurrence_days:
- Monday
name: Auto created scale condition 0
rules:
- time_aggregation: Average
time_window: 10
direction: Increase
metric_name: Percentage CPU
metric_resource_uri: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtua
lMachineScaleSets/vmss"
value: '1'
threshold: 70
cooldown: 5
time_grain: 1
statistic: Average
operator: GreaterThan
type: ChangeCount
max_count: '1'
recurrence_mins:
- '0'
min_count: '1'
recurrence_timezone: China Standard Time
recurrence_frequency: Week
recurrence_hours:
- '6'
notifications:
- email_admin: True
email_co_admin: False
custom_emails:
- [email protected]
name: scale
resource_group: myResourceGroup
- name: Delete an Azure Auto Scale Setting
azure_rm_autoscale:
state: absent
resource_group: myResourceGroup
name: scale
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** dictionary | always | Current state of the resource. **Sample:** {'changed': False, 'enabled': True, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/microsoft.insights/autoscalesettings/scale', 'location': 'eastus', 'name': 'scale', 'notifications': [{'custom\_emails': ['[email protected]'], 'send\_to\_subscription\_administrator': True, 'send\_to\_subscription\_co\_administrators': False, 'webhooks': []}], 'profiles': [{'count': '1', 'max\_count': '1', 'min\_count': '1', 'name': 'Auto created scale condition 0', 'recurrence\_days': ['Monday'], 'recurrence\_frequency': 'Week', 'recurrence\_hours': ['6'], 'recurrence\_mins': ['0'], 'recurrence\_timezone': 'China Standard Time', 'rules': [{'cooldown': 5.0, 'direction': 'Increase', 'metric\_name': 'Percentage CPU', 'metric\_resource\_uri': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsof t.Compute/virtualMachineScaleSets/MyVmss', 'operator': 'GreaterThan', 'statistic': 'Average', 'threshold': 70.0, 'time\_aggregation': 'Average', 'time\_grain': 1.0, 'time\_window': 10.0, 'type': 'ChangeCount', 'value': '1'}]}], 'target': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScale Sets/myVmss'} |
### Authors
* Yuwei Zhou (@yuwzho)
| programming_docs |
ansible azure.azcollection.azure_rm_devtestlabvirtualnetwork – Manage Azure DevTest Lab Virtual Network instance azure.azcollection.azure\_rm\_devtestlabvirtualnetwork – Manage Azure DevTest Lab Virtual Network instance
==========================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabvirtualnetwork`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure DevTest Lab Virtual Network.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **description** string | | The description of the virtual network. |
| **lab\_name** string / required | | The name of the lab. |
| **location** string | | The location of the resource. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the virtual network. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Virtual Network. Use `present` to create or update an Virtual Network and `absent` to delete it. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) Virtual Network
azure_rm_devtestlabvirtualnetwork:
resource_group: myResourceGroup
lab_name: mylab
name: myvn
description: My Lab Virtual Network
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **external\_provider\_resource\_id** string | always | The identifier of external virtual network. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testrg/providers/Microsoft.Network/vi rtualNetworks/myvn |
| **id** string | always | The identifier of the resource. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/testrg/providers/microsoft.devtestlab/ mylab/mylab/virtualnetworks/myvn |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_adapplication_info – Get Azure Active Directory application info azure.azcollection.azure\_rm\_adapplication\_info – Get Azure Active Directory application info
===============================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_adapplication_info`.
New in version 1.6.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get Azure Active Directory application info.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **app\_id** string | | The application ID. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **identifier\_uri** string | | It's identifier\_uri's object ID. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **object\_id** string | | It's application's object ID. |
| **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. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string / required | | The tenant ID. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: get ad app info by App ID
azure_rm_adapplication_info:
app_id: "{{ app_id }}"
tenant: "{{ tenant_id }}"
- name: get ad app info ---- by object ID
azure_rm_adapplication_info:
object_id: "{{ object_id }}"
tenant: "{{ tenant_id }}"
- name: get ad app info ---- by identifier uri
azure_rm_adapplication_info:
identifier_uri: "{{ identifier_uri }}"
tenant: "{{ tenant_id }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **applications** complex | aways | The info of the ad application. |
| | **app\_display\_name** string | always | Object's display name or its prefix. **Sample:** app |
| | **app\_id** string | always | The application ID. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | **identifier\_uris** list / elements=string | always | The identifiers\_uri list of app. **Sample:** ['http://ansible-atodorov'] |
| | **object\_id** string | always | It's application's object ID. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
### Authors
* haiyuan\_zhang (@haiyuazhang) Fred-sun (@Fred-sun) guopeng\_lin (@guopenglin)
ansible azure.azcollection.azure_rm_storageaccount_info – Get storage account facts azure.azcollection.azure\_rm\_storageaccount\_info – Get storage account facts
==============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_storageaccount_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for one storage account or all storage accounts within a resource group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Only show results for a specific account. |
| **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 | | Limit results to a resource group. Required when filtering by name.
aliases: resource\_group\_name |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **show\_blob\_cors** boolean | **Choices:*** no
* yes
| Show the blob CORS settings for each blob related to the storage account. Querying all storage accounts will take a long time. |
| **show\_connection\_string** boolean | **Choices:*** no
* yes
| Show the connection string for each of the storageaccount's endpoints. For convenient usage, `show_connection_string` will also show the access keys for each of the storageaccount's endpoints. Note that it will cost a lot of time when list all storageaccount rather than query a single one. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one account
azure_rm_storageaccount_info:
resource_group: myResourceGroup
name: clh0002
- name: Get facts for all accounts in a resource group
azure_rm_storageaccount_info:
resource_group: myResourceGroup
- name: Get facts for all accounts by tags
azure_rm_storageaccount_info:
tags:
- testing
- foo:bar
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_storageaccounts** list / elements=string | always | List of storage account dicts. **Sample:** [{'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/myResourceGroups/testing/providers/Microsoft.Storage/storageAccounts/testaccount001', 'location': 'eastus2', 'name': 'testaccount001', 'properties': {'accountType': 'Standard\_LRS', 'creationTime': '2016-03-28T02:46:58.290113Z', 'primaryEndpoints': {'blob': 'https://testaccount001.blob.core.windows.net/', 'file': 'https://testaccount001.file.core.windows.net/', 'queue': 'https://testaccount001.queue.core.windows.net/', 'table': 'https://testaccount001.table.core.windows.net/'}, 'primaryLocation': 'eastus2', 'provisioningState': 'Succeeded', 'statusOfPrimary': 'Available'}, 'tags': {}, 'type': 'Microsoft.Storage/storageAccounts'}] |
| **storageaccounts** complex | always | List of storage account dicts in resource module's parameter format. |
| | **access\_tier** string | always | The access tier for this storage account. **Sample:** Hot |
| | **account\_type** string | always | Type of storage account.
`Standard_ZRS` and `Premium_LRS` accounts cannot be changed to other account types. Other account types cannot be changed to `Standard_ZRS` or `Premium_LRS`. **Sample:** Standard\_ZRS |
| | **custom\_domain** complex | always | User domain assigned to the storage account. Must be a dictionary with *name* and *use\_sub\_domain* keys where *name* is the CNAME source. |
| | | **name** string | always | CNAME source. **Sample:** testaccount |
| | | **use\_sub\_domain** boolean | always | Whether to use sub domain. **Sample:** True |
| | **https\_only** boolean | always | Allows https traffic only to storage service when set to `true`. |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/t estaccount001 |
| | **kind** string | always | The kind of storage. **Sample:** Storage |
| | **location** string | always | Valid Azure location. Defaults to location of the resource group. **Sample:** eastus |
| | **name** string | always | Name of the storage account to update or create. **Sample:** testaccount001 |
| | **network\_acls** dictionary | always | A set of firewall and virtual network rules **Sample:** {'bypass': 'AzureServices', 'default\_action': 'Deny', 'ip\_rules': [{'action': 'Allow', 'value': '1.2.3.4'}, {'action': 'Allow', 'value': '123.234.123.0/24'}], 'virtual\_network\_rules': [{'action': 'Allow', 'id': '/subscriptions/mySubscriptionId/resourceGroups/myResourceGroup/ providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet'}]} |
| | **primary\_endpoints** complex | always | URLs to retrieve a public *blob*, *file*, *queue*, or *table* object. Note that `Standard_ZRS` and `Premium_LRS` accounts only return the blob endpoint. |
| | | **blob** complex | always | The primary blob endpoint and connection string. |
| | | | **connectionstring** string | always | Connectionstring of the blob endpoint. **Sample:** DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;BlobEndpoint=X |
| | | | **endpoint** string | always | The primary blob endpoint. **Sample:** https://testaccount001.blob.core.windows.net/ |
| | | **file** complex | always | The primary file endpoint and connection string. |
| | | | **connectionstring** string | always | Connectionstring of the file endpoint. **Sample:** DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;FileEndpoint=X |
| | | | **endpoint** string | always | The primary file endpoint. **Sample:** https://testaccount001.file.core.windows.net/ |
| | | **key** string | always | The account key for the primary\_endpoints **Sample:** xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| | | **queue** complex | always | The primary queue endpoint and connection string. |
| | | | **connectionstring** string | always | Connectionstring of the queue endpoint. **Sample:** DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;QueueEndpoint=X |
| | | | **endpoint** string | always | The primary queue endpoint. **Sample:** https://testaccount001.queue.core.windows.net/ |
| | | **table** complex | always | The primary table endpoint and connection string. |
| | | | **connectionstring** string | always | Connectionstring of the table endpoint. **Sample:** DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;TableEndpoint=X |
| | | | **endpoint** string | always | The primary table endpoint. **Sample:** https://testaccount001.table.core.windows.net/ |
| | **primary\_location** string | always | The location of the primary data center for the storage account. **Sample:** eastus |
| | **provisioning\_state** string | always | The status of the storage account at the time the operation was called. Possible values include `Creating`, `ResolvingDNS`, `Succeeded`. **Sample:** Succeeded |
| | **secondary\_endpoints** complex | always | The URLs to retrieve a public *blob*, *file*, *queue*, or *table* object from the secondary location. Only available if the SKU *name=Standard\_RAGRS*. |
| | | **blob** complex | always | The secondary blob endpoint and connection string. |
| | | | **connectionstring** string | always | Connectionstring of the blob endpoint. **Sample:** DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;BlobEndpoint=X |
| | | | **endpoint** string | always | The secondary blob endpoint. **Sample:** https://testaccount001.blob.core.windows.net/ |
| | | **file** complex | always | The secondary file endpoint and connection string. |
| | | | **connectionstring** string | always | Connectionstring of the file endpoint. **Sample:** DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;FileEndpoint=X |
| | | | **endpoint** string | always | The secondary file endpoint. **Sample:** https://testaccount001.file.core.windows.net/ |
| | | **key** string | success | The account key for the secondary\_endpoints **Sample:** xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| | | **queue** complex | always | The secondary queue endpoint and connection string. |
| | | | **connectionstring** string | always | Connectionstring of the queue endpoint. **Sample:** DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;QueueEndpoint=X |
| | | | **endpoint** string | always | The secondary queue endpoint. **Sample:** https://testaccount001.queue.core.windows.net/ |
| | | **table** complex | always | The secondary table endpoint and connection string. |
| | | | **connectionstring** string | always | Connectionstring of the table endpoint. **Sample:** DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;TableEndpoint=X |
| | | | **endpoint** string | always | The secondary table endpoint. **Sample:** https://testaccount001.table.core.windows.net/ |
| | **secondary\_location** string | always | The location of the geo-replicated secondary for the storage account. Only available if the *account\_type=Standard\_GRS* or *account\_type=Standard\_RAGRS*. **Sample:** westus |
| | **status\_of\_primary** string | always | Status of the primary location of the storage account; either `available` or `unavailable`. **Sample:** available |
| | **status\_of\_secondary** string | always | Status of the secondary location of the storage account; either `available` or `unavailable`. **Sample:** available |
| | **tags** dictionary | always | Resource tags. **Sample:** {'tag1': 'abc'} |
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
| programming_docs |
ansible azure.azcollection.azure_rm_sqlfirewallrule – Manage Firewall Rule instance azure.azcollection.azure\_rm\_sqlfirewallrule – Manage Firewall Rule instance
=============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_sqlfirewallrule`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Firewall Rule.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **end\_ip\_address** string | | The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to *start\_ip\_address*. Use value `0.0.0.0` to represent all Azure-internal IP addresses. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the firewall rule. |
| **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 / required | | The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string / required | | The name of the server. |
| **start\_ip\_address** string | | The start IP address of the firewall rule. Must be IPv4 format. Use value `0.0.0.0` to represent all Azure-internal IP addresses. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the SQL Database. Use `present` to create or update an SQL Database and `absent` to delete it. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) Firewall Rule
azure_rm_sqlfirewallrule:
resource_group: myResourceGroup
server_name: firewallrulecrudtest-6285
name: firewallrulecrudtest-5370
start_ip_address: 172.28.10.136
end_ip_address: 172.28.10.138
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Sql/servers/firewallrulecrudtest-628 5/firewallRules/firewallrulecrudtest-5370 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_subscription_info – Get Azure Subscription facts azure.azcollection.azure\_rm\_subscription\_info – Get Azure Subscription facts
===============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_subscription_info`.
New in version 1.2.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific subscription or all subscriptions.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **all** boolean | **Choices:*** no
* yes
| If true, will return all subscriptions. If false will omit disabled subscriptions (default). Option has no effect when searching by id or name, and will be silently ignored. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **id** string | | Limit results to a specific subscription by id. Mutually exclusive with *name*. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Limit results to a specific subscription by name. Mutually exclusive with *id*.
aliases: subscription\_name |
| **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. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** list / elements=string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. Option has no effect when searching by id or name, and will be silently ignored. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one subscription by id
azure_rm_subscription_info:
id: 00000000-0000-0000-0000-000000000000
- name: Get facts for one subscription by name
azure_rm_subscription_info:
name: "my-subscription"
- name: Get facts for all subscriptions, including ones that are disabled.
azure_rm_subscription_info:
all: True
- name: Get facts for subscriptions containing tags provided.
azure_rm_subscription_info:
tags:
- testing
- foo:bar
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **subscriptions** list / elements=string | always | List of subscription dicts. |
| | **display\_name** string | always | Subscription display name. **Sample:** my-subscription |
| | **fqid** string | always | Subscription fully qualified id. **Sample:** /subscriptions/00000000-0000-0000-0000-000000000000 |
| | **state** string | always | Subscription state. **Sample:** 'Enabled' or 'Disabled' |
| | **subscription\_id** string | always | Subscription guid. **Sample:** 00000000-0000-0000-0000-000000000000 |
| | **tags** dictionary | always | Tags assigned to resource group. **Sample:** {'tag1': 'value1', 'tag2': 'value2'} |
| | **tenant\_id** string | always | Subscription tenant id **Sample:** 00000000-0000-0000-0000-000000000000 |
### Authors
* Paul Aiton (@paultaiton)
ansible azure.azcollection.azure_rm_webappvnetconnection_info – Get Azure web app virtual network connection facts azure.azcollection.azure\_rm\_webappvnetconnection\_info – Get Azure web app virtual network connection facts
=============================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_webappvnetconnection_info`.
New in version 1.8.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a web app’s virtual network connection.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the web app. |
| **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 / required | | Resource group of the web app. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get web app virtual network connection
azure_rm_webappvnetconnection_info:
name: "MyWebapp"
resource_group: "MyResourceGroup"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **connection** complex | always | The web app's virtual network connection. |
| | **id** string | always | ID of the web app virtual network connection. **Sample:** /subscriptions/xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp/virtualNetworkConnections/yyy-yyy\_subnet |
| | **name** string | always | Name of the web app virtual network connection. **Sample:** yyy-yyy\_subnet |
| | **subnet\_name** string | always | Name of the subnet connected to the web app. **Sample:** mySubnet |
| | **vnet\_name** string | always | Name of the virtual network connected to the web app. **Sample:** myVnet |
| | **vnet\_resource\_group** string | always | Name of the resource group the virtual network is in. **Sample:** myResourceGroup |
| | **vnet\_resource\_id** string | always | ID of the virtual network/subnet connected to the web app. **Sample:** /subscriptions/xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet |
### Authors
* Ross Bender (@l3ender)
| programming_docs |
ansible azure.azcollection.azure_rm_sqldatabase – Manage SQL Database instance azure.azcollection.azure\_rm\_sqldatabase – Manage SQL Database instance
========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_sqldatabase`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of SQL Database.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **collation** string | | The collation of the database. If not *create\_mode=default*, this value is ignored. |
| **create\_mode** string | **Choices:*** copy
* default
* non\_readable\_secondary
* online\_secondary
* point\_in\_time\_restore
* recovery
* restore
* restore\_long\_term\_retention\_backup
| Specifies the mode of database creation.
`default`, regular database creation.
`copy`, creates a database as a copy of an existing database.
`online_secondary`/`non_readable_secondary`, creates a database as a (readable or nonreadable) secondary replica of an existing database.
`point_in_time_restore`, Creates a database by restoring a point in time backup of an existing database.
`recovery`, Creates a database by restoring a geo-replicated backup.
`restore`, Creates a database by restoring a backup of a deleted database.
`restore_long_term_retention_backup`, Creates a database by restoring from a long term retention vault.
`copy`, `non_readable_secondary`, `online_secondary` and `restore_long_term_retention_backup` are not supported for `data_warehouse` edition. |
| **edition** string | **Choices:*** web
* business
* basic
* standard
* premium
* free
* stretch
* data\_warehouse
* system
* system2
| (Deprecate)The edition of the database. The DatabaseEditions enumeration contains all the valid editions. This option will be deprecated in 2.11, use *sku* instead. Cannot set `sku` when this field set. |
| **elastic\_pool\_name** string | | The name of the elastic pool the database is in. Not supported for *edition=data\_warehouse*. |
| **force\_update** boolean | **Choices:*** no
* yes
| SQL Database will be updated if given parameters differ from existing resource state. To force SQL Database update in any circumstances set this parameter to True. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **max\_size\_bytes** string | | The max size of the database expressed in bytes. If not *create\_mode=default*, this value is ignored. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities). referred to by operationId:'Capabilities\_ListByLocation'. |
| **name** string / required | | The name of the database to be operated on (updated or created). |
| **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. |
| **read\_scale** boolean | **Choices:*** **no** ←
* yes
| If the database is a geo-secondary, indicates whether read-only connections are allowed to this database or not. Not supported for *edition=data\_warehouse*. |
| **recovery\_services\_recovery\_point\_resource\_id** string | | Required if *create\_mode=restore\_long\_term\_retention\_backup*, then this value is required. Specifies the resource ID of the recovery point to restore from. |
| **resource\_group** string / required | | The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
| **restore\_point\_in\_time** string | | Required if *create\_mode=point\_in\_time\_restore*, this value is required. If *create\_mode=restore*, this value is optional. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. Must be greater than or equal to the source database's earliestRestoreDate value. |
| **sample\_name** string | **Choices:*** adventure\_works\_lt
| Indicates the name of the sample schema to apply when creating this database. If not *create\_mode=default*, this value is ignored. Not supported for *edition=data\_warehouse*. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string / required | | The name of the server. |
| **sku** string | | The sku of the database. The DatabaseEditions enumeration contains all the valid sku. If *create\_mode=non\_readable\_secondary* or *create\_mode=online\_secondary*, this value is ignored. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId:'Capabilities\_ListByLocation'. Cannot set `edition` when this field set. |
| | **capacity** string | | Capacity of the particular SKU. |
| | **family** string | | If the service has different generations of hardware, for the same SKU, then that can be used here |
| | **name** string / required | | Name of the database SKU, typically, a letter + Number code, e.g. P3 |
| | **size** string | | Size of the particular SKU |
| | **tier** string | | The tier or edition of the particular SKU, e.g. Basic, Premium |
| **source\_database\_deletion\_date** string | | Required if *create\_mode=restore* and *source\_database\_id* is the deleted database's original resource id when it existed (as opposed to its current restorable dropped database ID), then this value is required. Specifies the time that the database was deleted. |
| **source\_database\_id** string | | Required unless *create\_mode=default* or *create\_mode=restore\_long\_term\_retention\_backup*. Specifies the resource ID of the source database. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the SQL Database. Use `present` to create or update an SQL Database and `absent` to delete it. |
| **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. |
| **zone\_redundant** boolean | **Choices:*** **no** ←
* yes
| Is this database is zone redundant? It means the replicas of this database will be spread across multiple availability zones. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) SQL Database
azure_rm_sqldatabase:
resource_group: myResourceGroup
server_name: sqlcrudtest-5961
name: testdb
location: eastus
- name: Restore SQL Database
azure_rm_sqldatabase:
resource_group: myResourceGroup
server_name: sqlcrudtest-5961
name: restoreddb
location: eastus
create_mode: restore
restorable_dropped_database_id: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Sql/s
ervers/testsvr/restorableDroppedDatabases/testdb2,131444841315030000"
- name: Create SQL Database in Copy Mode
azure_rm_sqldatabase:
resource_group: myResourceGroup
server_name: sqlcrudtest-5961
name: copydb
location: eastus
create_mode: copy
source_database_id: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Sql/servers/tests
vr/databases/testdb"
- name: Create (or update) SQL Database with SKU
azure_rm_sqldatabase:
resource_group: myResourceGroup
server_name: sqlcrudtest-5961
name: testdb
location: eastus
sku:
name: S0
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **database\_id** string | always | The ID of the database. **Sample:** database\_id |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Sql/servers/sqlcrudtest-5961/databases/t estdb |
| **status** string | always | The status of the database. **Sample:** Online |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_vmbackuppolicy_info – Fetch Backup Policy Details azure.azcollection.azure\_rm\_vmbackuppolicy\_info – Fetch Backup Policy Details
================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_vmbackuppolicy_info`.
New in version 1.1.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get Backup Policy Details.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Policy Name. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **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. |
| **vault\_name** string / required | | Recovery Service Vault Name. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
azure_rm_backvmuppolicy_info:
name: 'myBackupPolicy'
vault_name: 'myVault'
resource_group: 'myResourceGroup'
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **response** complex | always | The response about the current state of the backup policy. |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxx/resourceGroups/resourcegroup\_name/ providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myBackup |
| | **name** string | always | Backup Policy Name. **Sample:** myBackup |
| | **properties** dictionary | always | The backup policy properties. **Sample:** {'backupManagementType': 'AzureIaasVM', 'protectedItemsCount': 0, 'retentionPolicy': {'monthlySchedule': {'retentionDuration': {'count': 2, 'durationType': 'Months'}, 'retentionScheduleFormatType': 'Weekly', 'retentionScheduleWeekly': {'daysOfTheWeek': ['Wednesday', 'Thursday'], 'weeksOfTheMonth': ['First', 'Third']}, 'retentionTimes': ['2018-01-24T10:00:00Z']}, 'retentionPolicyType': 'LongTermRetentionPolicy', 'weeklySchedule': {'daysOfTheWeek': ['Monday', 'Wednesday', 'Thursday'], 'retentionDuration': {'count': 1, 'durationType': 'Weeks'}, 'retentionTimes': ['2018-01-24T10:00:00Z']}, 'yearlySchedule': {'monthsOfYear': ['February', 'November'], 'retentionDuration': {'count': 4, 'durationType': 'Years'}, 'retentionScheduleFormatType': 'Weekly', 'retentionScheduleWeekly': {'daysOfTheWeek': ['Monday', 'Thursday'], 'weeksOfTheMonth': ['Fourth']}, 'retentionTimes': ['2018-01-24T10:00:00Z']}}, 'schedulePolicy': {'schedulePolicyType': 'SimpleSchedulePolicy', 'scheduleRunDays': ['Monday', 'Wednesday', 'Thursday'], 'scheduleRunFrequency': 'Weekly', 'scheduleRunTimes': ['2018-01-24T10:00:00Z'], 'scheduleWeeklyFrequency': 0}, 'timeZone': 'Pacific Standard Time'} |
| | **type** string | always | Resource type. **Sample:** Microsoft.RecoveryServices/vaults/backupPolicies |
### Authors
* Suyeb Ansari (@suyeb786)
| programming_docs |
ansible azure.azcollection.azure_rm_diskencryptionset_info – Get disk encryption set facts azure.azcollection.azure\_rm\_diskencryptionset\_info – Get disk encryption set facts
=====================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_diskencryptionset_info`.
New in version 1.9.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for specific disk encryption set or all sets in a given resource group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Name of the disk encryption set. |
| **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 | | Name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** dictionary | | Limit the results by providing resource tags. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one disk encryption set
azure_rm_diskencryptionset_info:
resource_group: myResourceGroup
name: mydiskencryptionset
- name: Get facts for all disk encryption sets in resource group
azure_rm_diskencryptionset_info:
resource_group: myResourceGroup
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **diskencryptionsets** list / elements=dictionary | always | Gets a list of disk encryption sets. **Sample:** [{'active\_key': {'key\_url': 'https://myvault.vault.azure.net/keys/Key1/e65090b268ec4c3ba1a0f7a473005768', 'source\_vault': {'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/ Microsoft.KeyVault/vaults/myvault'}}, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/ Microsoft.Compute/diskEncryptionSets/mydiskencryptionset', 'identity': {'principal\_id': 'd3abec0a-5818-4bbd-8300-8014198124ca', 'tenant\_id': '7268bab5-aabd-44f9-915f-6bf864e879c6', 'type': 'SystemAssigned'}, 'location': 'eastus', 'name': 'mydiskencryptionset', 'provisioning\_state': 'Succeeded', 'tags': {'key1': 'value1'}, 'type': 'Microsoft.Compute/diskEncryptionSets'}] |
### Authors
* Aparna Patil (@techcon65)
ansible azure.azcollection.azure_rm_iotdevice – Manage Azure IoT hub device azure.azcollection.azure\_rm\_iotdevice – Manage Azure IoT hub device
=====================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_iotdevice`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, delete an Azure IoT hub device.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_method** string | **Choices:*** **sas** ←
* certificate\_authority
* self\_signed
| The authorization type an entity is to be created with. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **desired** dictionary | | Used along with reported properties to synchronize device configuration or conditions. The tag can be nested dictionary, '.', '$', '#', ' ' is not allowed in the key. List is not supported. Not supported in IoT Hub with Basic tier. |
| **edge\_enabled** boolean | **Choices:*** no
* yes
| Flag indicating edge enablement. Not supported in IoT Hub with Basic tier. |
| **hub** string / required | | Name of IoT Hub. |
| **hub\_policy\_key** string / required | | Key of the *hub\_policy\_name*. |
| **hub\_policy\_name** string / required | | Policy name of the IoT Hub which will be used to query from IoT hub. This policy should have 'RegistryWrite, ServiceConnect, DeviceConnect' accesses. You may get 401 error when you lack any of these. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the IoT hub device identity. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **primary\_key** string | | Explicit self-signed certificate thumbprint to use for primary key. Explicit Shared Private Key to use for primary key.
aliases: primary\_thumbprint |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **secondary\_key** string | | Explicit self-signed certificate thumbprint to use for secondary key. Explicit Shared Private Key to use for secondary key.
aliases: secondary\_thumbprint |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the IoT hub. Use `present` to create or update an IoT hub device and `absent` to delete an IoT hub device. |
| **status** boolean | **Choices:*** no
* yes
| Set device status upon creation. |
| **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. |
| **twin\_tags** dictionary | | A section that the solution back end can read from and write to. Tags are not visible to device apps. The tag can be nested dictionary, '.', '$', '#', ' ' is not allowed in the key. List is not supported. Not supported in IoT Hub with Basic tier. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create simplest Azure IoT Hub device
azure_rm_iotdevice:
hub: myHub
name: Testing
hub_policy_name: iothubowner
hub_policy_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
- name: Create Azure IoT Edge device
azure_rm_iotdevice:
hub: myHub
name: Testing
hub_policy_name: iothubowner
hub_policy_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
edge_enabled: yes
- name: Create Azure IoT Hub device with device twin properties and tag
azure_rm_iotdevice:
hub: myHub
name: Testing
hub_policy_name: iothubowner
hub_policy_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
twin_tags:
location:
country: US
city: Redmond
sensor: humidity
desired:
period: 100
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **device** dictionary | always | IoT Hub device. **Sample:** {'authentication': {'symmetricKey': {'primaryKey': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'secondaryKey': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}, 'type': 'sas', 'x509Thumbprint': {'primaryThumbprint': None, 'secondaryThumbprint': None}}, 'capabilities': {'iotEdge': False}, 'changed': True, 'cloudToDeviceMessageCount': 0, 'connectionState': 'Disconnected', 'connectionStateUpdatedTime': '0001-01-01T00:00:00', 'deviceId': 'Testing', 'etag': 'NzA2NjU2ODc=', 'failed': False, 'generationId': '636903014505613307', 'lastActivityTime': '0001-01-01T00:00:00', 'modules': [{'authentication': {'symmetricKey': {'primaryKey': 'XXXXXXXXXXXXXXXXXXX', 'secondaryKey': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}, 'type': 'sas', 'x509Thumbprint': {'primaryThumbprint': None, 'secondaryThumbprint': None}}, 'cloudToDeviceMessageCount': 0, 'connectionState': 'Disconnected', 'connectionStateUpdatedTime': '0001-01-01T00:00:00', 'deviceId': 'testdevice', 'etag': 'MjgxOTE5ODE4', 'generationId': '636903840872788074', 'lastActivityTime': '0001-01-01T00:00:00', 'managedBy': None, 'moduleId': 'test'}], 'properties': {'desired': {'$metadata': {'$lastUpdated': '2019-04-10T05:00:46.2702079Z', '$lastUpdatedVersion': 8, 'period': {'$lastUpdated': '2019-04-10T05:00:46.2702079Z', '$lastUpdatedVersion': 8}}, '$version': 1, 'period': 100}, 'reported': {'$metadata': {'$lastUpdated': '2019-04-08T06:24:10.5613307Z'}, '$version': 1}}, 'status': 'enabled', 'statusReason': None, 'statusUpdatedTime': '0001-01-01T00:00:00', 'tags': {'location': {'city': 'Redmond', 'country': 'us'}, 'sensor': 'humidity'}} |
### Authors
* Yuwei Zhou (@yuwzho)
ansible azure.azcollection.azure_rm_roledefinition_info – Get Azure Role Definition facts azure.azcollection.azure\_rm\_roledefinition\_info – Get Azure Role Definition facts
====================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_roledefinition_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure Role Definition.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **id** string | | Role definition id. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **role\_name** string | | Role name. |
| **scope** string / required | | The scope of role definition. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **type** string | **Choices:*** system
* custom
| Type of role. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: List Role Definitions in scope
azure_rm_roledefinition_info:
scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup
- name: Get Role Definition by name
azure_rm_roledefinition_info:
scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup
role_name: myRoleDefinition
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **roledefinitions** complex | always | A list of Role Definition facts. |
| | **assignable\_scopes** list / elements=string | always | List of assignable scopes of this definition. **Sample:** ['/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup'] |
| | **id** string | always | Role Definition ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | **name** string | always | System assigned role name. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | **permissions** complex | always | List of Role Definition permissions. |
| | | **actions** list / elements=string | always | List of allowed actions. **Sample:** ['Microsoft.Compute/virtualMachines/read'] |
| | | **data\_actions** list / elements=string | always | List of allowed data actions. **Sample:** ['Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read'] |
| | | **not\_actions** list / elements=string | always | List of denied actions. **Sample:** ['Microsoft.Compute/virtualMachines/write'] |
| | | **not\_data\_actions** list / elements=string | always | List of denied data actions. **Sample:** ['Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write'] |
| | **role\_name** string | always | Role name. **Sample:** myCustomRoleDefinition |
### Authors
* Yunge Zhu(@yungezz)
| programming_docs |
ansible azure.azcollection.azure_rm_adpassword – Manage application password azure.azcollection.azure\_rm\_adpassword – Manage application password
======================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_adpassword`.
New in version 0.2.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage application password.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **app\_id** string | | The application ID. |
| **app\_object\_id** string | | The application object ID. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **end\_date** string | | Date or datemtime after which credentials expire. Default value is one year after current time. |
| **key\_id** string | | The password key ID. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **service\_principal\_object\_id** string | | The service principal object ID. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of Active Dirctory Password. Use `present` to create or update a Password and use `absent` to delete. Update is not supported, if *state=absent* and *key\_id=None*, then all passwords of the application will be deleted. |
| **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 / required | | The tenant ID. |
| **value** string | | The application password value. Length greater than 18 characters. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: create ad password
azure_rm_adpassword:
app_id: "{{ app_id }}"
state: present
value: "$abc12345678"
tenant: "{{ tenant_id }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **end\_date** string | always | Date or datemtime after which credentials expire. Default value is one year after current time. **Sample:** 2021-06-28T06:00:32.637070+00:00 |
| **key\_id** string | always | The password key ID **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| **start\_date** string | always | Date or datetime at which credentials become valid. Default value is current time. **Sample:** 2020-06-28T06:00:32.637070+00:00 |
### Authors
* haiyuan\_zhang (@haiyuazhang) Fred-sun (@Fred-sun)
ansible azure.azcollection.azure_rm_resourcegroup_info – Get resource group facts azure.azcollection.azure\_rm\_resourcegroup\_info – Get resource group facts
============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_resourcegroup_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific resource group or all resource groups.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **list\_resources** string | | List all resources under the resource group. Note this will cost network overhead for each resource group. Suggest use this when *name* set. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Limit results to a specific resource group. |
| **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. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one resource group
azure_rm_resourcegroup_info:
name: myResourceGroup
- name: Get facts for all resource groups
azure_rm_resourcegroup_info:
- name: Get facts by tags
azure_rm_resourcegroup_info:
tags:
- testing
- foo:bar
- name: Get facts for one resource group including resources it contains
azure_rm_resourcegroup_info:
name: myResourceGroup
list_resources: yes
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **resourcegroups** list / elements=string | always | List of resource group dicts. |
| | **id** string | always | Resource id. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup |
| | **name** string | always | Resource group name. **Sample:** foo |
| | **resources** list / elements=string | when *list\_resources=yes*. | List of resources under the resource group. |
| | | **id** string | always | Resource id. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMa chines/myVirtualMachine |
| | | **location** string | always | Resource region. **Sample:** eastus |
| | | **name** string | always | Resource name. **Sample:** myVirtualMachine |
| | | **tags** dictionary | always | Tags to assign to the managed disk. **Sample:** {'tag': 'value'} |
| | | **type** string | always | Resource type. **Sample:** Microsoft.Compute/virtualMachines |
| | **tags** dictionary | always | Tags assigned to resource group. **Sample:** {'tag': 'value'} |
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
ansible azure.azcollection.azure_rm_registrationassignment – Manage Azure RegistrationAssignment instance azure.azcollection.azure\_rm\_registrationassignment – Manage Azure RegistrationAssignment instance
===================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_registrationassignment`.
New in version 1.3.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create and delete instance of Azure RegistrationAssignment.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **properties** dictionary | | Properties of a registration assignment. |
| | **registration\_definition\_id** string / required | | Fully qualified path of the registration definition. |
| **registration\_assignment\_id** string | | ID of the registration assignment. If is not specified, an UUID will be generated for it. |
| **scope** string / required | | Scope of the registration assignment. Can be in subscription or group level. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the RegistrationAssignment. Use `present` to create or update an RegistrationAssignment and `absent` to delete it. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Delete Registration Assignment
azure_rm_registrationassignment:
scope: subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
registration_assignment_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
state: absent
- name: Create Registration Assignment in subscription level
azure_rm_registrationassignment:
scope: subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
registration_assignment_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
properties:
registration_definition_id: /subscriptions/xxx-xxx/providers/Microsoft.ManagedServices/registrationDefinitions/xxx-xxx
- name: Create Registration Assignment in resourcegroup level with randomly generating registration_assignment_id
azure_rm_registrationassignment:
scope: subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup
properties:
registration_definition_id: /subscriptions/xxx-xxx/providers/Microsoft.ManagedServices/registrationDefinitions/xxx-xxx
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | always | The state info of the registration assignment. |
| | **id** string | always | The fully qualified path of the registration assignment. **Sample:** /subscriptions/xxx-xxx/providers/Microsoft.ManagedServices/registrationAssignments/xxx-xxx |
| | **name** string | always | Name of the registration assignment. **Sample:** 9b2895ec-fb1e-4a1e-a978-abd9933d6b20 |
| | **properties** complex | always | Properties of a registration assignment. |
| | | **registration\_definition\_id** string | always | Fully qualified path of the registration definition. |
| | **type** string | always | Type of the resource. **Sample:** Microsoft.ManagedServices/registrationAssignments |
### Authors
* Fred-Sun (@Fred-Sun)
| programming_docs |
ansible azure.azcollection.azure_rm_monitorlogprofile – Manage Azure Monitor log profile azure.azcollection.azure\_rm\_monitorlogprofile – Manage Azure Monitor log profile
==================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_monitorlogprofile`.
New in version 0.0.1: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure Monitor log profile.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **categories** list / elements=string | | List of categories of logs. These categories are created as is convenient to user. Some Values are `Write`, `Delete` and/or `Action`. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **location** string | | Resource location. |
| **locations** list / elements=string | | List of regions for which Activity Log events should be stored. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Unique name of the log profile to create or update. |
| **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. |
| **retention\_policy** dictionary | | Retention policy for events in the log. |
| | **days** integer | | The number of days for the retention. A value of 0 will retain the events indefinitely. |
| | **enabled** boolean | **Choices:*** no
* yes
| Whether the retention policy is enabled. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **service\_bus\_rule\_id** string | | The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming in the Activity Log. Format like {service\_bus\_resource\_id}/authorizationrules{key\_name}. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the log profile. Use `present` to create or update a log profile and `absent` to delete it. |
| **storage\_account** raw | | The storage account to which send the Activity Log. It could be a resource ID. It could be a dict containing *resource\_grorup* and *name*. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a log profile
azure_rm_monitorlogprofile:
name: myProfile
location: eastus
locations:
- eastus
- westus
categories:
- Write
- Action
retention_policy:
enabled: False
days: 1
storage_account:
resource_group: myResourceGroup
name: myStorageAccount
register: output
- name: Delete a log profile
azure_rm_monitorlogprofile:
name: myProfile
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | ID of the log profile. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/microsoft.insights/logprofiles/myProfile |
### Authors
* Yunge Zhu(@yungezz)
ansible azure.azcollection.azure_rm_backupazurevm – Back up an Azure Virtual Machine using Azure Backup azure.azcollection.azure\_rm\_backupazurevm – Back up an Azure Virtual Machine using Azure Backup
=================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_backupazurevm`.
New in version 1.1.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Back up an Azure VM using Azure Backup.
* Enabling/Updating protection for the Azure VM.
* Trigger an on-demand backup for a protected Azure VM.
* Stop protection but retain existing data.
* Stop protection and delete data.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **backup\_policy\_id** string / required | | Backup Policy ID present under Recovery Service Vault mentioned in recovery\_vault\_name field. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **recovery\_vault\_name** string / required | | The name of the Azure Recovery Service Vault. |
| **resource\_group** string / required | | The name of the resource group. |
| **resource\_id** string / required | | Azure Virtual Machine Resource ID. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** **create** ←
* update
* delete
* stop
* backup
| Assert the state of the protection item. Use `create` for enabling protection for the Azure VM. Use `update` for changing the policy of protection. Use `stop` for stop protection but retain existing data. Use `delete` for stop protection and delete data. Use `backup` for on-demand backup. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Enabling/Updating protection for the Azure VM
azure_rm_backupazurevm:
resource_group: 'myResourceGroup'
recovery_vault_name: 'testVault'
resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM'
backup_policy_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ resourceGroups/myResourceGroup/providers/microsoft.recoveryservices/vaults/testVault/backupPolicies/ProdPolicy'
state: 'create'
- name: Stop protection but retain existing data
azure_rm_backupazurevm:
resource_group: 'myResourceGroup'
recovery_vault_name: 'testVault'
resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM'
state: 'stop'
- name: Stop protection and delete data
azure_rm_backupazurevm:
resource_group: 'myResourceGroup'
recovery_vault_name: 'testVault'
resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM'
state: 'delete'
- name: Trigger an on-demand backup for a protected Azure VM
azure_rm_backupazurevm:
resource_group: 'myResourceGroup'
recovery_vault_name: 'testVault'
resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM'
backup_policy_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ resourceGroups/myResourceGroup/providers/microsoft.recoveryservices/vaults/testVault/backupPolicies/ProdPolicy'
state: 'backup'
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | VM backup protection details. **Sample:** {"response":{"id":"protection\_id","name":"protection\_item\_name","properties":{}}} |
### Authors
* Suyeb Ansari (@suyeb786)
* Pallavi Chaudhari (@PallaviC2510)
ansible azure.azcollection.azure_rm_publicipaddress_info – Get public IP facts azure.azcollection.azure\_rm\_publicipaddress\_info – Get public IP facts
=========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_publicipaddress_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific public IP or all public IPs within a resource group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Only show results for a specific Public IP. |
| **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 | | Limit results by resource group. Required when using name parameter. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one Public IP
azure_rm_publicipaddress_info:
resource_group: myResourceGroup
name: publicip001
- name: Get facts for all Public IPs within a resource groups
azure_rm_publicipaddress_info:
resource_group: myResourceGroup
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_publicipaddresses** list / elements=string | always | List of public IP address dicts. Please note that this option will be deprecated in 2.10 when curated format will become the only supported format. **Sample:** [{'etag': 'W/"a31a6d7d-cb18-40a5-b16d-9f4a36c1b18a"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/pip2001', 'location': 'eastus2', 'name': 'pip2001', 'properties': {'idleTimeoutInMinutes': 4, 'provisioningState': 'Succeeded', 'publicIPAllocationMethod': 'Dynamic', 'resourceGuid': '29de82f4-a7da-440e-bd3d-9cabb79af95a'}, 'type': 'Microsoft.Network/publicIPAddresses'}] |
| **publicipaddresses** complex | always | List of publicipaddress. Contains the detail which matches azure\_rm\_publicipaddress parameters. Returned when the format parameter set to curated. |
| | **allocation\_method** string | always | The public IP allocation method. Possible values are `static` and `dynamic`. **Sample:** static |
| | **dns\_settings** dictionary | always | The FQDN of the DNS record associated with the public IP address. **Sample:** {'domain\_name\_label': 'ansible-b57dc95985712e45eb8b9c2e', 'fqdn': 'ansible-b57dc95985712e45eb8b9c2e.eastus.cloudapp.azure.com', 'reverse\_fqdn': None} |
| | **etag** string | always | A unique read-only string that changes whenever the resource is updated. **Sample:** W/'1905ee13-7623-45b1-bc6b-4a12b2fb9d15' |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxx---xxxxx/resourceGroups/v-xisuRG/providers/Microsoft.Network/publicIPAddresses/pipb57dc95224 |
| | **idle\_timeout** integer | always | The idle timeout of the public IP address. **Sample:** 4 |
| | **ip\_address** string | always | The Public IP Prefix this Public IP Address should be allocated from. **Sample:** 40.121.144.14 |
| | **ip\_tags** list / elements=string | always | The list of tags associated with the public IP address. **Sample:** [{'type': 'FirstPartyUsage', 'value': 'Storage'}] |
| | **location** string | always | Resource location. **Sample:** eastus |
| | **name** string | always | Name of the public IP address. **Sample:** pipb57dc95224 |
| | **provisioning\_state** string | always | The provisioning state of the PublicIP resource. Possible values is `Succeeded`. **Sample:** Succeeded |
| | **sku** string | always | The public IP address SKU. **Sample:** Basic |
| | **tags** dictionary | always | Resource tags. **Sample:** {'delete': 'on-exit', 'testing': 'testing'} |
| | **type** string | always | Resource type. **Sample:** Microsoft.Network/publicIPAddresses |
| | **version** string | always | The public IP address version. Possible values are `ipv4` and `ipv6`. **Sample:** ipv4 |
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
| programming_docs |
ansible azure.azcollection.azure_rm_managementgroup – Manage Azure ManagementGroup instance azure.azcollection.azure\_rm\_managementgroup – Manage Azure ManagementGroup instance
=====================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_managementgroup`.
New in version 0.1.1: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure ManagementGroup.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **group\_id** string / required | | Management Group ID. |
| **id** string | | The fully qualified ID for the management group. For example /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the management group. For example 00000000-0000-0000-0000-000000000000. |
| **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. |
| **properties** dictionary | | The properties of the management group. |
| | **display\_name** string | | The friendly name of the management group. |
| | **parent\_id** string | | The parent of the management group. |
| | **tenant\_id** string | | The AAD Tenant ID associated with the management group. For example 00000000-0000-0000-0000-000000000000. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the ManagementGroup. Use `present` to create or update an ManagementGroup and `absent` to delete it. |
| **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. |
| **type** string | | The type of the resource. For example /providers/Microsoft.Management/managementGroups. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: create management group
azure_rm_managementgroup:
group_id: ChildGroup
type: /providers/Microsoft.Management/managementGroups/
name: ChildGroup
properties:
tenantId: 20000000-0000-0000-0000-000000000000
display_name: ChildGroup
parent_id: /providers/Microsoft.Management/managementGroups/RootGroup
- name: delete management group
azure_rm_managementgroup:
group_id: ChildGroup
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | The fully qualified ID for the management group. For example /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000. |
| **name** string | always | The name of the management group. For example 00000000-0000-0000-0000-000000000000. |
| **properties** complex | always | The properties of the management group. |
| | **details** complex | always | The details of the management group. |
| | | **children** complex | always | The list of children. |
| | | | **display\_name** string | always | The friendly name of the child resource. |
| | | | **id** string | always | The fully qualified ID for the child resource (management group or subscription). For example /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000. |
| | | | **name** string | always | The name of the child entity. |
| | | | **type** string | always | The fully qualified resource type which includes provider namespace. For example /providers/Microsoft.Management/managementGroups. |
| | | **parent** complex | always | The parent of the management group. |
| | | | **display\_name** string | always | The friendly name of the parent management group. |
| | | | **id** string | always | The fully qualified ID for the parent management group. For example /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000. |
| | | | **name** string | always | The name of the parent management group |
| | | **updated\_by** string | always | The identity of the principal or process that updated the object. |
| | | **updated\_time** string | always | The date and time when this object was last updated. |
| | | **version** string | always | The version number of the object. |
| | **display\_name** string | always | The friendly name of the management group. |
| | **roles** string | always | The role definitions associated with the management group. |
| | **tenant\_id** string | always | The AAD Tenant ID associated with the management group. For example 00000000-0000-0000-0000-000000000000. |
| **type** string | always | The type of the resource. For example /providers/Microsoft.Management/managementGroups. |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_azurefirewall_info – Get AzureFirewall info azure.azcollection.azure\_rm\_azurefirewall\_info – Get AzureFirewall info
==========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_azurefirewall_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get info of AzureFirewall.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Resource name. |
| **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 | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: List all Azure Firewalls for a given subscription
azure_rm_azurefirewall_info:
- name: List all Azure Firewalls for a given resource group
azure_rm_azurefirewall_info:
resource_group: myResourceGroup
- name: Get Azure Firewall
azure_rm_azurefirewall_info:
resource_group: myResourceGroup
name: myAzureFirewall
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **firewalls** complex | always | A list of dict results where the key is the name of the AzureFirewall and the values are the facts for that AzureFirewall. |
| | **etag** string | always | Gets a unique read-only string that changes whenever the resource is updated. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ myResourceGroup/providers/Microsoft.Network/azureFirewalls/myAzureFirewall |
| | **ip\_configurations** list / elements=string | success | IP configuration of the Azure Firewall resource. |
| | **location** string | always | Resource location. **Sample:** eastus |
| | **name** string | always | Resource name. **Sample:** myAzureFirewall |
| | **nat\_rule\_collections** list / elements=string | success | Collection of NAT rule collections used by Azure Firewall. |
| | **network\_rule\_collections** list / elements=string | success | Collection of network rule collections used by Azure Firewall. |
| | **provisioning\_state** string | success | The current state of the gallery. **Sample:** Succeeded |
| | **tags** dictionary | always | Resource tags. **Sample:** {'tag': 'value'} |
### Authors
* Liu Qingyi (@smile37773)
ansible azure.azcollection.azure_rm_devtestlabarmtemplate_info – Get Azure DevTest Lab ARM Template facts azure.azcollection.azure\_rm\_devtestlabarmtemplate\_info – Get Azure DevTest Lab ARM Template facts
====================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabarmtemplate_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure DevTest Lab ARM Template.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **artifact\_source\_name** string / required | | The name of the artifact source. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **lab\_name** string / required | | The name of the lab. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the ARM template. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get information on DevTest Lab ARM Template
azure_rm_devtestlabarmtemplate_info:
resource_group: myResourceGroup
lab_name: myLab
artifact_source_name: public environment repo
name: WebApp
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **arm\_templates** complex | always | A list of dictionaries containing facts for DevTest Lab ARM Template. |
| | **artifact\_source\_name** string | always | Artifact source name. **Sample:** public environment repo |
| | **description** string | always | The tags of the resource. **Sample:** This template creates an Azure Web App without a data store. |
| | **display\_name** string | always | The tags of the resource. **Sample:** Web App |
| | **id** string | always | The identifier of the resource. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DevTestLab/labs/myLab/art ifactSources/public environment repo/armTemplates/WebApp |
| | **lab\_name** string | always | DevTest Lab name. **Sample:** myLab |
| | **name** string | always | ARM Template name. **Sample:** WebApp |
| | **publisher** string | always | The tags of the resource. **Sample:** Microsoft |
| | **resource\_group** string | always | Resource group name. **Sample:** myResourceGroup |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible azure.azcollection.azure_rm – Azure Resource Manager inventory plugin azure.azcollection.azure\_rm – Azure Resource Manager inventory plugin
======================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
Synopsis
--------
* Query VM details from Azure Resource Manager
* Requires a YAML configuration file whose name ends with ‘azure\_rm.(yml|yaml)’
* By default, sets `ansible_host` to the first public IP address found (preferring the primary NIC). If no public IPs are found, the first private IP (also preferring the primary NIC). The default may be overridden via `hostvar_expressions`; see examples.
Requirements
------------
The below requirements are needed on the local controller node that executes this inventory.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | Configuration | 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 0.0.1 of azure.azcollection | | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| | Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **batch\_fetch** string | **Default:**"yes" | | To improve performance, results are fetched using an unsupported batch API. Disabling `batch_fetch` uses a much slower serial fetch, resulting in many more round-trips. Generally only useful for troubleshooting. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| | 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **compose** dictionary | **Default:**{} | | Create vars from jinja2 expressions. |
| **conditional\_groups** string | | | A mapping of group names to Jinja2 expressions. When the mapped expression is true, the host is added to the named group. |
| **default\_host\_filters** string | **Default:**["powerstate != \"running\"", "provisioning\_state != \"succeeded\""] | | A default set of filters that is applied in addition to the conditions in `exclude_host_filters` to exclude powered-off and not-fully-provisioned hosts. Set this to a different value or empty list if you need to include hosts in these states. |
| **exclude\_host\_filters** string | **Default:**[] | | Excludes hosts from the inventory with a list of Jinja2 conditional expressions. Each expression in the list is evaluated for each host; when the expression is true, the host is excluded from the inventory. |
| **fail\_on\_template\_errors** string | **Choices:*** True
* False
**Default:**"yes" | | When false, template failures during group and filter processing are silently ignored (eg, if a filter or group expression refers to an undefined host variable) |
| **groups** dictionary | **Default:**{} | | Add hosts to group based on Jinja2 conditionals. |
| **hostnames** list / elements=string | **Default:**["default"] | | A list of Jinja2 expressions in order of precedence to compose inventory\_hostname. Ignores expression if result is an empty string or None value. By default, inventory\_hostname is generated to be globally unique based on the VM host name. See `plain_host_names` for more details on the default. An expression of 'default' will force using the default hostname generator if no previous hostname expression resulted in a valid hostname. Use ``default\_inventory\_hostname`` to access the default hostname generator's value in any of the Jinja2 expressions. |
| **hostvar\_expressions** string | | | A mapping of hostvar names to Jinja2 expressions. The value for each host is the result of the Jinja2 expression (which may refer to any of the host's existing variables at the time this inventory plugin runs). |
| **include\_vm\_resource\_groups** string | **Default:**["\*"] | | A list of resource group names to search for virtual machines. '\\*' will include all resource groups in the subscription. |
| **include\_vmss\_resource\_groups** string | **Default:**[] | | A list of resource group names to search for virtual machine scale sets (VMSSs). '\\*' will include all resource groups in the subscription. |
| **keyed\_groups** list / elements=string | **Default:**[] | | Creates groups based on the value of a host variable. Requires a list of dictionaries, defining `key` (the source dictionary-typed variable), `prefix` (the prefix to use for the new group name), and optionally `separator` (which defaults to `_`) |
| **leading\_separator** boolean added in 2.11 of ansible.builtin | **Choices:*** no
* **yes** ←
| | Use in conjunction with keyed\_groups. By default, a keyed group that does not have a prefix or a separator provided will have a name that starts with an underscore. This is because the default prefix is "" and the default separator is "\_". Set this option to False to omit the leading underscore (or other separator) if no prefix is given. If the group name is derived from a mapping the separator is still used to concatenate the items. To not use a separator in the group name at all, set the separator for the keyed group to an empty string instead. |
| **log\_mode** string | | | Parent argument. |
| **log\_path** string | | | Parent argument. |
| **password** string | | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **plain\_host\_names** boolean added in 2.8 of azure.azcollection | **Choices:*** **no** ←
* yes
| | By default this plugin will use globally unique host names. This option allows you to override that, and use the name that matches the old inventory script naming. This is not the default, as these names are not truly unique, and can conflict with other hosts. The default behavior will add extra hashing to the end of the hostname to prevent such conflicts. |
| **plugin** string / required | **Choices:*** azure\_rm
* azure.azcollection.azure\_rm
| | marks this as an instance of the 'azure\_rm' plugin |
| **profile** string | | | Security profile found in ~/.azure/credentials file. |
| **secret** string | | | Azure client secret. Use when authenticating with a Service Principal. |
| **strict** boolean | **Choices:*** **no** ←
* yes
| | 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. |
| **subscription\_id** string | | | Your Azure subscription Id. |
| **tenant** string | | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **use\_contrib\_script\_compatible\_sanitization** boolean added in 2.8 of azure.azcollection | **Choices:*** **no** ←
* yes
| | 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 and matches the sanitization of groups when the script's ``replace\_dash\_in\_groups`` option is set to ``False``. To replicate behavior of ``replace\_dash\_in\_groups = True`` with constructed groups, you will need to replace hyphens with underscores via the regex\_replace filter for those entries. 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. |
| **use\_extra\_vars** boolean added in 2.11 of ansible.builtin | **Choices:*** **no** ←
* yes
| ini entries: [inventory\_plugins]use\_extra\_vars = no env:ANSIBLE\_INVENTORY\_USE\_EXTRA\_VARS | Merge extra vars into the available variables for composition (highest precedence). |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
# The following host variables are always available:
# public_ipv4_addresses: all public IP addresses, with the primary IP config from the primary NIC first
# public_dns_hostnames: all public DNS hostnames, with the primary IP config from the primary NIC first
# private_ipv4_addresses: all private IP addressses, with the primary IP config from the primary NIC first
# id: the VM's Azure resource ID, eg /subscriptions/00000000-0000-0000-1111-1111aaaabb/resourceGroups/my_rg/providers/Microsoft.Compute/virtualMachines/my_vm
# location: the VM's Azure location, eg 'westus', 'eastus'
# name: the VM's resource name, eg 'myvm'
# os_profile: The VM OS properties, a dictionary, only system is currently available, eg 'os_profile.system not in ['linux']'
# powerstate: the VM's current power state, eg: 'running', 'stopped', 'deallocated'
# provisioning_state: the VM's current provisioning state, eg: 'succeeded'
# tags: dictionary of the VM's defined tag values
# resource_type: the VM's resource type, eg: 'Microsoft.Compute/virtualMachine', 'Microsoft.Compute/virtualMachineScaleSets/virtualMachines'
# vmid: the VM's internal SMBIOS ID, eg: '36bca69d-c365-4584-8c06-a62f4a1dc5d2'
# vmss: if the VM is a member of a scaleset (vmss), a dictionary including the id and name of the parent scaleset
# availability_zone: availability zone in which VM is deployed, eg '1','2','3'
#
# The following host variables are sometimes availble:
# computer_name: the Operating System's hostname. Will not be available if azure agent is not available and picking it up.
# sample 'myazuresub.azure_rm.yaml'
# required for all azure_rm inventory plugin configs
plugin: azure.azcollection.azure_rm
# forces this plugin to use a CLI auth session instead of the automatic auth source selection (eg, prevents the
# presence of 'ANSIBLE_AZURE_RM_X' environment variables from overriding CLI auth)
auth_source: cli
# fetches VMs from an explicit list of resource groups instead of default all (- '*')
include_vm_resource_groups:
- myrg1
- myrg2
# fetches VMs from VMSSs in all resource groups (defaults to no VMSS fetch)
include_vmss_resource_groups:
- '*'
# places a host in the named group if the associated condition evaluates to true
conditional_groups:
# since this will be true for every host, every host sourced from this inventory plugin config will be in the
# group 'all_the_hosts'
all_the_hosts: true
# if the VM's "name" variable contains "dbserver", it will be placed in the 'db_hosts' group
db_hosts: "'dbserver' in name"
# adds variables to each host found by this inventory plugin, whose values are the result of the associated expression
hostvar_expressions:
my_host_var:
# A statically-valued expression has to be both single and double-quoted, or use escaped quotes, since the outer
# layer of quotes will be consumed by YAML. Without the second set of quotes, it interprets 'staticvalue' as a
# variable instead of a string literal.
some_statically_valued_var: "'staticvalue'"
# overrides the default ansible_host value with a custom Jinja2 expression, in this case, the first DNS hostname, or
# if none are found, the first public IP address.
ansible_host: (public_dns_hostnames + public_ipv4_addresses) | first
# change how inventory_hostname is generated. Each item is a jinja2 expression similar to hostvar_expressions.
hostnames:
- tags.vm_name
- default # special var that uses the default hashed name
# places hosts in dynamically-created groups based on a variable value.
keyed_groups:
# places each host in a group named 'tag_(tag name)_(tag value)' for each tag on a VM.
- prefix: tag
key: tags
# places each host in a group named 'azure_loc_(location name)', depending on the VM's location
- prefix: azure_loc
key: location
# places host in a group named 'some_tag_X' using the value of the 'sometag' tag on a VM as X, and defaulting to the
# value 'none' (eg, the group 'some_tag_none') if the 'sometag' tag is not defined for a VM.
- prefix: some_tag
key: tags.sometag | default('none')
# excludes a host from the inventory when any of these expressions is true, can refer to any vars defined on the host
exclude_host_filters:
# excludes hosts in the eastus region
- location in ['eastus']
# excludes hosts that are powered off
- powerstate != 'running'
```
ansible azure.azcollection.azure_rm_virtualmachineextension – Managed Azure Virtual Machine extension azure.azcollection.azure\_rm\_virtualmachineextension – Managed Azure Virtual Machine extension
===============================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualmachineextension`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete Azure Virtual Machine Extension.
* Note that this module was called M(azure\_rm\_virtualmachine\_extension) before Ansible 2.8. The usage did not change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **auto\_upgrade\_minor\_version** boolean | **Choices:*** no
* yes
| Whether the extension handler should be automatically upgraded across minor versions. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **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 vm extension. |
| **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. |
| **protected\_settings** string | | Json formatted protected settings for the extension. |
| **publisher** string | | The name of the extension handler publisher. |
| **resource\_group** string / required | | Name of a resource group where the vm extension exists or will be created. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **settings** string | | Json formatted public settings for the extension. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the vm extension. Use `present` to create or update a vm extension and `absent` to delete a vm extension. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **type\_handler\_version** string | | The type version of the extension handler. |
| **virtual\_machine\_extension\_type** string | | The type of the extension handler. |
| **virtual\_machine\_name** string | | The name of the virtual machine where the extension should be create or updated. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create VM Extension
azure_rm_virtualmachineextension:
name: myvmextension
location: eastus
resource_group: myResourceGroup
virtual_machine_name: myvm
publisher: Microsoft.Azure.Extensions
virtual_machine_extension_type: CustomScript
type_handler_version: 2.0
settings: '{"commandToExecute": "hostname"}'
auto_upgrade_minor_version: true
- name: Delete VM Extension
azure_rm_virtualmachineextension:
name: myvmextension
location: eastus
resource_group: myResourceGroup
virtual_machine_name: myvm
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Whether or not the resource has changed. **Sample:** True |
| **state** dictionary | always | Current state of the vm extension. **Sample:** {'state': 'Deleted'} |
### Authors
* Sertac Ozercan (@sozercan)
* Julien Stroheker (@julienstroheker)
| programming_docs |
ansible azure.azcollection.azure_rm_dnsrecordset_info – Get DNS Record Set facts azure.azcollection.azure\_rm\_dnsrecordset\_info – Get DNS Record Set facts
===========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_dnsrecordset_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific DNS Record Set in a Zone, or a specific type in all Zones or in one Zone etc.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **record\_type** string | | Limit record sets by record type. |
| **relative\_name** string | | Only show results for a Record Set. |
| **resource\_group** string | | Limit results by resource group. Required when filtering by name or type. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **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. |
| **top** integer | | Limit the maximum number of record sets to return. |
| **zone\_name** string | | Limit results by zones. Required when filtering by name or type. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one Record Set
azure_rm_dnsrecordset_info:
resource_group: myResourceGroup
zone_name: example.com
relative_name: server10
record_type: A
- name: Get facts for all Type A Record Sets in a Zone
azure_rm_dnsrecordset_info:
resource_group: myResourceGroup
zone_name: example.com
record_type: A
- name: Get all record sets in one zone
azure_rm_dnsrecordset_info:
resource_group: myResourceGroup
zone_name: example.com
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_dnsrecordset** list / elements=string | always | List of record set dicts. **Sample:** [{'etag': '60ac0480-44dd-4881-a2ed-680d20b3978e', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/dnszones/newzone.com/A/servera', 'name': 'servera', 'properties': {'ARecords': [{'ipv4Address': '10.4.5.7'}, {'ipv4Address': '2.4.5.8'}], 'TTL': 12900}, 'type': 'Microsoft.Network/dnszones/A'}] |
| **dnsrecordsets** list / elements=string | always | List of record set dicts, which shares the same hierarchy as M(azure\_rm\_dnsrecordset) module's parameter. |
| | **fqdn** string | success | Fully qualified domain name of the record set. **Sample:** www.newzone.com |
| | **id** string | success | ID of the dns recordset. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/dnszones/newzone. com/A/servera |
| | **provisioning\_state** string | success | Provision state of the resource. **Sample:** Successed |
| | **record\_type** string | success | The type of the record set. Can be `A`, `AAAA`, `CNAME`, `MX`, `NS`, `SRV`, `TXT`, `PTR`. **Sample:** A |
| | **records** string | success | List of records depending on the type of recordset. **Sample:** [{'ipv4Address': '10.4.5.7'}, {'ipv4Address': '2.4.5.8'}] |
| | **relative\_name** string | success | Name of the dns recordset. **Sample:** servera |
| | **time\_to\_live** string | success | Time to live of the record set in seconds. **Sample:** 12900 |
### Authors
* Ozi Boms (@ozboms)
ansible azure.azcollection.azure_rm_eventhub – Manage Event Hub azure.azcollection.azure\_rm\_eventhub – Manage Event Hub
=========================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_eventhub`.
New in version 1.6.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Event Hub.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **message\_retention\_in\_days** integer | | Number of days to retain the events for this Event Hub. |
| **name** string | | Unique name of the Event Hub. |
| **namespace\_name** string / required | | Name of the namespace in which to create event hub. |
| **partition\_count** integer | | Number of partitions created for the Event Hub. Range from 1 to 32. |
| **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 / required | | Name of the resource group to which the resource belongs. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | **Choices:*** **Basic** ←
* Standard
| The name of the SKU. Please see L(https://azure.microsoft.com/en-in/pricing/details/event-hubs/). |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Event Hub. Use `present` to create or update an event hub and `absent` to delete it. |
| **status** string | **Choices:*** **Active** ←
* Disabled
* Restoring
* SendDisabled
* ReceiveDisabled
* Creating
* Deleting
* Renaming
* Unknown
| Enumerates the possible values for the status of the Event hub. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: "Create Event Hub"
azure_rm_eventhub:
resource_group: testgroupans
location: eastus
namespace_name: myNamespace
name: myhub
tags:
- a: b
sku: free
- name: Delete Event Hub
azure_rm_eventhub:
resource_group: testgroupans
name: myNamespace
state: absent
- name: "Create Event Hub Namespace"
azure_rm_eventhub:
resource_group: testgroupans
location: eastus
namespace_name: myNamespace
tags:
a: b
sku: free
- name: Delete Event Hub Namespace
azure_rm_eventhub:
resource_group: testgroupans
namespace_name: myNamespace
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** dictionary | always | Current state of the Event Hub namesapce or Event Hub. **Sample:** {'additional\_properties': {'location': 'East US'}, 'created\_at': '2021-04-29T10:05:20.377Z', 'critical': False, 'enabled': True, 'message\_retention\_in\_days': 7, 'metric\_id': None, 'name': 'testnaedd3d22d3w', 'namespace\_type': 'eventHub', 'partition\_count': 4, 'partition\_ids': ['0', '1', '2', '3'], 'region': None, 'scale\_unit': None, 'service\_bus\_endpoint': 'https://testnaedd3d22d3w.servicebus.windows.net:443/', 'sku': 'Basic', 'status': 'Active', 'tags': {'a': 'b'}, 'type': 'Microsoft.eventHubs/namespaces', 'updated\_at': '2021-04-29T10:05:24.000Z'} |
### Authors
* Praveen Ghuge (@praveenghuge)
* Karl Dasan (@karldas30)
* Saurabh Malpani(@saurabh3796)
ansible azure.azcollection.azure_rm_aduser_info – Get Azure Active Directory user info azure.azcollection.azure\_rm\_aduser\_info – Get Azure Active Directory user info
=================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_aduser_info`.
New in version 1.4.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get Azure Active Directory user info.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **all** boolean | **Choices:*** no
* yes
| If True, will return all users in tenant. If False will return no users. It is recommended that you instead identify a subset of users and use filter. Mutually exclusive with *object\_id*, *attribute\_name*, *odata\_filter* and *user\_principal\_name*. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **attribute\_name** string | | The name of an attribute that you want to match to attribute\_value. If attribute\_name is not a collection type it will return users where attribute\_name is equal to attribute\_value. If attribute\_name is a collection type it will return users where attribute\_value is in attribute\_name. Mutually exclusive with *object\_id*, *user\_principal\_name*, *odata\_filter* and *all*. Required together with *attribute\_value*. |
| **attribute\_value** string | | The value to match attribute\_name to. If attribute\_name is not a collection type it will return users where attribute\_name is equal to attribute\_value. If attribute\_name is a collection type it will return users where attribute\_value is in attribute\_name. Required together with *attribute\_name*. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **object\_id** string | | The object id for the user. returns the user who has this object ID. Mutually exclusive with *user\_principal\_name*, *attribute\_name*, *odata\_filter* and *all*. |
| **odata\_filter** string | | returns users based on the the OData filter passed into this parameter. Mutually exclusive with *object\_id*, *attribute\_name*, *user\_principal\_name* and *all*. |
| **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. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string / required | | The tenant ID. |
| **user\_principal\_name** string | | The principal name of the user. returns the user who has this principal name. Mutually exclusive with *object\_id*, *attribute\_name*, *odata\_filter* and *all*. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Using user_principal_name
azure.azcollection.azure_rm_aduser_info:
user_principal_name: [email protected]
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- name: Using object_id
azure.azcollection.azure_rm_aduser_info:
object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- name: Using attribute mailNickname - not a collection
azure.azcollection.azure_rm_aduser_info:
attribute_name: mailNickname
attribute_value: users_mailNickname
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- name: Using attribute proxyAddresses - a collection
azure.azcollection.azure_rm_aduser_info:
attribute_name: proxyAddresses
attribute_value: SMTP:[email protected]
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- name: Using Filter mailNickname
azure.azcollection.azure_rm_aduser_info:
odata_filter: mailNickname eq '[email protected]'
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- name: Using Filter proxyAddresses
azure.azcollection.azure_rm_aduser_info:
odata_filter: proxyAddresses/any(c:c eq 'SMTP:[email protected]')
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **account\_enabled** boolean | always | Whether the account is enabled. |
| **display\_name** string | always | The display name of the user. **Sample:** John Smith |
| **mail** string | always | The primary email address of the user. **Sample:** [email protected] |
| **mail\_nickname** string | always | The mail alias for the user. **Sample:** jsmith |
| **object\_id** string | always | The object\_id for the user. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| **user\_principal\_name** string | always | The principal name of the user. **Sample:** [email protected] |
| **user\_type** string | always | A string value that can be used to classify user types in your directory. **Sample:** Member |
### Authors
* Cole Neubauer(@coleneubauer)
| programming_docs |
ansible azure.azcollection.azure_rm_rediscache – Manage Azure Cache for Redis instance azure.azcollection.azure\_rm\_rediscache – Manage Azure Cache for Redis instance
================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_rediscache`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure Cache for Redis.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **enable\_non\_ssl\_port** boolean | **Choices:*** **no** ←
* yes
| When set *enable\_non\_ssl\_port=true*, the non-ssl Redis server port 6379 will be enabled. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **maxfragmentationmemory\_reserved** string | | Configures the amount of memory in MB that is reserved to accommodate for memory fragmentation. Please see <https://docs.microsoft.com/en-us/azure/redis-cache/cache-configure#advanced-settings> for more detail. |
| **maxmemory\_policy** string | **Choices:*** volatile\_lru
* allkeys\_lru
* volatile\_random
* allkeys\_random
* volatile\_ttl
* noeviction
| Configures the eviction policy of the cache. Please see <https://docs.microsoft.com/en-us/azure/redis-cache/cache-configure#advanced-settings> for more detail. |
| **maxmemory\_reserved** string | | Configures the amount of memory in MB that is reserved for non-cache operations. Please see <https://docs.microsoft.com/en-us/azure/redis-cache/cache-configure#advanced-settings> for more detail. |
| **name** string / required | | Unique name of the Azure Cache for Redis to create or update. |
| **notify\_keyspace\_events** string | | Allows clients to receive notifications when certain events occur. Please see <https://docs.microsoft.com/en-us/azure/redis-cache/cache-configure#advanced-settings> for more detail. |
| **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. |
| **reboot** string | | Reboot specified Redis node(s). There can be potential data loss. |
| | **reboot\_type** string | **Choices:*** primary
* secondary
* **all** ←
| Which Redis node(s) to reboot. |
| | **shard\_id** integer | | If clustering is enabled, the id of the shard to be rebooted. |
| **regenerate\_key** string | | Regenerate Redis cache's access keys. |
| | **key\_type** string | **Choices:*** primary
* secondary
| The Redis key to regenerate. |
| **resource\_group** string / required | | Name of the resource group to which the resource belongs. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **shard\_count** integer | | The number of shards to be created when *sku=premium*. |
| **sku** string | | SKU info of Azure Cache for Redis. |
| | **name** string / required | **Choices:*** basic
* standard
* premium
| Type of Azure Cache for Redis to deploy. |
| | **size** string / required | **Choices:*** C0
* C1
* C2
* C3
* C4
* C5
* C6
* P1
* P2
* P3
* P4
| Size of Azure Cache for Redis to deploy. When *sku=basic* or *sku=standard*, allowed values are `C0`, `C1`, `C2`, `C3`, `C4`, `C5`, `C6`. When *sku=premium*, allowed values are `P1`, `P2`, `P3`, `P4`. Please see <https://docs.microsoft.com/en-us/rest/api/redis/redis/create#sku> for allowed values. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Azure Cache for Redis. Use `present` to create or update an Azure Cache for Redis and `absent` to delete it. |
| **static\_ip** string | | Static IP address. Required when deploying an Azure Cache for Redis inside an existing Azure virtual network. |
| **subnet** string | | Subnet in a virtual network to deploy the Azure Cache for Redis in. It can be resource id of subnet, for example /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. It can be a dictionary where contains *name*, *virtual\_network\_name* and *resource\_group*.
*name*. Name of the subnet.
*resource\_group*. Resource group name of the subnet.
*virtual\_network\_name*. Name of virtual network to which this subnet belongs. |
| **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. |
| **tenant\_settings** dictionary | | Dict of tenant settings. |
| **wait\_for\_provisioning** boolean | **Choices:*** no
* **yes** ←
| Wait till the Azure Cache for Redis instance provisioning\_state is Succeeded. It takes several minutes for Azure Cache for Redis to be provisioned ready for use after creating/updating/rebooting. Set this option to `true` to wait for provisioning\_state. Set to `false` if you don't care about provisioning\_state. Poll wait timeout is 60 minutes. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create an Azure Cache for Redis
azure_rm_rediscache:
resource_group: myResourceGroup
name: myRedis
sku:
name: basic
size: C1
- name: Scale up the Azure Cache for Redis
azure_rm_rediscache:
resource_group: myResourceGroup
name: myRedis
sku:
name: standard
size: C1
tags:
testing: foo
- name: Force reboot the redis cache
azure_rm_rediscache:
resource_group: myResourceGroup
name: myRedisCache
reboot:
reboot_type: all
- name: Create Azure Cache for Redis with subnet
azure_rm_rediscache:
resource_group: myResourceGroup
name: myRedis
sku:
name: premium
size: P1
subnet: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirt
ualNetwork/subnets/mySubnet"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **host\_name** string | when *state=present* | Host name of the Azure Cache for Redis. **Sample:** myredis.redis.cache.windows.net |
| **id** string | always | Id of the Azure Cache for Redis. **Sample:** /subscriptions/xxxxxxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Cache/Redis/myRedis |
### Authors
* Yunge Zhu(@yungezz)
ansible azure.azcollection.azure_rm_keyvault_info – Get Azure Key Vault facts azure.azcollection.azure\_rm\_keyvault\_info – Get Azure Key Vault facts
========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_keyvault_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure Key Vault.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the key vault. |
| **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 | | The name of the resource group to which the key vault belongs. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** list / elements=string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get Key Vault by name
azure_rm_keyvault_info:
resource_group: myResourceGroup
name: myVault
- name: List Key Vaults in specific resource group
azure_rm_keyvault_info:
resource_group: myResourceGroup
- name: List Key Vaults in current subscription
azure_rm_keyvault_info:
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **keyvaults** list / elements=string | always | List of Azure Key Vaults. |
| | **access\_policies** list / elements=string | always | List of policies. |
| | | **object\_id** string | always | The object if of a user, service principal or security group in AAD for the vault. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | | **permissions** complex | always | Permissions the identity has for keys, secrets and certificates. |
| | | | **certificates** list / elements=string | always | Permissions to secrets. **Sample:** ['get', 'import'] |
| | | | **keys** list / elements=string | always | Permissions to keys. **Sample:** ['get', 'create'] |
| | | | **secrets** list / elements=string | always | Permissions to secrets. **Sample:** ['list', 'set'] |
| | | **tenant\_id** string | always | The AAD tenant iD that should be used for authenticating requests to the key vault. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | **enable\_purge\_protection** boolean | always | Property specifying whether protection against purge is enabled for this vault. |
| | **enable\_soft\_delete** boolean | always | Property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. **Sample:** True |
| | **enabled\_for\_deployments** boolean | always | Whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault. |
| | **enabled\_for\_disk\_encryption** boolean | always | Whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys. |
| | **enabled\_for\_template\_deployment** boolean | always | Whether Azure Resource Manager is permitted to retrieve secrets from the key vault. |
| | **id** string | always | Resource Id of the vault. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVault |
| | **location** string | always | Location of the vault. **Sample:** eastus |
| | **name** string | always | Name of the vault. **Sample:** myVault |
| | **sku** dictionary | always | Sku of the vault. |
| | | **family** string | always | Sku family name. **Sample:** A |
| | | **name** string | always | Sku name. **Sample:** standard |
| | **tags** list / elements=string | success | List of tags. **Sample:** ['foo'] |
| | **vault\_uri** string | always | Vault uri. **Sample:** https://myVault.vault.azure.net/ |
### Authors
* Yunge Zhu (@yungezz)
| programming_docs |
ansible azure.azcollection.azure_rm_storageblob – Manage blob containers and blob objects azure.azcollection.azure\_rm\_storageblob – Manage blob containers and blob objects
===================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_storageblob`.
New in version 0.0.1: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete blob containers and blob objects.
* Use to upload a file and store it as a blob object, or download a blob object to a file(upload and download mode)
* Use to upload a batch of files under a given directory(batch upload mode)
* In the batch upload mode, the existing blob object will be overwritten if a blob object with the same name is to be created.
* the module can work exclusively in three modes, when `batch_upload_src` is set, it is working in batch upload mode; when `src` is set, it is working in upload mode and when `dst` is set, it is working in dowload mode.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **batch\_upload\_dst** string | | Base directory in container when upload batch of files. |
| **batch\_upload\_src** string | | Batch upload source directory. Use with state `present` to upload batch of files under the directory. |
| **blob** string | | Name of a blob object within the container.
aliases: blob\_name |
| **blob\_type** string added in 0.0.1 of azure.azcollection | **Choices:*** **block** ←
* page
| Type of blob object. |
| **cache\_control** string | | Set the blob cache-control header. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **container** string / required | | Name of a blob container within the storage account.
aliases: container\_name |
| **content\_disposition** string | | Set the blob content-disposition header. |
| **content\_encoding** string | | Set the blob encoding header. |
| **content\_language** string | | Set the blob content-language header. |
| **content\_md5** string | | Set the blob md5 hash value. |
| **content\_type** string | | Set the blob content-type header. For example `image/png`. |
| **dest** string | | Destination file path. Use with state `present` to download a blob.
aliases: destination |
| **force** boolean | **Choices:*** **no** ←
* yes
| Overwrite existing blob or file when uploading or downloading. Force deletion of a container that contains blobs. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **public\_access** string | **Choices:*** container
* blob
| A container's level of public access. By default containers are private. Can only be set at time of container creation. |
| **resource\_group** string / required | | Name of the resource group to use.
aliases: resource\_group\_name |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **src** string | | Source file path. Use with state `present` to upload a blob.
aliases: source |
| **state** string | **Choices:*** absent
* **present** ←
| State of a container or blob. Use state `absent` with a container value only to delete a container. Include a blob value to remove a specific blob. A container will not be deleted, if it contains blobs. Use the *force* option to override, deleting the container and all associated blobs. Use state `present` to create or update a container and upload or download a blob. If the container does not exist, it will be created. If it exists, it will be updated with configuration options. Provide a blob name and either src or dest to upload or download. Provide a src path to upload and a dest path to download. If a blob (uploading) or a file (downloading) already exists, it will not be overwritten unless *force=true*. |
| **storage\_account\_name** string / required | | Name of the storage account to use.
aliases: account\_name, storage\_account |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Remove container foo
azure_rm_storageblob:
resource_group: myResourceGroup
storage_account_name: clh0002
container: foo
state: absent
- name: Create container foo and upload a file
azure_rm_storageblob:
resource_group: myResourceGroup
storage_account_name: clh0002
container: foo
blob: graylog.png
src: ./files/graylog.png
public_access: container
content_type: 'application/image'
- name: Download the file
azure_rm_storageblob:
resource_group: myResourceGroup
storage_account_name: clh0002
container: foo
blob: graylog.png
dest: ~/tmp/images/graylog.png
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **blob** dictionary | when a blob is operated on | Facts about the current state of the blob. **Sample:** {'content\_length': 136532, 'content\_settings': {'cache\_control': None, 'content\_disposition': None, 'content\_encoding': None, 'content\_language': None, 'content\_md5': None, 'content\_type': 'application/image'}, 'last\_modified': '09-Mar-2016 22:08:25 +0000', 'name': 'graylog.png', 'tags': {}, 'type': 'BlockBlob'} |
| **container** dictionary | always | Facts about the current state of the selected container. **Sample:** {'last\_modified': '09-Mar-2016 19:28:26 +0000', 'name': 'foo', 'tags': {}} |
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
ansible azure.azcollection.azure_rm_cdnendpoint_info – Get Azure CDN endpoint facts azure.azcollection.azure\_rm\_cdnendpoint\_info – Get Azure CDN endpoint facts
==============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_cdnendpoint_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific Azure CDN endpoint or all Azure CDN endpoints.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Limit results to a specific Azure CDN endpoint. |
| **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. |
| **profile\_name** string / required | | Name of CDN profile. |
| **resource\_group** string / required | | Name of resource group where this CDN profile belongs to. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for all endpoints in CDN profile
azure_rm_cdnendpoint_info:
resource_group: myResourceGroup
profile_name: myCDNProfile
- name: Get facts of specific CDN endpoint
azure_rm_cdnendpoint_info:
resource_group: myResourceGroup
profile_name: myCDNProfile
name: myEndpoint1
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **cdnendpoints** complex | always | List of Azure CDN endpoints. |
| | **content\_types\_to\_compress** list / elements=string | success | List of content types on which compression applies. **Sample:** ['text/plain', 'text/html', 'text/css', 'text/javascript', 'application/x-javascript', 'application/javascript', 'application/json', 'application/xml'] |
| | **id** string | success | ID of the Azure CDN endpoint. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myCDN/providers/Microsoft.Cdn/profiles/myProfile/endpoints/myEndpoint1 |
| | **is\_compression\_enabled** boolean | success | Indicates whether content compression is enabled on CDN. **Sample:** True |
| | **is\_http\_allowed** boolean | success | Indicates whether HTTP traffic is allowed on the endpoint. **Sample:** True |
| | **is\_https\_allowed** boolean | success | Indicates whether HTTPS traffic is allowed on the endpoint. **Sample:** True |
| | **location** string | success | Location of the Azure CDN endpoint. **Sample:** WestUS |
| | **name** string | always | Name of the Azure CDN endpoint. **Sample:** myEndpoint |
| | **origin\_host\_header** string | success | The host header value sent to the origin with each request. **Sample:** xxxxxxxx.blob.core.windows.net |
| | **origin\_path** string | success | A directory path on the origin that CDN can use to retrieve content from. **Sample:** /pic/ |
| | **origins** string | success | The source of the content being delivered via CDN. **Sample:** {'host\_name': 'xxxxxxxx.blob.core.windows.net', 'http\_port': None, 'https\_port': None, 'name': 'xxxxxxxx-blob-core-windows-net'} |
| | **profile\_name** string | always | Name of the Azure CDN profile that this endpoint is attached to. **Sample:** myProfile |
| | **provisioning\_state** string | success | Provisioning status of the Azure CDN endpoint. **Sample:** Succeeded |
| | **query\_string\_caching\_behavior** string | success | Defines how CDN caches requests that include query strings. **Sample:** IgnoreQueryString |
| | **resource\_group** string | always | Name of a resource group where the Azure CDN endpoint exists. **Sample:** myResourceGroup |
| | **resource\_state** string | success | Resource status of the profile. **Sample:** Running |
| | **tags** list / elements=string | success | The tags of the Azure CDN endpoint. **Sample:** foo |
### Authors
* Hai Cao (@caohai)
* Yunge zhu (@yungezz)
| programming_docs |
ansible azure.azcollection.azure_rm_keyvaultsecret_info – Get Azure Key Vault secret facts azure.azcollection.azure\_rm\_keyvaultsecret\_info – Get Azure Key Vault secret facts
=====================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_keyvaultsecret_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure Key Vault secret.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Secret name. If not set, will list all secrets in vault\_uri. |
| **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. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **show\_deleted\_secret** boolean | **Choices:*** **no** ←
* yes
| Set to *show\_delete\_secret=true* to show deleted secrets. Set to *show\_deleted\_secret=false* to show not deleted secrets. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** dictionary | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **vault\_uri** string / required | | Vault uri where the secret stored in. |
| **version** string | **Default:**"current" | Secret version. Set it to `current` to show latest version of a secret. Set it to `all` to list all versions of a secret. Set it to specific version to list specific version of a secret. eg. fd2682392a504455b79c90dd04a1bf46 |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get latest version of specific secret
azure_rm_keyvaultsecret_info:
vault_uri: "https://myVault.vault.azure.net"
name: mySecret
- name: List all versions of specific secret
azure_rm_keyvaultsecret_info:
vault_uri: "https://myVault.vault.azure.net"
name: mySecret
version: all
- name: List specific version of specific secret
azure_rm_keyvaultsecret_info:
vault_uri: "https://myVault.vault.azure.net"
name: mySecret
version: fd2682392a504455b79c90dd04a1bf46
- name: List all secrets in specific key vault
azure_rm_keyvaultsecret_info:
vault_uri: "https://myVault.vault.azure.net"
- name: List deleted secrets in specific key vault
azure_rm_keyvaultsecret_info:
vault_uri: "https://myVault.vault.azure.net"
show_deleted_secret: True
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **secrets** complex | always | List of secrets in Azure Key Vault. |
| | **attributes** dictionary | success | Secret attributes. |
| | | **created** string | always | Creation datetime. **Sample:** 2019-04-25T07:26:49+00:00 |
| | | **enabled** string | always | Indicate whether the secret is enabled. **Sample:** True |
| | | **expires** string | success | Expiration datetime. **Sample:** 2019-04-25T07:26:49+00:00 |
| | | **not\_before** string | success | Not before datetime. **Sample:** 2019-04-25T07:26:49+00:00 |
| | | **recovery\_level** string | always | Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable' the secret can be permanently deleted by a privileged user, Otherwise, only the system can purge the secret, at the end of the retention interval. **Sample:** Recoverable+Purgeable |
| | | **updated** string | always | Update datetime. **Sample:** 2019-04-25T07:26:49+00:00 |
| | **content\_type** string | always | Content type (optional) **Sample:** mysecrettype |
| | **secret** string | always | secret value. **Sample:** mysecretvault |
| | **sid** string | always | Secret identifier. **Sample:** https://myVault.vault.azure.net/flexsecret/secret1/fd2682392a504455b79c90dd04a1bf46 |
| | **tags** dictionary | always | Tags of the secret. **Sample:** {'delete': 'on-exit'} |
| | **version** string | always | Secret version. **Sample:** fd2682392a504455b79c90dd04a1bf46 |
### Authors
* Jose Angel Munoz (@imjoseangel)
ansible azure.azcollection.azure_rm_sqlserver – Manage SQL Server instance azure.azcollection.azure\_rm\_sqlserver – Manage SQL Server instance
====================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_sqlserver`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of SQL Server.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **admin\_password** string | | The administrator login password (required for server creation). |
| **admin\_username** string | | Administrator username for the server. Once created it cannot be changed. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **identity** string | | The identity type. Set this to `SystemAssigned` in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include `SystemAssigned`. |
| **location** string | | Resource location. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the server. |
| **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 / required | | The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the SQL server. Use `present` to create or update a server and use `absent` to delete a server. |
| **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. |
| **version** string | | The version of the server. For example `12.0`. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) SQL Server
azure_rm_sqlserver:
resource_group: myResourceGroup
name: server_name
location: westus
admin_username: mylogin
admin_password: Testpasswordxyz12!
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **fully\_qualified\_domain\_name** string | always | The fully qualified domain name of the server. **Sample:** sqlcrudtest-4645.database.windows.net |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Sql/servers/sqlcrudtest-4645 |
| **state** string | always | The state of the server. **Sample:** state |
| **version** string | always | The version of the server. **Sample:** 12.0 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_ipgroup_info – Get IP group facts azure.azcollection.azure\_rm\_ipgroup\_info – Get IP group facts
================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_ipgroup_info`.
New in version 1.6.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for specified IP group or all IP groups in a given resource group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Name of the IP group. |
| **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 | | Name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** dictionary | | Limit the results by providing resource tags. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one IP group
azure_rm_ipgroup_info:
resource_group: myAzureResourceGroup
name: myipgroup
- name: Get facts for all IP groups in resource group
azure_rm_ipgroup_info:
resource_group: myAzureResourceGroup
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **ipgroups** list / elements=dictionary | always | Gets a list of IP groups. **Sample:** [{'etag': 'c67388ea-6dab-481b-9387-bd441c0d32f8', 'firewalls': [], 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MyAzureResourceGroup/providers/ Microsoft.Network/ipGroups/myipgroup', 'ip\_addresses': ['13.64.39.16/32', '40.74.146.80/31', '40.74.147.32/28'], 'location': 'eastus', 'name': 'myipgroup', 'provisioning\_state': 'Succeeded', 'tags': {'key1': 'value1'}}] |
### Authors
* Aparna Patil (@techcon65)
| programming_docs |
ansible azure.azcollection.azure_rm_cdnendpoint – Manage a Azure CDN endpoint azure.azcollection.azure\_rm\_cdnendpoint – Manage a Azure CDN endpoint
=======================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_cdnendpoint`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update, start, stop and delete a Azure CDN endpoint.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **content\_types\_to\_compress** list / elements=string | | List of content types on which compression applies. This value should be a valid MIME type. |
| **is\_compression\_enabled** boolean | **Choices:*** **no** ←
* yes
| Indicates whether content compression is enabled on CDN. |
| **is\_http\_allowed** boolean | **Choices:*** no
* **yes** ←
| Indicates whether HTTP traffic is allowed on the endpoint. |
| **is\_https\_allowed** boolean | **Choices:*** no
* **yes** ←
| Indicates whether HTTPS traffic is allowed on the endpoint. |
| **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 Azure CDN endpoint. |
| **origin\_host\_header** string | | The host header value sent to the origin with each request. |
| **origin\_path** string | | A directory path on the origin that CDN can use to retrieve content from. E.g. contoso.cloudapp.net/originpath. |
| **origins** string / required | | Set of source of the content being delivered via CDN. |
| | **host\_name** string / required | | The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. |
| | **http\_port** integer | | The value of the HTTP port. Must be between `1` and `65535`. |
| | **https\_port** integer | | The value of the HTTPS port. Must be between `1` and `65535`. |
| | **name** string / required | | Origin name. |
| **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. |
| **profile\_name** string / required | | Name of the CDN profile where the endpoint attached to. |
| **purge** boolean | **Choices:*** no
* yes
| Use with *state=present* to purge the endpoint. |
| **purge\_content\_paths** list / elements=string | **Default:**["/"] | Use with *state=present* and *purge=true* to specify content paths to be purged. |
| **query\_string\_caching\_behavior** string | **Choices:*** **ignore\_query\_string** ←
* bypass\_caching
* use\_query\_string
* not\_set
| Defines how CDN caches requests that include query strings. |
| **resource\_group** string / required | | Name of a resource group where the Azure CDN endpoint exists or will be created. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **started** boolean | **Choices:*** no
* yes
| Use with *state=present* to start the endpoint. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Azure CDN endpoint. Use `present` to create or update a Azure CDN endpoint and `absent` to delete it. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a Azure CDN endpoint
azure_rm_cdnendpoint:
resource_group: myResourceGroup
profile_name: myProfile
name: myEndpoint
origins:
- name: TestOrig
host_name: "www.example.com"
tags:
testing: testing
delete: on-exit
foo: bar
- name: Delete a Azure CDN endpoint
azure_rm_cdnendpoint:
resource_group: myResourceGroup
profile_name: myProfile
name: myEndpoint
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **host\_name** string | always | Host name of the CDN endpoint. **Sample:** myendpoint.azureedge.net |
| **id** string | always | Id of the CDN endpoint. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/Microsoft.Cdn/profiles/myProfile/endpoints/ myEndpoint |
| **state** string | always | Current state of the Azure CDN endpoint. |
### Authors
* Yunge Zhu (@yungezz)
ansible azure.azcollection.azure_rm_postgresqldatabase_info – Get Azure PostgreSQL Database facts azure.azcollection.azure\_rm\_postgresqldatabase\_info – Get Azure PostgreSQL Database facts
============================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_postgresqldatabase_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of PostgreSQL Database.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the database. |
| **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 / required | | The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string / required | | The name of the server. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of PostgreSQL Database
azure_rm_postgresqldatabase_info:
resource_group: myResourceGroup
server_name: server_name
name: database_name
- name: List instances of PostgreSQL Database
azure_rm_postgresqldatabase_info:
resource_group: myResourceGroup
server_name: server_name
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **databases** complex | always | A list of dict results where the key is the name of the PostgreSQL Database and the values are the facts for that PostgreSQL Database. |
| | **charset** string | always | The charset of the database. **Sample:** UTF8 |
| | **collation** string | always | The collation of the database. **Sample:** English\_United States.1252 |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/testser ver/databases/db1 |
| | **name** string | always | Resource name. **Sample:** db1 |
| | **resource\_group** string | always | Resource group name. **Sample:** testrg |
| | **server\_name** string | always | Server name. **Sample:** testserver |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_keyvaultsecret – Use Azure KeyVault Secrets azure.azcollection.azure\_rm\_keyvaultsecret – Use Azure KeyVault Secrets
=========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_keyvaultsecret`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create or delete a secret within a given keyvault.
* By using Key Vault, you can encrypt keys and secrets.
* Such as authentication keys, storage account keys, data encryption keys, .PFX files, and passwords.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **content\_type** string | | Type of the secret value such as a password. |
| **keyvault\_uri** string / required | | URI of the keyvault endpoint. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **secret\_name** string / required | | Name of the keyvault secret. |
| **secret\_value** string | | Secret to be secured by keyvault. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the subnet. Use `present` to create or update a secret and `absent` to delete a secret . |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a secret
azure_rm_keyvaultsecret:
secret_name: MySecret
secret_value: My_Pass_Sec
keyvault_uri: https://contoso.vault.azure.net/
tags:
testing: testing
delete: never
- name: Delete a secret
azure_rm_keyvaultsecret:
secret_name: MySecret
keyvault_uri: https://contoso.vault.azure.net/
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | success | Current state of the secret. |
| | **secret\_id** string | success | Secret resource path. **Sample:** https://contoso.vault.azure.net/secrets/hello/e924f053839f4431b35bc54393f98423 |
### Authors
* Ian Philpot (@iphilpot)
| programming_docs |
ansible azure.azcollection.azure_rm_vpnsite – Manage Azure VpnSite instance azure.azcollection.azure\_rm\_vpnsite – Manage Azure VpnSite instance
=====================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_vpnsite`.
New in version 1.5.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure VpnSite.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **ad\_user** string | | Active Directory username. Use when authenticating with an Active Directory user rather than service principal. |
| **address\_space** dictionary | | The AddressSpace that contains an array of IP address ranges. |
| | **address\_prefixes** list / elements=string | | A list of address blocks reserved for this virtual network in CIDR notation. |
| **adfs\_authority\_url** string added in 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **bgp\_properties** dictionary | | The set of bgp properties. |
| | **asn** integer | | The BGP speaker's ASN. |
| | **bgp\_peering\_address** string | | The BGP peering address and BGP identifier of this BGP speaker. |
| | **bgp\_peering\_addresses** list / elements=string | | BGP peering address with IP configuration ID for virtual network gateway. |
| | | **custom\_bgp\_ip\_addresses** list / elements=string | | The list of custom BGP peering addresses which belong to IP configuration. |
| | | **default\_bgp\_ip\_addresses** list / elements=string | | The list of default BGP peering addresses which belong to IP configuration. |
| | | **ipconfiguration\_id** string | | The ID of IP configuration which belongs to gateway. |
| | | **tunnel\_ip\_addresses** list / elements=string | | The list of tunnel public IP addresses which belong to IP configuration. |
| | **peer\_weight** integer | | The weight added to routes learned from this BGP speaker. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **device\_properties** dictionary | | The device properties. |
| | **device\_model** string | | Model of the device. |
| | **device\_vendor** string | | Name of the device Vendor. |
| | **link\_speed\_in\_mbps** integer | | Link speed. |
| **ip\_address** string | | The ip-address for the vpn-site. |
| **is\_security\_site** boolean | **Choices:*** no
* yes
| IsSecuritySite flag. |
| **location** string | | The location of the VpnSite |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the VpnSite. |
| **o365\_policy** dictionary | | Office365 Policy. |
| | **break\_out\_categories** dictionary | | Office365 breakout categories. |
| | | **allow** boolean | **Choices:*** no
* yes
| Flag to control allow category. |
| | | **default** boolean | **Choices:*** no
* yes
| Flag to control default category. |
| | | **optimize** boolean | **Choices:*** no
* yes
| Flag to control optimize category. |
| **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 / required | | The resource group name of the VpnSite. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **site\_key** string | | The key for vpn-site that can be used for connections. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the VpnSite. Use `present` to create or update an VpnSite and `absent` to delete it. |
| **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. |
| **virtual\_wan** dictionary | | The VirtualWAN to which the vpnSite belongs. |
| | **id** string | | The resource ID of the related virtual wan. |
| **vpn\_site\_links** list / elements=string | | List of all vpn site links. |
| | **bgp\_properties** dictionary | | The set of bgp properties. |
| | | **asn** integer | | The BGP speaker's ASN. |
| | | **bgp\_peering\_address** string | | The BGP peering address and BGP identifier of this BGP speaker. |
| | **fqdn** string | | FQDN of vpn-site-link. |
| | **ip\_address** string | | The IP address for the vpn site link. |
| | **link\_properties** dictionary | | The link provider properties. |
| | | **link\_provider\_name** string | | Name of the link provider. |
| | | **link\_speed\_in\_mbps** integer | | Link speed. |
| | **name** string | | The name of the resource that is unique within a resource group. This name can be used to access the resource. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create VpnSite
azure_rm_vpnsite:
resource_group: myResourceGroup
name: vpnSite_name
- name: Delete Vpn Site
azure_rm_vpnsite:
resource_group: myResourceGroup
name: vpnSite_name
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | success | Current state of the vpn site. |
| | **device\_properties** complex | always | The device properties. |
| | | **device\_vendor** string | always | Name of the device Vendor. **Sample:** {'link\_speed\_in\_mbps': 0} |
| | **etag** string | always | A unique read-only string that changes whenever the resource is updated. **Sample:** 8d7415fe-d92c-4331-92ea-460aadfb9648 |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxx-xxx/resourceGroups/v-xisuRG/providers/Microsoft.Network/vpnSites/vpn\_site\_name |
| | **is\_security\_site** boolean | always | IsSecuritySite flag. |
| | **location** string | always | Resource location. **Sample:** eastus |
| | **name** string | always | Resource name. **Sample:** vpn\_site\_name |
| | **provisioning\_state** string | always | The provisioning state of the VPN site resource. **Sample:** Succeeded |
| | **tags** dictionary | always | Resource tags. **Sample:** {'key1': 'value1'} |
| | **type** string | always | Resource type. **Sample:** Microsoft.Network/vpnSites |
| | **virtual\_wan** complex | always | The VirtualWAN to which the vpnSite belongs. |
| | | **id** string | always | Resource ID. **Sample:** /subscriptions/xxx-xxx/resourceGroups/v-xisuRG/providers/Microsoft.Network/virtualWans/virtualwan\_name |
### Authors
* Fred-Sun (@Fred-Sun)
ansible azure.azcollection.azure_rm_trafficmanagerprofile_info – Get Azure Traffic Manager profile facts azure.azcollection.azure\_rm\_trafficmanagerprofile\_info – Get Azure Traffic Manager profile facts
===================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_trafficmanagerprofile_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a Azure specific Traffic Manager profile or all Traffic Manager profiles.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Limit results to a specific Traffic Manager profile. |
| **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 | | The resource group to search for the desired Traffic Manager profile. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one Traffic Manager profile
azure_rm_trafficmanager_info:
name: Testing
resource_group: myResourceGroup
- name: Get facts for all Traffic Manager profiles
azure_rm_trafficmanager_info:
- name: Get facts by tags
azure_rm_trafficmanager_info:
tags:
- Environment:Test
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **tms** complex | always | List of Traffic Manager profiles. |
| | **dns\_config** complex | always | The DNS settings of the Traffic Manager profile. |
| | | **fqdn** string | always | The fully-qualified domain name(FQDN) of the Traffic Manager profile. **Sample:** testTm.trafficmanager.net |
| | | **relative\_name** string | always | The relative DNS name provided by the Traffic Manager profile. **Sample:** testTm |
| | | **ttl** integer | always | The DNS Time-To-Live(TTL), in seconds. **Sample:** 60 |
| | **endpoints** complex | always | The list of endpoints in the Traffic Manager profile. |
| | | **geo\_mapping** list / elements=string | always | The list of countries/regions mapped to this endpoint when the profile has routing\_method `geographic`. **Sample:** ['GEO-NA', 'GEO-AS'] |
| | | **id** string | always | Fully qualified resource ID for the resource. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/trafficMan agerProfiles/tmtest/externalEndpoints/e1 |
| | | **location** string | always | The location of endpoints when *type=external\_endpoints* or *type=nested\_endpoints*, and profile *routing\_method=performance*. **Sample:** East US |
| | | **min\_child\_endpoints** integer | always | The minimum number of endpoints that must be available in the child profile to make the parent profile available. **Sample:** 3 |
| | | **name** string | always | The name of the endpoint. **Sample:** e1 |
| | | **priority** string | always | The priority of this endpoint when the profile has *routing\_method=priority*. **Sample:** 3 |
| | | **status** string | always | The status of the endpoint. **Sample:** Enabled |
| | | **target** string | always | The fully-qualified DNS name of the endpoint. **Sample:** 8.8.8.8 |
| | | **target\_resource\_id** string | always | The Azure Resource URI of the of the endpoint. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/dom ainNames/vscjavaci |
| | | **type** string | always | The type of the endpoint. **Sample:** external\_endpoints |
| | | **weight** integer | always | The weight of this endpoint when the profile has *routing\_method=weighted*. **Sample:** 10 |
| | **location** string | always | Location of the Traffic Manager profile. **Sample:** global |
| | **monitor\_config** complex | always | The endpoint monitoring settings of the Traffic Manager profile. |
| | | **interval** integer | always | The monitor interval for endpoints in this profile in seconds. **Sample:** 10 |
| | | **path** string | always | The path relative to the endpoint domain name used to probe for endpoint health. **Sample:** / |
| | | **port** integer | always | The TCP port used to probe for endpoint health. **Sample:** 80 |
| | | **protocol** string | always | The protocol `HTTP`, `HTTPS` or `TCP` used to probe for endpoint health. **Sample:** HTTP |
| | | **timeout** integer | always | The monitor timeout for endpoints in this profile in seconds. **Sample:** 30 |
| | | **tolerated\_failures** integer | always | The number of consecutive failed health check before declaring an endpoint Degraded after the next failed health check. **Sample:** 3 |
| | **name** string | always | Name of the Traffic Manager profile. **Sample:** testTm |
| | **profile\_status** string | always | The status of the Traffic Manager profile. **Sample:** Enabled |
| | **resource\_group** string | always | Name of a resource group where the Traffic Manager profile exists. **Sample:** testGroup |
| | **routing\_method** string | always | The traffic routing method of the Traffic Manager profile. **Sample:** performance |
| | **state** string | always | The state of the Traffic Manager profile. **Sample:** present |
### Authors
* Hai Cao (@caohai)
* Yunge Zhu (@yungezz)
| programming_docs |
ansible azure.azcollection.azure_rm_roleassignment – Manage Azure Role Assignment azure.azcollection.azure\_rm\_roleassignment – Manage Azure Role Assignment
===========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_roleassignment`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create and delete instance of Azure Role Assignment.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **assignee\_object\_id** string | | The object id of assignee. This maps to the ID inside the Active Directory. It can point to a user, service principal or security group. Required when creating role assignment.
aliases: assignee |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **id** string | | Fully qualified id of assignment to delete or create. Mutually Exclusive with *scope* and *name*
|
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Unique name of role assignment. The role assignment name must be a GUID, sample as "3ce0cbb0-58c4-4e6d-a16d-99d86a78b3ca". Mutually Exclusive with *id*
|
| **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. |
| **role\_definition\_id** string | | The role definition id used in the role assignment. Required when creating role assignment. |
| **scope** string | | The scope of the role assignment to create. For example, use /subscriptions/{subscription-id}/ for subscription. /subscriptions/{subscription-id}/resourceGroups/{resource-group-name} for resource group. /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name} for resource. Mutually Exclusive with *id*
|
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the role assignment. Use `present` to create or update a role assignment and `absent` to delete it. If `present`, then *role\_definition\_id* and *assignee\_object\_id* are both required |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a role assignment
azure_rm_roleassignment:
scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
assignee_object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
role_definition_id:
"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
- name: Create a role assignment
azure_rm_roleassignment:
name: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
assignee_object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
role_definition_id:
"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
- name: Delete a role assignment
azure_rm_roleassignment:
name: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
state: absent
- name: Delete a role assignment
azure_rm_roleassignment:
id: /subscriptions/xxx-sub-guid-xxx/resourceGroups/rgname/providers/Microsoft.Authorization/roleAssignments/xxx-assign-guid-xxx"
- name: Delete a role assignment
azure_rm_roleassignment:
scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
assignee_object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
role_definition_id:
"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **assignee\_object\_id** string | always | Principal Id of the role assignee. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| **id** string | always | Id of current role assignment. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleAssignments/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| **name** string | always | Name of role assignment. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| **principal\_type** string | always | Principal type of the role assigned to. **Sample:** ServicePrincipal |
| **role\_definition\_id** string | always | Role definition id that was assigned to principal\_id. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| **scope** string | always | The role assignment scope. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| **type** string | always | Type of role assignment. **Sample:** Microsoft.Authorization/roleAssignments |
### Authors
* Yunge Zhu(@yungezz)
* Paul Aiton(@paultaiton)
ansible azure.azcollection.azure_rm_adgroup – Manage Azure Active Directory group azure.azcollection.azure\_rm\_adgroup – Manage Azure Active Directory group
===========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_adgroup`.
New in version 1.6.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete Azure Active Directory group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **absent\_members** list / elements=string | | The azure ad objects asserted to not be members of the group. |
| **absent\_owners** list / elements=string | | The azure ad objects asserted to not be owners of the group. |
| **ad\_user** string | | Active Directory username. Use when authenticating with an Active Directory user rather than service principal. |
| **adfs\_authority\_url** string added in 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **display\_name** string | | The display name of the ad group. Can be used with *mail\_nickname* instead of *object\_id* to reference existing group. Required when creating a new ad group. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **mail\_nickname** string | | The mail nickname of the ad group. Can be used with *display\_name* instead of *object\_id* to reference existing group. Required when creating a new ad group. |
| **object\_id** string | | The object id for the ad group. Can be used to reference when updating an existing group. Ignored when attempting to create a group. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **present\_members** list / elements=string | | The azure ad objects asserted to be members of the group. This list does not need to be all inclusive. Objects that are members and not on this list remain members. |
| **present\_owners** list / elements=string | | The azure ad objects asserted to be owners of the group. This list does not need to be all inclusive. Objects that are owners and not on this list remain members. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the resource group. Use `present` to create or update and `absent` to delete. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string / required | | The tenant ID. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create Group
azure_rm_adgroup:
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
display_name: "Group-Name"
mail_nickname: "Group-Mail-Nickname"
state: 'present'
- name: Delete Group using display_name and mail_nickname
azure_rm_adgroup:
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
display_name: "Group-Name"
mail_nickname: "Group-Mail-Nickname"
state: 'absent'
- name: Delete Group using object_id
azure_rm_adgroup:
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
state: 'absent'
- name: Ensure Users are Members of a Group using display_name and mail_nickname
azure_rm_adgroup:
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
display_name: "Group-Name"
mail_nickname: "Group-Mail-Nickname"
state: 'present'
present_members:
- "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ ad_object_1_object_id }}"
- "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ ad_object_2_object_id }}"
- name: Ensure Users are Members of a Group using object_id
azure_rm_adgroup:
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
state: 'present'
present_members:
- "https://graph.windows.net/{{ ad_object_1_tenant_id }}/directoryObjects/{{ ad_object_1_object_id }}"
- "https://graph.windows.net/{{ ad_object_2_tenant_id }}/directoryObjects/{{ ad_object_2_object_id }}"
- name: Ensure Users are not Members of a Group using display_name and mail_nickname
azure_rm_adgroup:
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
display_name: "Group-Name"
mail_nickname: "Group-Mail-Nickname"
state: 'present'
absent_members:
- "{{ ad_object_1_object_id }}"
- name: Ensure Users are Members of a Group using object_id
azure_rm_adgroup:
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
state: 'present'
absent_members:
- "{{ ad_object_1_object_id }}"
- name: Ensure Users are Owners of a Group using display_name and mail_nickname
azure_rm_adgroup:
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
display_name: "Group-Name"
mail_nickname: "Group-Mail-Nickname"
state: 'present'
present_owners:
- "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ ad_object_1_object_id }}"
- "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ ad_object_2_object_id }}"
- name: Ensure Users are Owners of a Group using object_id
azure_rm_adgroup:
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
state: 'present'
present_owners:
- "https://graph.windows.net/{{ ad_object_1_tenant_id }}/directoryObjects/{{ ad_object_1_object_id }}"
- "https://graph.windows.net/{{ ad_object_2_tenant_id }}/directoryObjects/{{ ad_object_2_object_id }}"
- name: Ensure Users are not Owners of a Group using display_name and mail_nickname
azure_rm_adgroup:
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
display_name: "Group-Name"
mail_nickname: "Group-Mail-Nickname"
state: 'present'
absent_owners:
- "{{ ad_object_1_object_id }}"
- "{{ ad_object_2_object_id }}"
- name: Ensure Users are Owners of a Group using object_id
azure_rm_adgroup:
tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
state: 'present'
absent_owners:
- "{{ ad_object_1_object_id }}"
- "{{ ad_object_2_object_id }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **display\_name** string | always | The display name of the group. **Sample:** GroupName |
| **group\_members** list / elements=string | always | The members of the group. |
| **group\_owners** list / elements=string | always | The owners of the group. |
| **mail** string | always | The primary email address of the group. **Sample:** [email protected] |
| **mail\_enabled** boolean | always | Whether the group is mail-enabled. Must be false. This is because only pure security groups can be created using the Graph API. |
| **mail\_nickname** string | always | The mail alias for the group. **Sample:** groupname |
| **object\_id** string | always | The object\_id for the group. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| **security\_enabled** boolean | always | Whether the group is security-enable. |
### Authors
* Cole Neubauer(@coleneubauer)
| programming_docs |
ansible azure.azcollection.azure_rm_cognitivesearch – Manage Azure Cognitive Search service azure.azcollection.azure\_rm\_cognitivesearch – Manage Azure Cognitive Search service
=====================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_cognitivesearch`.
New in version 1.4.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete Azure Cognitive Search service.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **hosting\_mode** string | **Choices:*** **default** ←
* highDensity
| Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be 'default'. |
| **identity** string | **Choices:*** **None** ←
* SystemAssigned
| The identity for the resource. |
| **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 | | The name of the Azure Cognitive Search service. Search service names must only contain lowercase letters, digits or dashes. Cannot use dash as the first two or last one characters. Cannot contain consecutive dashes. Must be between 2 and 60 characters in length. Search service names must be globally unique. You cannot change the service name after the service is created. |
| **network\_rule\_set** list / elements=string | | Network specific rules that determine how the Azure Cognitive Search service may be reached. |
| **partition\_count** integer | **Default:**1 | The number of partitions in the search service. It can be `1`, `2`, `3`, `4`, `6`, or `12`. Values greater than 1 are only valid for standard SKUs. For 'standard3' services with hostingMode set to 'highDensity', the allowed values are between 1 and 3. |
| **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. |
| **public\_network\_access** string | **Choices:*** **enabled** ←
* disabled
| This value can be set to `enabled` to avoid breaking changes on existing customer resources and templates. If set to `enabled`, traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method. |
| **replica\_count** integer | **Default:**1 | The number of replicas in the search service. It must be a value between 1 and 12 inclusive for *sku=standard*. It must be a value between 1 and 3 inclusive for *sku=basic*. |
| **resource\_group** string / required | | The name of the resource group within the current subscription. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | **Choices:*** free
* **basic** ←
* standard
* standard2
* standard3
* storage\_optimized\_l1
* storage\_optimized\_l2
| The SKU of the Search Service, which determines price tier and capacity limits. This property is required when creating a new Search Service. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the search instance. Set to `present` to create or update a search instance. Set to `absent` to remove a search instance. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create Azure Cognitive Search
azure_rm_cognitivesearch:
resource_group: myResourceGroup
name: myAzureSearch
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** dictionary | always | Info for Azure Cognitive Search. |
| | **hosting\_mode** string | always | Type of hosting mode selected. **Sample:** default |
| | **id** string | always | The unique identifier associated with this Azure Cognitive Search. **Sample:** /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| | **identity** dictionary | always | The identity of the Azure Cognitive Search Service. **Sample:** {'principal\_id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'type': 'SystemAssigned'} |
| | | **principal\_id** string | success | Identifier assigned. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | | **type** string | always | Identity type. **Sample:** SystemAssigned |
| | **location** string | always | The geo-location where the Azure Cognitive Search Service lives. **Sample:** West Europe |
| | **name** string | always | The name of the Azure Cognitive Search Service. **Sample:** myazuresearch |
| | **network\_rule\_set** list / elements=string | always | Network specific rules that determine how the Azure Cognitive Search service may be reached. **Sample:** ['1.1.1.1', '8.8.8.8/31'] |
| | **partition\_count** integer | always | The number of partitions in the Azure Cognitive Search Service. **Sample:** 3 |
| | **provisioning\_state** string | always | The state of the provisioning state of Azure Cognitive Search Service. **Sample:** succeeded |
| | **public\_network\_access** string | always | If it's allowed traffic over public interface. **Sample:** enabled |
| | **replica\_count** integer | always | The number of replicas in the Azure Cognitive Search Service. **Sample:** 3 |
| | **sku** string | always | The SKU of the Azure Cognitive Search Service. **Sample:** standard |
| | **status** string | always | The state of the Azure Cognitive Search. **Sample:** Active running |
| | **tags** dictionary | always | The resource tags. **Sample:** {'tag1': 'abc'} |
### Authors
* David Duque Hernández (@next-davidduquehernandez)
ansible azure.azcollection.azure_rm_virtualmachineimage_info – Get virtual machine image facts azure.azcollection.azure\_rm\_virtualmachineimage\_info – Get virtual machine image facts
=========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualmachineimage_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for virtual machine images.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **location** string / required | | Azure location value, for example `westus`, `eastus`, `eastus2`, `northcentralus`, etc. Supplying only a location value will yield a list of available publishers for the location. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **offer** string | | Name of an image offering. Combine with SKU to see a list of available image versions. |
| **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. |
| **publisher** string | | Name of an image publisher. List image offerings associated with a particular publisher. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | | Image offering SKU. Combine with offer to see a list of available versions. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **version** string | | Specific version number of an image. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for a specific image
azure_rm_virtualmachineimage_info:
location: eastus
publisher: OpenLogic
offer: CentOS
sku: '7.1'
version: '7.1.20160308'
- name: List available versions
azure_rm_virtualmachineimage_info:
location: eastus
publisher: OpenLogic
offer: CentOS
sku: '7.1'
- name: List available offers
azure_rm_virtualmachineimage_info:
location: eastus
publisher: OpenLogic
- name: List available publishers
azure_rm_virtualmachineimage_info:
location: eastus
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_vmimages** list / elements=string | always | List of image dicts. **Sample:** [{'id': '/Subscriptions/xxx...xxx/Providers/Microsoft.Compute/Locations/eastus/ Publishers/OpenLogic/ArtifactTypes/VMImage/Offers/CentOS/Skus/7.1/Versions/7.1.20150410', 'location': 'eastus', 'name': '7.1.20150410'}, {'id': '/Subscriptions/xxx...xxx/Providers/Microsoft.Compute/Locations/eastus/ Publishers/OpenLogic/ArtifactTypes/VMImage/Offers/CentOS/Skus/7.1/Versions/7.1.20150605', 'location': 'eastus', 'name': '7.1.20150605'}, {'id': '/Subscriptions/xxx...xxx/Providers/Microsoft.Compute/Locations/eastus/ Publishers/OpenLogic/ArtifactTypes/VMImage/Offers/CentOS/Skus/7.1/Versions/7.1.20150731', 'location': 'eastus', 'name': '7.1.20150731'}, {'id': '/Subscriptions/xxx...xxx/Providers/Microsoft.Compute/Locations/eastus/ Publishers/OpenLogic/ArtifactTypes/VMImage/Offers/CentOS/Skus/7.1/Versions/7.1.20160308', 'location': 'eastus', 'name': '7.1.20160308'}] |
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
| programming_docs |
ansible azure.azcollection.azure_rm_webapp_info – Get Azure web app facts azure.azcollection.azure\_rm\_webapp\_info – Get Azure web app facts
====================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_webapp_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific web app or all web app in a resource group, or all web app in current subscription.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Only show results for a specific web app. |
| **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 | | Limit results by resource group. |
| **return\_publish\_profile** boolean | **Choices:*** **no** ←
* yes
| Indicate whether to return publishing profile of the web app. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for web app by name
azure_rm_webapp_info:
resource_group: myResourceGroup
name: winwebapp1
- name: Get facts for web apps in resource group
azure_rm_webapp_info:
resource_group: myResourceGroup
- name: Get facts for web apps with tags
azure_rm_webapp_info:
tags:
- testtag
- foo:bar
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **webapps** complex | always | List of web apps. |
| | **app\_settings** dictionary | always | App settings of the application. Only returned when web app has app settings. **Sample:** {'testkey': 'testvalue', 'testkey2': 'testvalue2'} |
| | **availability\_state** string | always | Availability of this web app. **Sample:** Normal |
| | **default\_host\_name** string | always | Host name of the web app. **Sample:** vxxisurg397winapp4.azurewebsites.net |
| | **enabled** boolean | always | Indicates the web app enabled or not. **Sample:** True |
| | **enabled\_host\_names** list / elements=string | always | Enabled host names of the web app. **Sample:** ['vxxisurg397winapp4.azurewebsites.net', 'vxxisurg397winapp4.scm.azurewebsites.net'] |
| | **frameworks** list / elements=string | always | Frameworks of the application. Only returned when web app has frameworks. **Sample:** [{'name': 'net\_framework', 'version': 'v4.0'}, {'name': 'java', 'settings': {'java\_container': 'tomcat', 'java\_container\_version': '8.5'}, 'version': '1.7'}, {'name': 'php', 'version': '5.6'}] |
| | **ftp\_publish\_url** string | always | Publishing URL of the web app when deployment type is FTP. **Sample:** ftp://xxxx.ftp.azurewebsites.windows.net |
| | **host\_name\_ssl\_states** list / elements=string | always | SSL state per host names of the web app. **Sample:** [{'hostType': 'Standard', 'name': 'vxxisurg397winapp4.azurewebsites.net', 'sslState': 'Disabled'}, {'hostType': 'Repository', 'name': 'vxxisurg397winapp4.scm.azurewebsites.net', 'sslState': 'Disabled'}] |
| | **host\_names** list / elements=string | always | Host names of the web app. **Sample:** ['vxxisurg397winapp4.azurewebsites.net'] |
| | **id** string | always | ID of the web app. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp |
| | **location** string | always | Location of the web app. **Sample:** eastus |
| | **name** string | always | Name of the web app. **Sample:** winwebapp1 |
| | **outbound\_ip\_addresses** string | always | Outbound IP address of the web app. **Sample:** 40.71.11.131,40.85.166.200,168.62.166.67,137.135.126.248,137.135.121.45 |
| | **plan** string | always | ID of app service plan used by the web app. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Web/serverfarms/myAppServicePlan |
| | **publishing\_password** string | only when *return\_publish\_profile=True*. | Publishing profile password. **Sample:** uvANsPQpGjWJmrFfm4Ssd5rpBSqGhjMk11pMSgW2vCsQtNx9tcgZ0xN26s9A |
| | **publishing\_username** string | only when *return\_publish\_profile=True*. | Publishing profile user name. **Sample:** $vxxisuRG397winapp4 |
| | **resource\_group** string | always | Resource group of the web app. **Sample:** myResourceGroup |
| | **state** string | always | State of the web app. **Sample:** running |
| | **tags** dictionary | always | Tags assigned to the resource. Dictionary of string:string pairs. **Sample:** {'tag1': 'abc'} |
### Authors
* Yunge Zhu (@yungezz)
ansible azure.azcollection.azure_rm_devtestlabvirtualmachine_info – Get Azure DevTest Lab Virtual Machine facts azure.azcollection.azure\_rm\_devtestlabvirtualmachine\_info – Get Azure DevTest Lab Virtual Machine facts
==========================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabvirtualmachine_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure DevTest Lab Virtual Machine.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **lab\_name** string / required | | The name of the lab. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the virtual machine. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** list / elements=string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of DTL Virtual Machine
azure_rm_devtestlabvirtualmachine_info:
resource_group: myResourceGroup
lab_name: myLab
name: myVm
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **virtualmachines** complex | always | A list of dictionaries containing facts for DevTest Lab Virtual Machine. |
| | **compute\_vm\_id** string | always | Resource id of compute virtual machine. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myLab-myVm-097933/providers/Microsoft.Compute/virtualMachines/myVm |
| | **compute\_vm\_name** string | always | Name of compute virtual machine. **Sample:** myVm |
| | **compute\_vm\_resource\_group** string | always | Resource group where compute virtual machine is created. **Sample:** myLab-myVm-097933 |
| | **disallow\_public\_ip\_address** boolean | always | Whether public IP should be not allowed. |
| | **expiration\_date** string | always | Virtual machine expiration date. **Sample:** 2029-02-22T01:49:12.117974Z |
| | **fqdn** string | always | Fully qualified domain name. **Sample:** myvm.eastus.cloudapp.azure.com |
| | **id** string | always | The identifier of the virtual machine. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/myLab/virt ualmachines/myVm |
| | **image** complex | always | Gallery image reference. |
| | | **offer** string | when created from gallery image | The offer of the gallery image. **Sample:** UbuntuServer |
| | | **os\_type** string | when created from gallery image | Operating system type. **Sample:** Linux |
| | | **publisher** string | when created from gallery image | The publisher of the gallery image. **Sample:** Canonical |
| | | **sku** string | when created from gallery image | The SKU of the gallery image. **Sample:** 16.04-LTS |
| | | **version** string | when created from gallery image | The version of the gallery image. **Sample:** latest |
| | **lab\_name** string | always | Name of the lab. **Sample:** myLab |
| | **name** string | always | Name of the virtual machine. **Sample:** myVm |
| | **notes** string | always | Notes of the virtual machine. **Sample:** My VM notes |
| | **os\_type** string | always | Operating system type. **Sample:** linux |
| | **provisioning\_state** string | always | Provisioning state of the virtual network. **Sample:** Succeeded |
| | **resource\_group** string | always | Name of the resource group. **Sample:** myResourceGroup |
| | **storage\_type** string | always | Storage type to use for virtual machine. **Sample:** standard |
| | **tags** complex | always | The tags of the resource. **Sample:** { 'foo': 'bar' } |
| | **user\_name** string | always | Admin user name. **Sample:** dtl\_admin |
| | **vm\_size** string | always | Virtual machine size. **Sample:** Standard\_A2\_v2 |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible azure.azcollection.azure_rm_functionapp_info – Get Azure Function App facts azure.azcollection.azure\_rm\_functionapp\_info – Get Azure Function App facts
==============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_functionapp_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for one Azure Function App or all Function Apps within a resource group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Only show results for a specific Function App. |
| **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 | | Limit results to a resource group. Required when filtering by name.
aliases: resource\_group\_name |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one Function App
azure_rm_functionapp_info:
resource_group: myResourceGroup
name: myfunctionapp
- name: Get facts for all Function Apps in a resource group
azure_rm_functionapp_info:
resource_group: myResourceGroup
- name: Get facts for all Function Apps by tags
azure_rm_functionapp_info:
tags:
- testing
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_functionapps** list / elements=string | always | List of Azure Function Apps dicts. **Sample:** {'availability\_state': 'Normal', 'client\_affinity\_enabled': True, 'client\_cert\_enabled': False, 'container\_size': 1536, 'daily\_memory\_time\_quota': 0, 'default\_host\_name': 'myfunctionapp.azurewebsites.net', 'enabled': True, 'enabled\_host\_names': ['myfunctionapp.azurewebsites.net', 'myfunctionapp.scm.azurewebsites.net'], 'host\_name\_ssl\_states': [{'host\_type': 'Standard', 'name': 'myfunctionapp.azurewebsites.net', 'ssl\_state': 'Disabled'}, {'host\_type': 'Repository', 'name': 'myfunctionapp.scm.azurewebsites.net', 'ssl\_state': 'Disabled'}], 'host\_names': ['myfunctionapp.azurewebsites.net'], 'host\_names\_disabled': False, 'id': '/subscriptions/.../resourceGroups/ansible-rg/providers/Microsoft.Web/sites/myfunctionapp', 'kind': 'functionapp', 'last\_modified\_time\_utc': '2017-08-22T18:54:01.190Z', 'location': 'East US', 'name': 'myfunctionapp', 'outbound\_ip\_addresses': '............', 'repository\_site\_name': 'myfunctionapp', 'reserved': False, 'resource\_group': 'myResourceGroup', 'scm\_site\_also\_stopped': False, 'server\_farm\_id': '/subscriptions/.../resourceGroups/ansible-rg/providers/Microsoft.Web/serverfarms/EastUSPlan', 'state': 'Running', 'type': 'Microsoft.Web/sites', 'usage\_state': 'Normal'} |
### Authors
* Thomas Stringer (@trstringer)
ansible azure.azcollection.azure_rm_availabilityset_info – Get Azure Availability Set facts azure.azcollection.azure\_rm\_availabilityset\_info – Get Azure Availability Set facts
======================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_availabilityset_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific availability set or all availability sets.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Limit results to a specific availability set. |
| **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 | | The resource group to search for the desired availability set. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | List of tags to be matched. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one availability set
azure_rm_availabilityset_info:
name: Testing
resource_group: myResourceGroup
- name: Get facts for all availability sets in a specific resource group
azure_rm_availabilityset_info:
resource_group: myResourceGroup
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_availabilityset** complex | always | List of availability sets dicts. |
| | **location** string | success | Location where the resource lives. **Sample:** eastus2 |
| | **name** string | success | Resource name. **Sample:** myAvailabilitySet |
| | **properties** dictionary | success | The properties of the resource. |
| | | **platformFaultDomainCount** integer | success | Fault Domain count. **Sample:** 3 |
| | | **platformUpdateDomainCount** integer | success | Update Domain count. **Sample:** 2 |
| | | **virtualMachines** list / elements=string | success | A list of references to all virtualmachines in the availability set. |
| | **sku** string | success | Location where the resource lives. **Sample:** Aligned |
| | **tags** dictionary | success | Resource tags. **Sample:** {'env': 'sandbox'} |
| | **type** string | success | Resource type. **Sample:** Microsoft.Compute/availabilitySets |
### Authors
* Julien Stroheker (@julienstroheker)
ansible azure.azcollection.azure_rm_ddosprotectionplan_info – Get Azure DDoS protection plan azure.azcollection.azure\_rm\_ddosprotectionplan\_info – Get Azure DDoS protection plan
=======================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_ddosprotectionplan_info`.
New in version 1.7.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
Synopsis
--------
* Get facts of Azure DDoS protection plan.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the DDoS protection plan. |
| **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 | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts of specific DDoS protection plan
azure_rm_ddosprotectionplan_info:
resource_group: myResourceGroup
name: myDDoSProtectionPlan
```
### Authors
* Praveen Ghuge (@praveenghuge)
* Karl Dasan (@ikarldasan)
| programming_docs |
ansible azure.azcollection.azure_rm_virtualnetwork_info – Get virtual network facts azure.azcollection.azure\_rm\_virtualnetwork\_info – Get virtual network facts
==============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualnetwork_info`.
New in version 0.0.1: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific virtual network or all virtual networks within a resource group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Only show results for a specific security group. |
| **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 | | Limit results by resource group. Required when filtering by name. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one virtual network
azure_rm_virtualnetwork_info:
resource_group: myResourceGroup
name: secgroup001
- name: Get facts for all virtual networks
azure_rm_virtualnetwork_info:
resource_group: myResourceGroup
- name: Get facts by tags
azure_rm_virtualnetwork_info:
tags:
- testing
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_virtualnetworks** list / elements=string | always | List of virtual network dicts. **Sample:** [{'etag': 'W/"532ba1be-ae71-40f2-9232-3b1d9cf5e37e"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet2001', 'location': 'eastus2', 'name': 'vnet2001', 'properties': {'addressSpace': {'addressPrefixes': ['10.10.0.0/16']}, 'provisioningState': 'Succeeded', 'resourceGuid': 'a7ba285f-f7e7-4e17-992a-de4d39f28612', 'subnets': []}, 'type': 'Microsoft.Network/virtualNetworks'}] |
| **virtualnetworks** complex | always | List of virtual network dicts with same format as M(azure\_rm\_virtualnetwork) module parameters. |
| | **address\_prefixes** list / elements=string | always | List of IPv4 address ranges where each is formatted using CIDR notation. **Sample:** ['10.10.0.0/16'] |
| | **dns\_servers** list / elements=string | always | Custom list of DNS servers. **Sample:** ['www.azure.com'] |
| | **id** string | always | Resource ID of the virtual network. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet2001 |
| | **location** string | always | Valid Azure location. **Sample:** eastus |
| | **name** string | always | Name of the virtual network. **Sample:** foo |
| | **provisioning\_state** string | always | Provisioning state of the resource. **Sample:** Succeeded |
| | **subnets** list / elements=string | always | Subnets associated with the virtual network. |
| | | **address\_prefix** string | always | The address prefix for the subnet. **Sample:** 10.1.0.0/16 |
| | | **address\_prefixes** list / elements=string | always | Both IPv4 and IPv6 address prefixes for the subnet, will return null if only an IPv4 set. **Sample:** ['10.1.0.0/16', 'fdda:e69b:2547:485e::/64'] |
| | | **id** string | always | Resource ID of the subnet. **Sample:** /subscriptions/f64d4ee8-be94-457d-ba26-3fa6b6506cef/resourceGroups/v-xisuRG/providers/ Microsoft.Network/virtualNetworks/vnetb57dc95232/subnets/vnetb57dc95232 |
| | | **name** string | always | Name of the subnet. **Sample:** vnetb57dc95232 |
| | | **network\_security\_group** string | always | Existing security group ID with which to associate the subnet. |
| | | **provisioning\_state** string | always | Provisioning state of the subnet. **Sample:** Succeeded |
| | | **route\_table** string | always | The reference of the RouteTable resource. |
| | | **service\_endpoints** list / elements=string | always | An array of service endpoints. **Sample:** [{'locations': ['southeastasia', 'eastasia'], 'service': 'Microsoft.Storage'}] |
| | **tags** dictionary | always | Tags assigned to the resource. Dictionary of string:string pairs. **Sample:** {'tag1': 'abc'} |
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
ansible azure.azcollection.azure_rm_automationaccount_info – Get Azure automation account facts azure.azcollection.azure\_rm\_automationaccount\_info – Get Azure automation account facts
==========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_automationaccount_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of automation account.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **list\_keys** boolean | **Choices:*** no
* yes
| List keys for a automation account. Note this will cost network overhead, suggest only used when *name* set. |
| **list\_statistics** boolean | **Choices:*** no
* yes
| List statistics details for a automation account. Note this will cost network overhead, suggest only used when *name* set. |
| **list\_usages** boolean | **Choices:*** no
* yes
| List usage details for a automation account. Note this will cost network overhead, suggest only used when *name* set. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the automation account. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** list / elements=string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get details of an automation account
azure_rm_automationaccount_info:
name: Testing
resource_group: myResourceGroup
list_statistics: yes
list_usages: yes
list_keys: yes
- name: List automation account in a resource group
azure_rm_automationaccount_info:
resource_group: myResourceGroup
- name: List automation account in a resource group
azure_rm_automationaccount_info:
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **automation\_accounts** complex | always | List of automation account dicts. |
| | **creation\_time** string | always | Resource creation date time. **Sample:** 2019-04-26T02:55:16.500Z |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups /myResourceGroup/providers/Microsoft.Automation/automationAccounts/Testing |
| | **keys** complex | always | Resource keys. |
| | | **key\_name** string | always | Name of the key. **Sample:** Primary |
| | | **permissions** string | always | Permission of the key. **Sample:** Full |
| | | **value** string | always | Value of the key. **Sample:** MbepKTO6IyGwml0GaKBkKN |
| | **last\_modified\_time** string | always | Resource last modified date time. **Sample:** 2019-04-26T02:55:16.500Z |
| | **location** string | always | Resource location. **Sample:** eastus |
| | **name** string | always | Resource name. **Sample:** Testing |
| | **resource\_group** string | always | Resource group name. **Sample:** myResourceGroup |
| | **state** string | always | Resource state. **Sample:** ok |
| | **statistics** complex | always | Resource statistics. |
| | | **counter\_property** string | always | Property value of the statistic. **Sample:** New |
| | | **counter\_value** integer | always | Value of the statistic. |
| | | **end\_time** string | always | EndTime of the statistic. **Sample:** 2019-04-26T06:29:43.587518Z |
| | | **id** string | always | ID of the statistic. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups /myResourceGroup/providers/Microsoft.Automation/automationAccounts/Testing/statistics/New |
| | | **start\_time** string | always | StartTime of the statistic. **Sample:** 2019-04-26T06:29:43.587518Z |
| | **usages** complex | always | Resource usages. |
| | | **current\_value** float | always | Current usage. |
| | | **limit** integer | always | Max limit, `-1` for unlimited. **Sample:** -1 |
| | | **name** complex | always | Usage counter name. |
| | | | **localized\_value** string | always | Localized name. **Sample:** SubscriptionUsage |
| | | | **value** string | always | Name value. **Sample:** SubscriptionUsage |
| | | **throttle\_status** string | always | Usage throttle status. **Sample:** NotThrottled |
| | | **unit** string | always | Usage unit name. **Sample:** Minute |
### Authors
* Yuwei Zhou (@yuwzho)
| programming_docs |
ansible azure.azcollection.azure_rm_applicationsecuritygroup_info – Get Azure Application Security Group facts azure.azcollection.azure\_rm\_applicationsecuritygroup\_info – Get Azure Application Security Group facts
=========================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_applicationsecuritygroup_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure Application Security Group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the application security group. |
| **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 | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: List application security groups in specific resource group
azure_rm_applicationsecuritygroup_info:
resource_group: myResourceGroup
- name: List application security groups in specific subscription
azure_rm_applicationsecuritygroup_info:
- name: Get application security group by name
azure_rm_applicationsecuritygroup_info:
resource_group: myResourceGroup
name: myApplicationSecurityGroup
tags:
- foo
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **applicationsecuritygroups** complex | always | List of application security groups. |
| | **id** string | always | Id of the application security group. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationSecurityGroups/MyAsg |
| | **location** string | always | Location of the application security group. **Sample:** eastus |
| | **name** string | always | Name of the resource. **Sample:** myAsg |
| | **provisioning\_state** string | always | Provisioning state of application security group. **Sample:** Succeeded |
### Authors
* Yunge Zhu (@yungezz)
ansible azure.azcollection.azure_rm_devtestlabartifact_info – Get Azure DevTest Lab Artifact facts azure.azcollection.azure\_rm\_devtestlabartifact\_info – Get Azure DevTest Lab Artifact facts
=============================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabartifact_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure DevTest Lab Artifact.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **artifact\_source\_name** string / required | | The name of the artifact source. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **lab\_name** string / required | | The name of the lab. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the artifact. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of DevTest Lab Artifact
azure_rm_devtestlabartifact_info:
resource_group: myResourceGroup
lab_name: myLab
artifact_source_name: myArtifactSource
name: myArtifact
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **artifacts** complex | always | A list of dictionaries containing facts for DevTest Lab Artifact. |
| | **artifact\_source\_name** string | always | The name of the artifact source. **Sample:** myArtifactSource |
| | **description** string | always | Description of the artifact. **Sample:** Installs My Software |
| | **file\_path** string | always | Artifact's path in the repo. **Sample:** Artifacts/myArtifact |
| | **id** string | always | The identifier of the artifact. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DevTestLab/labs/myLab/ar tifactSources/myArtifactSource/artifacts/myArtifact |
| | **lab\_name** string | always | Name of the lab. **Sample:** myLab |
| | **name** string | always | The name of the artifact. **Sample:** myArtifact |
| | **parameters** complex | always | A dictionary containing parameters definition of the artifact. |
| | **publisher** string | always | Publisher name. **Sample:** MyPublisher |
| | **resource\_group** string | always | Name of the resource group. **Sample:** myResourceGroup |
| | **target\_os\_type** string | always | Target OS type. **Sample:** Linux |
| | **title** string | always | Title of the artifact. **Sample:** My Software |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_resource – Create any Azure resource azure.azcollection.azure\_rm\_resource – Create any Azure resource
==================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_resource`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete any Azure resource using Azure REST API.
* This module gives access to resources that are not supported via Ansible modules.
* Refer to <https://docs.microsoft.com/en-us/rest/api/> regarding details related to specific resource REST API.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **api\_version** string | | Specific API version to be used. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **body** string | | The body of the HTTP request/response to the web service. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **idempotency** boolean | **Choices:*** **no** ←
* yes
| If enabled, idempotency check will be done by using *method=GET* first and then comparing with *body*. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **method** string | **Choices:*** GET
* **PUT** ←
* POST
* HEAD
* PATCH
* DELETE
* MERGE
| The HTTP method of the request or response. It must be uppercase. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **polling\_interval** integer | **Default:**60 | If enabled, idempotency check will be done by using *method=GET* first and then comparing with *body*. |
| **polling\_timeout** integer | **Default:**0 | If enabled, idempotency check will be done by using *method=GET* first and then comparing with *body*. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **provider** string | | Provider type. Required if URL is not specified. |
| **resource\_group** string | | Resource group to be used. Required if URL is not specified. |
| **resource\_name** string | | Resource name. Required if URL Is not specified. |
| **resource\_type** string | | Resource type. Required if URL is not specified. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the resource. Use `present` to create or update resource or `absent` to delete resource. |
| **status\_code** list / elements=string | **Default:**[200, 201, 202] | A valid, numeric, HTTP status code that signifies success of the request. Can also be comma separated list of status codes. |
| **subresource** string | | List of subresources. |
| | **name** string | | Subresource name. |
| | **namespace** string | | Subresource namespace. |
| | **type** string | | Subresource type. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **url** string | | Azure RM Resource URL. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Update scaleset info using azure_rm_resource
azure_rm_resource:
resource_group: myResourceGroup
provider: compute
resource_type: virtualmachinescalesets
resource_name: myVmss
api_version: "2017-12-01"
body: { body }
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **response** complex | always | Response specific to resource type. |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxx...xxxx/resourceGroups/v-xisuRG/providers/Microsoft.Storage/storageAccounts/staccb57dc95183 |
| | **kind** string | always | The kind of storage. **Sample:** Storage |
| | **location** string | always | The resource location, defaults to location of the resource group. **Sample:** eastus |
| | **name** string | always | The storage account name. **Sample:** staccb57dc95183 |
| | **properties** dictionary | always | The storage account's related properties. **Sample:** {'creationTime': '2019-06-13T06:34:33.0996676Z', 'encryption': {'keySource': 'Microsoft.Storage', 'services': {'blob': {'enabled': True, 'lastEnabledTime': '2019-06-13T06:34:33.1934074Z'}, 'file': {'enabled': True, 'lastEnabledTime': '2019-06-13T06:34:33.1934074Z'}}}, 'networkAcls': {'bypass': 'AzureServices', 'defaultAction': 'Allow', 'ipRules': [], 'virtualNetworkRules': []}, 'primaryEndpoints': {'blob': 'https://staccb57dc95183.blob.core.windows.net/', 'file': 'https://staccb57dc95183.file.core.windows.net/', 'queue': 'https://staccb57dc95183.queue.core.windows.net/', 'table': 'https://staccb57dc95183.table.core.windows.net/'}, 'primaryLocation': 'eastus', 'provisioningState': 'Succeeded', 'secondaryLocation': 'westus', 'statusOfPrimary': 'available', 'statusOfSecondary': 'available', 'supportsHttpsTrafficOnly': False} |
| | **sku** dictionary | always | The storage account SKU. **Sample:** {'name': 'Standard\_GRS', 'tier': 'Standard'} |
| | **tags** dictionary | always | Resource tags. **Sample:** {'key1': 'value1'} |
| | **type** string | always | The resource type. **Sample:** Microsoft.Storage/storageAccounts |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible azure.azcollection.azure_rm_postgresqlconfiguration_info – Get Azure PostgreSQL Configuration facts azure.azcollection.azure\_rm\_postgresqlconfiguration\_info – Get Azure PostgreSQL Configuration facts
======================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_postgresqlconfiguration_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure PostgreSQL Configuration.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Setting name. |
| **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 / required | | The name of the resource group that contains the resource. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string / required | | The name of the server. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get specific setting of PostgreSQL configuration
azure_rm_postgresqlconfiguration_info:
resource_group: myResourceGroup
server_name: testpostgresqlserver
name: deadlock_timeout
- name: Get all settings of PostgreSQL Configuration
azure_rm_postgresqlconfiguration_info:
resource_group: myResourceGroup
server_name: testpostgresqlserver
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **settings** complex | always | A list of dictionaries containing MySQL Server settings. |
| | **description** string | always | Description of the configuration. **Sample:** Deadlock timeout. |
| | **id** string | always | Setting resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testpostgresqlser ver/configurations/deadlock\_timeout |
| | **name** string | always | Setting name. **Sample:** deadlock\_timeout |
| | **source** string | always | Source of the configuration. **Sample:** system-default |
| | **value** any | always | Setting value. **Sample:** 1000 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_sqlserver_info – Get SQL Server facts azure.azcollection.azure\_rm\_sqlserver\_info – Get SQL Server facts
====================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_sqlserver_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of SQL Server.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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 / required | | The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string | | The name of the server. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of SQL Server
azure_rm_sqlserver_info:
resource_group: myResourceGroup
server_name: server_name
- name: List instances of SQL Server
azure_rm_sqlserver_info:
resource_group: myResourceGroup
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **servers** complex | always | A list of dict results where the key is the name of the SQL Server and the values are the facts for that SQL Server. |
| | **sqlserver\_name** complex | success | The key is the name of the server that the values relate to. |
| | | **fully\_qualified\_domain\_name** string | always | The fully qualified domain name of the server. **Sample:** fully\_qualified\_domain\_name |
| | | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Sql/servers/sqlcrudtest-4645 |
| | | **kind** string | always | Kind of sql server. This is metadata used for the Azure portal experience. **Sample:** v12.0 |
| | | **location** string | always | Resource location. **Sample:** japaneast |
| | | **name** string | always | Resource name. **Sample:** sqlcrudtest-4645 |
| | | **state** string | always | The state of the server. **Sample:** Ready |
| | | **type** string | always | Resource type. **Sample:** Microsoft.Sql/servers |
| | | **version** string | always | The version of the server. **Sample:** 12.0 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_devtestlabpolicy – Manage Azure Policy instance azure.azcollection.azure\_rm\_devtestlabpolicy – Manage Azure Policy instance
=============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabpolicy`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure Policy.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **description** string | | The description of the policy. |
| **fact\_name** string | **Choices:*** user\_owned\_lab\_vm\_count
* user\_owned\_lab\_premium\_vm\_count
* lab\_vm\_count
* lab\_premium\_vm\_count
* lab\_vm\_size
* gallery\_image
* user\_owned\_lab\_vm\_count\_in\_subnet
* lab\_target\_cost
| The fact name of the policy (e.g. `lab_vm_count`, `lab_vm_size`), MaxVmsAllowedPerLab, etc. |
| **lab\_name** string / required | | The name of the lab. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the policy. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **policy\_set\_name** string / required | | The name of the policy set. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **resource\_group** string / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Policy. Use `present` to create or update an Policy and `absent` to delete it. |
| **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. |
| **threshold** raw | | The threshold of the policy (it could be either a maximum value or a list of allowed values). |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create DevTest Lab Policy
azure_rm_devtestlabpolicy:
resource_group: myResourceGroup
lab_name: myLab
policy_set_name: myPolicySet
name: myPolicy
fact_name: user_owned_lab_vm_count
threshold: 5
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | The identifier of the resource. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/myLab/policySets/ myPolicySet/policies/myPolicy |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible azure.azcollection.azure_rm_mysqlfirewallrule_info – Get Azure MySQL Firewall Rule facts azure.azcollection.azure\_rm\_mysqlfirewallrule\_info – Get Azure MySQL Firewall Rule facts
===========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_mysqlfirewallrule_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure MySQL Firewall Rule.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the server firewall rule. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string / required | | The name of the server. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of MySQL Firewall Rule
azure_rm_mysqlfirewallrule_info:
resource_group: myResourceGroup
server_name: server_name
name: firewall_rule_name
- name: List instances of MySQL Firewall Rule
azure_rm_mysqlfirewallrule_info:
resource_group: myResourceGroup
server_name: server_name
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **rules** complex | always | A list of dictionaries containing facts for MySQL Firewall Rule. |
| | **end\_ip\_address** string | always | The end IP address of the MySQL firewall rule. **Sample:** 10.0.0.18 |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/fire wallRules/rule1 |
| | **name** string | always | Resource name. **Sample:** rule1 |
| | **server\_name** string | always | The name of the server. **Sample:** testserver |
| | **start\_ip\_address** string | always | The start IP address of the MySQL firewall rule. **Sample:** 10.0.0.16 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_containerregistrywebhook – Manage Webhook instance. azure.azcollection.azure\_rm\_containerregistrywebhook – Manage Webhook instance.
=================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_containerregistrywebhook`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Webhook.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **actions** list / elements=string | | The list of actions that trigger the webhook to post notifications. |
| **ad\_user** string | | Active Directory username. Use when authenticating with an Active Directory user rather than service principal. |
| **adfs\_authority\_url** string added in 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **custom\_headers** string | | Custom headers that will be added to the webhook notifications. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **registry\_name** string / required | | The name of the container registry. |
| **resource\_group** string / required | | The name of the resource group to which the container registry belongs. |
| **scope** string | | The scope of repositories where the event can be triggered. For example, 'foo:\*' means events for all tags under repository 'foo'. 'foo:bar' m eans events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **service\_uri** string | | The service URI for the webhook to post notifications. |
| **status** string | **Choices:*** enabled
* disabled
| The status of the webhook at the time the operation was called. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **webhook\_name** string / required | | The name of the webhook. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) Webhook
azure_rm_containerregistrywebhook:
resource_group: myResourceGroup
registry_name: myRegistry
webhook_name: myWebhook
location: eastus
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | The resource ID. **Sample:** /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/w ebhooks/myWebhook |
| **status** string | always | The status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled' **Sample:** enabled |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_adserviceprincipal – Manage Azure Active Directory service principal azure.azcollection.azure\_rm\_adserviceprincipal – Manage Azure Active Directory service principal
==================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_adserviceprincipal`.
New in version 0.2.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Azure Active Directory service principal.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **app\_id** string / required | | The application ID. |
| **app\_role\_assignment\_required** boolean | **Choices:*** no
* yes
| Whether the Role of the Service Principal is set. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of Active Dirctory service principal. Use `present` to create or update a Password and use `absent` to delete. |
| **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 / required | | The tenant ID. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: create ad sp
azure_rm_adserviceprincipal:
app_id: "{{ app_id }}"
state: present
tenant: "{{ tenant_id }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **app\_display\_name** string | always | Object's display name or its prefix. **Sample:** fredAKSCluster |
| **app\_id** string | always | The application ID. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| **app\_role\_assignment\_required** boolean | always | Whether the Role of the Service Principal is set. |
| **object\_id** string | always | Object ID of the associated service principal. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
### Authors
* haiyuan\_zhang (@haiyuazhang) Fred-sun (@Fred-sun)
| programming_docs |
ansible azure.azcollection.azure_rm_devtestlabvirtualmachine – Manage Azure DevTest Lab Virtual Machine instance azure.azcollection.azure\_rm\_devtestlabvirtualmachine – Manage Azure DevTest Lab Virtual Machine instance
==========================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabvirtualmachine`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure DevTest Lab Virtual Machine.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **allow\_claim** string | | Indicates whether another user can take ownership of the virtual machine. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **artifacts** list / elements=string | | The artifacts to be installed on the virtual machine. |
| | **parameters** list / elements=string | | The parameters of the artifact. |
| | | **name** string | | The name of the artifact parameter. |
| | | **value** string | | The value of the artifact parameter. |
| | **source\_name** string | | The artifact's source name. |
| | **source\_path** string | | The artifact's path in the source repository. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **disallow\_public\_ip\_address** string | | Indicates whether the virtual machine is to be created without a public IP address. |
| **expiration\_date** string | | The expiration date for VM. |
| **image** string | | The Microsoft Azure Marketplace image reference of the virtual machine. |
| | **offer** string | | The offer of the gallery image. |
| | **os\_type** string | | The OS type of the gallery image. |
| | **publisher** string | | The publisher of the gallery image. |
| | **sku** string | | The SKU of the gallery image. |
| | **version** string | | The version of the gallery image. |
| **lab\_name** string / required | | The name of the lab. |
| **lab\_subnet** string | | An existing subnet within lab's virtual network. It can be the subnet's resource id. It can be a dict which contains `virtual_network_name` and `name`. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the virtual machine. |
| **notes** string | | The notes of the virtual machine. |
| **os\_type** string | **Choices:*** windows
* linux
| Base type of operating system. |
| **password** string | | The password of the virtual machine administrator. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **resource\_group** string / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **ssh\_key** string | | The SSH key of the virtual machine administrator. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Virtual Machine. Use `present` to create or update an Virtual Machine and `absent` to delete it. |
| **storage\_type** string | **Choices:*** standard
* premium
| Storage type to use for virtual machine. |
| **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. |
| **user\_name** string | | The user name of the virtual machine. |
| **vm\_size** string | | A valid Azure VM size value. For example, `Standard_D4`. The list of choices varies depending on the subscription and location. Check your subscription for available choices. Available values can be found on this website, link <https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes-general>. Required when *state=present*. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) Virtual Machine
azure_rm_devtestlabvirtualmachine:
resource_group: myrg
lab_name: mylab
name: myvm
notes: Virtual machine notes....
os_type: linux
vm_size: Standard_A2_v2
user_name: vmadmin
password: ZSuppas$$21!
lab_subnet:
name: myvnSubnet
virtual_network_name: myvn
disallow_public_ip_address: no
image:
offer: UbuntuServer
publisher: Canonical
sku: 16.04-LTS
os_type: Linux
version: latest
artifacts:
- source_name: myartifact
source_path: "/Artifacts/linux-install-mongodb"
allow_claim: no
expiration_date: "2019-02-22T01:49:12.117974Z"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **compute\_id** string | always | The identifier of the underlying Compute Virtual Machine resource. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myrg/providers/microsoft.devtestlab/labs/mylab/virtualmachines/myvm |
| **fqdn** string | always | Fully qualified domain name or IP Address of the virtual machine. **Sample:** myvm.eastus.cloudapp.azure.com |
| **id** string | always | The identifier of the DTL Virtual Machine resource. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myrg/providers/microsoft.devtestlab/labs/mylab/virtualmachines/myvm |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_manageddisk_info – Get managed disk facts azure.azcollection.azure\_rm\_manageddisk\_info – Get managed disk facts
========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_manageddisk_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific managed disk or all managed disks.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **managed\_by** string | | Limit results to disks managed by the given VM fqid. |
| **name** string | | Limit results to a specific managed disk. |
| **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 | | Limit results to a specific resource group. Required if *name* is set |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** list / elements=string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* This module was called M(azure\_rm\_managed\_disk\_facts) before Ansible 2.8. The usage did not change.
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one managed disk
azure_rm_manageddisk_info:
name: Testing
resource_group: myResourceGroup
- name: Get facts for all managed disks
azure_rm_manageddisk_info:
- name: Get facts for all managed disks managed by a specific vm
azure_rm_manageddisk_info:
managed_by: '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rgName/Microsoft.Compute/virtualMachines/vmName'
- name: Get facts by tags
azure_rm_manageddisk_info:
tags:
- testing
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_managed\_disk** list / elements=string | always | List of managed disk dicts. |
| | **create\_option** string | success | Create option of the disk. **Sample:** copy |
| | **disk\_size\_gb** string | success | Size in GB of the managed disk to be created. |
| | **id** string | success | Resource id. |
| | **location** string | success | Valid Azure location. |
| | **managed\_by** string | success | Name of an existing virtual machine with which the disk is or will be associated, this VM should be in the same resource group. |
| | **name** string | success | Name of the managed disk. |
| | **os\_type** string | success | Type of Operating System.
**Can only return:** linux, windows
|
| | **source\_uri** string | success | URI to a valid VHD file to be used or the resource ID of the managed disk to copy. |
| | **storage\_account\_type** string | success | Type of storage for the managed disk. See <https://docs.microsoft.com/en-us/azure/virtual-machines/windows/disks-types> for more information about this type. **Sample:** Standard\_LRS |
| | **tags** dictionary | success | Tags to assign to the managed disk. **Sample:** {'tag': 'value'} |
### Authors
* Bruno Medina (@brusMX)
* Paul Aiton (@paultaiton)
| programming_docs |
ansible azure.azcollection.azure_rm_snapshot – Manage Azure Snapshot instance. azure.azcollection.azure\_rm\_snapshot – Manage Azure Snapshot instance.
========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_snapshot`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure Snapshot.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **creation\_data** dictionary | | Disk source information. CreationData information cannot be changed after the disk has been created. |
| | **create\_option** string | **Choices:*** Import
* Copy
| This enumerates the possible sources of a disk's creation. |
| | **source\_id** string | | If *createOption=Copy*, this is the resource ID of a managed disk to be copied from. |
| | **source\_uri** string | | If *createOption=Import*, this is the URI of a blob to be imported into a managed disk. |
| **location** string | | Resource location. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Resource name. |
| **os\_type** string | **Choices:*** Linux
* Windows
| The Operating System type. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** dictionary | | The snapshots SKU. |
| | **name** string | **Choices:*** Standard\_LRS
* Premium\_LRS
* Standard\_ZRS
| The sku name. |
| | **tier** string | | The sku tier. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Snapshot. Use `present` to create or update an Snapshot and `absent` to delete it. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a snapshot by importing an unmanaged blob from the same subscription.
azure_rm_snapshot:
resource_group: myResourceGroup
name: mySnapshot
location: eastus
creation_data:
create_option: Import
source_uri: 'https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd'
- name: Create a snapshot by copying an existing managed disk.
azure_rm_snapshot:
resource_group: myResourceGroup
name: mySnapshot
location: eastus
creation_data:
create_option: Copy
source_id: '/subscriptions/sub123/resourceGroups/group123/providers/Microsoft.Compute/disks/disk123'
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_galleryimage – Manage Azure SIG Image instance azure.azcollection.azure\_rm\_galleryimage – Manage Azure SIG Image instance
============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_galleryimage`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure SIG Image.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **description** string | | The description of this gallery Image Definition resource. This property is updatable. |
| **disallowed** dictionary | | Disallowed parameter values. |
| | **disk\_types** list / elements=string | | A list of disallowed disk types. |
| **end\_of\_life\_date** string | | The end of life date of the gallery Image Definition. This property can be used for decommissioning purposes. This property is updatable. Format should be according to ISO-8601, for instance "2019-06-26". |
| **eula** string | | The Eula agreement for the gallery Image Definition. |
| **gallery\_name** string / required | | The name of the Shared Image Gallery in which the Image Definition is to be created. |
| **identifier** dictionary / required | | Image identifier. |
| | **offer** string / required | | The name of the gallery Image Definition offer. |
| | **publisher** string / required | | The name of the gallery Image Definition publisher. |
| | **sku** string / required | | The name of the gallery Image Definition SKU. |
| **location** string | | Resource location. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the gallery Image Definition to be created or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 characters. |
| **os\_state** string / required | **Choices:*** generalized
* specialized
| The allowed values for OS State are `generalized`. |
| **os\_type** string / required | **Choices:*** windows
* linux
| This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **privacy\_statement\_uri** string | | The privacy statement uri. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **purchase\_plan** dictionary | | Purchase plan. |
| | **name** string | | The plan ID. |
| | **product** string | | The product ID. |
| | **publisher** string | | The publisher ID. |
| **recommended** dictionary | | Recommended parameter values. |
| | **memory** dictionary | | Memory. |
| | | **max** integer | | The maximum number of the resource. |
| | | **min** integer | | The minimum number of the resource. |
| | **v\_cpus** dictionary | | Number of virtual CPUs. |
| | | **max** integer | | The maximum number of the resource. |
| | | **min** integer | | The minimum number of the resource. |
| **release\_note\_uri** string | | The release note uri. |
| **resource\_group** string / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the GalleryImage. Use `present` to create or update an GalleryImage and `absent` to delete it. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create or update gallery image
azure_rm_galleryimage:
resource_group: myResourceGroup
gallery_name: myGallery1283
name: myImage
location: West US
os_type: linux
os_state: generalized
identifier:
publisher: myPublisherName
offer: myOfferName
sku: mySkuName
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalle ry1283/images/myImage |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_lock – Manage Azure locks azure.azcollection.azure\_rm\_lock – Manage Azure locks
=======================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_lock`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, delete an Azure lock.
* To create or delete management locks, you must have access to Microsoft.Authorization/\* or Microsoft.Authorization/locks/\* actions.
* Of the built-in roles, only Owner and User Access Administrator are granted those actions.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **level** string | **Choices:*** can\_not\_delete
* read\_only
| The lock level type. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **managed\_resource\_id** string | | Manage a lock for the specified resource ID. Mutually exclusive with *resource\_group*. If neither *managed\_resource\_id* or *resource\_group* are specified, manage a lock for the current subscription. '/subscriptions/{subscriptionId}' for subscriptions. '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups. '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{namespace}/{resourceType}/{resourceName}' for resources. |
| **name** string / required | | Name of the lock. |
| **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 | | Manage a lock for the named resource group. Mutually exclusive with *managed\_resource\_id*. If neither *managed\_resource\_id* or *resource\_group* are specified, manage a lock for the current subscription. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the lock. Use `present` to create or update a lock and `absent` to delete a lock. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a lock for a resource
azure_rm_lock:
managed_resource_id: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM
name: myLock
level: read_only
- name: Create a lock for a resource group
azure_rm_lock:
managed_resource_id: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup
name: myLock
level: read_only
- name: Create a lock for a resource group
azure_rm_lock:
resource_group: myResourceGroup
name: myLock
level: read_only
- name: Create a lock for a subscription
azure_rm_lock:
name: myLock
level: read_only
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | success | Resource ID of the lock. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/locks/keep |
### Authors
* Yuwei Zhou (@yuwzho)
| programming_docs |
ansible azure.azcollection.azure_rm_virtualmachinesize_info – Get facts for virtual machine sizes azure.azcollection.azure\_rm\_virtualmachinesize\_info – Get facts for virtual machine sizes
============================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualmachinesize_info`.
New in version 1.8.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get available virtual machine size profiles for a location
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **location** string / required | | Location for which to list the available virtual machine size profiles |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Name of a size to get information about |
| **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. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get all virtual machine size info in eastus
azure_rm_virtualmachinesize_info:
location: eastus
- name: Get virtual machine size info for eastus for Standard_A1_v2
azure_rm_virtualmachinesize_info:
location: eastus
name: Standard_A1_v2
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **sizes** complex | always | List of virtual machine size profiles available for the location. |
| | **maxDataDiskCount** integer | success | The maximum number of data disks that can be attached to the virtual machine size **Sample:** 2 |
| | **memoryInMB** integer | success | The amount of memory, in MB, supported by the virtual machine size **Sample:** 2048 |
| | **name** string | success | The name of the virtual machine size **Sample:** Standard\_A1\_v2 |
| | **numberOfCores** integer | success | The number of cores supported by the virtual machine size **Sample:** 1 |
| | **osDiskSizeInMB** integer | success | The OS disk size, in MB, allowed by the virtual machine size **Sample:** 1047552 |
| | **resourceDiskSizeInMB** integer | success | The resource disk size, in MB, allowed by the virtual machine size **Sample:** 10240 |
### Authors
* Maxence Ardouin (@nbr23)
ansible azure.azcollection.azure_rm_webappaccessrestriction – Manage web app network access restrictions azure.azcollection.azure\_rm\_webappaccessrestriction – Manage web app network access restrictions
==================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_webappaccessrestriction`.
New in version 1.8.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Add, remove, or update network access restrictions for a web app.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **ip\_security\_restrictions** list / elements=dictionary | | The web app's HTTP access restrictions. |
| | **action** string | **Choices:*** **Allow** ←
* Deny
| Traffic action for the access restriction. |
| | **description** string | | Description of the access restriction. |
| | **ip\_address** string / required | | IPv4 address (with subnet mask) of the access restriction. |
| | **name** string | | Name of the access restriction. |
| | **priority** integer / required | | Numerical priority of the access restriction. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the web app. |
| **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 / required | | Resource group of the web app. |
| **scm\_ip\_security\_restrictions** list / elements=dictionary | | The web app's SCM access restrictions. If `scm_ip_security_restrictions_use_main` is set to `true`, the SCM restrictions will be configured but not used. |
| | **action** string | **Choices:*** **Allow** ←
* Deny
| Traffic action for the access restriction. |
| | **description** string | | Description of the access restriction. |
| | **ip\_address** string / required | | IPv4 address (with subnet mask) of the access restriction. |
| | **name** string | | Name of the access restriction. |
| | **priority** integer / required | | Numerical priority of the access restriction. |
| **scm\_ip\_security\_restrictions\_use\_main** boolean | **Choices:*** **no** ←
* yes
| Set to `true` to have the HTTP access restrictions also apply to the SCM site. If `scm_ip_security_restrictions` are also applied, they will configured but not used. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the access restrictions. Use `present` to create or update and `absent` to delete. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Configure web app access restrictions.
azure.azcollection.azure_rm_webappaccessrestriction:
name: "MyWebapp"
resource_group: "MyResourceGroup"
ip_security_restrictions:
- name: "Datacenter 1"
action: "Allow"
ip_address: "1.1.1.1/24"
priority: 1
- name: "Datacenter 2"
action: "Allow"
ip_address: "2.2.2.2/24"
priority: 2
scm_ip_security_restrictions_use_main: true
- name: Delete web app network access restrictions.
azure.azcollection.azure_rm_webappaccessrestriction:
name: "MyWebapp"
resource_group: "MyResourceGroup"
state: "absent"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **ip\_security\_restrictions** list / elements=dictionary | always | The web app's HTTP access restrictions. |
| | **action** string | always | Traffic action of the access restriction. **Sample:** Allow |
| | **description** string | always | Description of the access restriction. **Sample:** my-access-restriction-description |
| | **ip\_address** string | always | IP address of the access restriction. **Sample:** 1.1.1.1/32 |
| | **name** string | always | Name of the access restriction. **Sample:** my-access-restriction |
| | **priority** integer | always | Numerical priority of the access restriction. **Sample:** 1 |
| **scm\_ip\_security\_restrictions** list / elements=dictionary | always | The web app's SCM access restrictions. |
| | **action** string | always | Traffic action of the access restriction. **Sample:** Allow |
| | **description** string | always | Description of the access restriction. **Sample:** my-access-restriction-description |
| | **ip\_address** string | always | IP address of the access restriction. **Sample:** 1.1.1.1/32 |
| | **name** string | always | Name of the access restriction. **Sample:** my-access-restriction |
| | **priority** integer | always | Numerical priority of the access restriction. **Sample:** 1 |
| **scm\_ip\_security\_restrictions\_use\_main** boolean | always | Whether the HTTP access restrictions are used for SCM access. |
### Authors
* Ross Bender (@l3ender)
ansible azure.azcollection.azure_rm_routetable – Manage Azure route table resource azure.azcollection.azure\_rm\_routetable – Manage Azure route table resource
============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_routetable`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete a route table.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **disable\_bgp\_route\_propagation** boolean | **Choices:*** **no** ←
* yes
| Specified whether to disable the routes learned by BGP on that route table. |
| **location** string | | Region of the resource. Derived from *resource\_group* if not specified. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the route table. |
| **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 / required | | Name of resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the route table. Use `present` to create or update and `absent` to delete. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a route table
azure_rm_routetable:
resource_group: myResourceGroup
name: myRouteTable
disable_bgp_route_propagation: False
tags:
purpose: testing
- name: Delete a route table
azure_rm_routetable:
resource_group: myResourceGroup
name: myRouteTable
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Whether the resource is changed. **Sample:** True |
| **id** string | success | Resource ID. **Sample:** /subscriptions/xxx...xxx/resourceGroups/v-xisuRG/providers/Microsoft.Network/routeTables/tableb57dc95642/routes/routeb57dc95986 |
### Authors
* Yuwei Zhou (@yuwzho)
| programming_docs |
ansible azure.azcollection.azure_rm_ddosprotectionplan – Manage DDoS protection plan azure.azcollection.azure\_rm\_ddosprotectionplan – Manage DDoS protection plan
==============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_ddosprotectionplan`.
New in version 1.7.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of DDoS protection plan.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | parent argument. |
| **log\_path** string | | parent argument. |
| **name** string / required | | Unique name of the app service plan to create or update. |
| **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 / required | | Name of the resource group to which the resource belongs. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the DDoS protection plan. Use `present` to create or update an DDoS protection plan and `absent` to delete it. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: "Create DDoS protection plan"
azure_rm_ddosprotectionplan:
resource_group: rg
location: eastus
name: ddosplan
- name: Delete DDoS protection plan
azure_rm_ddosprotectionplan:
resource_group: rg
name: ddosplan
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** dictionary | always | Current state of the DDoS protection plan. **Sample:** {'etag': 'W/60ac0480-44dd-4881-a2ed-680d20b3978e', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/ddosProtectionPlans/ddosplan', 'location': 'eastus', 'name': 'ddosplan', 'provisioning\_state': 'Succeeded', 'resource\_guid': None, 'tags': {'a': 'b'}, 'type': 'Microsoft.Network/ddosProtectionPlans', 'virtual\_networks': []} |
### Authors
* Praveen Ghuge (@praveenghuge)
* Karl Dasan (@ikarldasan)
ansible azure.azcollection.azure_rm_privatednszone_info – Get private DNS zone facts azure.azcollection.azure\_rm\_privatednszone\_info – Get private DNS zone facts
===============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_privatednszone_info`.
New in version 0.0.1: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for a specific private DNS zone or all private DNS zones within a resource group.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Only show results for a specific zone. |
| **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 | | Limit results by resource group. Required when filtering by name. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** list / elements=string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get facts for one zone
azure_rm_privatednszone_info:
resource_group: myResourceGroup
name: foobar22
- name: Get facts for all zones in a resource group
azure_rm_privatednszone_info:
resource_group: myResourceGroup
- name: Get facts for privatednszone with tags
azure_rm_privatednszone_info:
tags:
- testing
- foo:bar
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_privatednszones** list / elements=string | always | List of private zone dicts. **Sample:** [{'etag': '00000002-0000-0000-0dcb-df5776efd201', 'location': 'global', 'properties': {'maxNumberOfRecordSets': 5000, 'number\_of\_virtual\_network\_links': 0, 'number\_of\_virtual\_network\_links\_with\_registration': 0}, 'tags': {}}] |
| **privatednszones** list / elements=string | always | List of private zone dicts, which share the same layout as azure\_rm\_privatednszone module parameter. |
| | **id** string | success | id of the private DNS Zone. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/privatednszones/azure.com |
| | **name** string | success | name of the private DNS zone. **Sample:** azure.com |
| | **number\_of\_record\_sets** integer | success | The current number of record sets in this private DNS zone. **Sample:** 2 |
| | **number\_of\_virtual\_network\_links** integer | success | The current number of network links in this private DNS zone. |
| | **number\_of\_virtual\_network\_links\_with\_registration** integer | success | The current number of network links with registration in this private DNS zone. |
### Authors
* Jose Angel Munoz (@imjoseangel)
ansible azure.azcollection.azure_rm_mariadbfirewallrule_info – Get Azure MariaDB Firewall Rule facts azure.azcollection.azure\_rm\_mariadbfirewallrule\_info – Get Azure MariaDB Firewall Rule facts
===============================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_mariadbfirewallrule_info`.
New in version 0.0.1: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure MariaDB Firewall Rule.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the server firewall rule. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string / required | | The name of the server. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of MariaDB Firewall Rule
azure_rm_mariadbfirewallrule_info:
resource_group: myResourceGroup
server_name: server_name
name: firewall_rule_name
- name: List instances of MariaDB Firewall Rule
azure_rm_mariadbfirewallrule_info:
resource_group: myResourceGroup
server_name: server_name
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **rules** complex | always | A list of dictionaries containing facts for MariaDB Firewall Rule. |
| | **end\_ip\_address** string | always | The end IP address of the MariaDB firewall rule. **Sample:** 10.0.0.18 |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/TestGroup/providers/Microsoft.DBforMariaDB/servers/testserver/fire wallRules/rule1 |
| | **name** string | always | Resource name. **Sample:** rule1 |
| | **server\_name** string | always | The name of the server. **Sample:** testserver |
| | **start\_ip\_address** string | always | The start IP address of the MariaDB firewall rule. **Sample:** 10.0.0.16 |
### Authors
* Zim Kalinowski (@zikalino)
* Matti Ranta (@techknowlogick)
| programming_docs |
ansible azure.azcollection.azure_rm_loganalyticsworkspace – Manage Azure Log Analytics workspaces azure.azcollection.azure\_rm\_loganalyticsworkspace – Manage Azure Log Analytics workspaces
===========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_loganalyticsworkspace`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, delete Azure Log Analytics workspaces.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **force** boolean | **Choices:*** **no** ←
* yes
| Deletes the workspace without the recovery option. A workspace that was deleted with this flag cannot be recovered. |
| **intelligence\_packs** dictionary | | Manage intelligence packs possible for this workspace. Enable one pack by setting it to `true`. For example "Backup:true". Disable one pack by setting it to `false`. For example "Backup:false". Other intelligence packs not list in this property will not be changed. |
| **location** string | | Resource location. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the workspace. |
| **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 / required | | Name of resource group. |
| **retention\_in\_days** string | | The workspace data retention in days. -1 means Unlimited retention for *sku=unlimited*. 730 days is the maximum allowed for all other SKUs. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | **Choices:*** free
* standard
* premium
* unlimited
* per\_node
* **per\_gb2018** ←
* standalone
| The SKU of the workspace. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the image. Use `present` to create or update a image and `absent` to delete an image. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a workspace with backup enabled
azure_rm_loganalyticsworkspace:
resource_group: myResourceGroup
name: myLogAnalyticsWorkspace
intelligence_pack:
Backup: true
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | success | Workspace resource path. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/m yLogAnalyticsWorkspace |
| **intelligence\_packs** list / elements=string | success | Lists all the intelligence packs possible and whether they are enabled or disabled for a given workspace. **Sample:** [{'name': 'CapacityPerformance'}, {'enabled': True}] |
| **location** string | success | Resource location. **Sample:** eastus |
| **management\_groups** dictionary | success | Management groups connected to the workspace. **Sample:** {'value': []} |
| **retention\_in\_days** integer | success | The workspace data retention in days. -1 means Unlimited retention for *sku=unlimited*. 730 days is the maximum allowed for all other SKUs. **Sample:** 40 |
| **shared\_keys** dictionary | success | Shared keys for the workspace. **Sample:** {'primarySharedKey': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'secondarySharedKey': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} |
| **sku** string | success | The SKU of the workspace. **Sample:** per\_gb2018 |
| **usages** dictionary | success | Usage metrics for the workspace. **Sample:** {'value': [{'currentValue': 0, 'limit': 524288000, 'name': {'localizedValue': 'Data Analyzed', 'value': 'DataAnalyzed'}, 'nextResetTime': '2017-10-03T00:00:00Z', 'quotaPeriod': 'P1D', 'unit': 'Bytes'}]} |
### Authors
* Yuwei Zhou (@yuwzho)
ansible azure.azcollection.azure_rm_publicipaddress – Manage Azure Public IP Addresses azure.azcollection.azure\_rm\_publicipaddress – Manage Azure Public IP Addresses
================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_publicipaddress`.
New in version 0.1.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
Synopsis
--------
* Create, update and delete a Public IP address.
* Allows setting and updating the address allocation method and domain name label.
* Use the M(azure\_rm\_networkinterface) module to associate a Public IP with a network interface.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **allocation\_method** string | **Choices:*** **dynamic** ←
* static
* Static
* Dynamic
| Control whether the assigned Public IP remains permanently assigned to the object. If not set to `Static`, the IP address my changed anytime an associated virtual machine is power cycled. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **domain\_name** string | | The customizable portion of the FQDN assigned to public IP address. This is an explicit setting. If no value is provided, any existing value will be removed on an existing public IP.
aliases: domain\_name\_label |
| **idle\_timeout** integer | | Idle timeout in minutes. |
| **ip\_tags** string | | List of IpTag associated with the public IP address. Each element should contain type:value pair. |
| | **type** string | | Sets the ip\_tags type. |
| | **value** string | | Sets the ip\_tags value. |
| **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. |
| **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 / required | | Name of resource group with which the Public IP is associated. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | **Choices:*** basic
* standard
* Basic
* Standard
| The public IP address SKU. When *version=ipv6*, if *sku=standard* then set *allocation\_method=static*. When *version=ipv4*, if *sku=standard* then set *allocation\_method=static*. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Public IP. Use `present` to create or update a and `absent` to delete. |
| **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. |
| **version** string | **Choices:*** **ipv4** ←
* ipv6
| The public IP address version. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a public ip address
azure_rm_publicipaddress:
resource_group: myResourceGroup
name: my_public_ip
allocation_method: static
domain_name: foobar
- name: Delete public ip
azure_rm_publicipaddress:
resource_group: myResourceGroup
name: my_public_ip
state: absent
```
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
There were some errors parsing the documentation for this plugin. Please file a bug with the collection.
The errors were:
* ```
Unable to normalize azure_rm_publicipaddress: return due to: 11 validation errors for PluginReturnSchema
return -> state -> contains -> dns_settings -> returns
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> etag -> returns
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> idle_timeout_in_minutes -> returns
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> ip_address -> returns
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> location -> returns
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> name -> returns
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> provisioning_state -> returns
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> public_ip_address_version -> returns
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> public_ip_allocation_method -> returns
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> tags -> returns
extra fields not permitted (type=value_error.extra)
return -> state -> contains -> type -> returns
extra fields not permitted (type=value_error.extra)
```
| programming_docs |
ansible azure.azcollection.azure_rm_registrationdefinition_info – Get RegistrationDefinition info azure.azcollection.azure\_rm\_registrationdefinition\_info – Get RegistrationDefinition info
============================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_registrationdefinition_info`.
New in version 1.3.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get info of RegistrationDefinition.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **registration\_definition\_id** string | | ID of the registration definition. |
| **scope** string | | The subscription ID defines the subscription in which the registration definition will be retrieved. If not specified, will use the subscription derived from AzureRMAuth. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get Registration Definition
azure_rm_registrationdefinition_info:
registration_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- name: Get All Registration Definitions from AzureRMAuth's subscription
azure_rm_registrationdefinition_info:
- name: Get All Registration Definitions in the subscription levle
azure_rm_registrationdefinition_info:
scope: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **registration\_definitions** complex | always | A list of dict results where the key is the name of the RegistrationDefinition and the values are the facts for that RegistrationDefinition. |
| | **id** string | always | Fully qualified path of the registration definition. |
| | **name** string | always | Name of the registration definition. |
| | **plan** complex | always | Plan details for the managed services. |
| | | **name** string | always | The plan name. |
| | | **product** string | always | The product code. |
| | | **publisher** string | always | The publisher ID. |
| | | **version** string | always | The plan's version. |
| | **properties** complex | always | Properties of a registration definition. |
| | | **authorizations** complex | always | Authorization tuple containing principal ID of the user/security group or service principal and id of the build-in role. |
| | | | **principal\_id** string | always | Principal ID of the security group/service principal/user that would be assigned permissions to the projected subscription. |
| | | | **role\_definition\_id** string | always | The role definition identifier. The role will define all the permissions that the security group/service principal/user must have on the subscription. The role cannot be an owner role. |
| | | **description** string | always | Description of the registration definition. |
| | | **managed\_by\_tenant\_id** string | always | ID of the managedBy tenant. |
| | | **registration\_definition\_name** string | always | Name of the registration definition. |
| | **type** string | always | Type of the resource. |
### Authors
* Fred-Sun (@Fred-Sun)
ansible azure.azcollection.azure_rm_adserviceprincipal_info – Get Azure Active Directory service principal info azure.azcollection.azure\_rm\_adserviceprincipal\_info – Get Azure Active Directory service principal info
==========================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_adserviceprincipal_info`.
New in version 0.2.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get Azure Active Directory service principal info.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **app\_id** string | | The application ID. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **object\_id** string | | It's service principal's object ID. |
| **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. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **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 / required | | The tenant ID. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: get ad sp info
azure_rm_adserviceprincipal_info:
app_id: "{{ app_id }}"
tenant: "{{ tenant_id }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **app\_display\_name** string | always | Object's display name or its prefix. **Sample:** sp |
| **app\_id** string | always | The application ID. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| **app\_role\_assignment\_required** boolean | always | Whether the Role of the Service Principal is set. |
| **object\_id** string | always | It's service principal's object ID. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
### Authors
* haiyuan\_zhang (@haiyuazhang) Fred-sun (@Fred-sun)
ansible azure.azcollection.azure_rm_adpassword_info – Get application password info azure.azcollection.azure\_rm\_adpassword\_info – Get application password info
==============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_adpassword_info`.
New in version 0.2.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
Synopsis
--------
* Get application password info.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **app\_id** string | | The application ID. |
| **app\_object\_id** string | | The application object ID. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **end\_date** string | | Date or datemtime after which credentials expire. Default value is one year after current time. |
| **key\_id** string | | The password key ID. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **service\_principal\_object\_id** string | | The service principal object ID. |
| **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 / required | | The tenant ID. |
| **value** string | | The application password value. Length greater than 18 characters. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: get ad password info
azure_rm_adpassword_info:
app_id: "{{ app_id }}"
tenant: "{{ tenant_id }}"
key_id: "{{ key_id }}"
```
### Authors
* haiyuan\_zhang (@haiyuazhang) Fred-sun (@Fred-sun)
There were some errors parsing the documentation for this plugin. Please file a bug with the collection.
The errors were:
* ```
Unable to normalize azure_rm_adpassword_info: return due to: 2 validation errors for PluginReturnSchema
return -> passwords -> contains -> end_date -> type
string does not match regex "^(any|bits|bool|bytes|complex|dict|float|int|json|jsonarg|list|path|sid|str|pathspec|pathlist)$" (type=value_error.str.regex; pattern=^(any|bits|bool|bytes|complex|dict|float|int|json|jsonarg|list|path|sid|str|pathspec|pathlist)$)
return -> passwords -> contains -> start_date -> type
string does not match regex "^(any|bits|bool|bytes|complex|dict|float|int|json|jsonarg|list|path|sid|str|pathspec|pathlist)$" (type=value_error.str.regex; pattern=^(any|bits|bool|bytes|complex|dict|float|int|json|jsonarg|list|path|sid|str|pathspec|pathlist)$)
```
| programming_docs |
ansible azure.azcollection.azure_rm_datalakestore_info – Get Azure Data Lake Store info azure.azcollection.azure\_rm\_datalakestore\_info – Get Azure Data Lake Store info
==================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_datalakestore_info`.
New in version 1.4.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get Azure Data Lake Store info.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the Data Lake Store account. |
| **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 | | The name of the Azure resource group.
aliases: resource\_group\_name |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get Azure Data Lake Store info from resource group 'myResourceGroup' and name 'myDataLakeStore'
azure_rm_datalakestore_info:
resource_group: myResourceGroup
name: myDataLakeStore
- name: Get Azure Data Lake Store info from resource group 'myResourceGroup'
azure_rm_datalakestore_info:
resource_group: myResourceGroup
- name: Get Azure Data Lake Store info
azure_rm_datalakestore_info:
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **datalake** complex | always | A list of dictionaries containing facts for Azure Data Lake Store. |
| | **account\_id** string | always | The unique identifier associated with this Data Lake Store account. **Sample:** xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| | **creation\_time** string | always | The account creation time. **Sample:** 2020-01-01T00:00:00.000000+00:00 |
| | **current\_tier** string | success | The commitment tier in use for the current month. **Sample:** Consumption |
| | **default\_group** string | success | The default owner group for all new folders and files created in the Data Lake Store account. |
| | **encryption\_config** complex | success | The Key Vault encryption configuration. |
| | | **key\_vault\_meta\_info** complex | success | The Key Vault information for connecting to user managed encryption keys. |
| | | | **encryption\_key\_name** string | always | The name of the user managed encryption key. **Sample:** KeyName |
| | | | **encryption\_key\_version** string | always | The version of the user managed encryption key. **Sample:** 86a1e3b7406f45afa0d54e21eff47e39 |
| | | | **key\_vault\_resource\_id** string | always | The resource identifier for the user managed Key Vault being used to encrypt. **Sample:** /subscriptions/{subscriptionId}/resourceGroups/myRG/providers/Microsoft.KeyVault/vaults/testkv |
| | | **type** string | always | The type of encryption configuration being used. **Sample:** ServiceManaged |
| | **encryption\_provisioning\_state** string | success | The current state of encryption provisioning for this Data Lake Store account. **Sample:** Succeeded |
| | **encryption\_state** string | success | The current state of encryption for this Data Lake Store account. **Sample:** Enabled |
| | **endpoint** string | always | The full CName endpoint for this account. **Sample:** testaccount.azuredatalakestore.net |
| | **firewall\_allow\_azure\_ips** string | success | The current state of allowing or disallowing IPs originating within Azure through the firewall. **Sample:** Disabled |
| | **firewall\_rules** list / elements=string | success | The list of firewall rules associated with this Data Lake Store account. |
| | | **end\_ip\_address** string | always | The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. **Sample:** 192.168.1.254 |
| | | **name** string | always | The resource name. **Sample:** Example Name |
| | | **start\_ip\_address** string | always | The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. **Sample:** 192.168.1.1 |
| | **firewall\_state** string | success | The current state of the IP address firewall for this Data Lake Store account. **Sample:** Enabled |
| | **id** string | always | The resource identifier. **Sample:** /subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.DataLakeStore/accounts/testaccount |
| | **identity** complex | success | The Key Vault encryption identity, if any. |
| | | **principal\_id** string | success | The principal identifier associated with the encryption. **Sample:** 00000000-0000-0000-0000-000000000000 |
| | | **tenant\_id** string | success | The tenant identifier associated with the encryption. **Sample:** 00000000-0000-0000-0000-000000000000 |
| | | **type** string | success | The type of encryption being used. **Sample:** SystemAssigned |
| | **last\_modified\_time** string | always | The account last modified time. **Sample:** 2020-01-01T00:00:00.000000+00:00 |
| | **location** string | always | The resource location. **Sample:** westeurope |
| | **name** string | always | The resource name. **Sample:** testaccount |
| | **new\_tier** string | success | The commitment tier to use for next month. **Sample:** Consumption |
| | **provisioning\_state** string | always | The provisioning status of the Data Lake Store account. **Sample:** Succeeded |
| | **state** string | always | The state of the Data Lake Store account. **Sample:** Active |
| | **tags** dictionary | always | The resource tags. **Sample:** {'tag1': 'abc'} |
| | **trusted\_id\_provider\_state** string | success | The list of trusted identity providers associated with this Data Lake Store account. **Sample:** Enabled |
| | **trusted\_id\_providers** list / elements=string | success | The current state of the trusted identity provider feature for this Data Lake Store account. |
| | | **id** string | success | The resource identifier. |
| | | **id\_provider** string | success | The URL of this trusted identity provider. |
| | | **name** string | success | The resource name. |
| | | **type** string | success | The resource type. |
| | **type** string | always | The resource type. **Sample:** Microsoft.DataLakeStore/accounts |
| | **virtual\_network\_rules** list / elements=string | success | The list of virtual network rules associated with this Data Lake Store account. |
| | | **name** string | success | The resource name. **Sample:** Rule Name |
| | | **subnet\_id** string | success | The resource identifier for the subnet. **Sample:** /subscriptions/{subscriptionId}/resourceGroups/myRG/providers/Microsoft.Network/virtualNetworks/vnet/subnets/default |
### Authors
* David Duque Hernández (@next-davidduquehernandez)
ansible azure.azcollection.azure_rm_containerregistry_info – Get Azure Container Registry facts azure.azcollection.azure\_rm\_containerregistry\_info – Get Azure Container Registry facts
==========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_containerregistry_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts for Container Registry.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the container registry. |
| **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 | | The name of the resource group to which the container registry belongs. |
| **retrieve\_credentials** boolean | **Choices:*** **no** ←
* yes
| Retrieve credentials for container registry. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of Registry
azure_rm_containerregistry_info:
resource_group: myResourceGroup
name: myRegistry
- name: List instances of Registry
azure_rm_containerregistry_info:
resource_group: myResourceGroup
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **registries** complex | always | A list of dictionaries containing facts for registries. |
| | **admin\_user\_enabled** boolean | always | Is admin user enabled. **Sample:** True |
| | **credentials** complex | when `retrieve_credentials` is set and `admin_user_enabled` is set on ACR | Credentials, fields will be empty if admin user is not enabled for ACR. |
| | | **password** string | when registry exists and `admin_user_enabled` is set | password value. **Sample:** pass1value |
| | | **password2** string | when registry exists and `admin_user_enabled` is set | password2 value. **Sample:** pass2value |
| | | **username** string | when registry exists and `admin_user_enabled` is set | The user name for container registry. **Sample:** zim |
| | **id** string | always | The resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registr ies/myRegistry |
| | **location** string | always | The location of the resource. This cannot be changed after the resource is created. **Sample:** westus |
| | **login\_server** string | always | Login server for the registry. **Sample:** acrd08521b.azurecr.io |
| | **name** string | always | The name of the resource. **Sample:** myRegistry |
| | **provisioning\_state** string | always | Provisioning state of the container registry. **Sample:** Succeeded |
| | **sku** string | always | The SKU name of the container registry. **Sample:** Premium |
| | **tags** dictionary | success | Tags assigned to the resource. Dictionary of string:string pairs. **Sample:** {'tag1': 'abc'} |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible azure.azcollection.azure_rm_azurefirewall – Manage Azure Firewall instance azure.azcollection.azure\_rm\_azurefirewall – Manage Azure Firewall instance
============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_azurefirewall`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure Firewall.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **application\_rule\_collections** list / elements=string | | Collection of application rule collections used by Azure Firewall. |
| | **action** string | **Choices:*** allow
* deny
| The action type of a rule collection. |
| | **name** string | | Gets name of the resource that is unique within a resource group. This name can be used to access the resource. |
| | **priority** integer | | Priority of the application rule collection resource. |
| | **rules** list / elements=string | | Collection of rules used by a application rule collection. |
| | | **description** string | | Description of the rule. |
| | | **fqdn\_tags** list / elements=string | | List of FQDN Tags for this rule. |
| | | **name** string | | Name of the application rule. |
| | | **protocols** list / elements=string | | Array of ApplicationRuleProtocols. |
| | | **source\_addresses** list / elements=string | | List of source IP addresses for this rule. |
| | | **target\_fqdns** list / elements=string | | List of FQDNs for this rule. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **ip\_configurations** list / elements=string | | IP configuration of the Azure Firewall resource. |
| | **name** string | | Name of the resource that is unique within a resource group. This name can be used to access the resource. |
| | **public\_ip\_address** raw | | Existing public IP address. It can be a string containing resource ID. It can be a string containing a name in current resource group. It can be a dictionary containing *name* and optionally *resource\_group*. |
| | **subnet** raw | | Existing subnet. It can be a string containing subnet resource ID. It can be a dictionary containing *name*, *virtual\_network\_name* and optionally *resource\_group* . |
| **location** string | | Resource location. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the Azure Firewall. |
| **nat\_rule\_collections** list / elements=string | | Collection of NAT rule collections used by Azure Firewall. |
| | **action** string | **Choices:*** snat
* dnat
| The action type of a NAT rule collection |
| | **name** string | | Gets name of the resource that is unique within a resource group. This name can be used to access the resource. |
| | **priority** integer | | Priority of the NAT rule collection resource. |
| | **rules** list / elements=string | | Collection of rules used by a NAT rule collection. |
| | | **description** string | | Description of the rule. |
| | | **destination\_addresses** list / elements=string | | List of destination IP addresses for this rule. |
| | | **destination\_ports** list / elements=string | | List of destination ports. |
| | | **name** string | | Name of the NAT rule. |
| | | **protocols** list / elements=string | | Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. |
| | | **source\_addresses** list / elements=string | | List of source IP addresses for this rule. |
| | | **translated\_address** string | | The translated address for this NAT rule. |
| | | **translated\_port** string | | The translated port for this NAT rule. |
| **network\_rule\_collections** list / elements=string | | Collection of network rule collections used by Azure Firewall. |
| | **action** string | **Choices:*** allow
* deny
| The action type of a rule collection. |
| | **name** string | | Gets name of the resource that is unique within a resource group. This name can be used to access the resource. |
| | **priority** integer | | Priority of the network rule collection resource. |
| | **rules** list / elements=string | | Collection of rules used by a network rule collection. |
| | | **description** string | | Description of the rule. |
| | | **destination\_addresses** list / elements=string | | List of destination IP addresses. |
| | | **destination\_ports** list / elements=string | | List of destination ports. |
| | | **name** string | | Name of the network rule. |
| | | **protocols** list / elements=string | | Array of AzureFirewallNetworkRuleProtocols. |
| | | **source\_addresses** list / elements=string | | List of source IP addresses for this rule. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the AzureFirewall. Use `present` to create or update an AzureFirewall and `absent` to delete it. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create Azure Firewall
azure_rm_azurefirewall:
resource_group: myResourceGroup
name: myAzureFirewall
tags:
key1: value1
application_rule_collections:
- priority: 110
action:
type: deny
rules:
- name: rule1
description: Deny inbound rule
source_addresses:
- 216.58.216.164
- 10.0.0.0/24
protocols:
- type: https
port: '443'
target_fqdns:
- www.test.com
name: apprulecoll
nat_rule_collections:
- priority: 112
action:
type: dnat
rules:
- name: DNAT-HTTPS-traffic
description: D-NAT all outbound web traffic for inspection
source_addresses:
- '*'
destination_addresses:
- 1.2.3.4
destination_ports:
- '443'
protocols:
- tcp
translated_address: 1.2.3.5
translated_port: '8443'
name: natrulecoll
network_rule_collections:
- priority: 112
action:
type: deny
rules:
- name: L4-traffic
description: Block traffic based on source IPs and ports
protocols:
- tcp
source_addresses:
- 192.168.1.1-192.168.1.12
- 10.1.4.12-10.1.4.255
destination_addresses:
- '*'
destination_ports:
- 443-444
- '8443'
name: netrulecoll
ip_configurations:
- subnet: >-
/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup
/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork
/subnets/AzureFirewallSubnet
public_ip_address: >-
/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup
/providers/Microsoft.Network/publicIPAddresses/
myPublicIpAddress
name: azureFirewallIpConfiguration
- name: Delete Azure Firewall
azure_rm_azurefirewall:
resource_group: myResourceGroup
name: myAzureFirewall
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/azureFirewalls/myAzureFirewall |
### Authors
* Zim Kalinowski (@zikalino)
* Jurijs Fadejevs (@needgithubid)
ansible azure.azcollection.azure_rm_loadbalancer – Manage Azure load balancers azure.azcollection.azure\_rm\_loadbalancer – Manage Azure load balancers
========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_loadbalancer`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete Azure load balancers.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **backend\_address\_pools** string | | List of backend address pools. |
| | **name** string / required | | Name of the backend address pool. |
| **backend\_port** string | | (deprecated) Backend port that will be exposed for the load balancer. This option has been deprecated, and will be removed in 2.9. Use *load\_balancing\_rules* instead. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **frontend\_ip\_configurations** string | | List of frontend IPs to be used. |
| | **name** string / required | | Name of the frontend ip configuration. |
| | **private\_ip\_address** string | | The reference of the Public IP resource. |
| | **private\_ip\_allocation\_method** string | **Choices:*** Static
* Dynamic
| The Private IP allocation method. |
| | **public\_ip\_address** string | | Name of an existing public IP address object in the current resource group to associate with the security group. |
| | **subnet** string | | The reference of the subnet resource. Should be an existing subnet's resource id. |
| **frontend\_port** string | | (deprecated) Frontend port that will be exposed for the load balancer. This option has been deprecated, and will be removed in 2.9. Use *load\_balancing\_rules* instead. |
| **idle\_timeout** string | **Default:**4 | (deprecated) Timeout for TCP idle connection in minutes. This option has been deprecated, and will be removed in 2.9. Use *load\_balancing\_rules* instead. |
| **inbound\_nat\_pools** string | | Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. |
| | **backend\_port** string | | The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. |
| | **frontend\_ip\_configuration\_name** string / required | | A reference to frontend IP addresses. |
| | **frontend\_port\_range\_end** string / required | | The last port in the range of external ports that will be used to provide inbound NAT to NICs associated with the load balancer. Acceptable values range between 1 and 65535. |
| | **frontend\_port\_range\_start** string / required | | The first port in the range of external ports that will be used to provide inbound NAT to NICs associated with the load balancer. Acceptable values range between 1 and 65534. |
| | **name** string / required | | Name of the inbound NAT pool. |
| | **protocol** string | **Choices:*** Tcp
* Udp
* All
| IP protocol for the NAT pool. |
| **inbound\_nat\_rules** string | | Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. |
| | **backend\_port** string | | The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". |
| | **enable\_floating\_ip** string | | Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. |
| | **enable\_tcp\_reset** string | | Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when *protocol=Tcp*. |
| | **frontend\_ip\_configuration** string / required | | A reference to frontend IP addresses. |
| | **frontend\_port** string | | The port for the external endpoint. Frontend port numbers must be unique across all rules within the load balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". |
| | **idle\_timeout** string | | The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is `4` minutes. This element is only used when *protocol=Tcp*. |
| | **name** string / required | | name of the inbound nat rule. |
| | **protocol** string | **Choices:*** Tcp
* Udp
* All
| IP protocol for the inbound nat rule. |
| **load\_balancing\_rules** string | | Object collection representing the load balancing rules Gets the provisioning. |
| | **backend\_address\_pool** string / required | | A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. |
| | **backend\_port** string | | The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". |
| | **enable\_floating\_ip** string | | Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. |
| | **frontend\_ip\_configuration** string / required | | A reference to frontend IP addresses. |
| | **frontend\_port** string | | The port for the external endpoint. Frontend port numbers must be unique across all rules within the load balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". |
| | **idle\_timeout** string | | The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is `4` minutes. This element is only used when the protocol is set to TCP. |
| | **load\_distribution** string | **Choices:*** **Default** ←
* SourceIP
* SourceIPProtocol
| The session persistence policy for this rule; `Default` is no persistence. |
| | **name** string / required | | Name of the load balancing rule. |
| | **probe** string / required | | The name of the load balancer probe this rule should use for health checks. |
| | **protocol** string | **Choices:*** Tcp
* Udp
* All
| IP protocol for the load balancing rule. |
| **load\_distribution** string | **Choices:*** Default
* SourceIP
* SourceIPProtocol
| (deprecated) The type of load distribution that the load balancer will employ. This option has been deprecated, and will be removed in 2.9. Use *load\_balancing\_rules* instead. |
| **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 load balancer. |
| **natpool\_backend\_port** string | | (deprecated) Backend port used by the NAT pool. This option has been deprecated, and will be removed in 2.9. Use *inbound\_nat\_pools* instead. |
| **natpool\_frontend\_port\_end** string | | (deprecated) End of the port range for a NAT pool. This option has been deprecated, and will be removed in 2.9. Use *inbound\_nat\_pools* instead. |
| **natpool\_frontend\_port\_start** string | | (deprecated) Start of the port range for a NAT pool. This option has been deprecated, and will be removed in 2.9. Use *inbound\_nat\_pools* instead. |
| **natpool\_protocol** string | | (deprecated) The protocol for the NAT pool. This option has been deprecated, and will be removed in 2.9. Use *inbound\_nat\_pools* instead. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **probe\_fail\_count** string | **Default:**3 | (deprecated) The amount of probe failures for the load balancer to make a health determination. This option has been deprecated, and will be removed in 2.9. Use *probes* instead. |
| **probe\_interval** string | **Default:**15 | (deprecated) Time (in seconds) between endpoint health probes. This option has been deprecated, and will be removed in 2.9. Use *probes* instead. |
| **probe\_port** string | | (deprecated) The port that the health probe will use. This option has been deprecated, and will be removed in 2.9. Use *probes* instead. |
| **probe\_protocol** string | **Choices:*** Tcp
* Http
* Https
| (deprecated) The protocol to use for the health probe. This option has been deprecated, and will be removed in 2.9. Use *probes* instead. |
| **probe\_request\_path** string | | (deprecated) The URL that an HTTP probe or HTTPS probe will use (only relevant if *probe\_protocol=Http* or *probe\_protocol=Https*). This option has been deprecated, and will be removed in 2.9. Use *probes* instead. |
| **probes** string | | List of probe definitions used to check endpoint health. |
| | **fail\_count** string | **Default:**3 | The number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure.
aliases: number\_of\_probes |
| | **interval** string | **Default:**15 | The interval, in seconds, for how frequently to probe the endpoint for health status. Slightly less than half the allocated timeout period, which allows two full probes before taking the instance out of rotation. The default value is `15`, the minimum value is `5`. |
| | **name** string / required | | Name of the probe. |
| | **port** string / required | | Probe port for communicating the probe. Possible values range from 1 to 65535, inclusive. |
| | **protocol** string | **Choices:*** Tcp
* Http
* Https
| The protocol of the end point to be probed. If `Tcp` is specified, a received ACK is required for the probe to be successful. If `Http` or `Https` is specified, a 200 OK response from the specified URL is required for the probe to be successful. |
| | **request\_path** string | | The URI used for requesting health status from the VM. Path is required if *protocol=Http* or *protocol=Https*. Otherwise, it is not allowed. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **protocol** string | **Choices:*** Tcp
* Udp
| (deprecated) The protocol (TCP or UDP) that the load balancer will use. This option has been deprecated, and will be removed in 2.9. Use *load\_balancing\_rules* instead. |
| **public\_ip\_address\_name** string | | (deprecated) Name of an existing public IP address object to associate with the security group. This option has been deprecated, and will be removed in 2.9. Use *frontend\_ip\_configurations* instead.
aliases: public\_ip\_address, public\_ip\_name, public\_ip |
| **resource\_group** string / required | | Name of a resource group where the load balancer exists or will be created. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | **Choices:*** Basic
* Standard
| The load balancer SKU. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the load balancer. Use `present` to create/update a load balancer, or `absent` to delete one. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: create load balancer
azure_rm_loadbalancer:
resource_group: myResourceGroup
name: testloadbalancer1
frontend_ip_configurations:
- name: frontendipconf0
public_ip_address: testpip
backend_address_pools:
- name: backendaddrpool0
probes:
- name: prob0
port: 80
inbound_nat_pools:
- name: inboundnatpool0
frontend_ip_configuration_name: frontendipconf0
protocol: Tcp
frontend_port_range_start: 80
frontend_port_range_end: 81
backend_port: 8080
load_balancing_rules:
- name: lbrbalancingrule0
frontend_ip_configuration: frontendipconf0
backend_address_pool: backendaddrpool0
frontend_port: 80
backend_port: 80
probe: prob0
inbound_nat_rules:
- name: inboundnatrule0
backend_port: 8080
protocol: Tcp
frontend_port: 8080
frontend_ip_configuration: frontendipconf0
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **changed** boolean | always | Whether or not the resource has changed. |
| **state** dictionary | always | Current state of the load balancer. |
### Authors
* Thomas Stringer (@trstringer)
* Yuwei Zhou (@yuwzho)
| programming_docs |
ansible azure.azcollection.azure_rm_rediscachefirewallrule – Manage Azure Cache for Redis Firewall rules azure.azcollection.azure\_rm\_rediscachefirewallrule – Manage Azure Cache for Redis Firewall rules
==================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_rediscachefirewallrule`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete Azure Cache for Redis Firewall rules.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cache\_name** string / required | | Name of the Azure Cache for Redis. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **end\_ip\_address** string | | The end IP address of the Azure Cache for Redis Firewall rule. Must be IPv4 format. Required when creating Firewall rule. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the Firewall rule. |
| **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 / required | | Name of the resource group to which the resource belongs. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **start\_ip\_address** string | | The start IP address of the Azure Cache for Redis Firewall rule. Must be IPv4 format. Required when creating Firewall rule. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Firewall rule of Azure Cache for Redis. Use `present` to create or update Firewall rule of Azure Cache for Redis and `absent` to delete it. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a Firewall rule for Azure Cache for Redis
azure_rm_rediscachefirewallrule:
resource_group: myResourceGroup
cache_name: myRedisCache
name: myRule
start_ip_address: 192.168.1.1
end_ip_address: 192.168.1.4
- name: Update a Firewall rule for Azure Cache for Redis
azure_rm_rediscachefirewallrule:
resource_group: myResourceGroup
cache_name: myRedisCache
name: myRule
end_ip_address: 192.168.1.5
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Id of the Azure Cache for Redis. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Cache/redis/myRedis/firewallRules/myRule |
### Authors
* Yunge Zhu(@yungezz)
ansible azure.azcollection.azure_rm_virtualwan – Manage Azure VirtualWan instance azure.azcollection.azure\_rm\_virtualwan – Manage Azure VirtualWan instance
===========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualwan`.
New in version 1.5.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure VirtualWan.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **allow\_branch\_to\_branch\_traffic** boolean | **Choices:*** no
* yes
| True if branch to branch traffic is allowed. |
| **allow\_vnet\_to\_vnet\_traffic** boolean | **Choices:*** no
* yes
| True if Vnet to Vnet traffic is allowed. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **disable\_vpn\_encryption** boolean | **Choices:*** no
* yes
| Vpn encryption to be disabled or not. |
| **location** string | | The virtual wan location. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the VirtualWAN being retrieved. |
| **office365\_local\_breakout\_category** string | **Choices:*** Optimize
* OptimizeAndAllow
* All
* None
| Specifies the Office365 local breakout category. Default value is `None`. |
| **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 / required | | The resource group name of the VirtualWan. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the VirtualWan. Use `present` to create or update an VirtualWan and `absent` to delete it. |
| **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. |
| **virtual\_hubs** list / elements=string | | List of VirtualHubs in the VirtualWAN. |
| | **id** string | | The virtual hub resource ID. |
| **virtual\_wan\_type** string | **Choices:*** Basic
* Standard
| The type of the VirtualWAN. |
| **vpn\_sites** list / elements=string | | List of VpnSites in the VirtualWAN. |
| | **id** string | | The vpn site resource ID. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a VirtualWan
azure_rm_virtualwan:
resource_group: myResouceGroup
name: testwan
disable_vpn_encryption: true
allow_branch_to_branch_traffic: true
allow_vnet_to_vnet_traffic: true
virtual_wan_type: Standard
- name: Delete the VirtualWan
azure_rm_virtualwan:
resource_group: myResouceGroup
name: testwan
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** complex | success | Current state of the virtual wan. |
| | **allow\_branch\_to\_branch\_traffic** boolean | always | True if branch to branch traffic is allowed. **Sample:** True |
| | **allow\_vnet\_to\_vnet\_traffic** boolean | always | True if Vnet to Vnet traffic is allowed. **Sample:** True |
| | **disable\_vpn\_encryption** boolean | always | Vpn encryption to be disabled or not. **Sample:** True |
| | **etag** string | always | A unique read-only string that changes whenever the resource is updated. **Sample:** 52def36b-84b6-49aa-a825-16ba167fc559 |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualWans/virtual\_wan\_name |
| | **location** string | always | The virtual wan resource location. **Sample:** eastus |
| | **name** string | always | Resource name. **Sample:** virtualwanb57dc9555691 |
| | **office365\_local\_breakout\_category** string | always | The office local breakout category. **Sample:** None |
| | **provisioning\_state** string | always | The provisioning state of the virtual WAN resource. **Sample:** Succeeded |
| | **tags** dictionary | always | Resource tags. **Sample:** {'key1': 'value1'} |
| | **type** string | always | Resource type. **Sample:** Microsoft.Network/virtualWans |
| | **virtual\_hubs** complex | always | List of VirtualHubs in the VirtualWAN. |
| | | **id** string | always | The virtual hubs ID. **Sample:** /subscriptions/xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualHubs/test |
| | **virtual\_wan\_type** string | always | The type of the VirtualWAN. **Sample:** Standard |
| | **vpn\_sites** list / elements=string | always | List of VpnSites in the VirtualWAN. |
| | | **id** string | always | The vpn sites resouce ID. **Sample:** /subscriptions/xxx-xxx/resourceGroups/resource\_group/providers/Microsoft.Network/vpnSites/test1 |
### Authors
* Fred-Sun (@Fred-Sun)
ansible azure.azcollection.azure_rm_vpnsite_info – Get VpnSite info azure.azcollection.azure\_rm\_vpnsite\_info – Get VpnSite info
==============================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_vpnsite_info`.
New in version 1.5.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get info of VpnSite.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the VpnSite being retrieved. |
| **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 | | The resource group name of the VpnSite. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get Vpn Site Info by name
azure_rm_vpnsite_info:
resource_group: myResourceGroup
name: vwan_site_name
- name: Get Vpn Site List By ResourceGroup
azure_rm_vpnsite_info:
resource_group: myResourceGroup
- name: Get Vpn Site List By Subscription
azure_rm_vpnsite_info:
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **vpn\_sites** complex | always | A list of dict results where the key is the name of the VpnSite and the values are the facts for that VpnSite. |
| | **address\_space** dictionary | always | The AddressSpace that contains an array of IP address ranges. **Sample:** {'address\_prefixes': ['10.0.0.0/24']} |
| | **device\_properties** dictionary | always | The device properties. **Sample:** {'device\_vendor': 'myVM', 'link\_speed\_in\_mbps': 0} |
| | **etag** string | always | A unique read-only string that changes whenever the resource is updated. **Sample:** 1d8c0731-adc6-4022-9c70-3c389cd73e2a |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/vpnSites/vwam\_site\_name |
| | **is\_security\_site** boolean | always | IsSecuritySite flag. |
| | **location** string | always | Resource location. **Sample:** eastus |
| | **name** string | always | Resource name. **Sample:** vwan\_site\_name |
| | **o365\_policy** dictionary | always | Office365 Policy. **Sample:** {'break\_out\_categories': {'allow': False, 'default': False, 'optimize': False}} |
| | **provisioning\_state** string | always | The provisioning state of the VPN site resource. **Sample:** succeeded |
| | **tags** dictionary | always | Resource tags. **Sample:** {'key1': 'value1'} |
| | **type** string | always | Resource type. **Sample:** Microsoft.Network/vpnSites |
| | **virtual\_wan** dictionary | always | The VirtualWAN to which the vpnSite belongs. **Sample:** {'id': '/subscriptions/xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualWans/vwan\_name'} |
| | **vpn\_site\_links** complex | always | List of all vpn site links. |
| | | **etag** string | always | A unique read-only string that changes whenever the resource is updated. **Sample:** 1d8c0731-adc6-4022-9c70-3c389cd73e2a |
| | | **id** string | always | Resource ID. **Sample:** /subscriptions/xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/vpnSites/vwam\_site\_name |
| | | **ip\_address** string | always | The ip-address for the vpn-site-link. **Sample:** 192.168.33.223 |
| | | **link\_properties** dictionary | always | The link provider properties. **Sample:** {'link\_provider\_name': 'azureuser', 'link\_speed\_in\_mbps': 100} |
| | | **name** string | always | The name of the resource that is unique within a resource group. This name can be used to access the resource. **Sample:** azureuser |
| | | **type** string | always | Resource type. **Sample:** Microsoft.Network/vpnSites |
### Authors
* Fred-Sun (@Fred-Sun)
| programming_docs |
ansible azure.azcollection.azure_rm_postgresqlserver – Manage PostgreSQL Server instance azure.azcollection.azure\_rm\_postgresqlserver – Manage PostgreSQL Server instance
==================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_postgresqlserver`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of PostgreSQL Server.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **admin\_password** string | | The password of the administrator login. |
| **admin\_username** string | | The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **backup\_retention\_days** integer | | Backup retention period between 7 and 35 days. 7 days by default if not set |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **create\_mode** string | **Choices:*** **default** ←
* geo\_restore
* point\_in\_time\_restore
| Create mode of SQL Server. Blank (default), restore from geo redundant (geo\_restore), or restore from point in time (point\_in\_time\_restore). |
| **enforce\_ssl** boolean | **Choices:*** **no** ←
* yes
| Enable SSL enforcement. |
| **geo\_redundant\_backup** boolean | **Choices:*** **no** ←
* yes
| Choose between locally redundant(default) or geo-redundant backup. This cannot be updated after first deployment |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the server. |
| **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 / required | | The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
| **restore\_point\_in\_time** string | | Restore point creation time (ISO8601 format), specifying the time to restore from. Required if *create\_mode=point\_in\_time\_restore*. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** dictionary | | The SKU (pricing tier) of the server. |
| | **capacity** string | | The scale up/out capacity, representing server's compute units. |
| | **name** string | | The name of the SKU, typically, tier + family + cores, for example `B_Gen4_1`, `GP_Gen5_8`. |
| | **size** string | | The size code, to be interpreted by resource as appropriate. |
| | **tier** string | **Choices:*** Basic
* Standard
| The tier of the particular SKU, for example `Basic`. |
| **source\_server\_id** string | | Id if the source server if *create\_mode=default*. |
| **state** string | **Choices:*** **present** ←
* absent
| Assert the state of the PostgreSQL server. Use `present` to create or update a server and `absent` to delete it. |
| **storage\_autogrow** boolean | **Choices:*** **no** ←
* yes
| Enable storage autogrow. |
| **storage\_mb** integer | | The maximum storage allowed for a server. |
| **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. |
| **version** string | **Choices:*** 9.5
* 9.6
* 10
* 11
| Server version. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create (or update) PostgreSQL Server
azure_rm_postgresqlserver:
resource_group: myResourceGroup
name: testserver
sku:
name: B_Gen5_1
tier: Basic
location: eastus
storage_mb: 1024
enforce_ssl: True
storage_autogrow: True
admin_username: cloudsa
admin_password: password
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **fully\_qualified\_domain\_name** string | always | The fully qualified domain name of a server. **Sample:** postgresqlsrv1b6dd89593.postgresql.database.azure.com |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/mysqlsrv1b6dd89593 |
| **state** string | always | A state of a server that is visible to user. Possible values include `Ready`, `Dropping`, `Disabled`. **Sample:** Ready |
| **version** string | always | Server version. Possible values include `9.5`, `9.6`, `10`, `11`. **Sample:** 9.6 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_deployment – Create or destroy Azure Resource Manager template deployments azure.azcollection.azure\_rm\_deployment – Create or destroy Azure Resource Manager template deployments
========================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_deployment`.
New in version 0.1.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create or destroy Azure Resource Manager template deployments via the Azure SDK for Python.
* You can find some quick start templates in GitHub here <https://github.com/azure/azure-quickstart-templates>.
* For more information on Azure Resource Manager templates see <https://azure.microsoft.com/en-us/documentation/articles/resource-group-template-deploy/>.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **deployment\_mode** string | **Choices:*** complete
* **incremental** ←
| In incremental mode, resources are deployed without deleting existing resources that are not included in the template. In complete mode resources are deployed and existing resources in the resource group not included in the template are deleted. |
| **location** string | **Default:**"westus" | The geo-locations in which the resource group will be located. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | **Default:**"ansible-arm" | The name of the deployment to be tracked in the resource group deployment history. Re-using a deployment name will overwrite the previous value in the resource group's deployment history.
aliases: deployment\_name |
| **parameters** dictionary | | A hash of all the required template variables for the deployment template. This parameter is mutually exclusive with *parameters\_link*. Either *parameters\_link* or *parameters* is required if *state=present*. |
| **parameters\_link** string | | Uri of file containing the parameters body. This parameter is mutually exclusive with *parameters*. Either *parameters\_link* or *parameters* is required if *state=present*. |
| **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 / required | | The resource group name to use or create to host the deployed template.
aliases: resource\_group\_name |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** **present** ←
* absent
| If *state=present*, template will be created. If *state=present* and deployment exists, it will be updated. If *state=absent*, the resource group will be removed. |
| **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. |
| **template** dictionary | | A hash containing the templates inline. This parameter is mutually exclusive with *template\_link*. Either *template* or *template\_link* is required if *state=present*. |
| **template\_link** string | | Uri of file containing the template body. This parameter is mutually exclusive with *template*. Either *template* or *template\_link* is required if *state=present*. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **wait\_for\_deployment\_completion** boolean | **Choices:*** no
* **yes** ←
| Whether or not to block until the deployment has completed. |
| **wait\_for\_deployment\_polling\_period** string | **Default:**10 | Time (in seconds) to wait between polls when waiting for deployment completion. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
# Destroy a template deployment
- name: Destroy Azure Deploy
azure_rm_deployment:
resource_group: myResourceGroup
name: myDeployment
state: absent
# Create or update a template deployment based on uris using parameter and template links
- name: Create Azure Deploy
azure_rm_deployment:
resource_group: myResourceGroup
name: myDeployment
template_link: 'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-simple-linux/azuredeploy.json'
parameters_link: 'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-simple-linux/azuredeploy.parameters.json'
# Create or update a template deployment based on a uri to the template and parameters specified inline.
# This deploys a VM with SSH support for a given public key, then stores the result in 'azure_vms'. The result is then
# used to create a new host group. This host group is then used to wait for each instance to respond to the public IP SSH.
- name: Create Azure Deploy
azure_rm_deployment:
resource_group: myResourceGroup
name: myDeployment
parameters:
newStorageAccountName:
value: devopsclestorage1
adminUsername:
value: devopscle
dnsNameForPublicIP:
value: devopscleazure
location:
value: West US
vmSize:
value: Standard_A2
vmName:
value: ansibleSshVm
sshKeyData:
value: YOUR_SSH_PUBLIC_KEY
template_link: 'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-sshkey/azuredeploy.json'
register: azure
- name: Add new instance to host group
add_host:
hostname: "{{ item['ips'][0].public_ip }}"
groupname: azure_vms
loop: "{{ azure.deployment.instances }}"
# Deploy an Azure WebApp running a hello world'ish node app
- name: Create Azure WebApp Deployment at http://devopscleweb.azurewebsites.net/hello.js
azure_rm_deployment:
resource_group: myResourceGroup
name: myDeployment
parameters:
repoURL:
value: 'https://github.com/devigned/az-roadshow-oss.git'
siteName:
value: devopscleweb
hostingPlanName:
value: someplan
siteLocation:
value: westus
sku:
value: Standard
template_link: 'https://raw.githubusercontent.com/azure/azure-quickstart-templates/master/201-web-app-github-deploy/azuredeploy.json'
# Create or update a template deployment based on an inline template and parameters
- name: Create Azure Deploy
azure_rm_deployment:
resource_group: myResourceGroup
name: myDeployment
template:
$schema: "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#"
contentVersion: "1.0.0.0"
parameters:
newStorageAccountName:
type: "string"
metadata:
description: "Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed."
adminUsername:
type: "string"
metadata:
description: "User name for the Virtual Machine."
adminPassword:
type: "securestring"
metadata:
description: "Password for the Virtual Machine."
dnsNameForPublicIP:
type: "string"
metadata:
description: "Unique DNS Name for the Public IP used to access the Virtual Machine."
ubuntuOSVersion:
type: "string"
defaultValue: "14.04.2-LTS"
allowedValues:
- "12.04.5-LTS"
- "14.04.2-LTS"
- "15.04"
metadata:
description: >
The Ubuntu version for the VM. This will pick a fully patched image of this given Ubuntu version.
Allowed values: 12.04.5-LTS, 14.04.2-LTS, 15.04."
variables:
location: "West US"
imagePublisher: "Canonical"
imageOffer: "UbuntuServer"
OSDiskName: "osdiskforlinuxsimple"
nicName: "myVMNic"
addressPrefix: "192.0.2.0/24"
subnetName: "Subnet"
subnetPrefix: "10.0.0.0/24"
storageAccountType: "Standard_LRS"
publicIPAddressName: "myPublicIP"
publicIPAddressType: "Dynamic"
vmStorageAccountContainerName: "vhds"
vmName: "MyUbuntuVM"
vmSize: "Standard_D1"
virtualNetworkName: "MyVNET"
vnetID: "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]"
subnetRef: "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]"
resources:
- type: "Microsoft.Storage/storageAccounts"
name: "[parameters('newStorageAccountName')]"
apiVersion: "2015-05-01-preview"
location: "[variables('location')]"
properties:
accountType: "[variables('storageAccountType')]"
- apiVersion: "2015-05-01-preview"
type: "Microsoft.Network/publicIPAddresses"
name: "[variables('publicIPAddressName')]"
location: "[variables('location')]"
properties:
publicIPAllocationMethod: "[variables('publicIPAddressType')]"
dnsSettings:
domainNameLabel: "[parameters('dnsNameForPublicIP')]"
- type: "Microsoft.Network/virtualNetworks"
apiVersion: "2015-05-01-preview"
name: "[variables('virtualNetworkName')]"
location: "[variables('location')]"
properties:
addressSpace:
addressPrefixes:
- "[variables('addressPrefix')]"
subnets:
-
name: "[variables('subnetName')]"
properties:
addressPrefix: "[variables('subnetPrefix')]"
- type: "Microsoft.Network/networkInterfaces"
apiVersion: "2015-05-01-preview"
name: "[variables('nicName')]"
location: "[variables('location')]"
dependsOn:
- "[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]"
- "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
properties:
ipConfigurations:
-
name: "ipconfig1"
properties:
privateIPAllocationMethod: "Dynamic"
publicIPAddress:
id: "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"
subnet:
id: "[variables('subnetRef')]"
- type: "Microsoft.Compute/virtualMachines"
apiVersion: "2015-06-15"
name: "[variables('vmName')]"
location: "[variables('location')]"
dependsOn:
- "[concat('Microsoft.Storage/storageAccounts/', parameters('newStorageAccountName'))]"
- "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
properties:
hardwareProfile:
vmSize: "[variables('vmSize')]"
osProfile:
computername: "[variables('vmName')]"
adminUsername: "[parameters('adminUsername')]"
adminPassword: "[parameters('adminPassword')]"
storageProfile:
imageReference:
publisher: "[variables('imagePublisher')]"
offer: "[variables('imageOffer')]"
sku: "[parameters('ubuntuOSVersion')]"
version: "latest"
osDisk:
name: "osdisk"
vhd:
uri: >
[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',
variables('OSDiskName'),'.vhd')]
caching: "ReadWrite"
createOption: "FromImage"
networkProfile:
networkInterfaces:
-
id: "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]"
diagnosticsProfile:
bootDiagnostics:
enabled: "true"
storageUri: "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net')]"
parameters:
newStorageAccountName:
value: devopsclestorage
adminUsername:
value: devopscle
adminPassword:
value: Password1!
dnsNameForPublicIP:
value: devopscleazure
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **deployment** complex | always | Deployment details. |
| | **group\_name** string | always | Name of the resource group. **Sample:** myResourceGroup |
| | **id** string | always | The Azure ID of the deployment. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/myD eployment |
| | **instances** list / elements=string | always | Provides the public IP addresses for each VM instance. |
| | | **ips** list / elements=string | always | List of Public IP addresses. |
| | | | **dns\_settings** complex | always | DNS Settings. |
| | | | | **domain\_name\_label** string | always | Domain Name Label. **Sample:** myvirtualmachine |
| | | | | **fqdn** string | always | Fully Qualified Domain Name. **Sample:** myvirtualmachine.eastus2.cloudapp.azure.com |
| | | | **id** string | always | Public IP resource id. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/p ublicIPAddresses/myPublicIP |
| | | | **name** string | always | Public IP resource name. **Sample:** myPublicIP |
| | | | **public\_ip** string | always | Public IP address value. **Sample:** 104.209.244.123 |
| | | | **public\_ip\_allocation\_method** string | always | Public IP allocation method. **Sample:** Dynamic |
| | | **vm\_name** string | always | Virtual machine name. **Sample:** myvirtualmachine |
| | **name** string | always | Name of the deployment. **Sample:** myDeployment |
| | **outputs** complex | always | Dictionary of outputs received from the deployment. **Sample:** {'hostname': {'type': 'String', 'value': 'myvirtualmachine.eastus2.cloudapp.azure.com'}} |
### Authors
* David Justice (@devigned)
* Laurent Mazuel (@lmazuel)
* Andre Price (@obsoleted)
| programming_docs |
ansible azure.azcollection.azure_rm_appgateway – Manage Application Gateway instance azure.azcollection.azure\_rm\_appgateway – Manage Application Gateway instance
==============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_appgateway`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Application Gateway.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **authentication\_certificates** string | | Authentication certificates of the application gateway resource. |
| | **data** string | | Certificate public data - base64 encoded pfx. |
| | **name** string | | Name of the resource that is unique within a resource group. This name can be used to access the resource. |
| **backend\_address\_pools** string | | List of backend address pool of the application gateway resource. |
| | **backend\_addresses** string | | List of backend addresses. |
| | | **fqdn** string | | Fully qualified domain name (FQDN). |
| | | **ip\_address** string | | IP address. |
| | **name** string | | Resource that is unique within a resource group. This name can be used to access the resource. |
| **backend\_http\_settings\_collection** string | | Backend http settings of the application gateway resource. |
| | **affinity\_cookie\_name** string | | Cookie name to use for the affinity cookie. |
| | **authentication\_certificates** string | | List of references to application gateway authentication certificates. Applicable only when `cookie_based_affinity` is enabled, otherwise quietly ignored. |
| | | **id** string | | Resource ID. |
| | **cookie\_based\_affinity** string | **Choices:*** enabled
* disabled
| Cookie based affinity. |
| | **host\_name** string | | Host header to be sent to the backend servers. |
| | **name** string | | Name of the resource that is unique within a resource group. This name can be used to access the resource. |
| | **path** string | | Path which should be used as a prefix for all `http` requests. Null means no path will be prefixed. Default value is null. |
| | **pick\_host\_name\_from\_backend\_address** string | | Whether host header should be picked from the host name of the backend server. Default value is false. |
| | **port** string | | The destination port on the backend. |
| | **probe** string | | Probe resource of an application gateway. |
| | **protocol** string | **Choices:*** http
* https
| The protocol used to communicate with the backend. |
| | **request\_timeout** string | | Request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **frontend\_ip\_configurations** string | | Frontend IP addresses of the application gateway resource. |
| | **name** string | | Name of the resource that is unique within a resource group. This name can be used to access the resource. |
| | **private\_ip\_address** string | | PrivateIPAddress of the network interface IP Configuration. |
| | **private\_ip\_allocation\_method** string | **Choices:*** static
* dynamic
| PrivateIP allocation method. |
| | **public\_ip\_address** string | | Reference of the PublicIP resource. |
| | **subnet** string | | Reference of the subnet resource. |
| | | **id** string | | Full ID of the subnet resource. Required if name and virtual\_network\_name are not provided. |
| | | **name** string | | Name of the subnet. Only used if virtual\_network\_name is also provided. |
| | | **virtual\_network\_name** string | | Name of the virtual network. Only used if name is also provided. |
| **frontend\_ports** string | | List of frontend ports of the application gateway resource. |
| | **name** string | | Name of the resource that is unique within a resource group. This name can be used to access the resource. |
| | **port** string | | Frontend port. |
| **gateway\_ip\_configurations** string | | List of subnets used by the application gateway. |
| | **name** string | | Name of the resource that is unique within a resource group. This name can be used to access the resource. |
| | **subnet** string | | Reference of the subnet resource. A subnet from where application gateway gets its private address. |
| | | **id** string | | Full ID of the subnet resource. Required if name and virtual\_network\_name are not provided. |
| | | **name** string | | Name of the subnet. Only used if virtual\_network\_name is also provided. |
| | | **virtual\_network\_name** string | | Name of the virtual network. Only used if name is also provided. |
| **http\_listeners** string | | List of HTTP listeners of the application gateway resource. |
| | **frontend\_ip\_configuration** string | | Frontend IP configuration resource of an application gateway. |
| | **frontend\_port** string | | Frontend port resource of an application gateway. |
| | **host\_name** string | | Host name of `http` listener. |
| | **name** string | | Name of the resource that is unique within a resource group. This name can be used to access the resource. |
| | **protocol** string | **Choices:*** http
* https
| Protocol of the `http` listener. |
| | **require\_server\_name\_indication** string | | Applicable only if *protocol* is `https`. Enables SNI for multi-hosting. |
| | **ssl\_certificate** string | | SSL certificate resource of an application gateway. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the application gateway. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **probes** string | | Probes available to the application gateway resource. |
| | **host** string | | Host name to send the *probe* to. |
| | **interval** string | | The probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds. |
| | **name** string | | Name of the *probe* that is unique within an Application Gateway. |
| | **path** string | | Relative path of *probe*. Valid path starts from '/'. Probe is sent to <Protocol>://<host>:<port><path>. |
| | **pick\_host\_name\_from\_backend\_http\_settings** boolean | **Choices:*** **no** ←
* yes
| Whether host header should be picked from the host name of the backend HTTP settings. Default value is false. |
| | **protocol** string | **Choices:*** http
* https
| The protocol used for the *probe*. |
| | **timeout** string | | The probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds. |
| | **unhealthy\_threshold** string | | The *probe* retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **redirect\_configurations** string | | Redirect configurations of the application gateway resource. |
| | **include\_path** string | | Include path in the redirected url. |
| | **include\_query\_string** string | | Include query string in the redirected url. |
| | **name** string | | Name of the resource that is unique within a resource group. |
| | **redirect\_type** string | **Choices:*** permanent
* found
* see\_other
* temporary
| Redirection type. |
| | **target\_listener** string | | Reference to a listener to redirect the request to. |
| **request\_routing\_rules** string | | List of request routing rules of the application gateway resource. |
| | **backend\_address\_pool** string | | Backend address pool resource of the application gateway. Not used if *rule\_type* is `path_based_routing`. |
| | **backend\_http\_settings** string | | Backend `http` settings resource of the application gateway. |
| | **http\_listener** string | | Http listener resource of the application gateway. |
| | **name** string | | Name of the resource that is unique within a resource group. This name can be used to access the resource. |
| | **redirect\_configuration** string | | Redirect configuration resource of the application gateway. |
| | **rule\_type** string | **Choices:*** basic
* path\_based\_routing
| Rule type. |
| | **url\_path\_map** string | | URL path map resource of the application gateway. Required if *rule\_type* is `path_based_routing`. |
| **resource\_group** string / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | | SKU of the application gateway resource. |
| | **capacity** string | | Capacity (instance count) of an application gateway. |
| | **name** string | **Choices:*** standard\_small
* standard\_medium
* standard\_large
* standard\_v2
* waf\_medium
* waf\_large
* waf\_v2
| Name of an application gateway SKU. |
| | **tier** string | **Choices:*** standard
* standard\_v2
* waf
* waf\_v2
| Tier of an application gateway. |
| **ssl\_certificates** string | | SSL certificates of the application gateway resource. |
| | **data** string | | Base-64 encoded pfx certificate. Only applicable in PUT Request. |
| | **name** string | | Name of the resource that is unique within a resource group. This name can be used to access the resource. |
| | **password** string | | Password for the pfx file specified in *data*. Only applicable in PUT request. |
| **ssl\_policy** string | | SSL policy of the application gateway resource. |
| | **cipher\_suites** string | **Choices:*** tls\_ecdhe\_rsa\_with\_aes\_256\_gcm\_sha384
* tls\_ecdhe\_rsa\_with\_aes\_128\_gcm\_sha256
* tls\_ecdhe\_rsa\_with\_aes\_256\_cbc\_sha384
* tls\_ecdhe\_rsa\_with\_aes\_128\_cbc\_sha256
* tls\_ecdhe\_rsa\_with\_aes\_256\_cbc\_sha
* tls\_ecdhe\_rsa\_with\_aes\_128\_cbc\_sha
* tls\_dhe\_rsa\_with\_aes\_256\_gcm\_sha384
* tls\_dhe\_rsa\_with\_aes\_128\_gcm\_sha256
* tls\_dhe\_rsa\_with\_aes\_256\_cbc\_sha
* tls\_dhe\_rsa\_with\_aes\_128\_cbc\_sha
* tls\_rsa\_with\_aes\_256\_gcm\_sha384
* tls\_rsa\_with\_aes\_128\_gcm\_sha256
* tls\_rsa\_with\_aes\_256\_cbc\_sha256
* tls\_rsa\_with\_aes\_128\_cbc\_sha256
* tls\_rsa\_with\_aes\_256\_cbc\_sha
* tls\_rsa\_with\_aes\_128\_cbc\_sha
* tls\_ecdhe\_ecdsa\_with\_aes\_256\_gcm\_sha384
* tls\_ecdhe\_ecdsa\_with\_aes\_128\_gcm\_sha256
* tls\_ecdhe\_ecdsa\_with\_aes\_256\_cbc\_sha384
* tls\_ecdhe\_ecdsa\_with\_aes\_128\_cbc\_sha256
* tls\_ecdhe\_ecdsa\_with\_aes\_256\_cbc\_sha
* tls\_ecdhe\_ecdsa\_with\_aes\_128\_cbc\_sha
* tls\_dhe\_dss\_with\_aes\_256\_cbc\_sha256
* tls\_dhe\_dss\_with\_aes\_128\_cbc\_sha256
* tls\_dhe\_dss\_with\_aes\_256\_cbc\_sha
* tls\_dhe\_dss\_with\_aes\_128\_cbc\_sha
* tls\_rsa\_with\_3des\_ede\_cbc\_sha
* tls\_dhe\_dss\_with\_3des\_ede\_cbc\_sha
| List of SSL cipher suites to be enabled in the specified order to application gateway. |
| | **disabled\_ssl\_protocols** string | **Choices:*** tls\_v1\_0
* tls\_v1\_1
* tls\_v1\_2
| List of SSL protocols to be disabled on application gateway. |
| | **min\_protocol\_version** string | **Choices:*** tls\_v1\_0
* tls\_v1\_1
* tls\_v1\_2
| Minimum version of Ssl protocol to be supported on application gateway. |
| | **policy\_name** string | **Choices:*** ssl\_policy20150501
* ssl\_policy20170401
* ssl\_policy20170401\_s
| Name of Ssl `predefined` policy. |
| | **policy\_type** string | **Choices:*** predefined
* custom
| Type of SSL Policy. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the Public IP. Use `present` to create or update a and `absent` to delete. |
| **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. |
| **url\_path\_maps** string | | List of URL path maps of the application gateway resource. |
| | **default\_backend\_address\_pool** string | | Backend address pool resource of the application gateway which will be used if no path matches occur. |
| | **default\_backend\_http\_settings** string | | Backend http settings resource of the application gateway; used for the *default\_backend\_address\_pool*. |
| | **name** string | | Name of the resource that is unique within the application gateway. This name can be used to access the resource. |
| | **path\_rules** string | | List of URL path rules. |
| | | **backend\_address\_pool** string | | Backend address pool resource of the application gateway which will be used if the path is matched. |
| | | **backend\_http\_settings** string | | Backend http settings resource of the application gateway; used for the path's *backend\_address\_pool*. |
| | | **name** string | | Name of the resource that is unique within the path map. |
| | | **paths** string | | List of paths. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create instance of Application Gateway
azure_rm_appgateway:
resource_group: myResourceGroup
name: myAppGateway
sku:
name: standard_small
tier: standard
capacity: 2
gateway_ip_configurations:
- subnet:
id: "{{ subnet_id }}"
name: app_gateway_ip_config
frontend_ip_configurations:
- subnet:
id: "{{ subnet_id }}"
name: sample_gateway_frontend_ip_config
frontend_ports:
- port: 90
name: ag_frontend_port
backend_address_pools:
- backend_addresses:
- ip_address: 10.0.0.4
name: test_backend_address_pool
backend_http_settings_collection:
- port: 80
protocol: http
cookie_based_affinity: enabled
name: sample_appgateway_http_settings
http_listeners:
- frontend_ip_configuration: sample_gateway_frontend_ip_config
frontend_port: ag_frontend_port
name: sample_http_listener
request_routing_rules:
- rule_type: Basic
backend_address_pool: test_backend_address_pool
backend_http_settings: sample_appgateway_http_settings
http_listener: sample_http_listener
name: rule1
- name: Create instance of Application Gateway by looking up virtual network and subnet
azure_rm_appgateway:
resource_group: myResourceGroup
name: myAppGateway
sku:
name: standard_small
tier: standard
capacity: 2
gateway_ip_configurations:
- subnet:
name: default
virtual_network_name: my-vnet
name: app_gateway_ip_config
frontend_ip_configurations:
- subnet:
name: default
virtual_network_name: my-vnet
name: sample_gateway_frontend_ip_config
frontend_ports:
- port: 90
name: ag_frontend_port
backend_address_pools:
- backend_addresses:
- ip_address: 10.0.0.4
name: test_backend_address_pool
backend_http_settings_collection:
- port: 80
protocol: http
cookie_based_affinity: enabled
name: sample_appgateway_http_settings
http_listeners:
- frontend_ip_configuration: sample_gateway_frontend_ip_config
frontend_port: ag_frontend_port
name: sample_http_listener
request_routing_rules:
- rule_type: Basic
backend_address_pool: test_backend_address_pool
backend_http_settings: sample_appgateway_http_settings
http_listener: sample_http_listener
name: rule1
- name: Create instance of Application Gateway with path based rules
azure_rm_appgateway:
resource_group: myResourceGroup
name: myAppGateway
sku:
name: standard_small
tier: standard
capacity: 2
gateway_ip_configurations:
- subnet:
id: "{{ subnet_id }}"
name: app_gateway_ip_config
frontend_ip_configurations:
- subnet:
id: "{{ subnet_id }}"
name: sample_gateway_frontend_ip_config
frontend_ports:
- port: 90
name: ag_frontend_port
backend_address_pools:
- backend_addresses:
- ip_address: 10.0.0.4
name: test_backend_address_pool
backend_http_settings_collection:
- port: 80
protocol: http
cookie_based_affinity: enabled
name: sample_appgateway_http_settings
http_listeners:
- frontend_ip_configuration: sample_gateway_frontend_ip_config
frontend_port: ag_frontend_port
name: sample_http_listener
request_routing_rules:
- rule_type: path_based_routing
http_listener: sample_http_listener
name: rule1
url_path_map: path_mappings
url_path_maps:
- name: path_mappings
default_backend_address_pool: test_backend_address_pool
default_backend_http_settings: sample_appgateway_http_settings
path_rules:
- name: path_rules
backend_address_pool: test_backend_address_pool
backend_http_settings: sample_appgateway_http_settings
paths:
- "/abc"
- "/123/*"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Resource ID. **Sample:** id |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible azure.azcollection.azure_rm_expressroute – Manage Express Route Circuits azure.azcollection.azure\_rm\_expressroute – Manage Express Route Circuits
==========================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_expressroute`.
New in version 1.7.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Express Route.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **allow\_classic\_operations** boolean | **Choices:*** no
* yes
| Support for classic operations. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **authorizations** list / elements=dictionary | | The list of authorizations. |
| | **name** string / required | | Name of the authorization. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **global\_reach\_enabled** boolean | **Choices:*** no
* yes
| Flag denoting global reach status. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Unique name of the app service plan to create or update. |
| **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 / required | | Name of the resource group to which the resource belongs. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **service\_provider\_properties** dictionary | | The service Provider properties |
| | **bandwidth\_in\_mbps** string | | The bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource. |
| | **peering\_location** string | | The peering location |
| | **service\_provider\_name** string | | Name of service provider |
| **sku** dictionary | | The name of the SKU. Please see L(https://azure.microsoft.com/en-in/pricing/details/expressroute/) Required sku when *state=present*. |
| | **family** string / required | **Choices:*** metereddata
* unlimiteddata
| the family of the SKU |
| | **tier** string / required | **Choices:*** standard
* premium
| The tier of the SKU |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the express route. Use `present` to create or update an express route and `absent` to delete it. |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: "Create Express route"
azure_rm_expressroute:
resource_group: rg
location: eastus
name: exp
allow_classic_operations: true
global_reach_enabled: false
tags:
- a: b
authorizations:
- name: authorization_test
service_provider_properties:
service_provider_name: Aryaka Networks
peering_location: Seattle
bandwidth_in_mbps: '200'
sku:
tier: premium
family: metereddata
- name: Delete Express route
azure_rm_expressroute:
resource_group: rg
name: exp
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **state** dictionary | always | Current state of the express route. **Sample:** {'additional\_properties': {}, 'allow\_classic\_operations': True, 'authorizations': [{'authorization\_key': 'd83e18b5-0200-4e0b-9cdb-6fdf95b00267', 'authorization\_use\_status': 'Available', 'etag': "W/'09572845-c667-410c-b664-ed8e39242c13'", 'id': '/subscriptions/subs\_id/resourceGroups/rg/providers/Microsoft.Network/expressRouteCircuits/exp/authorizations/az', 'name': 'authorization\_test', 'provisioning\_state': 'Succeeded', 'type': 'Microsoft.Network/expressRouteCircuits/authorizations'}], 'bandwidth\_in\_gbps': None, 'circuit\_provisioning\_state': 'Enabled', 'express\_route\_port': None, 'gateway\_manager\_etag': '', 'global\_reach\_enabled': False, 'id': '/subscriptions/subs\_id/resourceGroups/rg/providers/Microsoft.Network/expressRouteCircuits/exp', 'location': 'eastus', 'name': 'exp', 'peerings': [], 'provisioning\_state': 'Succeeded', 'service\_key': 'e1956383-63b6-4709-8baa-3615bbf5d22b', 'service\_provider\_notes': None, 'service\_provider\_provisioning\_state': 'NotProvisioned', 'stag': 27, 'status': 'Deleted', 'tags': {'a': 'b'}, 'type': 'Microsoft.Network/expressRouteCircuits'} |
### Authors
* Praveen Ghuge (@praveenghuge)
* Karl Dasan (@ikarldasan)
* Sakar Mehra (@sakar97)
ansible azure.azcollection.azure_rm_postgresqlfirewallrule_info – Get Azure PostgreSQL Firewall Rule facts azure.azcollection.azure\_rm\_postgresqlfirewallrule\_info – Get Azure PostgreSQL Firewall Rule facts
=====================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_postgresqlfirewallrule_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure PostgreSQL Firewall Rule.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the server firewall rule. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **server\_name** string / required | | The name of the server. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of PostgreSQL Firewall Rule
azure_rm_postgresqlfirewallrule_info:
resource_group: myResourceGroup
server_name: server_name
name: firewall_rule_name
- name: List instances of PostgreSQL Firewall Rule
azure_rm_postgresqlfirewallrule_info:
resource_group: myResourceGroup
server_name: server_name
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **rules** complex | always | A list of dictionaries containing facts for PostgreSQL Firewall Rule. |
| | **end\_ip\_address** string | always | The end IP address of the PostgreSQL firewall rule. **Sample:** 10.0.0.18 |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/fire wallRules/rule1 |
| | **name** string | always | Resource name. **Sample:** rule1 |
| | **server\_name** string | always | The name of the server. **Sample:** testserver |
| | **start\_ip\_address** string | always | The start IP address of the PostgreSQL firewall rule. **Sample:** 10.0.0.16 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_virtualmachine – Manage Azure virtual machines azure.azcollection.azure\_rm\_virtualmachine – Manage Azure virtual machines
============================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualmachine`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage and configure virtual machines (VMs) and associated resources on Azure.
* Requires a resource group containing at least one virtual network with at least one subnet.
* Supports images from the Azure Marketplace, which can be discovered with M(azure\_rm\_virtualmachineimage\_info).
* Supports custom images since Ansible 2.5.
* To use *custom\_data* on a Linux image, the image must have cloud-init enabled. If cloud-init is not enabled, *custom\_data* is ignored.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **accept\_terms** boolean | **Choices:*** **no** ←
* yes
| Accept terms for Marketplace images that require it. Only Azure service admin/account admin users can purchase images from the Marketplace. Only valid when a *plan* is specified. |
| **ad\_user** string | | Active Directory username. Use when authenticating with an Active Directory user rather than service principal. |
| **adfs\_authority\_url** string added in 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **admin\_password** string | | Password for the admin username. Not required if the *os\_type=Linux* and SSH password authentication is disabled by setting *ssh\_password\_enabled=false*. |
| **admin\_username** string | | Admin username used to access the VM after it is created. Required when creating a VM. |
| **allocated** boolean | **Choices:*** no
* **yes** ←
| Whether the VM is allocated or deallocated, only useful with *state=present*. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **availability\_set** string | | Name or ID of an existing availability set to add the VM to. The *availability\_set* should be in the same resource group as VM. |
| **boot\_diagnostics** string | | Manage boot diagnostics settings for a VM. Boot diagnostics includes a serial console and remote console screenshots. |
| | **enabled** boolean / required | **Choices:*** no
* yes
| Flag indicating if boot diagnostics are enabled. |
| | **resource\_group** string | | Resource group where the storage account is located. |
| | **storage\_account** string | | The name of an existing storage account to use for boot diagnostics. If not specified, uses *storage\_account\_name* defined one level up. If storage account is not specified anywhere, and `enabled` is `true`, a default storage account is created for boot diagnostics data. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **custom\_data** string | | Data made available to the VM and used by `cloud-init`. Only used on Linux images with `cloud-init` enabled. Consult <https://docs.microsoft.com/en-us/azure/virtual-machines/linux/using-cloud-init#cloud-init-overview> for cloud-init ready images. To enable cloud-init on a Linux image, follow <https://docs.microsoft.com/en-us/azure/virtual-machines/linux/cloudinit-prepare-custom-image>. |
| **data\_disks** string | | Describes list of data disks. Use M(azure\_rm\_mangeddisk) to manage the specific disk. |
| | **caching** string | **Choices:*** **ReadOnly** ←
* ReadWrite
| Type of data disk caching. |
| | **disk\_size\_gb** string | | The initial disk size in GB for blank data disks. This value cannot be larger than `1023` GB. Size can be changed only when the virtual machine is deallocated. Not sure when *managed\_disk\_id* defined. |
| | **lun** string / required | | The logical unit number for data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. |
| | **managed\_disk\_type** string | **Choices:*** Standard\_LRS
* StandardSSD\_LRS
* Premium\_LRS
| Managed data disk type. Only used when OS disk created with managed disk. |
| | **storage\_account\_name** string | | Name of an existing storage account that supports creation of VHD blobs. If not specified for a new VM, a new storage account started with *name* will be created using storage type `Standard_LRS`. Only used when OS disk created with virtual hard disk (VHD). Used when *managed\_disk\_type* not defined. Cannot be updated unless *lun* updated. |
| | **storage\_blob\_name** string | | Name of the storage blob used to hold the OS disk image of the VM. Must end with '.vhd'. Default to the *name* + timestamp + *lun* + '.vhd'. Only used when OS disk created with virtual hard disk (VHD). Used when *managed\_disk\_type* not defined. Cannot be updated unless *lun* updated. |
| | **storage\_container\_name** string | **Default:**"vhds" | Name of the container to use within the storage account to store VHD blobs. If no name is specified a default container named 'vhds' will created. Only used when OS disk created with virtual hard disk (VHD). Used when *managed\_disk\_type* not defined. Cannot be updated unless *lun* updated. |
| **ephemeral\_os\_disk** boolean | **Choices:*** no
* yes
| Parameters of ephemeral disk settings that can be specified for operating system disk. Ephemeral OS disk is only supported for VMS Instances using Managed Disk. |
| **eviction\_policy** string | **Choices:*** Deallocate
* Delete
| Specifies the eviction policy for the Azure Spot virtual machine. Requires priority to be set to Spot. |
| **generalized** boolean | **Choices:*** **no** ←
* yes
| Whether the VM is generalized or not. Set to `true` with *state=present* to generalize the VM. Generalizing a VM is irreversible. |
| **image** string / required | | The image used to build the VM. For custom images, the name of the image. To narrow the search to a specific resource group, a dict with the keys *name* and *resource\_group*. For Marketplace images, a dict with the keys *publisher*, *offer*, *sku*, and *version*. Set *version=latest* to get the most recent version of a given image. |
| **license\_type** string | **Choices:*** Windows\_Server
* Windows\_Client
| On-premise license for the image or disk. Only used for images that contain the Windows Server operating system. To remove all license type settings, set to the string `None`. |
| **location** string | | Valid Azure location for the VM. Defaults to location of the resource group. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **managed\_disk\_type** string | **Choices:*** Standard\_LRS
* StandardSSD\_LRS
* Premium\_LRS
| Managed OS disk type. Create OS disk with managed disk if defined. If not defined, the OS disk will be created with virtual hard disk (VHD). |
| **max\_price** string | **Default:**-1 | Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars.
`-1` indicates default price to be up-to on-demand. Requires priority to be set to Spot. |
| **name** string / required | | Name of the VM. |
| **network\_interface\_names** list / elements=string | | Network interface names to add to the VM. Can be a string of name or resource ID of the network interface. Can be a dict containing *resource\_group* and *name* of the network interface. If a network interface name is not provided when the VM is created, a default network interface will be created. To create a new network interface, at least one Virtual Network with one Subnet must exist.
aliases: network\_interfaces |
| **open\_ports** string | | List of ports to open in the security group for the VM, when a security group and network interface are created with a VM. For Linux hosts, defaults to allowing inbound TCP connections to port 22. For Windows hosts, defaults to opening ports 3389 and 5986. |
| **os\_disk\_caching** string | **Choices:*** ReadOnly
* ReadWrite
| Type of OS disk caching.
aliases: disk\_caching |
| **os\_disk\_name** string | | OS disk name. |
| **os\_disk\_size\_gb** string | | Type of OS disk size in GB. |
| **os\_type** string | **Choices:*** Windows
* **Linux** ←
| Base type of operating system. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **plan** dictionary | | Third-party billing plan for the VM. |
| | **name** string / required | | Billing plan name. |
| | **product** string / required | | Product name. |
| | **promotion\_code** string | | Optional promotion code. |
| | **publisher** string / required | | Publisher offering the plan. |
| **priority** string | **Choices:*** None
* Spot
| Priority of the VM.
`None` is the equivalent of Regular VM. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **public\_ip\_allocation\_method** string | **Choices:*** Dynamic
* **Static** ←
* Disabled
| Allocation method for the public IP of the VM. Used only if a network interface is not specified. When set to `Dynamic`, the public IP address may change any time the VM is rebooted or power cycled. The `Disabled` choice was added in Ansible 2.6.
aliases: public\_ip\_allocation |
| **remove\_on\_absent** list / elements=string | **Default:**["all"] | Associated resources to remove when removing a VM using *state=absent*. To remove all resources related to the VM being removed, including auto-created resources, set to `all`. To remove only resources that were automatically created while provisioning the VM being removed, set to `all_autocreated`. To remove only specific resources, set to `network_interfaces`, `virtual_storage` or `public_ips`. Any other input will be ignored. |
| **resource\_group** string / required | | Name of the resource group containing the VM. |
| **restarted** boolean | **Choices:*** **no** ←
* yes
| Set to `true` with *state=present* to restart a running VM. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **short\_hostname** string | | Name assigned internally to the host. On a Linux VM this is the name returned by the `hostname` command. When creating a VM, short\_hostname defaults to *name*. |
| **ssh\_password\_enabled** boolean | **Choices:*** no
* **yes** ←
| Whether to enable or disable SSH passwords. When *os\_type=Linux*, set to `false` to disable SSH password authentication and require use of SSH keys. |
| **ssh\_public\_keys** string | | For *os\_type=Linux* provide a list of SSH keys. Accepts a list of dicts where each dictionary contains two keys, *path* and *key\_data*. Set *path* to the default location of the authorized\_keys files. For example, *path=/home/<admin username>/.ssh/authorized\_keys*. Set *key\_data* to the actual value of the public key. |
| **started** boolean | **Choices:*** no
* **yes** ←
| Whether the VM is started or stopped. Set to (true) with *state=present* to start the VM. Set to `false` to stop the VM. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the VM. Set to `present` to create a VM with the configuration specified by other options, or to update the configuration of an existing VM. Set to `absent` to remove a VM. Does not affect power state. Use *started*/*allocated*/*restarted* parameters to change the power state of a VM. |
| **storage\_account\_name** string | | Name of a storage account that supports creation of VHD blobs. If not specified for a new VM, a new storage account named <vm name>01 will be created using storage type `Standard_LRS`.
aliases: storage\_account |
| **storage\_blob\_name** string | | Name of the storage blob used to hold the OS disk image of the VM. Must end with '.vhd'. If not specified, defaults to the VM name + '.vhd'.
aliases: storage\_blob |
| **storage\_container\_name** string | **Default:**"vhds" | Name of the container to use within the storage account to store VHD blobs. If not specified, a default container will be created.
aliases: storage\_container |
| **subnet\_name** string | | Subnet for the VM. Defaults to the first subnet found in the virtual network or the subnet of the *network\_interface\_name*, if provided. If the subnet is in another resource group, specify the resource group with *virtual\_network\_resource\_group*.
aliases: subnet |
| **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. |
| **virtual\_network\_name** string | | The virtual network to use when creating a VM. If not specified, a new network interface will be created and assigned to the first virtual network found in the resource group. Use with *virtual\_network\_resource\_group* to place the virtual network in another resource group.
aliases: virtual\_network |
| **virtual\_network\_resource\_group** string | | The resource group to use when creating a VM with another resource group's virtual network. |
| **vm\_identity** string | **Choices:*** SystemAssigned
| Identity for the VM. |
| **vm\_size** string | | A valid Azure VM size value. For example, `Standard_D4`. Choices vary depending on the subscription and location. Check your subscription for available choices. Required when creating a VM. |
| **winrm** string | | List of Windows Remote Management configurations of the VM. |
| | **certificate\_store** string | | The certificate store on the VM to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. |
| | **certificate\_url** string | | The URL of a certificate that has been uploaded to Key Vault as a secret. |
| | **protocol** string / required | **Choices:*** http
* https
| The protocol of the winrm listener. |
| | **source\_vault** string | | The relative URL of the Key Vault containing the certificate. |
| **zones** list / elements=string | | A list of Availability Zones for your VM. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create VM with defaults
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: testvm10
admin_username: "{{ username }}"
admin_password: "{{ password }}"
image:
offer: CentOS
publisher: OpenLogic
sku: '7.1'
version: latest
- name: Create an availability set for managed disk vm
azure_rm_availabilityset:
name: avs-managed-disk
resource_group: myResourceGroup
platform_update_domain_count: 5
platform_fault_domain_count: 2
sku: Aligned
- name: Create a VM with managed disk
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: vm-managed-disk
admin_username: "{{ username }}"
availability_set: avs-managed-disk
managed_disk_type: Standard_LRS
image:
offer: CoreOS
publisher: CoreOS
sku: Stable
version: latest
vm_size: Standard_D4
- name: Create a VM with existing storage account and NIC
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: testvm002
vm_size: Standard_D4
storage_account: testaccount001
admin_username: "{{ username }}"
ssh_public_keys:
- path: /home/adminUser/.ssh/authorized_keys
key_data: < insert yor ssh public key here... >
network_interfaces: testvm001
image:
offer: CentOS
publisher: OpenLogic
sku: '7.1'
version: latest
- name: Create a VM with OS and multiple data managed disks
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: testvm001
vm_size: Standard_D4
managed_disk_type: Standard_LRS
admin_username: "{{ username }}"
ssh_public_keys:
- path: /home/adminUser/.ssh/authorized_keys
key_data: < insert yor ssh public key here... >
image:
offer: CoreOS
publisher: CoreOS
sku: Stable
version: latest
data_disks:
- lun: 0
managed_disk_id: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"
- lun: 1
disk_size_gb: 128
managed_disk_type: Premium_LRS
- name: Create a VM with OS and multiple data storage accounts
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: testvm001
vm_size: Standard_DS1_v2
admin_username: "{{ username }}"
ssh_password_enabled: false
ssh_public_keys:
- path: /home/adminUser/.ssh/authorized_keys
key_data: < insert yor ssh public key here... >
network_interfaces: testvm001
storage_container: osdisk
storage_blob: osdisk.vhd
boot_diagnostics:
enabled: yes
image:
offer: CoreOS
publisher: CoreOS
sku: Stable
version: latest
data_disks:
- lun: 0
disk_size_gb: 64
storage_container_name: datadisk1
storage_blob_name: datadisk1.vhd
- lun: 1
disk_size_gb: 128
storage_container_name: datadisk2
storage_blob_name: datadisk2.vhd
- name: Create a VM with a custom image
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: testvm001
vm_size: Standard_DS1_v2
admin_username: "{{ username }}"
admin_password: "{{ password }}"
image: customimage001
- name: Create a VM with a custom image from a particular resource group
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: testvm001
vm_size: Standard_DS1_v2
admin_username: "{{ username }}"
admin_password: "{{ password }}"
image:
name: customimage001
resource_group: myResourceGroup
- name: Create a VM with an image id
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: testvm001
vm_size: Standard_DS1_v2
admin_username: "{{ username }}"
admin_password: "{{ password }}"
image:
id: '{{image_id}}'
- name: Create VM with spcified OS disk size
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: big-os-disk
admin_username: "{{ username }}"
admin_password: "{{ password }}"
os_disk_size_gb: 512
image:
offer: CentOS
publisher: OpenLogic
sku: '7.1'
version: latest
- name: Create VM with OS and Plan, accepting the terms
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: f5-nva
admin_username: "{{ username }}"
admin_password: "{{ password }}"
image:
publisher: f5-networks
offer: f5-big-ip-best
sku: f5-bigip-virtual-edition-200m-best-hourly
version: latest
plan:
name: f5-bigip-virtual-edition-200m-best-hourly
product: f5-big-ip-best
publisher: f5-networks
- name: Create a VM with Spot Instance
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: testvm10
vm_size: Standard_D4
priority: Spot
eviction_policy: Deallocate
admin_username: "{{ username }}"
admin_password: "{{ password }}"
image:
offer: CentOS
publisher: OpenLogic
sku: '7.1'
version: latest
- name: Power Off
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: testvm002
started: no
- name: Deallocate
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: testvm002
allocated: no
- name: Power On
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: testvm002
- name: Restart
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: testvm002
restarted: yes
- name: Create a VM with an Availability Zone
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: testvm001
vm_size: Standard_DS1_v2
admin_username: "{{ username }}"
admin_password: "{{ password }}"
image: customimage001
zones: [1]
- name: Remove a VM and all resources that were autocreated
azure_rm_virtualmachine:
resource_group: myResourceGroup
name: testvm002
remove_on_absent: all_autocreated
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_vm** dictionary | always | Facts about the current state of the object. Note that facts are not part of the registered output but available directly. **Sample:** {'properties': {'availabilitySet': {'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Compute/availabilitySets/MYAVAILABILITYSET'}, 'hardwareProfile': {'vmSize': 'Standard\_D1'}, 'instanceView': {'disks': [{'name': 'testvm10.vhd', 'statuses': [{'code': 'ProvisioningState/succeeded', 'displayStatus': 'Provisioning succeeded', 'level': 'Info', 'time': '2016-03-30T07:11:16.187272Z'}]}], 'statuses': [{'code': 'ProvisioningState/succeeded', 'displayStatus': 'Provisioning succeeded', 'level': 'Info', 'time': '2016-03-30T20:33:38.946916Z'}, {'code': 'PowerState/running', 'displayStatus': 'VM running', 'level': 'Info'}], 'vmAgent': {'extensionHandlers': [], 'statuses': [{'code': 'ProvisioningState/succeeded', 'displayStatus': 'Ready', 'level': 'Info', 'message': 'GuestAgent is running and accepting new configurations.', 'time': '2016-03-30T20:31:16.000Z'}], 'vmAgentVersion': 'WALinuxAgent-2.0.16'}}, 'networkProfile': {'networkInterfaces': [{'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkInterfaces/testvm10\_NIC01', 'name': 'testvm10\_NIC01', 'properties': {'dnsSettings': {'appliedDnsServers': [], 'dnsServers': []}, 'enableIPForwarding': False, 'ipConfigurations': [{'etag': 'W/"041c8c2a-d5dd-4cd7-8465-9125cfbe2cf8"', 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkInterfaces/testvm10\_NIC01/ipConfigurations/default', 'name': 'default', 'properties': {'privateIPAddress': '10.10.0.5', 'privateIPAllocationMethod': 'Dynamic', 'provisioningState': 'Succeeded', 'publicIPAddress': {'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/testvm10\_PIP01', 'name': 'testvm10\_PIP01', 'properties': {'idleTimeoutInMinutes': 4, 'ipAddress': '13.92.246.197', 'ipConfiguration': {'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkInterfaces/testvm10\_NIC01/ipConfigurations/default'}, 'provisioningState': 'Succeeded', 'publicIPAllocationMethod': 'Static', 'resourceGuid': '3447d987-ca0d-4eca-818b-5dddc0625b42'}}}}], 'macAddress': '00-0D-3A-12-AA-14', 'primary': True, 'provisioningState': 'Succeeded', 'resourceGuid': '10979e12-ccf9-42ee-9f6d-ff2cc63b3844', 'virtualMachine': {'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testvm10'}}}]}, 'osProfile': {'adminUsername': 'chouseknecht', 'computerName': 'test10', 'linuxConfiguration': {'disablePasswordAuthentication': False}, 'secrets': []}, 'provisioningState': 'Succeeded', 'storageProfile': {'dataDisks': [{'caching': 'ReadWrite', 'createOption': 'empty', 'diskSizeGB': 64, 'lun': 0, 'name': 'datadisk1.vhd', 'vhd': {'uri': 'https://testvm10sa1.blob.core.windows.net/datadisk/datadisk1.vhd'}}], 'imageReference': {'offer': 'CentOS', 'publisher': 'OpenLogic', 'sku': '7.1', 'version': '7.1.20160308'}, 'osDisk': {'caching': 'ReadOnly', 'createOption': 'fromImage', 'name': 'testvm10.vhd', 'osType': 'Linux', 'vhd': {'uri': 'https://testvm10sa1.blob.core.windows.net/vhds/testvm10.vhd'}}}}, 'type': 'Microsoft.Compute/virtualMachines'} |
| **deleted\_network\_interfaces** list / elements=string | on delete | List of deleted NICs. **Sample:** ['testvm1001'] |
| **deleted\_public\_ips** list / elements=string | on delete | List of deleted public IP address names. **Sample:** ['testvm1001'] |
| **deleted\_vhd\_uris** list / elements=string | on delete | List of deleted Virtual Hard Disk URIs. **Sample:** ['https://testvm104519.blob.core.windows.net/vhds/testvm10.vhd'] |
| **powerstate** string | always | Indicates if the state is `running`, `stopped`, `deallocated`, `generalized`. **Sample:** running |
### Authors
* Chris Houseknecht (@chouseknecht)
* Matt Davis (@nitzmahone)
* Christopher Perrin (@cperrin88)
* James E. King III (@jeking3)
| programming_docs |
ansible azure.azcollection.azure_rm_galleryimageversion – Manage Azure SIG Image Version instance azure.azcollection.azure\_rm\_galleryimageversion – Manage Azure SIG Image Version instance
===========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_galleryimageversion`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure SIG Image Version.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **gallery\_image\_name** string / required | | The name of the gallery Image Definition in which the Image Version is to be created. |
| **gallery\_name** string / required | | The name of the Shared Image Gallery in which the Image Definition resides. |
| **location** string | | Resource location. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the gallery Image Version to be created. Needs to follow semantic version name pattern, The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. For example <MajorVersion>.<MinorVersion>.<Patch>. |
| **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. |
| **publishing\_profile** dictionary / required | | Publishing profile. |
| | **end\_of\_life\_date** string | | The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. Format should be according to ISO-8601, for instance "2019-06-26". |
| | **exclude\_from\_latest** boolean | **Choices:*** no
* yes
| If *exclude\_from\_latest=true*, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. |
| | **managed\_image** string | | Managed image reference, could be resource ID, or dictionary containing *resource\_group* and *name*
Obsolete since 2.10, use storage\_profile instead |
| | **replica\_count** integer | | The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. |
| | **snapshot** string | | Source snapshot to be used. Obsolete since 2.10, use storage\_profile instead |
| | **storage\_account\_type** string | | Specifies the storage account type to be used to store the image. This property is not updatable. |
| | **target\_regions** list / elements=string | | The target regions where the Image Version is going to be replicated to. This property is updatable. |
| | | **name** string | | Region name. |
| | | **regional\_replica\_count** string | | The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. |
| | | **storage\_account\_type** string | | Storage account type. |
| **resource\_group** string / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the GalleryImageVersion. Use `present` to create or update an GalleryImageVersion and `absent` to delete it. |
| **storage\_profile** dictionary / required | | Storage profile |
| | **data\_disks** list / elements=string | | list of data disk snapshot Mutual exclusive with source\_image |
| | | **host\_caching** string | **Choices:*** **None** ←
* ReadOnly
* ReadWrite
| host disk caching |
| | | **lun** integer | | lun of the data disk |
| | | **source** string | | Reference to data disk snapshot. Could be resource ID or dictionary containing *resource\_group* and *name*
|
| | **os\_disk** raw | | os disk snapshot Mutual exclusive with source\_image |
| | | **host\_caching** string | **Choices:*** **None** ←
* ReadOnly
* ReadWrite
| host disk caching |
| | | **source** string | | Reference to os disk snapshot. Could be resource ID or dictionary containing *resource\_group* and *name*
|
| | **source\_image** raw | | Reference to managed image or gallery image version Could be resource ID to managed image, or dictionary containing *resource\_group* and *name*
Could be resource ID to image version, or dictionary containing *resource\_group*,*gallery\_name*, *gallery\_image\_name* and *version*
Mutual exclusive with os\_disk and data\_disks |
| **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. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create a gallery image version form a managed image
azure_rm_galleryimageversion:
resource_group: myResourceGroup
gallery_name: myGallery
gallery_image_name: myGalleryImage
name: 1.1.0
location: East US
publishing_profile:
end_of_life_date: "2020-10-01t00:00:00+00:00"
exclude_from_latest: yes
replica_count: 4
storage_account_type: Standard_LRS
target_regions:
- name: West US
regional_replica_count: 1
- name: East US
regional_replica_count: 3
storage_account_type: Standard_LRS
storage_profile:
source_image: /subscriptions/sub123/resourceGroups/group123/providers/Microsoft.Compute/images/myOsImage
- name: Create a gallery image version from another gallery image version
azure_rm_galleryimageversion:
resource_group: myResourceGroup
gallery_name: myGallery
gallery_image_name: myGalleryImage
name: 1.2.0
location: East US
publishing_profile:
end_of_life_date: "2020-10-01t00:00:00+00:00"
exclude_from_latest: yes
replica_count: 4
storage_account_type: Standard_LRS
target_regions:
- name: West US
regional_replica_count: 1
- name: East US
regional_replica_count: 3
storage_account_type: Standard_LRS
storage_profile:
source_image:
version: 1.1.0
gallery_name: myGallery2
gallery_image_name: myGalleryImage2
- name: Create gallery image by using one os dist snapshot and zero or many data disk snapshots
azure_rm_galleryimageversion:
resource_group: myRsourceGroup
gallery_name: myGallery
gallery_image_name: myGalleryImage
name: 3.4.0
location: East US
publishing_profile:
end_of_life_date: "2020-10-01t00:00:00+00:00"
exclude_from_latest: yes
replica_count: 1
storage_account_type: Standard_LRS
target_regions:
- name: East US
regional_replica_count: 1
storage_account_type: Standard_LRS
storage_profile:
os_disk:
source: "/subscriptions/mySub/resourceGroups/myGroup/providers/Microsoft.Compute/snapshots/os_snapshot_vma"
data_disks:
- lun: 0
source:
name: data_snapshot_vma
- lun: 1
source: "/subscriptions/mySub/resourceGroups/myGroup/providers/Microsoft.Compute/snapshots/data_snapshot_vmb"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalle ry1283/images/myImage/versions/10.1.3 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_keyvault – Manage Key Vault instance azure.azcollection.azure\_rm\_keyvault – Manage Key Vault instance
==================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_keyvault`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Key Vault.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_policies** string | | An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. |
| | **application\_id** string | | Application ID of the client making request on behalf of a principal. |
| | **certificates** string | **Choices:*** get
* list
* delete
* create
* import
* update
* managecontacts
* getissuers
* listissuers
* setissuers
* deleteissuers
* manageissuers
* recover
* purge
| List of permissions to certificates. |
| | **keys** string | **Choices:*** encrypt
* decrypt
* wrapkey
* unwrapkey
* sign
* verify
* get
* list
* create
* update
* import
* delete
* backup
* restore
* recover
* purge
| List of permissions to keys. |
| | **object\_id** string / required | | The object ID of a user, service principal or security group in the Azure Active Directory tenant for the vault. The object ID must be unique for the list of access policies. Please note this is not application id. Object id can be obtained by running "az ad sp show --id <application id>". |
| | **secrets** string | **Choices:*** get
* list
* set
* delete
* backup
* restore
* recover
* purge
| List of permissions to secrets. |
| | **storage** string | | List of permissions to storage accounts. |
| | **tenant\_id** string | | The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. Current keyvault `tenant_id` value will be used if not specified. |
| **ad\_user** string | | Active Directory username. Use when authenticating with an Active Directory user rather than service principal. |
| **adfs\_authority\_url** string added in 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **enable\_purge\_protection** boolean | **Choices:*** **no** ←
* yes
| Property specifying whether protection against purge is enabled for this vault. |
| **enable\_soft\_delete** boolean | **Choices:*** no
* **yes** ←
| Property to specify whether the soft delete functionality is enabled for this key vault. |
| **enabled\_for\_deployment** boolean | **Choices:*** no
* yes
| Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault. |
| **enabled\_for\_disk\_encryption** boolean | **Choices:*** no
* yes
| Property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys. |
| **enabled\_for\_template\_deployment** boolean | **Choices:*** no
* yes
| Property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **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. |
| **recover\_mode** boolean | **Choices:*** no
* yes
| Create vault in recovery mode. |
| **resource\_group** string / required | | The name of the Resource Group to which the server belongs. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **sku** string | | SKU details. |
| | **family** string | | SKU family name. |
| | **name** string / required | **Choices:*** standard
* premium
| SKU name to specify whether the key vault is a standard vault or a premium vault. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the KeyVault. Use `present` to create or update an KeyVault and `absent` to delete it. |
| **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. |
| **vault\_name** string / required | | Name of the vault. |
| **vault\_tenant** string | | The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create instance of Key Vault
azure_rm_keyvault:
resource_group: myResourceGroup
vault_name: samplekeyvault
enabled_for_deployment: yes
vault_tenant: 72f98888-8666-4144-9199-2d7cd0111111
sku:
name: standard
access_policies:
- tenant_id: 72f98888-8666-4144-9199-2d7cd0111111
object_id: 99998888-8666-4144-9199-2d7cd0111111
keys:
- get
- list
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | The Azure Resource Manager resource ID for the key vault. **Sample:** id |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible azure.azcollection.azure_rm_devtestlabschedule_info – Get Azure Schedule facts azure.azcollection.azure\_rm\_devtestlabschedule\_info – Get Azure Schedule facts
=================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_devtestlabschedule_info`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure Schedule.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **lab\_name** string / required | | The name of the lab. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the schedule. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tags** list / elements=string | | Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get instance of Schedule
azure_rm_devtestlabschedule_info:
resource_group: myResourceGroup
lab_name: myLab
name: mySchedule
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **schedules** complex | always | A list of dictionaries containing facts for Schedule. |
| | **id** string | always | The identifier of the artifact source. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.DevTestLab/labs/myLab/sc hedules/labvmsshutdown |
| | **lab\_name** string | always | Name of the lab. **Sample:** myLab |
| | **name** string | always | The name of the environment. **Sample:** lab\_vms\_shutdown |
| | **resource\_group** string | always | Name of the resource group. **Sample:** myResourceGroup |
| | **tags** complex | always | The tags of the resource. **Sample:** { 'MyTag': 'MyValue' } |
| | **time** string | always | Time of the schedule. **Sample:** lab\_vms\_shutdown |
| | **time\_zone\_id** string | always | Time zone id. **Sample:** UTC+12 |
### Authors
* Zim Kalinowski (@zikalino)
ansible azure.azcollection.azure_rm_vpnsitelink_info – Get VpnSiteLink info azure.azcollection.azure\_rm\_vpnsitelink\_info – Get VpnSiteLink info
======================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_vpnsitelink_info`.
New in version 1.5.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get info of Vpn Site Link relate infomation.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | The name of the VpnSiteLink being retrieved. |
| **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 / required | | The resource group name of the VpnSite. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **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. |
| **vpn\_site\_name** string / required | | The name of the Vpn Site. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get Vpn Site Link info by the name
azure_rm_vpnsitelink_info:
resource_group: myResourceGroup
name: vpnSiteLink1
vpn_site_name: vpnSite1
- name: Get Vpn Site Links by the Vpn Site
azure_rm_vpnsitelink_info:
resource_group: myResourceGroup
vpn_site_name: vpnSite1
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **vpn\_site\_links** complex | always | A list of dict results where the key is the name of the VpnSiteLink and the values are the facts for that VpnSiteLink. |
| | **etag** string | always | A unique read-only string that changes whenever the resource is updated. **Sample:** 1ec5c61b-d66f-4b1c-b7b5-f27d0a9ad9d3 |
| | **id** string | always | Resource ID. **Sample:** /subscriptions/xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/vpnSites/fred/vpnSiteLinks/azureuser |
| | **ip\_address** string | always | The ip-address for the vpn-site-link. **Sample:** 192.168.33.223 |
| | **link\_properties** complex | always | The link provider properties. |
| | | **link\_provider\_name** string | always | Name of the link provider. **Sample:** azureuser |
| | | **link\_speed\_in\_mbps** integer | always | Link speed. **Sample:** 100 |
| | **name** string | always | The name of the resource that is unique within a resource group. This name can be used to access the resource. **Sample:** azureuser |
| | **provisioning\_state** string | always | The provisioning state of the VPN site link resource. **Sample:** Succeeded |
| | **type** string | always | Resource type. **Sample:** Microsoft.Network/vpnSites/vpnSiteLinks |
### Authors
* Fred-Sun (@Fred-Sun)
* Haiyuan Zhang (@haiyuazhang)
ansible azure.azcollection.azure_rm_hdinsightcluster – Manage Azure HDInsight Cluster instance azure.azcollection.azure\_rm\_hdinsightcluster – Manage Azure HDInsight Cluster instance
========================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_hdinsightcluster`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and delete instance of Azure HDInsight Cluster.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **append\_tags** boolean | **Choices:*** no
* **yes** ←
| 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. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **cluster\_definition** string | | The cluster definition. |
| | **gateway\_rest\_password** string | | Gateway REST password. |
| | **gateway\_rest\_username** string | | Gateway REST user name. |
| | **kind** string | **Choices:*** hadoop
* spark
* hbase
* storm
| The type of cluster. |
| **cluster\_version** string | | The version of the cluster. For example `3.6`. |
| **compute\_profile\_roles** list / elements=string | | The list of roles in the cluster. |
| | **linux\_profile** string | | The Linux OS profile. |
| | | **password** string | | SSH password. |
| | | **username** string | | SSH user name. |
| | **min\_instance\_count** string | | The minimum instance count of the cluster. |
| | **name** string | **Choices:*** headnode
* workernode
* zookepernode
| The name of the role. |
| | **target\_instance\_count** string | | The instance count of the cluster. |
| | **vm\_size** string | | The size of the VM. |
| **location** string | | Resource location. If not set, location from the resource group will be used as default. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | The name of the cluster. |
| **os\_type** string | **Choices:*** linux
| The type of operating system. |
| **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 / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| Assert the state of the cluster. Use `present` to create or update a cluster and `absent` to delete it. |
| **storage\_accounts** list / elements=string | | The list of storage accounts in the cluster. |
| | **container** string | | The container in the storage account. |
| | **is\_default** string | | Whether or not the storage account is the default storage account. |
| | **key** string | | The storage account access key. |
| | **name** string | | Blob storage endpoint. For example storage\_account\_name.blob.core.windows.net. |
| **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. |
| **tier** string | **Choices:*** standard
* premium
| The cluster tier. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Create instance of HDInsight Cluster
azure_rm_hdinsightcluster:
resource_group: myResourceGroup
name: myCluster
location: eastus2
cluster_version: 3.6
os_type: linux
tier: standard
cluster_definition:
kind: spark
gateway_rest_username: http-user
gateway_rest_password: MuABCPassword!!@123
storage_accounts:
- name: myStorageAccount.blob.core.windows.net
is_default: yes
container: myContainer
key: GExmaxH4lDNdHA9nwAsCt8t4AOQas2y9vXQP1kKALTram7Q3/5xLVIab3+nYG1x63Xyak9/VXxQyNBHA9pDWw==
compute_profile_roles:
- name: headnode
target_instance_count: 2
hardware_profile:
vm_size: Standard_D3
linux_profile:
username: sshuser
password: MuABCPassword!!@123
- name: workernode
target_instance_count: 2
vm_size: Standard_D3
linux_profile:
username: sshuser
password: MuABCPassword!!@123
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **id** string | always | Fully qualified resource id of the cluster. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.HDInsight/clusters/myCluster |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
ansible azure.azcollection.azure_rm_virtualnetworkpeering_info – Get facts of Azure Virtual Network Peering azure.azcollection.azure\_rm\_virtualnetworkpeering\_info – Get facts of Azure Virtual Network Peering
======================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualnetworkpeering_info`.
New in version 0.0.1: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure Virtual Network Peering.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string | | Name of the virtual network peering. |
| **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 / required | | Name of a resource group where the vnet exists. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **virtual\_network** string / required | | Name or resource ID of a virtual network. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get virtual network peering by name
azure_rm_virtualnetworkpeering_info:
resource_group: myResourceGroup
virtual_network: myVnet1
name: myVnetPeer
- name: List virtual network peering of virtual network
azure_rm_virtualnetworkpeering:
resource_group: myResourceGroup
virtual_network: myVnet1
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **vnetpeerings** complex | always | A list of Virtual Network Peering facts. |
| | **allow\_forwarded\_traffic** boolean | always | Whether forwarded traffic from the VMs in the remote Virtual Network will be allowed/disallowed. |
| | **allow\_gateway\_transit** boolean | always | Whether gateway links can be used in remote Virtual Networking to link to this Virtual Network. |
| | **allow\_virtual\_network\_access** boolean | always | Whether the VMs in the linked Virtual Network space can access all the VMs in local Virtual Network space. |
| | **id** string | always | ID of current Virtual Network peering. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/virtualNetworkPeerings/peer1 |
| | **name** string | always | Name of Virtual Network peering. **Sample:** myPeering |
| | **peering\_state** string | always | The state of the virtual network peering. **Sample:** Connected |
| | **provisioning\_state** string | always | The provisioning state of the resource. **Sample:** Succeeded |
| | **remote\_address\_space** complex | always | The reference of the remote Virtual Network address space. |
| | | **address\_prefixes** list / elements=string | always | A list of address blocks reserved for this Virtual Network in CIDR notation. **Sample:** 10.1.0.0/16 |
| | **remote\_virtual\_network** string | always | ID of remote Virtual Network to be peered to. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet2 |
| | **use\_remote\_gateways** boolean | always | Whether remote gateways can be used on this Virtual Network. |
### Authors
* Yunge Zhu (@yungezz)
ansible azure.azcollection.azure_rm_aksupgrade_info – Get the upgrade versions available for a AKS instance azure.azcollection.azure\_rm\_aksupgrade\_info – Get the upgrade versions available for a AKS instance
======================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_aksupgrade_info`.
New in version 1.4.0: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get the upgrade versions available for a managed Azure Container Service (AKS) instance.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **name** string / required | | Name of the managed Azure Container Services (AKS) instance. |
| **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 / required | | Name of a resource group where the managed Azure Container Services (AKS) exists. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Get available upgrade versions for AKS instance
azure_rm_aksupgrade_info:
name: myAKS
resource_group: myResourceGroup
register: myAKSupgrades
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **azure\_aks\_upgrades** complex | always | Supported AKS instance versions for upgrade by agent pools and control plane. |
| | **agent\_pool\_profiles** complex | always | Available upgrade versions for agent pools |
| | | **kubernetes\_version** string | success | Current kubernetes version **Sample:** 1.18.1 |
| | | **name** string | success | Pool name **Sample:** my\_pool |
| | | **os\_type** string | success | Operating system type **Sample:** Linux |
| | | **upgrades** complex | success | List of orchestrator types and versions available for upgrade. |
| | | | **is\_preview** boolean | success | Is the version available in preview |
| | | | **kubernetes\_version** string | success | Kubernetes version **Sample:** 1.19.3 |
| | **control\_plane\_profile** complex | always | Available upgrade versions for control plane |
| | | **kubernetes\_version** string | success | Current kubernetes version **Sample:** 1.18.1 |
| | | **name** string | success | Pool name **Sample:** my\_pool |
| | | **os\_type** string | success | Operating system type **Sample:** Linux |
| | | **upgrades** complex | success | List of orchestrator types and versions available for upgrade. |
| | | | **is\_preview** boolean | success | Is the version available in preview |
| | | | **kubernetes\_version** string | success | Kubernetes version **Sample:** 1.19.3 |
### Authors
* Andrii Bilorus (@ewscat)
ansible azure.azcollection.azure_rm_virtualmachinescalesetinstance – Get Azure Virtual Machine Scale Set Instance facts azure.azcollection.azure\_rm\_virtualmachinescalesetinstance – Get Azure Virtual Machine Scale Set Instance facts
=================================================================================================================
Note
This plugin is part of the [azure.azcollection collection](https://galaxy.ansible.com/azure/azcollection) (version 1.10.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`.
To use it in a playbook, specify: `azure.azcollection.azure_rm_virtualmachinescalesetinstance`.
New in version 0.1.2: of azure.azcollection
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get facts of Azure Virtual Machine Scale Set VMs.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* The host that executes this module must have the azure.azcollection collection installed via galaxy
* All python packages listed in collection’s requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
* Full installation instructions may be found <https://galaxy.ansible.com/azure/azcollection>
Parameters
----------
| Parameter | Choices/Defaults | 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 0.0.1 of azure.azcollection | | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
| **api\_profile** string added in 0.0.1 of azure.azcollection | **Default:**"latest" | Selects an API profile to use when communicating with Azure services. Default value of `latest` is appropriate for public clouds; future values will allow use with Azure Stack. |
| **auth\_source** string added in 0.0.1 of azure.azcollection | **Choices:*** **auto** ←
* cli
* credential\_file
* env
* msi
| Controls the source of the credentials to use for authentication. Can also be set via the `ANSIBLE_AZURE_AUTH_SOURCE` environment variable. When set to `auto` (the default) the precedence is module parameters -> `env` -> `credential_file` -> `cli`. When set to `env`, the credentials will be read from the environment variables When set to `credential_file`, it will read the profile from `~/.azure/credentials`. When set to `cli`, the credentials will be sources from the Azure CLI profile. `subscription_id` or the environment variable `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 `msi`, the host machine must be an azure resource with an enabled MSI extension. `subscription_id` or the environment variable `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 `msi` was added in Ansible 2.6. |
| **cert\_validation\_mode** string added in 0.0.1 of azure.azcollection | **Choices:*** ignore
* validate
| 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 `ignore`. Can also be set via credential file profile or the `AZURE_CERT_VALIDATION` environment variable. |
| **client\_id** string | | Azure client ID. Use when authenticating with a Service Principal. |
| **cloud\_environment** string added in 0.0.1 of azure.azcollection | **Default:**"AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, `AzureChinaCloud`, `AzureUSGovernment`), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the `AZURE_CLOUD_ENVIRONMENT` environment variable. |
| **instance\_id** string / required | | The instance ID of the virtual machine. |
| **latest\_model** boolean | **Choices:*** no
* yes
| Set to `yes` to upgrade to the latest model. |
| **log\_mode** string | | Parent argument. |
| **log\_path** string | | Parent argument. |
| **password** string | | Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
| **power\_state** string | **Choices:*** running
* stopped
* deallocated
| Use this option to change power state of the instance. |
| **profile** string | | Security profile found in ~/.azure/credentials file. |
| **protect\_from\_scale\_in** boolean | **Choices:*** no
* yes
| turn on/off instance protection from scale in |
| **protect\_from\_scale\_set\_actions** boolean | **Choices:*** no
* yes
| tun on/off instance protection from scale set actions |
| **resource\_group** string / required | | The name of the resource group. |
| **secret** string | | Azure client secret. Use when authenticating with a Service Principal. |
| **state** string | **Choices:*** absent
* **present** ←
| State of the VMSS instance. Use `present` to update an instance and `absent` to delete an instance. |
| **subscription\_id** string | | Your Azure subscription Id. |
| **tenant** string | | Azure tenant ID. Use when authenticating with a Service Principal. |
| **vmss\_name** string / required | | The name of the VM scale set. |
Notes
-----
Note
* For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with `az login`.
* Authentication is also possible using a service principal or Active Directory user.
* To authenticate via service principal, pass subscription\_id, client\_id, secret and tenant or set environment variables AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET and AZURE\_TENANT.
* To authenticate via Active Directory user, pass ad\_user and password, or set AZURE\_AD\_USER and AZURE\_PASSWORD in the environment.
* Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription\_id, client\_id, secret and tenant or subscription\_id, ad\_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE\_PROFILE in the environment.
See Also
--------
See also
[Sign in with Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)
How to authenticate using the `az login` command.
Examples
--------
```
- name: Upgrade instance to the latest image
azure_rm_virtualmachinescalesetinstance:
resource_group: myResourceGroup
vmss_name: myVMSS
instance_id: "2"
latest_model: yes
- name: Turn on protect from scale in
azure_rm_virtualmachinescalesetinstance:
resource_group: myResourceGroup
vmss_name: myVMSS
instance_id: "2"
protect_from_scale_in: true
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **instances** complex | always | A list of instances. |
| | **id** string | always | Instance resource ID. **Sample:** /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/TestGroup/providers/Microsoft.Compute/scalesets/myscaleset/vms/myvm |
### Authors
* Zim Kalinowski (@zikalino)
| programming_docs |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.