code
stringlengths 2.5k
150k
| kind
stringclasses 1
value |
---|---|
ansible community.network.exos_lldp_global – Configure and manage Link Layer Discovery Protocol(LLDP) attributes on EXOS platforms. community.network.exos\_lldp\_global – Configure and manage Link Layer Discovery Protocol(LLDP) attributes on EXOS platforms.
=============================================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.exos_lldp_global`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module configures and manages the Link Layer Discovery Protocol(LLDP) attributes on Extreme Networks EXOS platforms.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** dictionary | | A dictionary of LLDP options |
| | **interval** integer | **Default:**30 | Frequency at which LLDP advertisements are sent (in seconds). By default - 30 seconds. |
| | **tlv\_select** dictionary | | This attribute can be used to specify the TLVs that need to be sent in the LLDP packets. By default, only system name and system description is sent |
| | | **management\_address** boolean | **Choices:*** no
* yes
| Used to specify the management address in TLV messages |
| | | **port\_description** boolean | **Choices:*** no
* yes
| Used to specify the port description TLV |
| | | **system\_capabilities** boolean | **Choices:*** no
* yes
| Used to specify the system capabilities TLV |
| | | **system\_description** boolean | **Choices:*** no
* **yes** ←
| Used to specify the system description TLV |
| | | **system\_name** boolean | **Choices:*** no
* **yes** ←
| Used to specify the system name TLV |
| **state** string | **Choices:*** **merged** ←
* replaced
* deleted
| The state of the configuration after module completion. |
Notes
-----
Note
* Tested against Extreme Networks EXOS version 30.2.1.8 on x460g2.
* This module works with connection `httpapi`. See [EXOS Platform Options](user_guide/platform_exos)
Examples
--------
```
# Using merged
# Before state:
# -------------
# path: /rest/restconf/data/openconfig_lldp:lldp/config
# method: GET
# data:
# {
# "openconfig_lldp:config": {
# "enabled": true,
# "hello-timer": 30,
# "suppress-tlv-advertisement": [
# "PORT_DESCRIPTION",
# "SYSTEM_CAPABILITIES",
# "MANAGEMENT_ADDRESS"
# ],
# "system-description": "ExtremeXOS (X460G2-24t-10G4) version 30.2.1.8"
# "system-name": "X460G2-24t-10G4"
# }
# }
- name: Merge provided LLDP configuration with device configuration
community.network.exos_lldp_global:
config:
interval: 10000
tlv_select:
system_capabilities: true
state: merged
# Module Execution Results:
# -------------------------
#
# "before": [
# {
# "interval": 30,
# "tlv_select": {
# "system_name": true,
# "system_description": true
# "port_description": false,
# "management_address": false,
# "system_capabilities": false
# }
# }
# ]
#
# "requests": [
# {
# "data": {
# "openconfig_lldp:config": {
# "hello-timer": 10000,
# "suppress-tlv-advertisement": [
# "PORT_DESCRIPTION",
# "MANAGEMENT_ADDRESS"
# ]
# }
# },
# "method": "PATCH",
# "path": "/rest/restconf/data/openconfig_lldp:lldp/config"
# }
# ]
#
# "after": [
# {
# "interval": 10000,
# "tlv_select": {
# "system_name": true,
# "system_description": true,
# "port_description": false,
# "management_address": false,
# "system_capabilities": true
# }
# }
# ]
# After state:
# -------------
# path: /rest/restconf/data/openconfig_lldp:lldp/config
# method: GET
# data:
# {
# "openconfig_lldp:config": {
# "enabled": true,
# "hello-timer": 10000,
# "suppress-tlv-advertisement": [
# "PORT_DESCRIPTION",
# "MANAGEMENT_ADDRESS"
# ],
# "system-description": "ExtremeXOS (X460G2-24t-10G4) version 30.2.1.8"
# "system-name": "X460G2-24t-10G4"
# }
# }
# Using replaced
# Before state:
# -------------
# path: /rest/restconf/data/openconfig_lldp:lldp/config
# method: GET
# data:
# {
# "openconfig_lldp:config": {
# "enabled": true,
# "hello-timer": 30,
# "suppress-tlv-advertisement": [
# "PORT_DESCRIPTION",
# "SYSTEM_CAPABILITIES",
# "MANAGEMENT_ADDRESS"
# ],
# "system-description": "ExtremeXOS (X460G2-24t-10G4) version 30.2.1.8"
# "system-name": "X460G2-24t-10G4"
# }
# }
- name: Replace device configuration with provided LLDP configuration
community.network.exos_lldp_global:
config:
interval: 10000
tlv_select:
system_capabilities: true
state: replaced
# Module Execution Results:
# -------------------------
#
# "before": [
# {
# "interval": 30,
# "tlv_select": {
# "system_name": true,
# "system_description": true
# "port_description": false,
# "management_address": false,
# "system_capabilities": false
# }
# }
# ]
#
# "requests": [
# {
# "data": {
# "openconfig_lldp:config": {
# "hello-timer": 10000,
# "suppress-tlv-advertisement": [
# "SYSTEM_NAME",
# "SYSTEM_DESCRIPTION",
# "PORT_DESCRIPTION",
# "MANAGEMENT_ADDRESS"
# ]
# }
# },
# "method": "PATCH",
# "path": "/rest/restconf/data/openconfig_lldp:lldp/config"
# }
# ]
#
# "after": [
# {
# "interval": 10000,
# "tlv_select": {
# "system_name": false,
# "system_description": false,
# "port_description": false,
# "management_address": false,
# "system_capabilities": true
# }
# }
# ]
# After state:
# -------------
# path: /rest/restconf/data/openconfig_lldp:lldp/config
# method: GET
# data:
# {
# "openconfig_lldp:config": {
# "enabled": true,
# "hello-timer": 10000,
# "suppress-tlv-advertisement": [
# "SYSTEM_NAME",
# "SYSTEM_DESCRIPTION",
# "PORT_DESCRIPTION",
# "MANAGEMENT_ADDRESS"
# ],
# "system-description": "ExtremeXOS (X460G2-24t-10G4) version 30.2.1.8"
# "system-name": "X460G2-24t-10G4"
# }
# }
# Using deleted
# Before state:
# -------------
# path: /rest/restconf/data/openconfig_lldp:lldp/config
# method: GET
# data:
# {
# "openconfig_lldp:config": {
# "enabled": true,
# "hello-timer": 10000,
# "suppress-tlv-advertisement": [
# "SYSTEM_CAPABILITIES",
# "MANAGEMENT_ADDRESS"
# ],
# "system-description": "ExtremeXOS (X460G2-24t-10G4) version 30.2.1.8"
# "system-name": "X460G2-24t-10G4"
# }
# }
- name: Delete attributes of given LLDP service (This won't delete the LLDP service itself)
community.network.exos_lldp_global:
config:
state: deleted
# Module Execution Results:
# -------------------------
#
# "before": [
# {
# "interval": 10000,
# "tlv_select": {
# "system_name": true,
# "system_description": true,
# "port_description": true,
# "management_address": false,
# "system_capabilities": false
# }
# }
# ]
#
# "requests": [
# {
# "data": {
# "openconfig_lldp:config": {
# "hello-timer": 30,
# "suppress-tlv-advertisement": [
# "SYSTEM_CAPABILITIES",
# "PORT_DESCRIPTION",
# "MANAGEMENT_ADDRESS"
# ]
# }
# },
# "method": "PATCH",
# "path": "/rest/restconf/data/openconfig_lldp:lldp/config"
# }
# ]
#
# "after": [
# {
# "interval": 30,
# "tlv_select": {
# "system_name": true,
# "system_description": true,
# "port_description": false,
# "management_address": false,
# "system_capabilities": false
# }
# }
# ]
# After state:
# -------------
# path: /rest/restconf/data/openconfig_lldp:lldp/config
# method: GET
# data:
# {
# "openconfig_lldp:config": {
# "enabled": true,
# "hello-timer": 30,
# "suppress-tlv-advertisement": [
# "SYSTEM_CAPABILITIES",
# "PORT_DESCRIPTION",
# "MANAGEMENT_ADDRESS"
# ],
# "system-description": "ExtremeXOS (X460G2-24t-10G4) version 30.2.1.8"
# "system-name": "X460G2-24t-10G4"
# }
# }
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **requests** list / elements=string | always | The set of requests pushed to the remote device. **Sample:** [{'data': '...', 'method': '...', 'path': '...'}, {'data': '...', 'method': '...', 'path': '...'}, {'data': '...', 'method': '...', 'path': '...'}] |
### Authors
* Ujwal Komarla (@ujwalkomarla)
ansible community.network.cnos_conditional_command – Execute a single command based on condition on devices running Lenovo CNOS community.network.cnos\_conditional\_command – Execute a single command based on condition on devices running Lenovo CNOS
=========================================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.cnos_conditional_command`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module allows you to modify the running configuration of a switch. It provides a way to execute a single CNOS command on a network device by evaluating the current running configuration and executing the command only if the specific settings have not been already configured. The CNOS command is passed as an argument of the method. This module functions the same as the cnos\_command module. The only exception is that following inventory variable can be specified [“condition = <flag string>”] When this inventory variable is specified as the variable of a task, the command is executed for the network element that matches the flag string. Usually, commands are executed across a group of network devices. When there is a requirement to skip the execution of the command on one or more devices, it is recommended to use this module. This module uses SSH to manage network device configuration.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **clicommand** string / required | | This specifies the CLI command as an attribute to this method. The command is passed using double quotes. The variables can be placed directly on to the CLI commands or can be invoked from the vars directory. |
| **condition** string / required | | If you specify condition=false in the inventory file against any device, the command execution is skipped for that device. |
| **deviceType** string / required | **Choices:*** g8272\_cnos
* g8296\_cnos
* g8332\_cnos
* NE0152T
* NE1072T
* NE1032
* NE1032T
* NE10032
* NE2572
| This specifies the type of device where the method is executed. The choices NE1072T,NE1032,NE1032T,NE10032,NE2572 are added since Ansible 2.4. The choice NE0152T is added since 2.8 |
| **enablePassword** string | | Configures the password used to enter Global Configuration command mode on the switch. If the switch does not request this password, the parameter is ignored.While generally the value should come from the inventory file, you can also specify it as a variable. This parameter is optional. If it is not specified, no default value will be used. |
| **flag** string / required | | If a task needs to be executed, you have to set the flag the same as it is specified in the inventory for that device. |
| **host** string / required | | This is the variable used to search the hosts file at /etc/ansible/hosts and identify the IP address of the device on which the template is going to be applied. Usually the Ansible keyword {{ inventory\_hostname }} is specified in the playbook as an abstraction of the group of network elements that need to be configured. |
| **outputfile** string / required | | This specifies the file path where the output of each command execution is saved. Each command that is specified in the merged template file and each response from the device are saved here. Usually the location is the results folder, but you can choose another location based on your write permission. |
| **password** string / required | | Configures the password used to authenticate the connection to the remote device. The value of the password parameter is used to authenticate the SSH session. While generally the value should come from the inventory file, you can also specify it as a variable. This parameter is optional. If it is not specified, no default value will be used. |
| **username** string / required | | Configures the username used to authenticate the connection to the remote device. The value of the username parameter is used to authenticate the SSH session. While generally the value should come from the inventory file, you can also specify it as a variable. This parameter is optional. If it is not specified, no default value will be used. |
Notes
-----
Note
* For more information on using Ansible to manage Lenovo Network devices see <https://www.ansible.com/ansible-lenovo>.
Examples
--------
```
Tasks : The following are examples of using the module
cnos_conditional_command. These are written in the main.yml file of the tasks
directory.
---
- name: Applying CLI template on VLAG Tier1 Leaf Switch1
community.network.cnos_conditional_command:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_conditional_command_
{{ inventory_hostname }}_output.txt"
condition: "{{ hostvars[inventory_hostname]['condition']}}"
flag: leaf_switch2
command: "spanning-tree mode enable"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **msg** string | always | Success or failure message **Sample:** Command Applied |
### Authors
* Anil Kumar Muraleedharan (@amuraleedhar)
ansible community.network.pn_vflow_table_profile – CLI command to modify vflow-table-profile community.network.pn\_vflow\_table\_profile – CLI command to modify vflow-table-profile
=======================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_vflow_table_profile`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to modify a vFlow table profile.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_enable** boolean | **Choices:*** no
* yes
| enable or disable vflow profile table. |
| **pn\_hw\_tbl** string | **Choices:*** switch-main
* switch-hash
* npu-main
* npu-hash
| hardware table used by vFlow. |
| **pn\_profile** string | **Choices:*** application
* ipv6
* qos
| type of vFlow profile. |
| **state** string / required | **Choices:*** update
| State the action to perform. Use `update` to modify the vflow-table-profile. |
Examples
--------
```
- name: Modify vflow table profile
community.network.pn_vflow_table_profile:
pn_cliswitch: 'sw01'
state: 'update'
pn_profile: 'ipv6'
pn_hw_tbl: 'switch-main'
pn_enable: true
- name: Modify vflow table profile
community.network.pn_vflow_table_profile:
state: 'update'
pn_profile: 'qos'
pn_hw_tbl: 'switch-main'
pn_enable: false
```
Return Values
-------------
Common return 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 | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the vflow-table-profile command. |
| **stdout** list / elements=string | always | set of responses from the vflow-table-profile command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
ansible community.network.ipadm_if – Manage IP interfaces on Solaris/illumos systems. community.network.ipadm\_if – Manage IP interfaces on Solaris/illumos systems.
==============================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ipadm_if`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, delete, enable or disable IP interfaces on Solaris/illumos systems.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **name** string / required | | IP interface name. |
| **state** string | **Choices:*** **present** ←
* absent
* enabled
* disabled
| Create or delete Solaris/illumos IP interfaces. |
| **temporary** boolean | **Choices:*** **no** ←
* yes
| Specifies that the IP interface is temporary. Temporary IP interfaces do not persist across reboots. |
Examples
--------
```
- name: Create vnic0 interface
community.network.ipadm_if:
name: vnic0
state: enabled
- name: Disable vnic0 interface
community.network.ipadm_if:
name: vnic0
state: disabled
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **name** string | always | IP interface name **Sample:** vnic0 |
| **state** string | always | state of the target **Sample:** present |
| **temporary** boolean | always | persistence of a IP interface **Sample:** True |
### Authors
* Adam Števko (@xen0l)
| programming_docs |
ansible community.network.pn_admin_syslog – CLI command to create/modify/delete admin-syslog community.network.pn\_admin\_syslog – CLI command to create/modify/delete admin-syslog
======================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_admin_syslog`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to create the scope and other parameters of syslog event collection.
* This module can be used to modify parameters of syslog event collection.
* This module can be used to delete the scope and other parameters of syslog event collection.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_host** string | | Hostname to log system events. |
| **pn\_message\_format** string | **Choices:*** structured
* legacy
| message-format for log events - structured or legacy. |
| **pn\_name** string | | name of the system log. |
| **pn\_port** string | | Host port. |
| **pn\_scope** string | **Choices:*** local
* fabric
| Scope of the system log. |
| **pn\_transport** string | **Choices:*** tcp-tls
* **udp** ←
| Transport for log events - tcp/tls or udp. |
| **state** string / required | **Choices:*** present
* absent
* update
| State the action to perform. Use `present` to create admin-syslog and `absent` to delete admin-syslog `update` to modify the admin-syslog. |
Examples
--------
```
- name: Admin-syslog functionality
community.network.pn_admin_syslog:
pn_cliswitch: "sw01"
state: "absent"
pn_name: "foo"
pn_scope: "local"
- name: Admin-syslog functionality
community.network.pn_admin_syslog:
pn_cliswitch: "sw01"
state: "present"
pn_name: "foo"
pn_scope: "local"
pn_host: "166.68.224.46"
pn_message_format: "structured"
- name: Admin-syslog functionality
community.network.pn_admin_syslog:
pn_cliswitch: "sw01"
state: "update"
pn_name: "foo"
pn_host: "166.68.224.10"
```
Return Values
-------------
Common return 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 | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the admin-syslog command. |
| **stdout** list / elements=string | always | set of responses from the admin-syslog command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
ansible community.network.pn_vrouter_loopback_interface – CLI command to add/remove vrouter-loopback-interface community.network.pn\_vrouter\_loopback\_interface – CLI command to add/remove vrouter-loopback-interface
=========================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_vrouter_loopback_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to add loopback interface to a vRouter or remove loopback interface from a vRouter.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_index** string | | loopback index from 1 to 255. |
| **pn\_ip** string / required | | loopback IP address. |
| **pn\_vrouter\_name** string / required | | name of service config. |
| **state** string | **Choices:*** **present** ←
* absent
| State the action to perform. Use `present` to add vrouter-loopback-interface and `absent` to remove vrouter-loopback-interface. |
Examples
--------
```
- name: Add vrouter loopback interface
community.network.pn_vrouter_loopback_interface:
state: "present"
pn_cliswitch: "sw01"
pn_vrouter_name: "sw01-vrouter"
pn_ip: "192.168.10.1"
- name: Remove vrouter loopback interface
community.network.pn_vrouter_loopback_interface:
state: "absent"
pn_cliswitch: "sw01"
pn_vrouter_name: "sw01-vrouter"
pn_ip: "192.168.10.1"
pn_index: "2"
```
Return Values
-------------
Common return 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 | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error response from the vrouter-loopback-interface command. |
| **stdout** list / elements=string | always | set of responses from the vrouter-loopback-interface command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
ansible community.network.ce_link_status – Get interface link status on HUAWEI CloudEngine switches. community.network.ce\_link\_status – Get interface link status on HUAWEI CloudEngine switches.
==============================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_link_status`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get interface link status on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **interface** string / required | | For the interface parameter, you can enter `all` to display information about all interfaces, an interface type such as `40GE` to display information about interfaces of the specified type, or full name of an interface such as `40GE1/0/22` or `vlanif10` to display information about the specific interface. |
Notes
-----
Note
* Current physical state shows an interface’s physical status.
* Current link state shows an interface’s link layer protocol status.
* Current IPv4 state shows an interface’s IPv4 protocol status.
* Current IPv6 state shows an interface’s IPv6 protocol status.
* Inbound octets(bytes) shows the number of bytes that an interface received.
* Inbound unicast(pkts) shows the number of unicast packets that an interface received.
* Inbound multicast(pkts) shows the number of multicast packets that an interface received.
* Inbound broadcast(pkts) shows the number of broadcast packets that an interface received.
* Inbound error(pkts) shows the number of error packets that an interface received.
* Inbound drop(pkts) shows the total number of packets that were sent to the interface but dropped by an interface.
* Inbound rate(byte/sec) shows the rate at which an interface receives bytes within an interval.
* Inbound rate(pkts/sec) shows the rate at which an interface receives packets within an interval.
* Outbound octets(bytes) shows the number of the bytes that an interface sent.
* Outbound unicast(pkts) shows the number of unicast packets that an interface sent.
* Outbound multicast(pkts) shows the number of multicast packets that an interface sent.
* Outbound broadcast(pkts) shows the number of broadcast packets that an interface sent.
* Outbound error(pkts) shows the total number of packets that an interface sent but dropped by the remote interface.
* Outbound drop(pkts) shows the number of dropped packets that an interface sent.
* Outbound rate(byte/sec) shows the rate at which an interface sends bytes within an interval.
* Outbound rate(pkts/sec) shows the rate at which an interface sends packets within an interval.
* Speed shows the rate for an Ethernet interface.
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Link status test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Get specified interface link status information
community.network.ce_link_status:
interface: 40GE1/0/1
provider: "{{ cli }}"
- name: Get specified interface type link status information
community.network.ce_link_status:
interface: 40GE
provider: "{{ cli }}"
- name: Get all interfaces link status information
community.network.ce_link_status:
interface: all
provider: "{{ cli }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **result** dictionary | always | Interface link status information **Sample:** {'40ge2/0/8': {'Current IPv4 state': 'down', 'Current IPv6 state': 'down', 'Current link state': 'up', 'Current physical state': 'up', 'Inbound broadcast(pkts)': '0', 'Inbound drop(pkts)': '0', 'Inbound error(pkts)': '0', 'Inbound multicast(pkts)': '20151', 'Inbound octets(bytes)': '7314813', 'Inbound rate(byte/sec)': '11', 'Inbound rate(pkts/sec)': '0', 'Inbound unicast(pkts)': '0', 'Outbound broadcast(pkts)': '1', 'Outbound drop(pkts)': '0', 'Outbound error(pkts)': '0', 'Outbound multicast(pkts)': '20152', 'Outbound octets(bytes)': '7235021', 'Outbound rate(byte/sec)': '11', 'Outbound rate(pkts/sec)': '0', 'Outbound unicast(pkts)': '0', 'Speed': '40GE'}} |
### Authors
* Zhijin Zhou (@QijunPan)
ansible community.network.icx_interface – Manage Interface on Ruckus ICX 7000 series switches community.network.icx\_interface – Manage Interface on Ruckus ICX 7000 series switches
======================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.icx_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of Interfaces on ruckus icx devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** list / elements=string | | List of Interfaces definitions. |
| | **check\_running\_config** boolean | **Choices:*** no
* yes
| Check running configuration. This can be set as environment variable. Module will use environment variable value(default:True), unless it is overridden, by specifying it as module parameter. |
| | **delay** integer | | Time in seconds to wait before checking for the operational state on remote device. This wait is applicable for operational state argument which are *state* with values `up`/`down`, *tx\_rate* and *rx\_rate*. |
| | **description** string | | Name of the description. |
| | **enabled** boolean | **Choices:*** no
* yes
| Interface link status |
| | **name** string | | Name of the Interface. |
| | **neighbors** list / elements=string | | Check the operational state of given interface `name` for CDP/LLDP neighbor. The following suboptions are available. |
| | | **host** string | | CDP/LLDP neighbor host for given interface `name`. |
| | | **port** string | | CDP/LLDP neighbor port to which given interface `name` is connected. |
| | **power** dictionary | | Inline power on Power over Ethernet (PoE) ports. |
| | | **by\_class** string | **Choices:*** 0
* 1
* 2
* 3
* 4
| The range is 0-4 The power limit based on class value for given interface `name`
|
| | | **enabled** boolean | **Choices:*** no
* yes
| enable/disable the poe of the given interface `name`
|
| | | **limit** string | | The range is 1000-15400|30000mW. For PoH ports the range is 1000-95000mW The power limit based on actual power value for given interface `name`
|
| | | **priority** string | **Choices:*** 1
* 2
* 3
| The range is 1 (highest) to 3 (lowest) The priority for power management or given interface `name`
|
| | **rx\_rate** string | | Receiver rate in bits per second (bps). This is state check parameter only. Supports conditionals, see [Conditionals in Networking Modules](user_guide/network_working_with_command_output)
|
| | **speed** string | **Choices:*** 10-full
* 10-half
* 100-full
* 100-half
* 1000-full
* 1000-full-master
* 1000-full-slave
* 10g-full
* 10g-full-master
* 10g-full-slave
* 2500-full
* 2500-full-master
* 2500-full-slave
* 5g-full
* 5g-full-master
* 5g-full-slave
* auto
| Interface link speed/duplex |
| | **state** string | **Choices:*** present
* absent
* up
* down
| State of the Interface configuration, `up` means present and operationally up and `down` means present and operationally `down`
|
| | **stp** boolean | **Choices:*** no
* yes
| enable/disable stp for the interface |
| | **tx\_rate** string | | Transmit rate in bits per second (bps). This is state check parameter only. Supports conditionals, see [Conditionals in Networking Modules](user_guide/network_working_with_command_output)
|
| **check\_running\_config** boolean | **Choices:*** no
* **yes** ←
| Check running configuration. This can be set as environment variable. Module will use environment variable value(default:True), unless it is overridden, by specifying it as module parameter. |
| **delay** integer | **Default:**10 | Time in seconds to wait before checking for the operational state on remote device. This wait is applicable for operational state argument which are *state* with values `up`/`down`, *tx\_rate* and *rx\_rate*. |
| **description** string | | Name of the description. |
| **enabled** boolean | **Choices:*** no
* **yes** ←
| Interface link status |
| **name** string | | Name of the Interface. |
| **neighbors** list / elements=string | | Check the operational state of given interface `name` for CDP/LLDP neighbor. The following suboptions are available. |
| | **host** string | | CDP/LLDP neighbor host for given interface `name`. |
| | **port** string | | CDP/LLDP neighbor port to which given interface `name` is connected. |
| **power** dictionary | | Inline power on Power over Ethernet (PoE) ports. |
| | **by\_class** string | **Choices:*** 0
* 1
* 2
* 3
* 4
| The range is 0-4 The power limit based on class value for given interface `name`
|
| | **enabled** boolean | **Choices:*** no
* yes
| enable/disable the poe of the given interface `name`
Default is false. |
| | **limit** string | | The range is 1000-15400|30000mW. For PoH ports the range is 1000-95000mW The power limit based on actual power value for given interface `name`
|
| | **priority** string | **Choices:*** 1
* 2
* 3
| The range is 1 (highest) to 3 (lowest) The priority for power management or given interface `name`
|
| **rx\_rate** string | | Receiver rate in bits per second (bps). This is state check parameter only. Supports conditionals, see [Conditionals in Networking Modules](user_guide/network_working_with_command_output)
|
| **speed** string | **Choices:*** 10-full
* 10-half
* 100-full
* 100-half
* 1000-full
* 1000-full-master
* 1000-full-slave
* 10g-full
* 10g-full-master
* 10g-full-slave
* 2500-full
* 2500-full-master
* 2500-full-slave
* 5g-full
* 5g-full-master
* 5g-full-slave
* auto
| Interface link speed/duplex |
| **state** string | **Choices:*** **present** ←
* absent
* up
* down
| State of the Interface configuration, `up` means present and operationally up and `down` means present and operationally `down`
|
| **stp** boolean | **Choices:*** no
* yes
| enable/disable stp for the interface |
| **tx\_rate** string | | Transmit rate in bits per second (bps). This is state check parameter only. Supports conditionals, see [Conditionals in Networking Modules](user_guide/network_working_with_command_output)
|
Notes
-----
Note
* Tested against ICX 10.1.
* For information on using ICX platform, see [the ICX OS Platform Options guide](user_guide/platform_icx).
Examples
--------
```
- name: Enable ethernet port and set name
community.network.icx_interface:
name: ethernet 1/1/1
description: interface-1
stp: true
enabled: true
- name: Disable ethernet port 1/1/1
community.network.icx_interface:
name: ethernet 1/1/1
enabled: false
- name: Enable ethernet port range, set name and speed
community.network.icx_interface:
name: ethernet 1/1/1 to 1/1/10
description: interface-1
speed: 100-full
enabled: true
- name: Enable poe. Set class
community.network.icx_interface:
name: ethernet 1/1/1
power:
by_class: 2
- name: Configure poe limit of interface
community.network.icx_interface:
name: ethernet 1/1/1
power:
limit: 10000
- name: Disable poe of interface
community.network.icx_interface:
name: ethernet 1/1/1
power:
enabled: false
- name: Set lag name for a range of lags
community.network.icx_interface:
name: lag 1 to 10
description: test lags
- name: Disable lag
community.network.icx_interface:
name: lag 1
enabled: false
- name: Enable management interface
community.network.icx_interface:
name: management 1
enabled: true
- name: Enable loopback interface
community.network.icx_interface:
name: loopback 10
enabled: true
- name: Add interface using aggregate
community.network.icx_interface:
aggregate:
- { name: ethernet 1/1/1, description: test-interface-1, power: { by_class: 2 } }
- { name: ethernet 1/1/3, description: test-interface-3}
speed: 10-full
enabled: true
- name: Check tx_rate, rx_rate intent arguments
community.network.icx_interface:
name: ethernet 1/1/10
state: up
tx_rate: ge(0)
rx_rate: le(0)
- name: Check neighbors intent arguments
community.network.icx_interface:
name: ethernet 1/1/10
neighbors:
- port: 1/1/5
host: netdev
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['interface ethernet 1/1/1', 'port-name interface-1', 'state present', 'speed-duplex 100-full', 'inline power priority 1'] |
### Authors
* Ruckus Wireless (@Commscope)
| programming_docs |
ansible community.network.cnos_vlag – Manage VLAG resources and attributes on devices running Lenovo CNOS community.network.cnos\_vlag – Manage VLAG resources and attributes on devices running Lenovo CNOS
==================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.cnos_vlag`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module allows you to work with virtual Link Aggregation Groups (vLAG) related configurations. The operators used are overloaded to ensure control over switch vLAG configurations. Apart from the regular device connection related attributes, there are four vLAG arguments which are overloaded variables that will perform further configurations. They are vlagArg1, vlagArg2, vlagArg3, and vlagArg4. For more details on how to use these arguments, see [Overloaded Variables]. This module uses SSH to manage network device configuration. The results of the operation will be placed in a directory named ‘results’ that must be created by the user in their local directory to where the playbook is run.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **deviceType** string / required | **Choices:*** g8272\_cnos
* g8296\_cnos
* g8332\_cnos
* NE0152T
* NE1072T
* NE1032
* NE1032T
* NE10032
* NE2572
| This specifies the type of device where the method is executed. The choices NE1072T,NE1032,NE1032T,NE10032,NE2572 are added since Ansible 2.4. The choice NE0152T is added since 2.8 |
| **enablePassword** string | | Configures the password used to enter Global Configuration command mode on the switch. If the switch does not request this password, the parameter is ignored.While generally the value should come from the inventory file, you can also specify it as a variable. This parameter is optional. If it is not specified, no default value will be used. |
| **host** string / required | | This is the variable used to search the hosts file at /etc/ansible/hosts and identify the IP address of the device on which the template is going to be applied. Usually the Ansible keyword {{ inventory\_hostname }} is specified in the playbook as an abstraction of the group of network elements that need to be configured. |
| **outputfile** string / required | | This specifies the file path where the output of each command execution is saved. Each command that is specified in the merged template file and each response from the device are saved here. Usually the location is the results folder, but you can choose another location based on your write permission. |
| **password** string / required | | Configures the password used to authenticate the connection to the remote device. The value of the password parameter is used to authenticate the SSH session. While generally the value should come from the inventory file, you can also specify it as a variable. This parameter is optional. If it is not specified, no default value will be used. |
| **username** string / required | | Configures the username used to authenticate the connection to the remote device. The value of the username parameter is used to authenticate the SSH session. While generally the value should come from the inventory file, you can also specify it as a variable. This parameter is optional. If it is not specified, no default value will be used. |
| **vlagArg1** string / required | **Choices:*** enable
* auto-recovery
* config-consistency
* isl
* mac-address-table
* peer-gateway
* priority
* startup-delay
* tier-id
* vrrp
* instance
* hlthchk
| This is an overloaded vlag first argument. Usage of this argument can be found is the User Guide referenced above. |
| **vlagArg2** string | **Choices:*** Interval in seconds
* disable or strict
* Port Aggregation Number
* VLAG priority
* Delay time in seconds
* VLAG tier-id value
* VLAG instance number
* keepalive-attempts
* keepalive-interval
* retry-interval
* peer-ip
| This is an overloaded vlag second argument. Usage of this argument can be found is the User Guide referenced above. |
| **vlagArg3** string | **Choices:*** enable or port-aggregation
* Number of keepalive attempts
* Interval in seconds
* Interval in seconds
* VLAG health check peer IP4 address
| This is an overloaded vlag third argument. Usage of this argument can be found is the User Guide referenced above. |
| **vlagArg4** string | **Choices:*** Port Aggregation Number
* default or management
| This is an overloaded vlag fourth argument. Usage of this argument can be found is the User Guide referenced above. |
Notes
-----
Note
* For more information on using Ansible to manage Lenovo Network devices see <https://www.ansible.com/ansible-lenovo>.
Examples
--------
```
Tasks : The following are examples of using the module cnos_vlag. These are
written in the main.yml file of the tasks directory.
---
- name: Test Vlag - enable
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "enable"
- name: Test Vlag - autorecovery
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "auto-recovery"
vlagArg2: 266
- name: Test Vlag - config-consistency
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "config-consistency"
vlagArg2: "strict"
- name: Test Vlag - isl
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "isl"
vlagArg2: 23
- name: Test Vlag - mac-address-table
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "mac-address-table"
- name: Test Vlag - peer-gateway
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "peer-gateway"
- name: Test Vlag - priority
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "priority"
vlagArg2: 1313
- name: Test Vlag - startup-delay
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "startup-delay"
vlagArg2: 323
- name: Test Vlag - tier-id
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "tier-id"
vlagArg2: 313
- name: Test Vlag - vrrp
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "vrrp"
- name: Test Vlag - instance
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "instance"
vlagArg2: 33
vlagArg3: 333
- name: Test Vlag - instance2
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "instance"
vlagArg2: "33"
- name: Test Vlag - keepalive-attempts
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "hlthchk"
vlagArg2: "keepalive-attempts"
vlagArg3: 13
- name: Test Vlag - keepalive-interval
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "hlthchk"
vlagArg2: "keepalive-interval"
vlagArg3: 131
- name: Test Vlag - retry-interval
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "hlthchk"
vlagArg2: "retry-interval"
vlagArg3: 133
- name: Test Vlag - peer ip
community.network.cnos_vlag:
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "hlthchk"
vlagArg2: "peer-ip"
vlagArg3: "1.2.3.4"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **msg** string | always | Success or failure message **Sample:** vLAG configurations accomplished |
### Authors
* Anil Kumar Muraleedharan (@amuraleedhar)
ansible community.network.ce_mtu – Manages MTU settings on HUAWEI CloudEngine switches. community.network.ce\_mtu – Manages MTU settings on HUAWEI CloudEngine switches.
================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_mtu`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages MTU settings on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **interface** string | | Full name of interface, i.e. 40GE1/0/22. |
| **jumbo\_max** string | | Maximum frame size. The default value is 9216. The value is an integer and expressed in bytes. The value range is 1536 to 12224 for the CE12800 and 1536 to 12288 for ToR switches. |
| **jumbo\_min** string | | Non-jumbo frame size threshold. The default value is 1518. The value is an integer that ranges from 1518 to jumbo\_max, in bytes. |
| **mtu** string | | MTU for a specific interface. The value is an integer ranging from 46 to 9600, in bytes. |
| **state** string | **Choices:*** **present** ←
* absent
| Specify desired state of the resource. |
Notes
-----
Note
* Either `sysmtu` param is required or `interface` AND `mtu` params are req’d.
* `state=absent` unconfigures a given MTU if that value is currently present.
* Recommended connection is `network_cli`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Mtu test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Config jumboframe on 40GE1/0/22"
community.network.ce_mtu:
interface: 40GE1/0/22
jumbo_max: 9000
jumbo_min: 8000
provider: "{{ cli }}"
- name: "Config mtu on 40GE1/0/22 (routed interface)"
community.network.ce_mtu:
interface: 40GE1/0/22
mtu: 1600
provider: "{{ cli }}"
- name: "Config mtu on 40GE1/0/23 (switched interface)"
community.network.ce_mtu:
interface: 40GE1/0/22
mtu: 9216
provider: "{{ cli }}"
- name: "Config mtu and jumboframe on 40GE1/0/22 (routed interface)"
community.network.ce_mtu:
interface: 40GE1/0/22
mtu: 1601
jumbo_max: 9001
jumbo_min: 8001
provider: "{{ cli }}"
- name: "Unconfigure mtu and jumboframe on a given interface"
community.network.ce_mtu:
state: absent
interface: 40GE1/0/22
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of mtu/sysmtu values after module execution **Sample:** {'jumbo\_max': '9000', 'jumbo\_min': '8000', 'mtu': '1700'} |
| **existing** dictionary | always | k/v pairs of existing mtu/sysmtu on the interface/system **Sample:** {'jumbo\_max': '9216', 'jumbo\_min': '1518', 'mtu': '1600'} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'jumbo\_max': '9000', 'jumbo\_min': '8000', 'mtu': '1700'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** ['interface 40GE1/0/23', 'mtu 1700', 'jumboframe enable 9000 8000'] |
### Authors
* QijunPan (@QijunPan)
ansible community.network.ce_lldp_interface – Manages INTERFACE LLDP configuration on HUAWEI CloudEngine switches. community.network.ce\_lldp\_interface – Manages INTERFACE LLDP configuration on HUAWEI CloudEngine switches.
============================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_lldp_interface`.
New in version 0.2.0: of community.network
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages INTERFACE LLDP configuration on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **dcbx** boolean | **Choices:*** no
* yes
| Enable the ability to send DCBX TLV. |
| **eee** boolean | **Choices:*** no
* yes
| Enable the ability to send EEE TLV. |
| **function\_lldp\_interface\_flag** string | **Choices:*** disableINTERFACE
* tlvdisableINTERFACE
* tlvenableINTERFACE
* intervalINTERFACE
| Used to distinguish between command line functions. |
| **ifname** string | | Interface name. |
| **linkaggretxenable** boolean | **Choices:*** no
* yes
| Enable the ability to send link aggregation TLV. |
| **lldpadminstatus** string | **Choices:*** txOnly
* rxOnly
* txAndRx
* disabled
| Set interface lldp enable state. |
| **lldpenable** string | **Choices:*** enabled
* disabled
| Set global LLDP enable state. |
| **macphytxenable** boolean | **Choices:*** no
* yes
| Enable MAC/PHY configuration and state TLV to be sent. |
| **manaddrtxenable** boolean | **Choices:*** no
* yes
| Make it able to send management address TLV. |
| **maxframetxenable** boolean | **Choices:*** no
* yes
| Enable the ability to send maximum frame length TLV. |
| **portdesctxenable** boolean | **Choices:*** no
* yes
| Enabling the ability to send a description of TLV. |
| **portvlantxenable** boolean | **Choices:*** no
* yes
| Enable port vlan tx. |
| **protoidtxenable** boolean | **Choices:*** no
* yes
| Enable the ability to send protocol identity TLV. |
| **protovlantxenable** boolean | **Choices:*** no
* yes
| Enable protocol vlan tx. |
| **state** string | **Choices:*** **present** ←
* absent
| Manage the state of the resource. |
| **syscaptxenable** boolean | **Choices:*** no
* yes
| Enable the ability to send system capabilities TLV. |
| **sysdesctxenable** boolean | **Choices:*** no
* yes
| Enable the ability to send system description TLV. |
| **sysnametxenable** boolean | **Choices:*** no
* yes
| Enable the ability to send system name TLV. |
| **txinterval** integer | | LLDP send message interval. |
| **txprotocolvlanid** integer | | Set tx protocol vlan id. |
| **txvlannameid** integer | | Set tx vlan name id. |
| **type\_tlv\_disable** string | **Choices:*** basic\_tlv
* dot3\_tlv
| Used to distinguish between command line functions. |
| **type\_tlv\_enable** string | **Choices:*** dot1\_tlv
* dcbx
| Used to distinguish between command line functions. |
| **vlannametxenable** boolean | **Choices:*** no
* yes
| Set vlan name tx enable or not. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: "Configure global LLDP enable state"
ce_lldp_interface_interface:
lldpenable: enabled
- name: "Configure interface lldp enable state"
community.network.ce_lldp_interface:
function_lldp_interface_flag: disableINTERFACE
ifname: 10GE1/0/1
lldpadminstatus: rxOnly
- name: "Configure LLDP transmit interval and ensure global LLDP state is already enabled"
community.network.ce_lldp_interface:
function_lldp_interface_flag: intervalINTERFACE
ifname: 10GE1/0/1
txinterval: 4
- name: "Configure basic-tlv: management-address TLV"
community.network.ce_lldp_interface:
function_lldp_interface_flag: tlvdisableINTERFACE
type_tlv_disable: basic_tlv
ifname: 10GE1/0/1
manaddrtxenable: true
- name: "Configure basic-tlv: prot description TLV"
community.network.ce_lldp_interface:
function_lldp_interface_flag: tlvdisableINTERFACE
type_tlv_disable: basic_tlv
ifname: 10GE1/0/1
portdesctxenable: true
- name: "Configure basic-tlv: system capabilities TLV"
community.network.ce_lldp_interface:
function_lldp_interface_flag: tlvdisableINTERFACE
type_tlv_disable: basic_tlv
ifname: 10GE1/0/1
syscaptxenable: true
- name: "Configure basic-tlv: system description TLV"
community.network.ce_lldp_interface:
function_lldp_interface_flag: tlvdisableINTERFACE
type_tlv_disable: basic_tlv
ifname: 10GE1/0/1
sysdesctxenable: true
- name: "Configure basic-tlv: system name TLV"
community.network.ce_lldp_interface:
function_lldp_interface_flag: tlvdisableINTERFACE
type_tlv_disable: basic_tlv
ifname: 10GE1/0/1
sysnametxenable: true
- name: "TLV types that are forbidden to be published on the configuration interface, link aggregation TLV"
community.network.ce_lldp_interface:
function_lldp_interface_flag: tlvdisableINTERFACE
type_tlv_disable: dot3_tlv
ifname: 10GE1/0/1
linkAggreTxEnable: true
- name: "TLV types that are forbidden to be published on the configuration interface, MAC/PHY configuration/status TLV"
community.network.ce_lldp_interface:
function_lldp_interface_flag: tlvdisableINTERFACE
type_tlv_disable: dot3_tlv
ifname: 10GE1/0/1
macPhyTxEnable: true
- name: "TLV types that are forbidden to be published on the configuration interface, maximum frame size TLV"
community.network.ce_lldp_interface:
function_lldp_interface_flag: tlvdisableINTERFACE
type_tlv_disable: dot3_tlv
ifname: 10GE1/0/1
maxFrameTxEnable: true
- name: "TLV types that are forbidden to be published on the configuration interface, EEE TLV"
community.network.ce_lldp_interface:
function_lldp_interface_flag: tlvdisableINTERFACE
type_tlv_disable: dot3_tlv
ifname: 10GE1/0/1
eee: true
- name: "Configure the interface to publish an optional DCBX TLV type "
community.network.ce_lldp_interface:
function_lldp_interface_flag: tlvenableINTERFACE
ifname: 10GE1/0/1
type_tlv_enable: dcbx
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of global DLDP configration after module execution **Sample:** {'function\_lldp\_interface\_flag': 'tlvenableINTERFACE', 'ifname': '10GE1/0/1', 'lldpadminstatus': 'rxOnly', 'lldpenable': 'enabled', 'type\_tlv\_enable': 'dot1\_tlv'} |
| **existing** dictionary | always | k/v pairs of existing global LLDP configration **Sample:** {'ifname': '10GE1/0/1', 'lldpadminstatus': 'txAndRx', 'lldpenable': 'disabled'} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'function\_lldp\_interface\_flag': 'tlvenableINTERFACE', 'ifname': '10GE1/0/1', 'lldpadminstatus': 'rxOnly', 'lldpenable': 'enabled', 'state': 'present', 'type\_tlv\_enable': 'dot1\_tlv'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** ['lldp enable', 'interface 10ge 1/0/1', 'undo lldp disable', 'lldp tlv-enable dot1-tlv vlan-name 4'] |
### Authors
* xuxiaowei0512 (@CloudEngine-Ansible)
| programming_docs |
ansible community.network.ce_ntp – Manages core NTP configuration on HUAWEI CloudEngine switches. community.network.ce\_ntp – Manages core NTP configuration on HUAWEI CloudEngine switches.
==========================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_ntp`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages core NTP configuration on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **is\_preferred** string | **Choices:*** enable
* disable
| Makes given NTP server or peer the preferred NTP server or peer for the device. |
| **key\_id** string | | Authentication key identifier to use with given NTP server or peer. |
| **peer** string | | Network address of NTP peer. |
| **server** string | | Network address of NTP server. |
| **source\_int** string | | Local source interface from which NTP messages are sent. Must be fully qualified interface name, i.e. `40GE1/0/22`, `vlanif10`. Interface types, such as `10GE`, `40GE`, `100GE`, `Eth-Trunk`, `LoopBack`, `MEth`, `NULL`, `Tunnel`, `Vlanif`. |
| **state** string | **Choices:*** **present** ←
* absent
| Manage the state of the resource. |
| **vpn\_name** string | **Default:**"\_public\_" | Makes the device communicate with the given NTP server or peer over a specific vpn. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: NTP test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Set NTP Server with parameters"
community.network.ce_ntp:
server: 192.8.2.6
vpn_name: js
source_int: vlanif4001
is_preferred: enable
key_id: 32
provider: "{{ cli }}"
- name: "Set NTP Peer with parameters"
community.network.ce_ntp:
peer: 192.8.2.6
vpn_name: js
source_int: vlanif4001
is_preferred: enable
key_id: 32
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of ntp info after module execution **Sample:** {'is\_preferred': 'enable', 'key\_id': '48', 'server': '2.2.2.2', 'source\_int': 'vlanif4002', 'vpn\_name': 'js'} |
| **existing** dictionary | always | k/v pairs of existing ntp server/peer **Sample:** {'is\_preferred': 'disable', 'key\_id': '32', 'server': '2.2.2.2', 'source\_int': 'vlanif4002', 'vpn\_name': 'js'} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'is\_preferred': 'enable', 'key\_id': '48', 'server': '2.2.2.2', 'source\_int': 'vlanif4002', 'state': 'present', 'vpn\_name': 'js'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** ['ntp server 2.2.2.2 authentication-keyid 48 source-interface vlanif4002 vpn-instance js preferred'] |
### Authors
* Zhijin Zhou (@QijunPan)
ansible community.network.avi_serviceengine – Module for setup of ServiceEngine Avi RESTful Object community.network.avi\_serviceengine – Module for setup of ServiceEngine Avi RESTful Object
===========================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_serviceengine`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure ServiceEngine object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **availability\_zone** string | | Availability\_zone of serviceengine. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **cloud\_ref** string | | It is a reference to an object of type cloud. |
| **container\_mode** boolean | **Choices:*** no
* yes
| Boolean flag to set container\_mode. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **container\_type** string | | Enum options - container\_type\_bridge, container\_type\_host, container\_type\_host\_dpdk. Default value when not specified in API or module is interpreted by Avi Controller as CONTAINER\_TYPE\_HOST. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **controller\_created** boolean | **Choices:*** no
* yes
| Boolean flag to set controller\_created. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **controller\_ip** string | | Controller\_ip of serviceengine. |
| **data\_vnics** string | | List of vnic. |
| **enable\_state** string | | Inorder to disable se set this field appropriately. Enum options - SE\_STATE\_ENABLED, SE\_STATE\_DISABLED\_FOR\_PLACEMENT, SE\_STATE\_DISABLED, SE\_STATE\_DISABLED\_FORCE. Default value when not specified in API or module is interpreted by Avi Controller as SE\_STATE\_ENABLED. |
| **flavor** string | | Flavor of serviceengine. |
| **host\_ref** string | | It is a reference to an object of type vimgrhostruntime. |
| **hypervisor** string | | Enum options - default, vmware\_esx, kvm, vmware\_vsan, xen. |
| **mgmt\_vnic** string | | Vnic settings for serviceengine. |
| **name** string | | Name of the object. Default value when not specified in API or module is interpreted by Avi Controller as VM name unknown. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **resources** string | | Seresources settings for serviceengine. |
| **se\_group\_ref** string | | It is a reference to an object of type serviceenginegroup. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Unique object identifier of the object. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create ServiceEngine object
community.network.avi_serviceengine:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_serviceengine
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | ServiceEngine (api/serviceengine) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#f394819280879c949ad5d0c0c4c8d5d0c6c1c8d5d0c7cbc892859a9d9687849c819880d5d0c7c5c8909c9e)>
ansible community.network.nos – Use nos cliconf to run command on Extreme NOS platform community.network.nos – Use nos cliconf to run command on Extreme NOS platform
==============================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.nos`.
Synopsis
--------
* This nos plugin provides low level abstraction apis for sending and receiving CLI commands from Extreme NOS network devices.
### Authors
* Unknown (!UNKNOWN)
ansible community.network.nclu – Configure network interfaces using NCLU community.network.nclu – Configure network interfaces using NCLU
================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.nclu`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Interface to the Network Command Line Utility, developed to make it easier to configure operating systems running ifupdown2 and Quagga, such as Cumulus Linux. Command documentation is available at <https://docs.cumulusnetworks.com/cumulus-linux/System-Configuration/Network-Command-Line-Utility-NCLU/>
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **abort** boolean | **Choices:*** **no** ←
* yes
| Boolean. When true, perform a 'net abort' before the block. This cleans out any uncommitted changes in the buffer. Mutually exclusive with *atomic*. |
| **atomic** boolean | **Choices:*** **no** ←
* yes
| When true, equivalent to both *commit* and *abort* being true. Mutually exclusive with *commit* and *atomic*. |
| **commands** string | | A list of strings containing the net commands to run. Mutually exclusive with *template*. |
| **commit** boolean | **Choices:*** **no** ←
* yes
| When true, performs a 'net commit' at the end of the block. Mutually exclusive with *atomic*. |
| **description** string | **Default:**"Ansible-originated commit" | Commit description that will be recorded to the commit log if *commit* or *atomic* are true. |
| **template** string | | A single, multi-line string with jinja2 formatting. This string will be broken by lines, and each line will be run through net. Mutually exclusive with *commands*. |
Examples
--------
```
- name: Add two interfaces without committing any changes
community.network.nclu:
commands:
- add int swp1
- add int swp2
- name: Modify hostname to Cumulus-1 and commit the change
community.network.nclu:
commands:
- add hostname Cumulus-1
commit: true
- name: Add 48 interfaces and commit the change.
community.network.nclu:
template: |
{% for iface in range(1,49) %}
add int swp{{iface}}
{% endfor %}
commit: true
description: "Ansible - add swps1-48"
- name: Fetch Status Of Interface
community.network.nclu:
commands:
- show interface swp1
register: output
- name: Print Status Of Interface
ansible.builtin.debug:
var: output
- name: Fetch Details From All Interfaces In JSON Format
community.network.nclu:
commands:
- show interface json
register: output
- name: Print Interface Details
ansible.builtin.debug:
var: output["msg"]
- name: Atomically add an interface
community.network.nclu:
commands:
- add int swp1
atomic: true
description: "Ansible - add swp1"
- name: Remove IP address from interface swp1
community.network.nclu:
commands:
- del int swp1 ip address 1.1.1.1/24
- name: Configure BGP AS and add 2 EBGP neighbors using BGP Unnumbered
community.network.nclu:
commands:
- add bgp autonomous-system 65000
- add bgp neighbor swp51 interface remote-as external
- add bgp neighbor swp52 interface remote-as external
commit: true
- name: Configure BGP AS and Add 2 EBGP neighbors Using BGP Unnumbered via Template
community.network.nclu:
template: |
{% for neighbor in range(51,53) %}
add bgp neighbor swp{{neighbor}} interface remote-as external
add bgp autonomous-system 65000
{% endfor %}
atomic: true
- name: Check BGP Status
community.network.nclu:
commands:
- show bgp summary json
register: output
- name: Print BGP Status In JSON
ansible.builtin.debug:
var: output["msg"]
```
Return Values
-------------
Common return 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 | changed | whether the interface was changed **Sample:** True |
| **msg** string | always | human-readable report of success or failure **Sample:** interface bond0 config updated |
### Authors
* Cumulus Networks (@isharacomix)
ansible community.network.ironware – Use ironware cliconf to run command on Extreme Ironware platform community.network.ironware – Use ironware cliconf to run command on Extreme Ironware platform
=============================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ironware`.
Synopsis
--------
* This ironware plugin provides low level abstraction apis for sending and receiving CLI commands from Extreme Ironware network devices.
### Authors
* Unknown (!UNKNOWN)
ansible community.network.pn_stp_port – CLI command to modify stp-port. community.network.pn\_stp\_port – CLI command to modify stp-port.
=================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_stp_port`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used modify Spanning Tree Protocol (STP) parameters on ports.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_block** boolean | **Choices:*** no
* yes
| Specify if a STP port blocks BPDUs. |
| **pn\_bpdu\_guard** boolean | **Choices:*** no
* yes
| STP port BPDU guard. |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_cost** string | **Default:**"2000" | STP port cost from 1 to 200000000. |
| **pn\_edge** boolean | **Choices:*** no
* yes
| STP port is an edge port. |
| **pn\_filter** boolean | **Choices:*** no
* yes
| STP port filters BPDUs. |
| **pn\_port** string | | STP port. |
| **pn\_priority** string | **Default:**"128" | STP port priority from 0 to 240. |
| **pn\_root\_guard** boolean | **Choices:*** no
* yes
| STP port Root guard. |
| **state** string / required | **Choices:*** update
| State the action to perform. Use `update` to update stp-port. |
Examples
--------
```
- name: Modify stp port
community.network.pn_stp_port:
pn_cliswitch: "sw01"
state: "update"
pn_port: "1"
pn_filter: True
pn_priority: '144'
- name: Modify stp port
community.network.pn_stp_port:
pn_cliswitch: "sw01"
state: "update"
pn_port: "1"
pn_cost: "200"
- name: Modify stp port
community.network.pn_stp_port:
pn_cliswitch: "sw01"
state: "update"
pn_port: "1"
pn_edge: True
pn_cost: "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 |
| --- | --- | --- |
| **changed** boolean | always | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the stp-port command. |
| **stdout** list / elements=string | always | set of responses from the stp-port command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
| programming_docs |
ansible community.network.avi_systemconfiguration – Module for setup of SystemConfiguration Avi RESTful Object community.network.avi\_systemconfiguration – Module for setup of SystemConfiguration Avi RESTful Object
=======================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_systemconfiguration`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure SystemConfiguration object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **admin\_auth\_configuration** string | | Adminauthconfiguration settings for systemconfiguration. |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **default\_license\_tier** string | | Specifies the default license tier which would be used by new clouds. Enum options - ENTERPRISE\_16, ENTERPRISE\_18. Field introduced in 17.2.5. Default value when not specified in API or module is interpreted by Avi Controller as ENTERPRISE\_18. |
| **dns\_configuration** string | | Dnsconfiguration settings for systemconfiguration. |
| **dns\_virtualservice\_refs** string | | Dns virtualservices hosting fqdn records for applications across avi vantage. If no virtualservices are provided, avi vantage will provide dns services for configured applications. Switching back to avi vantage from dns virtualservices is not allowed. It is a reference to an object of type virtualservice. |
| **docker\_mode** boolean | **Choices:*** no
* yes
| Boolean flag to set docker\_mode. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **email\_configuration** string | | Emailconfiguration settings for systemconfiguration. |
| **global\_tenant\_config** string | | Tenantconfiguration settings for systemconfiguration. |
| **linux\_configuration** string | | Linuxconfiguration settings for systemconfiguration. |
| **mgmt\_ip\_access\_control** string | | Configure ip access control for controller to restrict open access. |
| **ntp\_configuration** string | | Ntpconfiguration settings for systemconfiguration. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **portal\_configuration** string | | Portalconfiguration settings for systemconfiguration. |
| **proxy\_configuration** string | | Proxyconfiguration settings for systemconfiguration. |
| **secure\_channel\_configuration** string | | Configure secure channel properties. Field introduced in 18.1.4, 18.2.1. |
| **snmp\_configuration** string | | Snmpconfiguration settings for systemconfiguration. |
| **ssh\_ciphers** string | | Allowed ciphers list for ssh to the management interface on the controller and service engines. If this is not specified, all the default ciphers are allowed. |
| **ssh\_hmacs** string | | Allowed hmac list for ssh to the management interface on the controller and service engines. If this is not specified, all the default hmacs are allowed. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Unique object identifier of the object. |
| **welcome\_workflow\_complete** boolean | **Choices:*** no
* yes
| This flag is set once the initial controller setup workflow is complete. Field introduced in 18.2.3. Default value when not specified in API or module is interpreted by Avi Controller as False. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create SystemConfiguration object
community.network.avi_systemconfiguration:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_systemconfiguration
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | SystemConfiguration (api/systemconfiguration) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#deb9acbfadaab1b9b7f8fdede9e5f8fdebece5f8fdeae6e5bfa8b7b0bbaaa9b1acb5adf8fdeae8e5bdb1b3)>
ansible community.network.pn_vrouter_ospf6 – CLI command to add/remove vrouter-ospf6 community.network.pn\_vrouter\_ospf6 – CLI command to add/remove vrouter-ospf6
==============================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_vrouter_ospf6`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to add interface ip to OSPF6 protocol or remove interface ip from OSPF6 protocol on vRouter.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_nic** string | | OSPF6 control for this interface. |
| **pn\_ospf6\_area** string | | area id for this interface in IPv4 address format. |
| **pn\_vrouter\_name** string | | name of service config. |
| **state** string / required | **Choices:*** present
* absent
| State the action to perform. Use `present` to add vrouter-ospf6 and `absent` to remove interface from vrouter-ospf6. |
Examples
--------
```
- name: Add vrouter interface nic to ospf6
community.network.pn_vrouter_ospf6:
pn_cliswitch: "sw01"
state: "present"
pn_vrouter_name: "foo-vrouter"
pn_nic: "eth0.4092"
pn_ospf6_area: "0.0.0.0"
- name: Remove vrouter interface nic to ospf6
community.network.pn_vrouter_ospf6:
pn_cliswitch: "sw01"
state: "absent"
pn_vrouter_name: "foo-vrouter"
pn_nic: "eth0.4092"
```
Return Values
-------------
Common return 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 | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the vrouter-ospf6 command. |
| **stdout** list / elements=string | always | set of responses from the vrouter-ospf6 command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
ansible community.network.cnos_banner – Manage multiline banners on Lenovo CNOS devices community.network.cnos\_banner – Manage multiline banners on Lenovo CNOS devices
================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.cnos_banner`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This will configure both login and motd banners on remote devices running Lenovo CNOS. It allows playbooks to add or remote banner text from the active running configuration.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **banner** string / required | **Choices:*** login
* motd
| Specifies which banner should be configured on the remote device. In Ansible 2.8 and earlier only *login* and *motd* were supported. |
| **provider** string | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [CNOS Platform Options guide](user_guide/platform_cnos). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** ←
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string / required | | 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. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** string | **Default:**22 | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** string | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE`will be used instead. |
| | **timeout** string | **Default:**10 | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **state** string | **Choices:*** **present** ←
* absent
| Specifies whether or not the configuration is present in the current devices active running configuration. |
| **text** string | | The banner text that should be present in the remote device running configuration. This argument accepts a multiline string, with no empty lines. Requires *state=present*. |
Notes
-----
Note
* Tested against CNOS 10.8.1
Examples
--------
```
- name: Configure the login banner
community.network.cnos_banner:
banner: login
text: |
this is my login banner
that contains a multiline
string
state: present
- name: Remove the motd banner
community.network.cnos_banner:
banner: motd
state: absent
- name: Configure banner from file
community.network.cnos_banner:
banner: motd
text: "{{ lookup('file', './config_partial/raw_banner.cfg') }}"
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 |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['banner login', 'this is my login banner', 'that contains a multiline', 'string'] |
### Authors
* Anil Kumar Muraleedharan (@amuraleedhar)
ansible community.network.cnos_command – Run arbitrary commands on Lenovo CNOS devices community.network.cnos\_command – Run arbitrary commands on Lenovo CNOS devices
===============================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.cnos_command`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Sends arbitrary commands to an CNOS node and returns the results read from the device. The `cnos_command` module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **commands** string / required | | List of commands to send to the remote device. The resulting output from the command is returned. If the *wait\_for* argument is provided, the module is not returned until the condition is satisfied or the number of retires is expired. |
| **interval** string | **Default:**1 | Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified conditions, the interval indicates how long to wait before trying the command again. |
| **match** string | **Choices:*** any
* **all** ←
| The *match* argument is used in conjunction with the *wait\_for* argument to specify the match policy. Valid values are `all` or `any`. If the value is set to `all` then all conditionals in the wait\_for must be satisfied. If the value is set to `any` then only one of the values must be satisfied. |
| **retries** string | **Default:**10 | Specifies the number of retries a command should by tried before it is considered failed. The command is run on the target device every retry and evaluated against the *wait\_for* conditions. |
| **wait\_for** string | | List of conditions to evaluate against the output of the command. The task will wait for each condition to be true before moving forward. If the conditional is not true within the configured number of retries, the task fails. See examples. |
Examples
--------
```
---
- name: Test contains operator
community.network.cnos_command:
commands:
- show version
- show system memory
wait_for:
- "result[0] contains 'Lenovo'"
- "result[1] contains 'MemFree'"
register: result
- ansible.builtin.assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- name: Get output for single command
community.network.cnos_command:
commands: ['show version']
register: result
- ansible.builtin.assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- name: Get output for multiple commands
community.network.cnos_command:
commands:
- show version
- show interface information
register: result
- ansible.builtin.assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- "result.stdout | length == 2"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **failed\_conditions** list / elements=string | failed | the conditionals that failed **Sample:** ['...', '...'] |
| **stdout** list / elements=string | always | the set of responses from the commands **Sample:** ['...', '...'] |
| **stdout\_lines** list / elements=string | always | The value of stdout split into a list **Sample:** [['...', '...'], ['...'], ['...']] |
### Authors
* Anil Kumar Muraleedharan (@amuraleedhar)
ansible community.network.icx_user – Manage the user accounts on Ruckus ICX 7000 series switches. community.network.icx\_user – Manage the user accounts on Ruckus ICX 7000 series switches.
==========================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.icx_user`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module creates or updates user account on network devices. It allows playbooks to manage either individual usernames or the aggregate of usernames in the current running config. It also supports purging usernames from the configuration that are not explicitly defined.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_time** string | | This parameter indicates the time the file's access time should be set to. Should be preserve when no modification is required, YYYYMMDDHHMM.SS when using default time format, or now. Default is None meaning that preserve is the default for state=[file,directory,link,hard] and now is default for state=touch |
| **aggregate** list / elements=string | | The set of username objects to be configured on the remote ICX device. The list entries can either be the username or a hash of username and properties. This argument is mutually exclusive with the `name` argument.
aliases: users, collection |
| | **access\_time** string | | This parameter indicates the time the file's access time should be set to. Should be preserve when no modification is required, YYYYMMDDHHMM.SS when using default time format, or now. Default is None meaning that preserve is the default for state=[file,directory,link,hard] and now is default for state=touch |
| | **check\_running\_config** boolean | **Choices:*** no
* yes
| Check running configuration. This can be set as environment variable. Module will use environment variable value(default:True), unless it is overridden, by specifying it as module parameter. |
| | **configured\_password** string | | The password to be configured on the ICX device. |
| | **name** string / required | | The username to be configured on the ICX device. |
| | **nopassword** boolean | **Choices:*** no
* yes
| Defines the username without assigning a password. This will allow the user to login to the system without being authenticated by a password. |
| | **privilege** string | **Choices:*** 0
* 4
* 5
| The privilege level to be granted to the user |
| | **state** string | **Choices:*** present
* absent
| Configures the state of the username definition as it relates to the device operational configuration. When set to *present*, the username(s) should be configured in the device active configuration and when set to *absent* the username(s) should not be in the device active configuration |
| | **update\_password** string | **Choices:*** on\_create
* always
| This argument will instruct the module when to change the password. When set to `always`, the password will always be updated in the device and when set to `on_create` the password will be updated only if the username is created. |
| **check\_running\_config** boolean | **Choices:*** no
* **yes** ←
| Check running configuration. This can be set as environment variable. Module will use environment variable value(default:True), unless it is overridden, by specifying it as module parameter. |
| **configured\_password** string | | The password to be configured on the ICX device. |
| **name** string / required | | The username to be configured on the ICX device. |
| **nopassword** boolean | **Choices:*** **no** ←
* yes
| Defines the username without assigning a password. This will allow the user to login to the system without being authenticated by a password. |
| **privilege** string | **Choices:*** 0
* 4
* 5
**Default:**0 | The privilege level to be granted to the user |
| **purge** boolean | **Choices:*** **no** ←
* yes
| If set to true module will remove any previously configured usernames on the device except the current defined set of users. |
| **state** string | **Choices:*** **present** ←
* absent
| Configures the state of the username definition as it relates to the device operational configuration. When set to *present*, the username(s) should be configured in the device active configuration and when set to *absent* the username(s) should not be in the device active configuration |
| **update\_password** string | **Choices:*** on\_create
* **always** ←
| This argument will instruct the module when to change the password. When set to `always`, the password will always be updated in the device and when set to `on_create` the password will be updated only if the username is created. |
Notes
-----
Note
* Tested against ICX 10.1.
* For information on using ICX platform, see [the ICX OS Platform Options guide](user_guide/platform_icx).
Examples
--------
```
- name: Create a new user without password
community.network.icx_user:
name: user1
nopassword: true
- name: Create a new user with password
community.network.icx_user:
name: user1
configured_password: 'newpassword'
- name: Remove users
community.network.icx_user:
name: user1
state: absent
- name: Set user privilege level to 5
community.network.icx_user:
name: user1
privilege: 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 |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['username ansible nopassword', 'username ansible password-string alethea123', 'no username ansible', 'username ansible privilege 5', 'username ansible enable'] |
### Authors
* Ruckus Wireless (@Commscope)
| programming_docs |
ansible community.network.netscaler_service – Manage service configuration in Netscaler community.network.netscaler\_service – Manage service configuration in Netscaler
================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.netscaler_service`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage service configuration in Netscaler.
* This module allows the creation, deletion and modification of Netscaler services.
* This module is intended to run either on the ansible control node or a bastion (jumpserver) with access to the actual netscaler instance.
* This module supports check mode.
Requirements
------------
The below requirements are needed on the host that executes this module.
* nitro python sdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **accessdown** boolean | **Choices:*** **no** ←
* yes
| Use Layer 2 mode to bridge the packets sent to this service if it is marked as DOWN. If the service is DOWN, and this parameter is disabled, the packets are dropped. |
| **appflowlog** string | **Choices:*** enabled
* disabled
| Enable logging of AppFlow information. |
| **cacheable** boolean | **Choices:*** **no** ←
* yes
| Use the transparent cache redirection virtual server to forward requests to the cache server. Note: Do not specify this parameter if you set the Cache Type parameter. |
| **cachetype** string | **Choices:*** TRANSPARENT
* REVERSE
* FORWARD
| Cache type supported by the cache server. |
| **cip** string | **Choices:*** enabled
* disabled
| Before forwarding a request to the service, insert an HTTP header with the client's IPv4 or IPv6 address as its value. Used if the server needs the client's IP address for security, accounting, or other purposes, and setting the Use Source IP parameter is not a viable option. |
| **cipheader** string | | Name for the HTTP header whose value must be set to the IP address of the client. Used with the Client IP parameter. If you set the Client IP parameter, and you do not specify a name for the header, the appliance uses the header name specified for the global Client IP Header parameter (the cipHeader parameter in the set ns param CLI command or the Client IP Header parameter in the Configure HTTP Parameters dialog box at System > Settings > Change HTTP parameters). If the global Client IP Header parameter is not specified, the appliance inserts a header with the name "client-ip.". Minimum length = 1 |
| **cka** boolean | **Choices:*** no
* yes
| Enable client keep-alive for the service. |
| **cleartextport** string | | Port to which clear text data must be sent after the appliance decrypts incoming SSL traffic. Applicable to transparent SSL services. Minimum value = 1 |
| **clttimeout** string | | Time, in seconds, after which to terminate an idle client connection. Minimum value = 0 Maximum value = 31536000 |
| **cmp** boolean | **Choices:*** no
* yes
| Enable compression for the service. |
| **comment** string | | Any information about the service. |
| **customserverid** string | **Default:**"None" | Unique identifier for the service. Used when the persistency type for the virtual server is set to Custom Server ID. |
| **disabled** boolean | **Choices:*** **no** ←
* yes
| When set to `yes` the service state will be set to DISABLED. When set to `no` the service state will be set to ENABLED. Note that due to limitations of the underlying NITRO API a `disabled` state change alone does not cause the module result to report a changed status. |
| **dnsprofilename** string | | Name of the DNS profile to be associated with the service. DNS profile properties will applied to the transactions processed by a service. This parameter is valid only for ADNS and ADNS-TCP services. Minimum length = 1 Maximum length = 127 |
| **downstateflush** string | **Choices:*** enabled
* disabled
| Flush all active transactions associated with a service whose state transitions from UP to DOWN. Do not enable this option for applications that must complete their transactions. |
| **graceful** boolean | **Choices:*** **no** ←
* yes
| Shut down gracefully, not accepting any new connections, and disabling the service when all of its connections are closed. |
| **hashid** string | | A numerical identifier that can be used by hash based load balancing methods. Must be unique for each service. Minimum value = 1 |
| **healthmonitor** boolean | **Choices:*** no
* **yes** ←
| Monitor the health of this service |
| **httpprofilename** string | | Name of the HTTP profile that contains HTTP configuration settings for the service. Minimum length = 1 Maximum length = 127 |
| **ip** string | | IP to assign to the service. Minimum length = 1 |
| **ipaddress** string | | The new IP address of the service. |
| **maxbandwidth** string | | Maximum bandwidth, in Kbps, allocated to the service. Minimum value = 0 Maximum value = 4294967287 |
| **maxclient** string | | Maximum number of simultaneous open connections to the service. Minimum value = 0 Maximum value = 4294967294 |
| **maxreq** string | | Maximum number of requests that can be sent on a persistent connection to the service. Note: Connection requests beyond this value are rejected. Minimum value = 0 Maximum value = 65535 |
| **monitor\_bindings** string | | A list of load balancing monitors to bind to this service. Each monitor entry is a dictionary which may contain the following options. Note that if not using the built in monitors they must first be setup. |
| | **dup\_state** string | **Choices:*** enabled
* disabled
| State of the monitor. The state setting for a monitor of a given type affects all monitors of that type. For example, if an HTTP monitor is enabled, all HTTP monitors on the appliance are (or remain) enabled. If an HTTP monitor is disabled, all HTTP monitors on the appliance are disabled. |
| | **dup\_weight** string | | Weight to assign to the binding between the monitor and service. |
| | **monitorname** string | | Name of the monitor. |
| | **weight** string | | Weight to assign to the binding between the monitor and service. |
| **monthreshold** string | | Minimum sum of weights of the monitors that are bound to this service. Used to determine whether to mark a service as UP or DOWN. Minimum value = 0 Maximum value = 65535 |
| **name** string | | Name for the service. Must begin with an ASCII alphabetic or underscore `_` character, and must contain only ASCII alphanumeric, underscore `_`, hash `#`, period `.`, space , colon `:`, at `@`, equals `=`, and hyphen `-` characters. Cannot be changed after the service has been created. Minimum length = 1 |
| **netprofile** string | | Network profile to use for the service. Minimum length = 1 Maximum length = 127 |
| **nitro\_pass** string / required | | The password with which to authenticate to the netscaler node. |
| **nitro\_protocol** string | **Choices:*** **http** ←
* https
| Which protocol to use when accessing the nitro API objects. |
| **nitro\_timeout** float | **Default:**310 | Time in seconds until a timeout error is thrown when establishing a new session with Netscaler |
| **nitro\_user** string / required | | The username with which to authenticate to the netscaler node. |
| **nsip** string / required | | The ip address of the netscaler appliance where the nitro API calls will be made. The port can be specified with the colon (:). E.g. 192.168.1.1:555. |
| **pathmonitor** string | | Path monitoring for clustering. |
| **pathmonitorindv** string | | Individual Path monitoring decisions. |
| **port** string | | Port number of the service. Range 1 - 65535 \* in CLI is represented as 65535 in NITRO API |
| **processlocal** string | **Choices:*** enabled
* disabled
| By turning on this option packets destined to a service in a cluster will not under go any steering. Turn this option for single packet request response mode or when the upstream device is performing a proper RSS for connection based distribution. |
| **rtspsessionidremap** boolean | **Choices:*** **no** ←
* yes
| Enable RTSP session ID mapping for the service. |
| **save\_config** boolean | **Choices:*** no
* **yes** ←
| If `yes` the module will save the configuration on the netscaler node if it makes any changes. The module will not save the configuration on the netscaler node if it made no changes. |
| **serverid** string | | The identifier for the service. This is used when the persistency type is set to Custom Server ID. |
| **servername** string | | Name of the server that hosts the service. Minimum length = 1 |
| **servicetype** string | **Choices:*** HTTP
* FTP
* TCP
* UDP
* SSL
* SSL\_BRIDGE
* SSL\_TCP
* DTLS
* NNTP
* RPCSVR
* DNS
* ADNS
* SNMP
* RTSP
* DHCPRA
* ANY
* SIP\_UDP
* SIP\_TCP
* SIP\_SSL
* DNS\_TCP
* ADNS\_TCP
* MYSQL
* MSSQL
* ORACLE
* RADIUS
* RADIUSListener
* RDP
* DIAMETER
* SSL\_DIAMETER
* TFTP
* SMPP
* PPTP
* GRE
* SYSLOGTCP
* SYSLOGUDP
* FIX
* SSL\_FIX
| Protocol in which data is exchanged with the service. |
| **sp** boolean | **Choices:*** no
* yes
| Enable surge protection for the service. |
| **state** string | **Choices:*** absent
* **present** ←
| The state of the resource being configured by the module on the netscaler node. When present the resource will be created if needed and configured according to the module's parameters. When absent the resource will be deleted from the netscaler node. |
| **svrtimeout** string | | Time, in seconds, after which to terminate an idle server connection. Minimum value = 0 Maximum value = 31536000 |
| **tcpb** boolean | **Choices:*** no
* yes
| Enable TCP buffering for the service. |
| **tcpprofilename** string | | Name of the TCP profile that contains TCP configuration settings for the service. Minimum length = 1 Maximum length = 127 |
| **td** string | | Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Minimum value = 0 Maximum value = 4094 |
| **useproxyport** boolean | **Choices:*** no
* yes
| Use the proxy port as the source port when initiating connections with the server. With the NO setting, the client-side connection port is used as the source port for the server-side connection. Note: This parameter is available only when the Use Source IP (USIP) parameter is set to YES. |
| **usip** boolean | **Choices:*** no
* yes
| Use the client's IP address as the source IP address when initiating a connection to the server. When creating a service, if you do not set this parameter, the service inherits the global Use Source IP setting (available in the enable ns mode and disable ns mode CLI commands, or in the System > Settings > Configure modes > Configure Modes dialog box). However, you can override this setting after you create the service. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `no`, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. |
Notes
-----
Note
* For more information on using Ansible to manage Citrix NetScaler Network devices see <https://www.ansible.com/ansible-netscaler>.
Examples
--------
```
# Monitor monitor-1 must have been already setup
- name: Setup http service
gather_facts: False
delegate_to: localhost
community.network.netscaler_service:
nsip: 172.18.0.2
nitro_user: nsroot
nitro_pass: nsroot
state: present
name: service-http-1
servicetype: HTTP
ipaddress: 10.78.0.1
port: 80
monitor_bindings:
- monitor-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 |
| --- | --- | --- |
| **diff** dictionary | failure | A dictionary with a list of differences between the actual configured object and the configuration specified in the module **Sample:** { 'clttimeout': 'difference. ours: (float) 10.0 other: (float) 20.0' } |
| **loglines** list / elements=string | always | list of logged messages by the module **Sample:** ['message 1', 'message 2'] |
### Authors
* George Nikolopoulos (@giorgos-nikolopoulos)
ansible community.network.avi_api_session – Avi API Module community.network.avi\_api\_session – Avi API Module
====================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_api_session`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used for calling any resources defined in Avi REST API. <https://avinetworks.com/>
* This module is useful for invoking HTTP Patch methods and accessing resources that do not have an REST object associated with them.
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **data** string | | HTTP body in YAML or JSON format. |
| **http\_method** string / required | **Choices:*** get
* put
* post
* patch
* delete
| Allowed HTTP methods for RESTful services and are supported by Avi Controller. |
| **params** string | | Query parameters passed to the HTTP API. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **path** string | | Path for Avi API resource. For example, `path: virtualservice` will translate to `api/virtualserivce`. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **timeout** string | **Default:**60 | Timeout (in seconds) for Avi API calls. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Get Pool Information using avi_api_session
community.network.avi_api_session:
controller: "{{ controller }}"
username: "{{ username }}"
password: "{{ password }}"
http_method: get
path: pool
params:
name: "{{ pool_name }}"
api_version: 16.4
register: pool_results
- name: Patch Pool with list of servers
community.network.avi_api_session:
controller: "{{ controller }}"
username: "{{ username }}"
password: "{{ password }}"
http_method: patch
path: "{{ pool_path }}"
api_version: 16.4
data:
add:
servers:
- ip:
addr: 10.10.10.10
type: V4
- ip:
addr: 20.20.20.20
type: V4
register: updated_pool
- name: Fetch Pool metrics bandwidth and connections rate
community.network.avi_api_session:
controller: "{{ controller }}"
username: "{{ username }}"
password: "{{ password }}"
http_method: get
path: analytics/metrics/pool
api_version: 16.4
params:
name: "{{ pool_name }}"
metric_id: l4_server.avg_bandwidth,l4_server.avg_complete_conns
step: 300
limit: 10
register: pool_metrics
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | Avi REST resource |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#c9aebba8babda6aea0efeafafef2efeafcfbf2efeafdf1f2a8bfa0a7acbdbea6bba2baefeafdfff2aaa6a4)>
ansible community.network.exos – Use exos cliconf to run command on Extreme EXOS platform community.network.exos – Use exos cliconf to run command on Extreme EXOS platform
=================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.exos`.
Synopsis
--------
* This exos plugin provides low level abstraction apis for sending and receiving CLI commands from Extreme EXOS network devices.
### Authors
* Unknown (!UNKNOWN)
ansible community.network.ce_is_is_view – Manages isis view configuration on HUAWEI CloudEngine devices. community.network.ce\_is\_is\_view – Manages isis view configuration on HUAWEI CloudEngine devices.
===================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_is_is_view`.
New in version 0.2.0: of community.network
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages isis process id, creates a isis instance id or deletes a process id on HUAWEI CloudEngine devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aclnum\_or\_name** string | | Specifies the acl number or name for isis. |
| **allow\_filter** boolean | **Choices:*** no
* yes
| Specifies the alow filter or not. |
| **allow\_up\_down** boolean | **Choices:*** no
* yes
| Specifies the alow up or down. |
| **autocostenable** boolean | **Choices:*** no
* yes
| Specifies the alow auto cost enable. |
| **autocostenablecompatible** boolean | **Choices:*** no
* yes
| Specifies the alow auto cost enable compatible. |
| **avoid\_learning** boolean | **Choices:*** no
* yes
| Specifies the alow avoid learning. |
| **bfd\_min\_rx** integer | | Specifies the bfd min received package. |
| **bfd\_min\_tx** integer | | Specifies the bfd min sent package. |
| **bfd\_multiplier\_num** integer | | Specifies the bfd multiplier number. |
| **cost** integer | | Specifies the bfd cost. |
| **cost\_type** string | **Choices:*** external
* internal
| Specifies the cost type. |
| **coststyle** string | **Choices:*** narrow
* wide
* transition
* ntransition
* wtransition
| Specifies the cost style. |
| **defaultmode** string | **Choices:*** always
* matchDefault
* matchAny
| Specifies the default mode. |
| **description** string | | Specifies description of isis. |
| **enablelevel1tolevel2** boolean | **Choices:*** no
* yes
| Enable level1 to level2. |
| **export\_aclnumorname** string | | Specifies export acl number or name. |
| **export\_ipprefix** string | | Specifies export ip prefix. |
| **export\_policytype** string | **Choices:*** aclNumOrName
* ipPrefix
* routePolicy
| Specifies the default mode. |
| **export\_processid** integer | | Specifies export process id. |
| **export\_protocol** string | **Choices:*** direct
* ospf
* isis
* static
* rip
* bgp
* ospfv3
* all
| Specifies the export router protocol. |
| **export\_routepolicyname** string | | Specifies export route policy name. |
| **import\_aclnumorname** string | | Specifies import acl number or name. |
| **import\_cost** integer | | Specifies import cost. |
| **import\_ipprefix** string | | Specifies import ip prefix. |
| **import\_route\_policy** string | | Specifies import route policy. |
| **import\_routepolicy\_name** string | | Specifies import route policy name. |
| **import\_routepolicyname** string | | Specifies import route policy name. |
| **import\_tag** integer | | Specifies import tag. |
| **impotr\_leveltype** string | **Choices:*** level\_1
* level\_2
* level\_1\_2
| Specifies the export router protocol. |
| **inheritcost** boolean | **Choices:*** no
* yes
| Enable inherit cost. |
| **instance\_id** integer | | Specifies instance id. |
| **ip\_address** string | | Specifies ip address. |
| **ip\_prefix\_name** string | | Specifies ip prefix name. |
| **islevel** string | **Choices:*** level\_1
* level\_2
* level\_1\_2
| Specifies the isis level. |
| **level\_type** string | **Choices:*** level\_1
* level\_2
* level\_1\_2
| Specifies the isis level type. |
| **max\_load** integer | | Specifies route max load. |
| **mode\_routepolicyname** string | | Specifies the mode of route polic yname. |
| **mode\_tag** integer | | Specifies the tag of mode. |
| **netentity** string | | Specifies the netentity. |
| **penetration\_direct** string | **Choices:*** level2-level1
* level1-level2
| Specifies the penetration direct. |
| **permitibgp** boolean | **Choices:*** no
* yes
| Specifies the permitibgp. |
| **preference\_value** integer | | Specifies the preference value. |
| **processid** integer | | Specifies the process id. |
| **protocol** string | **Choices:*** direct
* ospf
* isis
* static
* rip
* bgp
* ospfv3
* all
| Specifies the protocol. |
| **relaxspfLimit** boolean | **Choices:*** no
* yes
| Specifies enable the relax spf limit. |
| **route\_policy\_name** string | | Specifies the route policy name. |
| **state** string | **Choices:*** **present** ←
* absent
| Determines whether the config should be present or not on the device. |
| **stdbandwidth** integer | | Specifies the std band width. |
| **stdlevel1cost** integer | | Specifies the std level1 cost. |
| **stdlevel2cost** integer | | Specifies the std level2 cost. |
| **tag** integer | | Specifies the isis tag. |
| **weight** integer | | Specifies the isis weight. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* This module works with connection `netconf`.
Examples
--------
```
- name: Set isis description
community.network.ce_is_is_view:
instance_id: 3
description: abcdeggfs
state: present
- name: Set isis islevel
community.network.ce_is_is_view:
instance_id: 3
islevel: level_1
state: present
- name: Set isis coststyle
community.network.ce_is_is_view:
instance_id: 3
coststyle: narrow
state: present
- name: Set isis stdlevel1cost
community.network.ce_is_is_view:
instance_id: 3
stdlevel1cost: 63
state: present
- name: Set isis stdlevel2cost
community.network.ce_is_is_view:
instance_id: 3
stdlevel2cost: 63
state: present
- name: Set isis stdbandwidth
community.network.ce_is_is_view:
instance_id: 3
stdbandwidth: 1
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 |
| --- | --- | --- |
| **changed** boolean | always | check to see if a change was made on the device **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of configuration after module execution **Sample:** {'session': {'addrType': 'IPV4', 'createType': 'SESS\_STATIC', 'destAddr': None, 'outIfName': '10GE1/0/1', 'sessName': 'bfd\_l2link', 'srcAddr': None, 'useDefaultIp': 'true', 'vrfName': None}} |
| **existing** dictionary | always | k/v pairs of existing configuration **Sample:** {'session': {}} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'state': 'present'} |
| **updates** list / elements=string | always | commands sent to the device **Sample:** ['bfd bfd\_l2link bind peer-ip default-ip interface 10ge1/0/1'] |
### Authors
* xuxiaowei0512 (@CloudEngine-Ansible)
| programming_docs |
ansible community.network.cnos_vlan – Manage VLANs on CNOS network devices community.network.cnos\_vlan – Manage VLANs on CNOS network devices
===================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.cnos_vlan`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of VLANs on Lenovo CNOS network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of VLANs definitions. |
| **associated\_interfaces** string | | This is a intent option and checks the operational state of the for given vlan `name` for associated interfaces. If the value in the `associated_interfaces` does not match with the operational state of vlan interfaces on device it will result in failure. |
| **delay** string | **Default:**10 | Delay the play should wait to check for declarative intent params values. |
| **interfaces** string / required | | List of interfaces that should be associated to the VLAN. |
| **name** string | | Name of the VLAN. |
| **provider** string | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [CNOS Platform Options guide](user_guide/platform_cnos). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** ←
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string / required | | 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. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** string | **Default:**22 | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** string | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** string | **Default:**10 | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **purge** boolean | **Choices:*** **no** ←
* yes
| Purge VLANs not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** ←
* absent
* active
* suspend
| State of the VLAN configuration. |
| **vlan\_id** string / required | | ID of the VLAN. Range 1-4094. |
Notes
-----
Note
* Tested against CNOS 10.8.1
Examples
--------
```
- name: Create vlan
community.network.cnos_vlan:
vlan_id: 100
name: test-vlan
state: present
- name: Add interfaces to VLAN
community.network.cnos_vlan:
vlan_id: 100
interfaces:
- Ethernet1/33
- Ethernet1/44
- name: Check if interfaces is assigned to VLAN
community.network.cnos_vlan:
vlan_id: 100
associated_interfaces:
- Ethernet1/33
- Ethernet1/44
- name: Delete vlan
community.network.cnos_vlan:
vlan_id: 100
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 |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['vlan 100', 'name test-vlan'] |
### Authors
* Anil Kumar Mureleedharan(@amuraleedhar)
ansible community.network.pn_port_cos_rate_setting – CLI command to modify port-cos-rate-setting community.network.pn\_port\_cos\_rate\_setting – CLI command to modify port-cos-rate-setting
============================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_port_cos_rate_setting`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This modules can be used to update the port cos rate limit.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_cos0\_rate** string | | cos0 rate limit (pps) unlimited or 0 to 10000000. |
| **pn\_cos1\_rate** string | | cos1 rate limit (pps) unlimited or 0 to 10000000. |
| **pn\_cos2\_rate** string | | cos2 rate limit (pps) unlimited or 0 to 10000000. |
| **pn\_cos3\_rate** string | | cos3 rate limit (pps) unlimited or 0 to 10000000. |
| **pn\_cos4\_rate** string | | cos4 rate limit (pps) unlimited or 0 to 10000000. |
| **pn\_cos5\_rate** string | | cos5 rate limit (pps) unlimited or 0 to 10000000. |
| **pn\_cos6\_rate** string | | cos6 rate limit (pps) unlimited or 0 to 10000000. |
| **pn\_cos7\_rate** string | | cos7 rate limit (pps) unlimited or 0 to 10000000. |
| **pn\_port** string | **Choices:*** control-port
* data-port
* span-ports
| port. |
| **state** string / required | **Choices:*** update
| State the action to perform. Use `update` to modify the port-cos-rate-setting. |
Examples
--------
```
- name: Port cos rate modify
community.network.pn_port_cos_rate_setting:
pn_cliswitch: "sw01"
state: "update"
pn_port: "control-port"
pn_cos1_rate: "1000"
pn_cos5_rate: "1000"
pn_cos2_rate: "1000"
pn_cos0_rate: "1000"
- name: Port cos rate modify
community.network.pn_port_cos_rate_setting:
pn_cliswitch: "sw01"
state: "update"
pn_port: "data-port"
pn_cos1_rate: "2000"
pn_cos5_rate: "2000"
pn_cos2_rate: "2000"
pn_cos0_rate: "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 |
| --- | --- | --- |
| **changed** boolean | always | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the port-cos-rate-setting command. |
| **stdout** list / elements=string | always | set of responses from the port-cos-rate-setting command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
ansible community.network.slxos_l2_interface – Manage Layer-2 interface on Extreme Networks SLX-OS devices. community.network.slxos\_l2\_interface – Manage Layer-2 interface on Extreme Networks SLX-OS devices.
=====================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.slxos_l2_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of Layer-2 interface on Extreme slxos devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_vlan** string | | Configure given VLAN in access port. If `mode=access`, used as the access VLAN ID. |
| **aggregate** string | | List of Layer-2 interface definitions. |
| **mode** string | **Choices:*** **access** ←
* trunk
| Mode in which interface needs to be configured. |
| **name** string / required | | Full name of the interface excluding any logical unit number, i.e. Ethernet 0/1.
aliases: interface |
| **native\_vlan** string | | Native VLAN to be configured in trunk port. If `mode=trunk`, used as the trunk native VLAN ID. |
| **state** string | **Choices:*** **present** ←
* absent
* unconfigured
| Manage the state of the Layer-2 Interface configuration. |
| **trunk\_allowed\_vlans** string | | List of allowed VLANs in a given trunk port. If `mode=trunk`, these are the only VLANs that will be configured on the trunk, i.e. "2-10,15". |
| **trunk\_vlans** string | | List of VLANs to be configured in trunk port. If `mode=trunk`, used as the VLAN range to ADD or REMOVE from the trunk. |
Examples
--------
```
- name: Ensure Ethernet 0/5 is in its default l2 interface state
community.network.slxos_l2_interface:
name: Ethernet 0/5
state: unconfigured
- name: Ensure Ethernet 0/5 is configured for access vlan 20
community.network.slxos_l2_interface:
name: Ethernet 0/5
mode: access
access_vlan: 20
- name: Ensure Ethernet 0/5 only has vlans 5-10 as trunk vlans
community.network.slxos_l2_interface:
name: Ethernet 0/5
mode: trunk
native_vlan: 10
trunk_vlans: 5-10
- name: Ensure Ethernet 0/5 is a trunk port and ensure 2-50 are being tagged (doesn't mean others aren't also being tagged)
community.network.slxos_l2_interface:
name: Ethernet 0/5
mode: trunk
native_vlan: 10
trunk_vlans: 2-50
- name: Ensure these VLANs are not being tagged on the trunk
community.network.slxos_l2_interface:
name: Ethernet 0/5
mode: trunk
trunk_vlans: 51-4094
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 |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['interface Ethernet 0/5', 'switchport access vlan 20'] |
### Authors
* Matthew Stone (@bigmstone)
ansible community.network.ce_info_center_global – Manages outputting logs on HUAWEI CloudEngine switches. community.network.ce\_info\_center\_global – Manages outputting logs on HUAWEI CloudEngine switches.
====================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_info_center_global`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module offers the ability to be output to the log buffer, log file, console, terminal, or log host on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **channel\_cfg\_name** string | **Default:**"console" | Channel name.The value is a string of 1 to 30 case-sensitive characters. The default value is console. |
| **channel\_id** string | | Number for channel. The value is an integer ranging from 0 to 9. The default value is 0. |
| **channel\_name** string | | Channel name. The value is a string of 1 to 30 case-sensitive characters. |
| **channel\_out\_direct** string | **Choices:*** console
* monitor
* trapbuffer
* logbuffer
* snmp
* logfile
| Direction of information output. |
| **facility** string | **Choices:*** local0
* local1
* local2
* local3
* local4
* local5
* local6
* local7
| Log record tool. |
| **filter\_feature\_name** string | | Feature name of the filtered log. The value is a string of 1 to 31 case-insensitive characters. |
| **filter\_log\_name** string | | Name of the filtered log. The value is a string of 1 to 63 case-sensitive characters. |
| **info\_center\_enable** string | **Choices:*** true
* false
| Whether the info-center function is enabled. The value is of the Boolean type. |
| **ip\_type** string | **Choices:*** ipv4
* ipv6
| Log server address type, IPv4 or IPv6. |
| **is\_default\_vpn** boolean | **Choices:*** **no** ←
* yes
| Use the default VPN or not. |
| **level** string | **Choices:*** emergencies
* alert
* critical
* error
* warning
* notification
* informational
* debugging
| Level of logs saved on a log server. |
| **logfile\_max\_num** string | | Maximum number of log files of the same type. The default value is 200. The value range for log files is[3, 500], for security files is [1, 3],and for operation files is [1, 7]. |
| **logfile\_max\_size** string | **Choices:*** 4
* 8
* 16
* 32
**Default:**32 | Maximum size (in MB) of a log file. The default value is 32. The value range for log files is [4, 8, 16, 32], for security files is [1, 4], and for operation files is [1, 4]. |
| **packet\_priority** string | | Set the priority of the syslog packet.The value is an integer ranging from 0 to 7. The default value is 0. |
| **server\_domain** string | | Server name. The value is a string of 1 to 255 case-sensitive characters. |
| **server\_ip** string | | Log server address, IPv4 or IPv6 type. The value is a string of 0 to 255 characters. The value can be an valid IPv4 or IPv6 address. |
| **server\_port** string | | Number of a port sending logs.The value is an integer ranging from 1 to 65535. For UDP, the default value is 514. For TCP, the default value is 601. For TSL, the default value is 6514. |
| **source\_ip** string | | Log source ip address, IPv4 or IPv6 type. The value is a string of 0 to 255. The value can be an valid IPv4 or IPv6 address. |
| **ssl\_policy\_name** string | | SSL policy name. The value is a string of 1 to 23 case-sensitive characters. |
| **state** string | **Choices:*** **present** ←
* absent
| Specify desired state of the resource. |
| **suppress\_enable** string | **Choices:*** false
* true
| Whether a device is enabled to suppress duplicate statistics. The value is of the Boolean type. |
| **timestamp** string | **Choices:*** UTC
* localtime
| Log server timestamp. The value is of the enumerated type and case-sensitive. |
| **transport\_mode** string | **Choices:*** tcp
* udp
| Transport mode. The value is of the enumerated type and case-sensitive. |
| **vrf\_name** string | | VPN name on a log server. The value is a string of 1 to 31 case-sensitive characters. The default value is \_public\_. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Info center global module test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Config info-center enable
community.network.ce_info_center_global:
info_center_enable: true
state: present
provider: "{{ cli }}"
- name: Config statistic-suppress enable
community.network.ce_info_center_global:
suppress_enable: true
state: present
provider: "{{ cli }}"
- name: Config info-center syslog packet-priority 1
community.network.ce_info_center_global:
packet_priority: 2
state: present
provider: "{{ cli }}"
- name: Config info-center channel 1 name aaa
community.network.ce_info_center_global:
channel_id: 1
channel_cfg_name: aaa
state: present
provider: "{{ cli }}"
- name: Config info-center logfile size 10
community.network.ce_info_center_global:
logfile_max_num: 10
state: present
provider: "{{ cli }}"
- name: Config info-center console channel 1
community.network.ce_info_center_global:
channel_out_direct: console
channel_id: 1
state: present
provider: "{{ cli }}"
- name: Config info-center filter-id bymodule-alias snmp snmp_ipunlock
community.network.ce_info_center_global:
filter_feature_name: SNMP
filter_log_name: SNMP_IPLOCK
state: present
provider: "{{ cli }}"
- name: Config info-center max-logfile-number 16
community.network.ce_info_center_global:
logfile_max_size: 16
state: present
provider: "{{ cli }}"
- name: Config syslog loghost domain.
community.network.ce_info_center_global:
server_domain: aaa
vrf_name: aaa
channel_id: 1
transport_mode: tcp
facility: local4
server_port: 100
level: alert
timestamp: UTC
state: present
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of aaa params after module execution **Sample:** {'server\_domain\_info': [{'chnlId': '1', 'chnlName': 'monitor', 'facility': 'local4', 'isBriefFmt': 'false', 'isDefaultVpn': 'true', 'level': 'alert', 'serverDomain': 'aaa', 'serverPort': '100', 'sourceIP': '0.0.0.0', 'sslPolicyName': None, 'timestamp': 'localtime', 'transportMode': 'tcp', 'vrfName': '\_public\_'}, {'chnlId': '1', 'chnlName': 'monitor', 'facility': 'local4', 'isBriefFmt': 'false', 'isDefaultVpn': 'false', 'level': 'alert', 'serverDomain': 'aaa', 'serverPort': '100', 'sourceIP': '0.0.0.0', 'sslPolicyName': 'gmc', 'timestamp': 'UTC', 'transportMode': 'tcp', 'vrfName': 'aaa'}]} |
| **existing** dictionary | always | k/v pairs of existing rollback **Sample:** {'server\_domain\_info': [{'chnlId': '1', 'chnlName': 'monitor', 'facility': 'local4', 'isBriefFmt': 'false', 'isDefaultVpn': 'false', 'level': 'alert', 'serverDomain': 'aaa', 'serverPort': '100', 'sourceIP': '0.0.0.0', 'sslPolicyName': 'gmc', 'timestamp': 'UTC', 'transportMode': 'tcp', 'vrfName': 'aaa'}]} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'channel\_id': '1', 'facility': 'local4', 'is\_default\_vpn': True, 'level': 'alert', 'server\_domain': 'aaa', 'server\_port': '100', 'state': 'present', 'timestamp': 'localtime', 'transport\_mode': 'tcp'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** ['info-center loghost domain aaa level alert port 100 facility local4 channel 1 localtime transport tcp'] |
### Authors
* Li Yanfeng (@QijunPan)
| programming_docs |
ansible community.network.netscaler_nitro_request – Issue Nitro API requests to a Netscaler instance. community.network.netscaler\_nitro\_request – Issue Nitro API requests to a Netscaler instance.
===============================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.netscaler_nitro_request`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Issue Nitro API requests to a Netscaler instance.
* This is intended to be a short hand for using the uri Ansible module to issue the raw HTTP requests directly.
* It provides consistent return values and has no other dependencies apart from the base Ansible runtime environment.
* This module is intended to run either on the Ansible control node or a bastion (jumpserver) with access to the actual Netscaler instance
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **action** string | | The action to perform when the *operation* value is set to `action`. Some common values for this parameter are `enable`, `disable`, `rename`. |
| **args** string | | A dictionary which defines the key arguments by which we will select the Nitro object to operate on. It is required for the following *operation* values: `get_by_args`, `'delete_by_args'`. |
| **attributes** string | | The attributes of the Nitro object we are operating on. It is required for the following *operation* values: `add`, `update`, `action`. |
| **expected\_nitro\_errorcode** string / required | **Default:**[0] | A list of numeric values that signify that the operation was successful. |
| **filter** string | | A dictionary which defines the filter with which to refine the Nitro objects returned by the `get_filtered` *operation*. |
| **instance\_id** string | | The id of the target Netscaler instance when issuing a Nitro request through a MAS proxy. |
| **instance\_ip** string | | The IP address of the target Netscaler instance when issuing a Nitro request through a MAS proxy. |
| **instance\_name** string | | The name of the target Netscaler instance when issuing a Nitro request through a MAS proxy. |
| **name** string | | The name of the resource we are operating on. It is required for the following *operation* values: `update`, `get`, `delete`. |
| **nitro\_auth\_token** string | | The authentication token provided by the `mas_login` operation. It is required when issuing Nitro API calls through a MAS proxy. |
| **nitro\_pass** string / required | | The password with which to authenticate to the Netscaler node. |
| **nitro\_protocol** string | **Choices:*** **http** ←
* https
| Which protocol to use when accessing the Nitro API objects. |
| **nitro\_user** string / required | | The username with which to authenticate to the Netscaler node. |
| **nsip** string | | The IP address of the Netscaler or MAS instance where the Nitro API calls will be made. The port can be specified with the colon `:`. E.g. `192.168.1.1:555`. |
| **operation** string | **Choices:*** add
* update
* get
* get\_by\_args
* get\_filtered
* get\_all
* delete
* delete\_by\_args
* count
* mas\_login
* save\_config
* action
| Define the Nitro operation that we want to perform. |
| **resource** string | | The type of resource we are operating on. It is required for all *operation* values except `mas_login` and `save_config`. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `no`, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. |
Examples
--------
```
- name: Add a server
delegate_to: localhost
community.network.netscaler_nitro_request:
nsip: "{{ nsip }}"
nitro_user: "{{ nitro_user }}"
nitro_pass: "{{ nitro_pass }}"
operation: add
resource: server
name: test-server-1
attributes:
name: test-server-1
ipaddress: 192.168.1.1
- name: Update server
delegate_to: localhost
community.network.netscaler_nitro_request:
nsip: "{{ nsip }}"
nitro_user: "{{ nitro_user }}"
nitro_pass: "{{ nitro_pass }}"
operation: update
resource: server
name: test-server-1
attributes:
name: test-server-1
ipaddress: 192.168.1.2
- name: Get server
delegate_to: localhost
register: result
community.network.netscaler_nitro_request:
nsip: "{{ nsip }}"
nitro_user: "{{ nitro_user }}"
nitro_pass: "{{ nitro_pass }}"
operation: get
resource: server
name: test-server-1
- name: Delete server
delegate_to: localhost
register: result
community.network.netscaler_nitro_request:
nsip: "{{ nsip }}"
nitro_user: "{{ nitro_user }}"
nitro_pass: "{{ nitro_pass }}"
operation: delete
resource: server
name: test-server-1
- name: Rename server
delegate_to: localhost
community.network.netscaler_nitro_request:
nsip: "{{ nsip }}"
nitro_user: "{{ nitro_user }}"
nitro_pass: "{{ nitro_pass }}"
operation: action
action: rename
resource: server
attributes:
name: test-server-1
newname: test-server-2
- name: Get server by args
delegate_to: localhost
register: result
community.network.netscaler_nitro_request:
nsip: "{{ nsip }}"
nitro_user: "{{ nitro_user }}"
nitro_pass: "{{ nitro_pass }}"
operation: get_by_args
resource: server
args:
name: test-server-1
- name: Get server by filter
delegate_to: localhost
register: result
community.network.netscaler_nitro_request:
nsip: "{{ nsip }}"
nitro_user: "{{ nitro_user }}"
nitro_pass: "{{ nitro_pass }}"
operation: get_filtered
resource: server
filter:
ipaddress: 192.168.1.2
# Doing a NITRO request through MAS.
# Requires to have an authentication token from the mas_login and used as the nitro_auth_token parameter
# Also nsip is the MAS address and the target Netscaler IP must be defined with instance_ip
# The rest of the task arguments remain the same as when issuing the NITRO request directly to a Netscaler instance.
- name: Do mas login
delegate_to: localhost
register: login_result
community.network.netscaler_nitro_request:
nsip: "{{ mas_ip }}"
nitro_user: "{{ nitro_user }}"
nitro_pass: "{{ nitro_pass }}"
operation: mas_login
- name: Add resource through MAS proxy
delegate_to: localhost
community.network.netscaler_nitro_request:
nsip: "{{ mas_ip }}"
nitro_auth_token: "{{ login_result.nitro_auth_token }}"
instance_ip: "{{ nsip }}"
operation: add
resource: server
name: test-server-1
attributes:
name: test-server-1
ipaddress: 192.168.1.7
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **http\_response\_body** string | always | A string with the actual HTTP response body content if existent. If there is no HTTP response body it is an empty string. **Sample:** { errorcode: 0, message: Done, severity: NONE } |
| **http\_response\_data** dictionary | always | A dictionary that contains all the HTTP response's data. **Sample:** status: 200 |
| **nitro\_auth\_token** string | when applicable | The token returned by the `mas_login` operation when successful. **Sample:** ##E8D7D74DDBD907EE579E8BB8FF4529655F22227C1C82A34BFC93C9539D66 |
| **nitro\_errorcode** integer | always | A numeric value containing the return code of the NITRO operation. When 0 the operation is successful. Any non zero value indicates an error. |
| **nitro\_message** string | always | A string containing a human readable explanation for the NITRO operation result. **Sample:** Success |
| **nitro\_object** list / elements=string | when applicable | The object returned from the NITRO operation. This is applicable to the various get operations which return an object. **Sample:** [{'ipaddress': '192.168.1.8', 'ipv6address': 'NO', 'maxbandwidth': '0', 'name': 'test-server-1', 'port': 0, 'sp': 'OFF', 'state': 'ENABLED'}] |
| **nitro\_severity** string | always | A string describing the severity of the NITRO operation error or NONE. **Sample:** NONE |
### Authors
* George Nikolopoulos (@giorgos-nikolopoulos)
ansible community.network.aruba_command – Run commands on remote devices running Aruba Mobility Controller community.network.aruba\_command – Run commands on remote devices running Aruba Mobility Controller
===================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.aruba_command`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Sends arbitrary commands to an aruba node and returns the results read from the device. This module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met.
* This module does not support running commands in configuration mode. Please use [community.network.aruba\_config](aruba_config_module#ansible-collections-community-network-aruba-config-module) to configure Aruba devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **commands** string / required | | List of commands to send to the remote aruba device over the configured provider. The resulting output from the command is returned. If the *wait\_for* argument is provided, the module is not returned until the condition is satisfied or the number of retries has expired. |
| **interval** string | **Default:**1 | Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified conditions, the interval indicates how long to wait before trying the command again. |
| **match** string | **Choices:*** any
* **all** ←
| The *match* argument is used in conjunction with the *wait\_for* argument to specify the match policy. Valid values are `all` or `any`. If the value is set to `all` then all conditionals in the wait\_for must be satisfied. If the value is set to `any` then only one of the values must be satisfied. |
| **provider** string | | A dict object containing connection details. |
| | **host** string / required | | 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. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | **Default:**22 | Specifies the port to use when building the connection to the remote. device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | **Default:**10 | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **retries** string | **Default:**10 | Specifies the number of retries a command should by tried before it is considered failed. The command is run on the target device every retry and evaluated against the *wait\_for* conditions. |
| **wait\_for** string | | List of conditions to evaluate against the output of the command. The task will wait for each condition to be true before moving forward. If the conditional is not true within the configured number of retries, the task fails. See examples.
aliases: waitfor |
Examples
--------
```
tasks:
- name: Run show version on remote devices
community.network.aruba_command:
commands: show version
- name: Run show version and check to see if output contains Aruba
community.network.aruba_command:
commands: show version
wait_for: result[0] contains Aruba
- name: Run multiple commands on remote nodes
community.network.aruba_command:
commands:
- show version
- show interfaces
- name: Run multiple commands and evaluate the output
community.network.aruba_command:
commands:
- show version
- show interfaces
wait_for:
- result[0] contains Aruba
- result[1] contains Loopback0
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **failed\_conditions** list / elements=string | failed | The list of conditionals that have failed **Sample:** ['...', '...'] |
| **stdout** list / elements=string | always | The set of responses from the commands **Sample:** ['...', '...'] |
| **stdout\_lines** list / elements=string | always | The value of stdout split into a list **Sample:** [['...', '...'], ['...'], ['...']] |
### Authors
* James Mighion (@jmighion)
ansible community.network.edgeos – Use edgeos cliconf to run command on EdgeOS platform community.network.edgeos – Use edgeos cliconf to run command on EdgeOS platform
===============================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.edgeos`.
Synopsis
--------
* This edgeos plugin provides low level abstraction apis for sending and receiving CLI commands from Ubiquiti EdgeOS network devices.
### Authors
* Unknown (!UNKNOWN)
ansible community.network.ce_dldp_interface – Manages interface DLDP configuration on HUAWEI CloudEngine switches. community.network.ce\_dldp\_interface – Manages interface DLDP configuration on HUAWEI CloudEngine switches.
============================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_dldp_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages interface DLDP configuration on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **enable** string | **Choices:*** enable
* disable
| Set interface DLDP enable state. |
| **interface** string / required | | Must be fully qualified interface name, i.e. GE1/0/1, 10GE1/0/1, 40GE1/0/22, 100GE1/0/1. |
| **local\_mac** string | | Set the source MAC address for DLDP packets sent in the DLDP-compatible mode. The value of MAC address is in H-H-H format. H contains 1 to 4 hexadecimal digits. |
| **mode\_enable** string | **Choices:*** enable
* disable
| Set DLDP compatible-mode enable state. |
| **reset** string | **Choices:*** enable
* disable
| Specify whether reseting interface DLDP state. |
| **state** string | **Choices:*** **present** ←
* absent
| Manage the state of the resource. |
Notes
-----
Note
* If `state=present, enable=disable`, interface DLDP enable will be turned off and related interface DLDP configuration will be cleared.
* If `state=absent`, only local\_mac is supported to configure.
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: DLDP interface test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Configure interface DLDP enable state and ensure global dldp enable is turned on"
community.network.ce_dldp_interface:
interface: 40GE2/0/1
enable: enable
provider: "{{ cli }}"
- name: "Configuire interface DLDP compatible-mode enable state and ensure interface DLDP state is already enabled"
community.network.ce_dldp_interface:
interface: 40GE2/0/1
enable: enable
mode_enable: enable
provider: "{{ cli }}"
- name: "Configuire the source MAC address for DLDP packets sent in the DLDP-compatible mode and
ensure interface DLDP state and compatible-mode enable state is already enabled"
community.network.ce_dldp_interface:
interface: 40GE2/0/1
enable: enable
mode_enable: enable
local_mac: aa-aa-aa
provider: "{{ cli }}"
- name: "Reset DLDP state of specified interface and ensure interface DLDP state is already enabled"
community.network.ce_dldp_interface:
interface: 40GE2/0/1
enable: enable
reset: enable
provider: "{{ cli }}"
- name: "Unconfigure interface DLDP local mac address when C(state=absent)"
community.network.ce_dldp_interface:
interface: 40GE2/0/1
state: absent
local_mac: aa-aa-aa
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of interface DLDP configuration after module execution **Sample:** {'enable': 'enable', 'interface': '40GE2/0/22', 'local\_mac': '00aa-00aa-00aa', 'mode\_enable': 'enable', 'reset': 'enable'} |
| **existing** dictionary | always | k/v pairs of existing interface DLDP configuration **Sample:** {'enable': 'disable', 'interface': '40GE2/0/22', 'local\_mac': None, 'mode\_enable': None, 'reset': 'disable'} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'enable': 'enalbe', 'interface': '40GE2/0/22', 'local\_mac': 'aa-aa-aa', 'mode\_enable': 'enable', 'reset': 'enable'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** ['dldp enable', 'dldp compatible-mode enable', 'dldp compatible-mode local-mac aa-aa-aa', 'dldp reset'] |
### Authors
* Zhou Zhijin (@QijunPan)
| programming_docs |
ansible community.network.avi_microservicegroup – Module for setup of MicroServiceGroup Avi RESTful Object community.network.avi\_microservicegroup – Module for setup of MicroServiceGroup Avi RESTful Object
===================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_microservicegroup`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure MicroServiceGroup object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **created\_by** string | | Creator name. |
| **description** string | | User defined description for the object. |
| **name** string / required | | Name of the microservice group. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **service\_refs** string | | Configure microservice(es). It is a reference to an object of type microservice. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Uuid of the microservice group. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Create a Microservice Group that can be used for setting up Network security policy
community.network.avi_microservicegroup:
controller: '{{ controller }}'
username: '{{ username }}'
password: '{{ password }}'
description: Group created by my Secure My App UI.
name: vs-msg-marketing
tenant_ref: admin
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | MicroServiceGroup (api/microservicegroup) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#b5d2c7d4c6c1dad2dc939686828e939680878e9396818d8ed4c3dcdbd0c1c2dac7dec6939681838ed6dad8)>
ansible community.network.cnos_facts – Collect facts from remote devices running Lenovo CNOS community.network.cnos\_facts – Collect facts from remote devices running Lenovo CNOS
=====================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.cnos_facts`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Collects a base set of device facts from a remote Lenovo device running on CNOS. This module prepends all of the base network fact keys with `ansible_net_<fact>`. The facts module will always collect a base set of facts from the device and can enable or disable collection of additional facts.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| **authorize** boolean | **Choices:*** **no** ←
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| **gather\_subset** string | **Default:**"!config" | When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument include all, hardware, config, and interfaces. Can specify a list of values to include a larger subset. Values can also be used with an initial `!` to specify that a specific subset should not be collected. |
Notes
-----
Note
* Tested against CNOS 10.8.1
Examples
--------
```
Tasks: The following are examples of using the module cnos_facts.
---
- name: Test cnos Facts
community.network.cnos_facts:
---
# Collect all facts from the device
- community.network.cnos_facts:
gather_subset: all
# Collect only the config and default facts
- community.network.cnos_facts:
gather_subset:
- config
# Do not collect hardware facts
- community.network.cnos_facts:
gather_subset:
- "!hardware"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **ansible\_net\_all\_ipv4\_addresses** list / elements=string | when interfaces is configured | All IPv4 addresses configured on the device |
| **ansible\_net\_all\_ipv6\_addresses** list / elements=string | when interfaces is configured | All IPv6 addresses configured on the device |
| **ansible\_net\_config** string | when config is configured | The current active config from the device |
| **ansible\_net\_gather\_subset** list / elements=string | always | The list of fact subsets collected from the device |
| **ansible\_net\_hostname** string | always | The configured hostname of the device |
| **ansible\_net\_image** string | always | Indicates the active image for the device |
| **ansible\_net\_interfaces** dictionary | when interfaces is configured | A hash of all interfaces running on the system. This gives information on description, mac address, mtu, speed, duplex and operstatus |
| **ansible\_net\_memfree\_mb** integer | when hardware is configured | The available free memory on the remote device in MB |
| **ansible\_net\_model** string | always | The model name returned from the Lenovo CNOS device |
| **ansible\_net\_neighbors** dictionary | when interfaces is configured | The list of LLDP neighbors from the remote device |
| **ansible\_net\_serialnum** string | always | The serial number of the Lenovo CNOS device |
| **ansible\_net\_version** string | always | The CNOS operating system version running on the remote device |
### Authors
* Anil Kumar Muraleedharan (@amuraleedhar)
ansible community.network.pn_vrouter_pim_config – CLI command to modify vrouter-pim-config community.network.pn\_vrouter\_pim\_config – CLI command to modify vrouter-pim-config
=====================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_vrouter_pim_config`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to modify pim parameters.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_hello\_interval** string | | hello interval in seconds. |
| **pn\_querier\_timeout** string | | igmp querier timeout in seconds. |
| **pn\_query\_interval** string | | igmp query interval in seconds. |
| **pn\_vrouter\_name** string | | name of service config. |
| **state** string / required | **Choices:*** update
| State the action to perform. Use `update` to modify the vrouter-pim-config. |
Examples
--------
```
- name: Pim config modify
community.network.pn_vrouter_pim_config:
pn_cliswitch: '192.168.1.1'
pn_query_interval: '10'
pn_querier_timeout: '30'
state: 'update'
pn_vrouter_name: 'ansible-spine1-vrouter'
```
Return Values
-------------
Common return 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 | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the vrouter-pim-config command. |
| **stdout** list / elements=string | always | set of responses from the vrouter-pim-config command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
ansible community.network.icx_lldp – Manage LLDP configuration on Ruckus ICX 7000 series switches community.network.icx\_lldp – Manage LLDP configuration on Ruckus ICX 7000 series switches
==========================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.icx_lldp`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of LLDP service on ICX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **check\_running\_config** boolean | **Choices:*** no
* **yes** ←
| Check running configuration. This can be set as environment variable. Module will use environment variable value(default:True), unless it is overridden, by specifying it as module parameter. |
| **interfaces** list / elements=string | | specify interfaces |
| | **name** list / elements=string | | List of ethernet ports to enable lldp. To add a range of ports use 'to' keyword. See the example. |
| | **state** string | **Choices:*** present
* absent
* enabled
* disabled
| State of lldp configuration for interfaces |
| **state** string | **Choices:*** present
* absent
* enabled
* disabled
| Enables the receipt and transmission of Link Layer Discovery Protocol (LLDP) globally. |
Notes
-----
Note
* Tested against ICX 10.1.
* For information on using ICX platform, see [the ICX OS Platform Options guide](user_guide/platform_icx).
Examples
--------
```
- name: Disable LLDP
community.network.icx_lldp:
state: absent
- name: Enable LLDP
community.network.icx_lldp:
state: present
- name: Disable LLDP on ports 1/1/1 - 1/1/10, 1/1/20
community.network.icx_lldp:
interfaces:
- name:
- ethernet 1/1/1 to 1/1/10
- ethernet 1/1/20
state: absent
state: present
- name: Enable LLDP on ports 1/1/5 - 1/1/10
community.network.icx_lldp:
interfaces:
- name:
- ethernet 1/1/1 to 1/1/10
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['lldp run', 'no lldp run'] |
### Authors
* Ruckus Wireless (@Commscope)
ansible community.network.a10_virtual_server – Manage A10 Networks AX/SoftAX/Thunder/vThunder devices’ virtual servers. community.network.a10\_virtual\_server – Manage A10 Networks AX/SoftAX/Thunder/vThunder devices’ virtual servers.
=================================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.a10_virtual_server`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage SLB (Server Load Balancing) virtual server objects on A10 Networks devices via aXAPIv2.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **client\_cert** path | | PEM formatted certificate chain file to be used for SSL client authentication. This file can also include the key as well, and if the key is included, `client_key` is not required. |
| **client\_key** path | | PEM formatted file that contains your private key to be used for SSL client authentication. If `client_cert` contains both the certificate and key, this option is not required. |
| **force** boolean | **Choices:*** **no** ←
* yes
| If `yes` do not get a cached copy. Alias `thirsty` has been deprecated and will be removed in 2.13.
aliases: thirsty |
| **force\_basic\_auth** boolean | **Choices:*** **no** ←
* yes
| Credentials specified with *url\_username* and *url\_password* should be passed in HTTP Header. |
| **host** string / required | | Hostname or IP of the A10 Networks device. |
| **http\_agent** string | **Default:**"ansible-httpget" | Header to identify as, generally appears in web server logs. |
| **partition** string | | set active-partition |
| **password** string / required | | Password for the `username` account.
aliases: pass, pwd |
| **state** string | **Choices:*** **present** ←
* absent
| If the specified virtual server should exist. |
| **url** string | | HTTP, HTTPS, or FTP URL in the form (http|https|ftp)://[user[:pass]]@host.domain[:port]/path |
| **url\_password** string | | The password for use in HTTP basic authentication. If the *url\_username* parameter is not specified, the *url\_password* parameter will not be used. |
| **url\_username** string | | The username for use in HTTP basic authentication. This parameter can be used without *url\_password* for sites that allow empty passwords |
| **use\_gssapi** boolean added in 2.11 of ansible.builtin | **Choices:*** **no** ←
* yes
| Use GSSAPI to perform the authentication, typically this is for Kerberos or Kerberos through Negotiate authentication. Requires the Python library [gssapi](https://github.com/pythongssapi/python-gssapi) to be installed. Credentials for GSSAPI can be specified with *url\_username*/*url\_password* or with the GSSAPI env var `KRB5CCNAME` that specified a custom Kerberos credential cache. NTLM authentication is `not` supported even if the GSSAPI mech for NTLM has been installed. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** ←
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **username** string / required | | An account with administrator privileges.
aliases: admin, user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `no`, SSL certificates will not be validated. This should only be used on personally controlled devices using self-signed certificates. |
| **virtual\_server** string / required | | The SLB (Server Load Balancing) virtual server name.
aliases: vip, virtual |
| **virtual\_server\_ip** string | | The SLB virtual server IPv4 address.
aliases: ip, address |
| **virtual\_server\_ports** string | | A list of ports to create for the virtual server. Each list item should be a dictionary which specifies the `port:` and `type:`, but can also optionally specify the `service_group:` as well as the `status:`. See the examples below for details. This parameter is required when `state` is `present`. |
| **virtual\_server\_status** string | **Choices:*** enabled
* disabled
**Default:**"enable" | The SLB virtual server status, such as enabled or disabled.
aliases: status |
| **write\_config** boolean | **Choices:*** **no** ←
* yes
| If `yes`, any changes will cause a write of the running configuration to non-volatile memory. This will save *all* configuration changes, including those that may have been made manually or through other modules, so care should be taken when specifying `yes`. |
Notes
-----
Note
* Requires A10 Networks aXAPI 2.1.
* Requires A10 Networks aXAPI 2.1.
Examples
--------
```
- name: Create a new virtual server
community.network.a10_virtual_server:
host: a10.mydomain.com
username: myadmin
password: mypassword
partition: mypartition
virtual_server: vserver1
virtual_server_ip: 1.1.1.1
virtual_server_ports:
- port: 80
protocol: TCP
service_group: sg-80-tcp
- port: 443
protocol: HTTPS
service_group: sg-443-https
- port: 8080
protocol: http
status: disabled
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **content** string | success | the full info regarding the slb\_virtual **Sample:** mynewvirtualserver |
### Authors
* Eric Chou (@ericchou1)
* Mischa Peters (@mischapeters)
| programming_docs |
ansible community.network.avi_certificatemanagementprofile – Module for setup of CertificateManagementProfile Avi RESTful Object community.network.avi\_certificatemanagementprofile – Module for setup of CertificateManagementProfile Avi RESTful Object
=========================================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_certificatemanagementprofile`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure CertificateManagementProfile object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **name** string / required | | Name of the pki profile. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **script\_params** string | | List of customparams. |
| **script\_path** string / required | | Script\_path of certificatemanagementprofile. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Unique object identifier of the object. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create CertificateManagementProfile object
community.network.avi_certificatemanagementprofile:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_certificatemanagementprofile
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | CertificateManagementProfile (api/certificatemanagementprofile) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#690e1b081a1d060e004f4a5a5e524f4a5c5b524f4a5d5152081f00070c1d1e061b021a4f4a5d5f520a0604)>
ansible community.network.dladm_linkprop – Manage link properties on Solaris/illumos systems. community.network.dladm\_linkprop – Manage link properties on Solaris/illumos systems.
======================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.dladm_linkprop`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Set / reset link properties on Solaris/illumos systems.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **link** string / required | | Link interface name.
aliases: nic, interface |
| **property** string / required | | Specifies the name of the property we want to manage.
aliases: name |
| **state** string | **Choices:*** **present** ←
* absent
* reset
| Set or reset the property value. |
| **temporary** boolean | **Choices:*** **no** ←
* yes
| Specifies that lin property configuration is temporary. Temporary link property configuration does not persist across reboots. |
| **value** string | | Specifies the value we want to set for the link property. |
Examples
--------
```
- name: Set 'maxbw' to 100M on e1000g1
community.network.dladm_linkprop: name=e1000g1 property=maxbw value=100M state=present
- name: Set 'mtu' to 9000 on e1000g1
community.network.dladm_linkprop: name=e1000g1 property=mtu value=9000
- name: Reset 'mtu' property on e1000g1
community.network.dladm_linkprop: name=e1000g1 property=mtu state=reset
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **link** string | always | link name **Sample:** e100g0 |
| **property** string | always | property name **Sample:** mtu |
| **state** string | always | state of the target **Sample:** present |
| **temporary** boolean | always | specifies if operation will persist across reboots **Sample:** True |
| **value** string | always | property value **Sample:** 9000 |
### Authors
* Adam Števko (@xen0l)
ansible community.network.voss_facts – Collect facts from remote devices running Extreme VOSS community.network.voss\_facts – Collect facts from remote devices running Extreme VOSS
======================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.voss_facts`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Collects a base set of device facts from a remote device that is running VOSS. This module prepends all of the base network fact keys with `ansible_net_<fact>`. The facts module will always collect a base set of facts from the device and can enable or disable collection of additional facts.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **gather\_subset** string | **Default:**"!config" | When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument include all, hardware, config, and interfaces. Can specify a list of values to include a larger subset. Values can also be used with an initial `!` to specify that a specific subset should not be collected. |
Notes
-----
Note
* Tested against VOSS 7.0.0
Examples
--------
```
- name: Collect all facts from the device
community.network.voss_facts:
gather_subset: all
- name: Collect only the config and default facts
community.network.voss_facts:
gather_subset:
- config
- name: Do not collect hardware facts
community.network.voss_facts:
gather_subset:
- "!hardware"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **ansible\_net\_all\_ipv4\_addresses** list / elements=string | when interfaces is configured | All IPv4 addresses configured on the device |
| **ansible\_net\_all\_ipv6\_addresses** list / elements=string | when interfaces is configured | All IPv6 addresses configured on the device |
| **ansible\_net\_config** string | when config is configured | The current active config from the device |
| **ansible\_net\_gather\_subset** list / elements=string | always | The list of fact subsets collected from the device |
| **ansible\_net\_hostname** string | always | The configured hostname of the device |
| **ansible\_net\_interfaces** dictionary | when interfaces is configured | A hash of all interfaces running on the system |
| **ansible\_net\_memfree\_mb** integer | when hardware is configured | The available free memory on the remote device in Mb |
| **ansible\_net\_memtotal\_mb** integer | when hardware is configured | The total memory on the remote device in Mb |
| **ansible\_net\_model** string | always | The model name returned from the device |
| **ansible\_net\_neighbors** dictionary | when interfaces is configured | The list of LLDP neighbors from the remote device |
| **ansible\_net\_serialnum** string | always | The serial number of the remote device |
| **ansible\_net\_version** string | always | The operating system version running on the remote device |
### Authors
* Lindsay Hill (@LindsayHill)
ansible community.network.ce_eth_trunk – Manages Eth-Trunk interfaces on HUAWEI CloudEngine switches. community.network.ce\_eth\_trunk – Manages Eth-Trunk interfaces on HUAWEI CloudEngine switches.
===============================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_eth_trunk`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages Eth-Trunk specific configuration parameters on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **force** boolean | **Choices:*** **no** ←
* yes
| When true it forces Eth-Trunk members to match what is declared in the members param. This can be used to remove members. |
| **hash\_type** string | **Choices:*** src-dst-ip
* src-dst-mac
* enhanced
* dst-ip
* dst-mac
* src-ip
* src-mac
| Hash algorithm used for load balancing among Eth-Trunk member interfaces. |
| **members** string | | List of interfaces that will be managed in a given Eth-Trunk. The interface name must be full name. |
| **min\_links** string | | Specifies the minimum number of Eth-Trunk member links in the Up state. The value is an integer ranging from 1 to the maximum number of interfaces that can be added to a Eth-Trunk interface. |
| **mode** string | **Choices:*** manual
* lacp-dynamic
* lacp-static
| Specifies the working mode of an Eth-Trunk interface. |
| **state** string | **Choices:*** **present** ←
* absent
| Manage the state of the resource. |
| **trunk\_id** string / required | | Eth-Trunk interface number. The value is an integer. The value range depends on the assign forward eth-trunk mode command. When 256 is specified, the value ranges from 0 to 255. When 512 is specified, the value ranges from 0 to 511. When 1024 is specified, the value ranges from 0 to 1023. |
Notes
-----
Note
* `state=absent` removes the Eth-Trunk config and interface if it already exists. If members to be removed are not explicitly passed, all existing members (if any), are removed, and Eth-Trunk removed.
* Members must be a list.
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Eth_trunk module test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Ensure Eth-Trunk100 is created, add two members, and set to mode lacp-static
community.network.ce_eth_trunk:
trunk_id: 100
members: ['10GE1/0/24','10GE1/0/25']
mode: 'lacp-static'
state: present
provider: '{{ cli }}'
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of Eth-Trunk info after module execution **Sample:** {'hash\_type': 'mac', 'members\_detail': [{'memberIfName': '10GE1/0/24', 'memberIfState': 'Down'}, {'memberIfName': '10GE1/0/25', 'memberIfState': 'Down'}], 'min\_links': '1', 'mode': 'lacp-static', 'trunk\_id': '100'} |
| **existing** dictionary | always | k/v pairs of existing Eth-Trunk **Sample:** {'hash\_type': 'mac', 'members\_detail': [{'memberIfName': '10GE1/0/25', 'memberIfState': 'Down'}], 'min\_links': '1', 'mode': 'manual', 'trunk\_id': '100'} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'members': ['10GE1/0/24', '10GE1/0/25'], 'mode': 'lacp-static', 'trunk\_id': '100'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** ['interface Eth-Trunk 100', 'mode lacp-static', 'interface 10GE1/0/25', 'eth-trunk 100'] |
### Authors
* QijunPan (@QijunPan)
ansible community.network.ipadm_prop – Manage protocol properties on Solaris/illumos systems. community.network.ipadm\_prop – Manage protocol properties on Solaris/illumos systems.
======================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ipadm_prop`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Modify protocol properties on Solaris/illumos systems.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **property** string / required | | Specifies the name of property we want to manage. |
| **protocol** string / required | | Specifies the protocol for which we want to manage properties. |
| **state** string | **Choices:*** **present** ←
* absent
* reset
| Set or reset the property value. |
| **temporary** boolean | **Choices:*** **no** ←
* yes
| Specifies that the property value is temporary. Temporary property values do not persist across reboots. |
| **value** string | | Specifies the value we want to set for the property. |
Examples
--------
```
- name: Set TCP receive buffer size
community.network.ipadm_prop:
protocol: tcp
property: recv_buf
value: 65536
- name: Reset UDP send buffer size to the default value
community.network.ipadm_prop:
protocol: udp
property: send_buf
state: reset
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **property** string | always | name of the property **Sample:** recv\_maxbuf |
| **protocol** string | always | property's protocol **Sample:** TCP |
| **state** string | always | state of the target **Sample:** present |
| **temporary** boolean | always | property's persistence **Sample:** True |
| **value** integer | always | value of the property. May be int or string depending on property. **Sample:** '1024' or 'never' |
### Authors
* Adam Števko (@xen0l)
ansible community.network.edgeswitch – Use edgeswitch cliconf to run command on EdgeSwitch platform community.network.edgeswitch – Use edgeswitch cliconf to run command on EdgeSwitch platform
===========================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.edgeswitch`.
Synopsis
--------
* This edgeswitch plugin provides low level abstraction apis for sending and receiving CLI commands from Ubiquiti EdgeSwitch network devices.
### Authors
* Unknown (!UNKNOWN)
| programming_docs |
ansible community.network.bigmon_chain – Create and remove a bigmon inline service chain. community.network.bigmon\_chain – Create and remove a bigmon inline service chain.
==================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.bigmon_chain`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Create and remove a bigmon inline service chain.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_token** string | | Bigmon access token. If this isn't set, the environment variable `BIGSWITCH_ACCESS_TOKEN` is used. |
| **controller** string / required | | The controller IP address. |
| **name** string / required | | The name of the chain. |
| **state** string | **Choices:*** **present** ←
* absent
| Whether the service chain should be present or absent. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `false`, SSL certificates will not be validated. This should only be used on personally controlled devices using self-signed certificates. |
Examples
--------
```
- name: Bigmon inline service chain
community.network.bigmon_chain:
name: MyChain
controller: '{{ inventory_hostname }}'
state: present
validate_certs: false
```
### Authors
* Ted (@tedelhourani)
ansible community.network.pn_port_cos_bw – CLI command to modify port-cos-bw community.network.pn\_port\_cos\_bw – CLI command to modify port-cos-bw
=======================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_port_cos_bw`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to update bw settings for CoS queues.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_cos** string | | CoS priority. |
| **pn\_max\_bw\_limit** string | | Maximum b/w in percentage. |
| **pn\_min\_bw\_guarantee** string | | Minimum b/w in percentage. |
| **pn\_port** string | | physical port number. |
| **pn\_weight** string | **Choices:*** priority
* no-priority
| Scheduling weight (1 to 127) after b/w guarantee met. |
| **state** string / required | **Choices:*** update
| State the action to perform. Use `update` to modify the port-cos-bw. |
Examples
--------
```
- name: Port cos bw modify
community.network.pn_port_cos_bw:
pn_cliswitch: "sw01"
state: "update"
pn_port: "1"
pn_cos: "0"
pn_min_bw_guarantee: "60"
- name: Port cos bw modify
community.network.pn_port_cos_bw:
pn_cliswitch: "sw01"
state: "update"
pn_port: "all"
pn_cos: "0"
pn_weight: "priority"
```
Return Values
-------------
Common return 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 | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the port-cos-bw command. |
| **stdout** list / elements=string | always | set of responses from the port-cos-bw command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
ansible community.network.enos_command – Run arbitrary commands on Lenovo ENOS devices community.network.enos\_command – Run arbitrary commands on Lenovo ENOS devices
===============================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.enos_command`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Sends arbitrary commands to an ENOS node and returns the results read from the device. The `enos_command` module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| **authorize** boolean | **Choices:*** **no** ←
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| **commands** string / required | | List of commands to send to the remote device over the configured provider. The resulting output from the command is returned. If the *wait\_for* argument is provided, the module is not returned until the condition is satisfied or the number of retires as expired. |
| **interval** string | **Default:**1 | Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified conditions, the interval indicates how long to wait before trying the command again. |
| **match** string | **Choices:*** any
* **all** ←
| The *match* argument is used in conjunction with the *wait\_for* argument to specify the match policy. Valid values are `all` or `any`. If the value is set to `all` then all conditionals in the wait\_for must be satisfied. If the value is set to `any` then only one of the values must be satisfied. |
| **provider** dictionary | | A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** ←
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string / required | | 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. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | **Default:**22 | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | **Default:**10 | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **retries** string | **Default:**10 | Specifies the number of retries a command should by tried before it is considered failed. The command is run on the target device every retry and evaluated against the *wait\_for* conditions. |
| **wait\_for** string | | List of conditions to evaluate against the output of the command. The task will wait for each condition to be true before moving forward. If the conditional is not true within the configured number of retries, the task fails. See examples. |
Examples
--------
```
# Note: examples below use the following provider dict to handle
# transport and authentication to the node.
---
vars:
cli:
host: "{{ inventory_hostname }}"
port: 22
username: admin
password: admin
timeout: 30
---
- name: Test contains operator
community.network.enos_command:
commands:
- show version
- show system memory
wait_for:
- "result[0] contains 'Lenovo'"
- "result[1] contains 'MemFree'"
provider: "{{ cli }}"
register: result
- ansible.builtin.assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- name: Get output for single command
community.network.enos_command:
commands: ['show version']
provider: "{{ cli }}"
register: result
- ansible.builtin.assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- name: Get output for multiple commands
community.network.enos_command:
commands:
- show version
- show interface information
provider: "{{ cli }}"
register: result
- ansible.builtin.assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- "result.stdout | length == 2"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **failed\_conditions** list / elements=string | failed | the conditionals that failed **Sample:** ['...', '...'] |
| **stdout** list / elements=string | always | the set of responses from the commands **Sample:** ['...', '...'] |
| **stdout\_lines** list / elements=string | always | The value of stdout split into a list **Sample:** [['...', '...'], ['...'], ['...']] |
### Authors
* Anil Kumar Muraleedharan (@amuraleedhar)
ansible community.network.avi_virtualservice – Module for setup of VirtualService Avi RESTful Object community.network.avi\_virtualservice – Module for setup of VirtualService Avi RESTful Object
=============================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_virtualservice`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure VirtualService object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **active\_standby\_se\_tag** string | | This configuration only applies if the virtualservice is in legacy active standby ha mode and load distribution among active standby is enabled. This field is used to tag the virtualservice so that virtualservices with the same tag will share the same active serviceengine. Virtualservices with different tags will have different active serviceengines. If one of the serviceengine's in the serviceenginegroup fails, all virtualservices will end up using the same active serviceengine. Redistribution of the virtualservices can be either manual or automated when the failed serviceengine recovers. Redistribution is based on the auto redistribute property of the serviceenginegroup. Enum options - ACTIVE\_STANDBY\_SE\_1, ACTIVE\_STANDBY\_SE\_2. Default value when not specified in API or module is interpreted by Avi Controller as ACTIVE\_STANDBY\_SE\_1. |
| **allow\_invalid\_client\_cert** boolean | **Choices:*** no
* yes
| Process request even if invalid client certificate is presented. Datascript apis need to be used for processing of such requests. Field introduced in 18.2.3. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **analytics\_policy** string | | Determines analytics settings for the application. |
| **analytics\_profile\_ref** string | | Specifies settings related to analytics. It is a reference to an object of type analyticsprofile. |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **apic\_contract\_graph** string | | The name of the contract/graph associated with the virtual service. Should be in the <contract name> <graph name> format. This is applicable only for service integration mode with cisco apic controller. Field introduced in 17.2.12,18.1.2. |
| **application\_profile\_ref** string | | Enable application layer specific features for the virtual service. It is a reference to an object of type applicationprofile. |
| **auto\_allocate\_floating\_ip** boolean | **Choices:*** no
* yes
| Auto-allocate floating/elastic ip from the cloud infrastructure. Field deprecated in 17.1.1. |
| **auto\_allocate\_ip** boolean | **Choices:*** no
* yes
| Auto-allocate vip from the provided subnet. Field deprecated in 17.1.1. |
| **availability\_zone** string | | Availability-zone to place the virtual service. Field deprecated in 17.1.1. |
| **avi\_allocated\_fip** boolean | **Choices:*** no
* yes
| (internal-use) fip allocated by avi in the cloud infrastructure. Field deprecated in 17.1.1. |
| **avi\_allocated\_vip** boolean | **Choices:*** no
* yes
| (internal-use) vip allocated by avi in the cloud infrastructure. Field deprecated in 17.1.1. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **azure\_availability\_set** string | | (internal-use)applicable for azure only. Azure availability set to which this vs is associated. Internally set by the cloud connector. Field introduced in 17.2.12, 18.1.2. |
| **bulk\_sync\_kvcache** boolean | **Choices:*** no
* yes
| (this is a beta feature). Sync key-value cache to the new ses when vs is scaled out. For ex ssl sessions are stored using vs's key-value cache. When the vs is scaled out, the ssl session information is synced to the new se, allowing existing ssl sessions to be reused on the new se. Field introduced in 17.2.7, 18.1.1. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **client\_auth** string | | Http authentication configuration for protected resources. |
| **close\_client\_conn\_on\_config\_update** boolean | **Choices:*** no
* yes
| Close client connection on vs config update. Field introduced in 17.2.4. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **cloud\_config\_cksum** string | | Checksum of cloud configuration for vs. Internally set by cloud connector. |
| **cloud\_ref** string | | It is a reference to an object of type cloud. |
| **cloud\_type** string | | Enum options - cloud\_none, cloud\_vcenter, cloud\_openstack, cloud\_aws, cloud\_vca, cloud\_apic, cloud\_mesos, cloud\_linuxserver, cloud\_docker\_ucp, cloud\_rancher, cloud\_oshift\_k8s, cloud\_azure, cloud\_gcp. Default value when not specified in API or module is interpreted by Avi Controller as CLOUD\_NONE. |
| **connections\_rate\_limit** string | | Rate limit the incoming connections to this virtual service. |
| **content\_rewrite** string | | Profile used to match and rewrite strings in request and/or response body. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **created\_by** string | | Creator name. |
| **delay\_fairness** boolean | **Choices:*** no
* yes
| Select the algorithm for qos fairness. This determines how multiple virtual services sharing the same service engines will prioritize traffic over a congested network. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **description** string | | User defined description for the object. |
| **discovered\_network\_ref** string | | (internal-use) discovered networks providing reachability for client facing virtual service ip. This field is deprecated. It is a reference to an object of type network. Field deprecated in 17.1.1. |
| **discovered\_networks** string | | (internal-use) discovered networks providing reachability for client facing virtual service ip. This field is used internally by avi, not editable by the user. Field deprecated in 17.1.1. |
| **discovered\_subnet** string | | (internal-use) discovered subnets providing reachability for client facing virtual service ip. This field is deprecated. Field deprecated in 17.1.1. |
| **dns\_info** string | | Service discovery specific data including fully qualified domain name, type and time-to-live of the dns record. Note that only one of fqdn and dns\_info setting is allowed. |
| **dns\_policies** string | | Dns policies applied on the dns traffic of the virtual service. Field introduced in 17.1.1. |
| **east\_west\_placement** boolean | **Choices:*** no
* yes
| Force placement on all se's in service group (mesos mode only). Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **enable\_autogw** boolean | **Choices:*** no
* yes
| Response traffic to clients will be sent back to the source mac address of the connection, rather than statically sent to a default gateway. Default value when not specified in API or module is interpreted by Avi Controller as True. |
| **enable\_rhi** boolean | **Choices:*** no
* yes
| Enable route health injection using the bgp config in the vrf context. |
| **enable\_rhi\_snat** boolean | **Choices:*** no
* yes
| Enable route health injection for source nat'ted floating ip address using the bgp config in the vrf context. |
| **enabled** boolean | **Choices:*** no
* yes
| Enable or disable the virtual service. Default value when not specified in API or module is interpreted by Avi Controller as True. |
| **error\_page\_profile\_ref** string | | Error page profile to be used for this virtualservice.this profile is used to send the custom error page to the client generated by the proxy. It is a reference to an object of type errorpageprofile. Field introduced in 17.2.4. |
| **floating\_ip** string | | Floating ip to associate with this virtual service. Field deprecated in 17.1.1. |
| **floating\_subnet\_uuid** string | | If auto\_allocate\_floating\_ip is true and more than one floating-ip subnets exist, then the subnet for the floating ip address allocation. This field is applicable only if the virtualservice belongs to an openstack or aws cloud. In openstack or aws cloud it is required when auto\_allocate\_floating\_ip is selected. Field deprecated in 17.1.1. |
| **flow\_dist** string | | Criteria for flow distribution among ses. Enum options - LOAD\_AWARE, CONSISTENT\_HASH\_SOURCE\_IP\_ADDRESS, CONSISTENT\_HASH\_SOURCE\_IP\_ADDRESS\_AND\_PORT. Default value when not specified in API or module is interpreted by Avi Controller as LOAD\_AWARE. |
| **flow\_label\_type** string | | Criteria for flow labelling. Enum options - NO\_LABEL, APPLICATION\_LABEL, SERVICE\_LABEL. Default value when not specified in API or module is interpreted by Avi Controller as NO\_LABEL. |
| **fqdn** string | | Dns resolvable, fully qualified domain name of the virtualservice. Only one of 'fqdn' and 'dns\_info' configuration is allowed. |
| **host\_name\_xlate** string | | Translate the host name sent to the servers to this value. Translate the host name sent from servers back to the value used by the client. |
| **http\_policies** string | | Http policies applied on the data traffic of the virtual service. |
| **ign\_pool\_net\_reach** boolean | **Choices:*** no
* yes
| Ignore pool servers network reachability constraints for virtual service placement. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **ip\_address** string | | Ip address of the virtual service. Field deprecated in 17.1.1. |
| **ipam\_network\_subnet** string | | Subnet and/or network for allocating virtualservice ip by ipam provider module. Field deprecated in 17.1.1. |
| **l4\_policies** string | | L4 policies applied to the data traffic of the virtual service. Field introduced in 17.2.7. |
| **limit\_doser** boolean | **Choices:*** no
* yes
| Limit potential dos attackers who exceed max\_cps\_per\_client significantly to a fraction of max\_cps\_per\_client for a while. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **max\_cps\_per\_client** string | | Maximum connections per second per client ip. Allowed values are 10-1000. Special values are 0- 'unlimited'. Default value when not specified in API or module is interpreted by Avi Controller as 0. |
| **microservice\_ref** string | | Microservice representing the virtual service. It is a reference to an object of type microservice. |
| **min\_pools\_up** string | | Minimum number of up pools to mark vs up. Field introduced in 18.2.1, 17.2.12. |
| **name** string / required | | Name for the virtual service. |
| **network\_profile\_ref** string | | Determines network settings such as protocol, tcp or udp, and related options for the protocol. It is a reference to an object of type networkprofile. |
| **network\_ref** string | | Manually override the network on which the virtual service is placed. It is a reference to an object of type network. Field deprecated in 17.1.1. |
| **network\_security\_policy\_ref** string | | Network security policies for the virtual service. It is a reference to an object of type networksecuritypolicy. |
| **nsx\_securitygroup** string | | A list of nsx service groups representing the clients which can access the virtual ip of the virtual service. Field introduced in 17.1.1. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **performance\_limits** string | | Optional settings that determine performance limits like max connections or bandwidth etc. |
| **pool\_group\_ref** string | | The pool group is an object that contains pools. It is a reference to an object of type poolgroup. |
| **pool\_ref** string | | The pool is an object that contains destination servers and related attributes such as load-balancing and persistence. It is a reference to an object of type pool. |
| **port\_uuid** string | | (internal-use) network port assigned to the virtual service ip address. Field deprecated in 17.1.1. |
| **remove\_listening\_port\_on\_vs\_down** boolean | **Choices:*** no
* yes
| Remove listening port if virtualservice is down. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **requests\_rate\_limit** string | | Rate limit the incoming requests to this virtual service. |
| **saml\_sp\_config** string | | Application-specific saml config. Field introduced in 18.2.3. |
| **scaleout\_ecmp** boolean | **Choices:*** no
* yes
| Disable re-distribution of flows across service engines for a virtual service. Enable if the network itself performs flow hashing with ecmp in environments such as gcp. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **se\_group\_ref** string | | The service engine group to use for this virtual service. Moving to a new se group is disruptive to existing connections for this vs. It is a reference to an object of type serviceenginegroup. |
| **security\_policy\_ref** string | | Security policy applied on the traffic of the virtual service. This policy is used to perform security actions such as distributed denial of service (ddos) attack mitigation, etc. It is a reference to an object of type securitypolicy. Field introduced in 18.2.1. |
| **server\_network\_profile\_ref** string | | Determines the network settings profile for the server side of tcp proxied connections. Leave blank to use the same settings as the client to vs side of the connection. It is a reference to an object of type networkprofile. |
| **service\_metadata** string | | Metadata pertaining to the service provided by this virtual service. In openshift/kubernetes environments, egress pod info is stored. Any user input to this field will be overwritten by avi vantage. |
| **service\_pool\_select** string | | Select pool based on destination port. |
| **services** string | | List of services defined for this virtual service. |
| **sideband\_profile** string | | Sideband configuration to be used for this virtualservice.it can be used for sending traffic to sideband vips for external inspection etc. |
| **snat\_ip** string | | Nat'ted floating source ip address(es) for upstream connection to servers. |
| **sp\_pool\_refs** string | | Gslb pools used to manage site-persistence functionality. Each site-persistence pool contains the virtualservices in all the other sites, that is auto-generated by the gslb manager. This is a read-only field for the user. It is a reference to an object of type pool. Field introduced in 17.2.2. |
| **ssl\_key\_and\_certificate\_refs** string | | Select or create one or two certificates, ec and/or rsa, that will be presented to ssl/tls terminated connections. It is a reference to an object of type sslkeyandcertificate. |
| **ssl\_profile\_ref** string | | Determines the set of ssl versions and ciphers to accept for ssl/tls terminated connections. It is a reference to an object of type sslprofile. |
| **ssl\_profile\_selectors** string | | Select ssl profile based on client ip address match. Field introduced in 18.2.3. |
| **ssl\_sess\_cache\_avg\_size** string | | Expected number of ssl session cache entries (may be exceeded). Allowed values are 1024-16383. Default value when not specified in API or module is interpreted by Avi Controller as 1024. |
| **sso\_policy** string | | Client authentication and authorization policy for the virtualservice. Field deprecated in 18.2.3. Field introduced in 18.2.1. |
| **sso\_policy\_ref** string | | The sso policy attached to the virtualservice. It is a reference to an object of type ssopolicy. Field introduced in 18.2.3. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **static\_dns\_records** string | | List of static dns records applied to this virtual service. These are static entries and no health monitoring is performed against the ip addresses. |
| **subnet** string | | Subnet providing reachability for client facing virtual service ip. Field deprecated in 17.1.1. |
| **subnet\_uuid** string | | It represents subnet for the virtual service ip address allocation when auto\_allocate\_ip is true.it is only applicable in openstack or aws cloud. This field is required if auto\_allocate\_ip is true. Field deprecated in 17.1.1. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **topology\_policies** string | | Topology policies applied on the dns traffic of the virtual service based ongslb topology algorithm. Field introduced in 18.2.3. |
| **traffic\_clone\_profile\_ref** string | | Server network or list of servers for cloning traffic. It is a reference to an object of type trafficcloneprofile. Field introduced in 17.1.1. |
| **traffic\_enabled** boolean | **Choices:*** no
* yes
| Knob to enable the virtual service traffic on its assigned service engines. This setting is effective only when the enabled flag is set to true. Field introduced in 17.2.8. Default value when not specified in API or module is interpreted by Avi Controller as True. |
| **type** string | | Specify if this is a normal virtual service, or if it is the parent or child of an sni-enabled virtual hosted virtual service. Enum options - VS\_TYPE\_NORMAL, VS\_TYPE\_VH\_PARENT, VS\_TYPE\_VH\_CHILD. Default value when not specified in API or module is interpreted by Avi Controller as VS\_TYPE\_NORMAL. |
| **url** string | | Avi controller URL of the object. |
| **use\_bridge\_ip\_as\_vip** boolean | **Choices:*** no
* yes
| Use bridge ip as vip on each host in mesos deployments. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **use\_vip\_as\_snat** boolean | **Choices:*** no
* yes
| Use the virtual ip as the snat ip for health monitoring and sending traffic to the backend servers instead of the service engine interface ip. The caveat of enabling this option is that the virtualservice cannot be configued in an active-active ha mode. Dns based multi vip solution has to be used for ha & non-disruptive upgrade purposes. Field introduced in 17.1.9,17.2.3. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Uuid of the virtualservice. |
| **vh\_domain\_name** string | | The exact name requested from the client's sni-enabled tls hello domain name field. If this is a match, the parent vs will forward the connection to this child vs. |
| **vh\_parent\_vs\_uuid** string | | Specifies the virtual service acting as virtual hosting (sni) parent. |
| **vip** string | | List of virtual service ips. While creating a 'shared vs',please use vsvip\_ref to point to the shared entities. Field introduced in 17.1.1. |
| **vrf\_context\_ref** string | | Virtual routing context that the virtual service is bound to. This is used to provide the isolation of the set of networks the application is attached to. It is a reference to an object of type vrfcontext. |
| **vs\_datascripts** string | | Datascripts applied on the data traffic of the virtual service. |
| **vsvip\_cloud\_config\_cksum** string | | Checksum of cloud configuration for vsvip. Internally set by cloud connector. Field introduced in 17.2.9, 18.1.2. |
| **vsvip\_ref** string | | Mostly used during the creation of shared vs, this field refers to entities that can be shared across virtual services. It is a reference to an object of type vsvip. Field introduced in 17.1.1. |
| **waf\_policy\_ref** string | | Waf policy for the virtual service. It is a reference to an object of type wafpolicy. Field introduced in 17.2.1. |
| **weight** string | | The quality of service weight to assign to traffic transmitted from this virtual service. A higher weight will prioritize traffic versus other virtual services sharing the same service engines. Allowed values are 1-128. Default value when not specified in API or module is interpreted by Avi Controller as 1. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Create SSL Virtual Service using Pool testpool2
community.network.avi_virtualservice:
controller: 10.10.27.90
username: admin
password: AviNetworks123!
name: newtestvs
state: present
performance_limits:
max_concurrent_connections: 1000
services:
- port: 443
enable_ssl: true
- port: 80
ssl_profile_ref: '/api/sslprofile?name=System-Standard'
application_profile_ref: '/api/applicationprofile?name=System-Secure-HTTP'
ssl_key_and_certificate_refs:
- '/api/sslkeyandcertificate?name=System-Default-Cert'
ip_address:
addr: 10.90.131.103
type: V4
pool_ref: '/api/pool?name=testpool2'
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | VirtualService (api/virtualservice) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#56312437252239313f707565616d707563646d7075626e6d37203f3833222139243d25707562606d35393b)>
| programming_docs |
ansible community.network.ce_evpn_global – Manages global configuration of EVPN on HUAWEI CloudEngine switches. community.network.ce\_evpn\_global – Manages global configuration of EVPN on HUAWEI CloudEngine switches.
=========================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_evpn_global`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages global configuration of EVPN on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **evpn\_overlay\_enable** string / required | **Choices:*** enable
* disable
| Configure EVPN as the VXLAN control plane. |
Notes
-----
Note
* Before configuring evpn\_overlay\_enable=disable, delete other EVPN configurations.
* Recommended connection is `network_cli`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Evpn global module test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Configure EVPN as the VXLAN control plan
community.network.ce_evpn_global:
evpn_overlay_enable: enable
provider: "{{ cli }}"
- name: Undo EVPN as the VXLAN control plan
community.network.ce_evpn_global:
evpn_overlay_enable: disable
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of end attributes on the interface **Sample:** {'evpn\_overlay\_enable': 'enable'} |
| **existing** dictionary | always | k/v pairs of existing attributes on the device **Sample:** {'evpn\_overlay\_enable': 'disable'} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'evpn\_overlay\_enable': 'enable'} |
| **updates** list / elements=string | always | command list sent to the device **Sample:** ['evpn-overlay enable'] |
### Authors
* Zhijin Zhou (@QijunPan)
ansible community.network.icx_copy – Transfer files from or to remote Ruckus ICX 7000 series switches community.network.icx\_copy – Transfer files from or to remote Ruckus ICX 7000 series switches
==============================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.icx_copy`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module transfers files from or to remote devices running ICX.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **download** string | **Choices:*** running-config
* startup-config
* flash\_primary
* flash\_secondary
* bootrom
* fips-primary-sig
* fips-secondary-sig
* fips-bootrom-sig
| Name of the resource to be downloaded. Mutually exclusive with upload. |
| **protocol** string / required | **Choices:*** scp
* https
| Data transfer protocol to be used |
| **public\_key** string | **Choices:*** rsa
* dsa
| public key type to be used to login to scp server |
| **remote\_filename** string / required | | The name or path of the remote file/resource to be uploaded or downloaded. |
| **remote\_pass** string | | remote password to be used for scp login. |
| **remote\_port** string | | The port number of the remote host. Default values will be selected based on protocol type. Default scp:22, http:443 |
| **remote\_server** string / required | | IP address of the remote server |
| **remote\_user** string | | remote username to be used for scp login. |
| **upload** string | **Choices:*** running-config
* startup-config
* flash\_primary
* flash\_secondary
| Name of the resource to be uploaded. Mutually exclusive with download. |
Notes
-----
Note
* Tested against ICX 10.1.
* For information on using ICX platform, see [the ICX OS Platform Options guide](user_guide/platform_icx).
Examples
--------
```
- name: Upload running-config to the remote scp server
community.network.icx_copy:
upload: running-config
protocol: scp
remote_server: 172.16.10.49
remote_filename: running.conf
remote_user: user1
remote_pass: pass123
- name: Download running-config from the remote scp server
community.network.icx_copy:
download: running-config
protocol: scp
remote_server: 172.16.10.49
remote_filename: running.conf
remote_user: user1
remote_pass: pass123
- name: Download running-config from the remote scp server using rsa public key
community.network.icx_copy:
download: running-config
protocol: scp
remote_server: 172.16.10.49
remote_filename: running.conf
remote_user: user1
remote_pass: pass123
public_key: rsa
- name: Upload startup-config to the remote https server
community.network.icx_copy:
upload: startup-config
protocol: https
remote_server: 172.16.10.49
remote_filename: config/running.conf
remote_user: user1
remote_pass: pass123
- name: Upload startup-config to the remote https server
community.network.icx_copy:
upload: startup-config
protocol: https
remote_server: 172.16.10.49
remote_filename: config/running.conf
remote_user: user1
remote_pass: pass123
- name: Download OS image into the flash from remote scp ipv6 server
community.network.icx_copy:
download: startup-config
protocol: scp
remote_server: ipv6 FE80:CD00:0000:0CDE:1257:0000:211E:729C
remote_filename: img.bin
remote_user: user1
remote_pass: pass123
- name: Download OS image into the secondary flash from remote scp ipv6 server
community.network.icx_copy:
Download: flash_secondary
protocol: scp
remote_server: ipv6 FE80:CD00:0000:0CDE:1257:0000:211E:729C
remote_filename: img.bin
remote_user: user1
remote_pass: pass123
- name: Download OS image into the secondary flash from remote scp ipv6 server on port 5000
community.network.icx_copy:
Download: flash_secondary
protocol: scp
remote_server: ipv6 FE80:CD00:0000:0CDE:1257:0000:211E:729C
remote_port: 5000
remote_filename: img.bin
remote_user: user1
remote_pass: pass123
- name: Download OS image into the primary flash from remote https ipv6 server
community.network.icx_copy:
Download: flash_primary
protocol: https
remote_server: ipv6 FE80:CD00:0000:0CDE:1257:0000:211E:729C
remote_filename: images/img.bin
remote_user: user1
remote_pass: pass123
- name: Download OS image into the primary flash from remote https ipv6 server on port 8080
community.network.icx_copy:
Download: flash_primary
protocol: https
remote_server: ipv6 FE80:CD00:0000:0CDE:1257:0000:211E:729C
remote_port: 8080
remote_filename: images/img.bin
remote_user: user1
remote_pass: pass123
```
Return Values
-------------
Common return 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 when downloaded any configuration or flash. false otherwise. |
### Authors
* Ruckus Wireless (@Commscope)
ansible community.network.cnos_linkagg – Manage link aggregation groups on Lenovo CNOS devices community.network.cnos\_linkagg – Manage link aggregation groups on Lenovo CNOS devices
=======================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.cnos_linkagg`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of link aggregation groups on Lenovo CNOS network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of link aggregation definitions. |
| **group** string | | Channel-group number for the port-channel Link aggregation group. Range 1-255. |
| **members** string | | List of members of the link aggregation group. |
| **mode** string | **Choices:*** active
* on
* passive
| Mode of the link aggregation group. |
| **provider** string | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [CNOS Platform Options guide](user_guide/platform_cnos). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** ←
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string / required | | 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. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** string | **Default:**22 | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** string | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** string | **Default:**10 | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **purge** boolean | **Choices:*** **no** ←
* yes
| Purge links not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** ←
* absent
| State of the link aggregation group. |
Notes
-----
Note
* Tested against CNOS 10.8.1
Examples
--------
```
- name: Create link aggregation group
community.network.cnos_linkagg:
group: 10
state: present
- name: Delete link aggregation group
community.network.cnos_linkagg:
group: 10
state: absent
- name: Set link aggregation group to members
community.network.cnos_linkagg:
group: 200
mode: active
members:
- Ethernet1/33
- Ethernet1/44
- name: Remove link aggregation group from GigabitEthernet0/0
community.network.cnos_linkagg:
group: 200
mode: active
members:
- Ethernet1/33
- name: Create aggregate of linkagg definitions
community.network.cnos_linkagg:
aggregate:
- { group: 3, mode: on, members: [Ethernet1/33] }
- { group: 100, mode: passive, members: [Ethernet1/44] }
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['interface port-channel 30', 'interface Ethernet1/33', 'channel-group 30 mode on', 'no interface port-channel 30'] |
### Authors
* Anil Kumar Muraleedharan (@auraleedhar)
ansible community.network.cnos_bgp – Manage BGP resources and attributes on devices running CNOS community.network.cnos\_bgp – Manage BGP resources and attributes on devices running CNOS
=========================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.cnos_bgp`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module allows you to work with Border Gateway Protocol (BGP) related configurations. The operators used are overloaded to ensure control over switch BGP configurations. This module is invoked using method with asNumber as one of its arguments. The first level of the BGP configuration allows to set up an AS number, with the following attributes going into various configuration operations under the context of BGP. After passing this level, there are eight BGP arguments that will perform further configurations. They are bgpArg1, bgpArg2, bgpArg3, bgpArg4, bgpArg5, bgpArg6, bgpArg7, and bgpArg8. For more details on how to use these arguments, see [Overloaded Variables]. This module uses SSH to manage network device configuration. The results of the operation will be placed in a directory named ‘results’ that must be created by the user in their local directory to where the playbook is run.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **asNum** string / required | | AS number |
| **bgpArg1** string / required | **Choices:*** address-family
* bestpath
* bgp
* cluster-id
* confederation
* enforce-first-as
* fast-external-failover
* graceful-restart
* graceful-restart-helper
* log-neighbor-changes
* maxas-limit
* neighbor
* router-id
* shutdown
* synchronization
* timers
* vrf
| This is an overloaded bgp first argument. Usage of this argument can be found is the User Guide referenced above. |
| **bgpArg2** string | **Choices:*** ipv4 or ipv6
* always-compare-med
* compare-confed-aspath
* compare-routerid
* dont-compare-originator-id
* tie-break-on-age
* as-path
* med
* identifier
* peers
| This is an overloaded bgp second argument. Usage of this argument can be found is the User Guide referenced above. |
| **bgpArg3** string | **Choices:*** aggregate-address
* client-to-client
* dampening
* distance
* maximum-paths
* network
* nexthop
* redistribute
* save
* synchronization
* ignore or multipath-relax
* confed or missing-as-worst or non-deterministic or remove-recv-med or remove-send-med
| This is an overloaded bgp third argument. Usage of this argument can be found is the User Guide referenced above. |
| **bgpArg4** string | **Choices:*** Aggregate prefix
* Reachability Half-life time
* route-map
* Distance for routes ext
* ebgp or ibgp
* IP prefix <network>
* IP prefix <network>/<length>
* synchronization
* Delay value
* direct
* ospf
* static
* memory
| This is an overloaded bgp fourth argument. Usage of this argument can be found is the User Guide referenced above. |
| **bgpArg5** string | **Choices:*** as-set
* summary-only
* Value to start reusing a route
* Distance for routes internal
* Supported multipath numbers
* backdoor
* map
* route-map
| This is an overloaded bgp fifth argument. Usage of this argument can be found is the User Guide referenced above. |
| **bgpArg6** string | **Choices:*** summary-only
* as-set
* route-map name
* Value to start suppressing a route
* Distance local routes
* Network mask
* Pointer to route-map entries
| This is an overloaded bgp sixth argument. Usage of this argument can be found is the User Guide referenced above. |
| **bgpArg7** string | **Choices:*** Maximum duration to suppress a stable route(minutes)
* backdoor
* route-map
* Name of the route map
| This is an overloaded bgp seventh argument. Use of this argument can be found is the User Guide referenced above. |
| **bgpArg8** string | **Choices:*** Un-reachability Half-life time for the penalty(minutes)
* backdoor
| This is an overloaded bgp eight argument. Usage of this argument can be found is the User Guide referenced above. |
| **deviceType** string / required | **Choices:*** g8272\_cnos
* g8296\_cnos
* g8332\_cnos
* NE0152T
* NE1072T
* NE1032
* NE1032T
* NE10032
* NE2572
| This specifies the type of device where the method is executed. The choices NE1072T,NE1032,NE1032T,NE10032,NE2572 are added since Ansible 2.4. The choice NE0152T is added since 2.8 |
| **enablePassword** string | | Configures the password used to enter Global Configuration command mode on the switch. If the switch does not request this password, the parameter is ignored.While generally the value should come from the inventory file, you can also specify it as a variable. This parameter is optional. If it is not specified, no default value will be used. |
| **host** string / required | | This is the variable used to search the hosts file at /etc/ansible/hosts and identify the IP address of the device on which the template is going to be applied. Usually the Ansible keyword {{ inventory\_hostname }} is specified in the playbook as an abstraction of the group of network elements that need to be configured. |
| **outputfile** string / required | | This specifies the file path where the output of each command execution is saved. Each command that is specified in the merged template file and each response from the device are saved here. Usually the location is the results folder, but you can choose another location based on your write permission. |
| **password** string / required | | Configures the password used to authenticate the connection to the remote device. The value of the password parameter is used to authenticate the SSH session. While generally the value should come from the inventory file, you can also specify it as a variable. This parameter is optional. If it is not specified, no default value will be used. |
| **username** string / required | | Configures the username used to authenticate the connection to the remote device. The value of the username parameter is used to authenticate the SSH session. While generally the value should come from the inventory file, you can also specify it as a variable. This parameter is optional. If it is not specified, no default value will be used. |
Notes
-----
Note
* For more information on using Ansible to manage Lenovo Network devices see <https://www.ansible.com/ansible-lenovo>.
Examples
--------
```
Tasks: The following are examples of using the module cnos_bgp. These are
written in the main.yml file of the tasks directory.
---
- name: Test BGP - neighbor
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "neighbor"
bgpArg2: "10.241.107.40"
bgpArg3: 13
bgpArg4: "address-family"
bgpArg5: "ipv4"
bgpArg6: "next-hop-self"
- name: Test BGP - BFD
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "neighbor"
bgpArg2: "10.241.107.40"
bgpArg3: 13
bgpArg4: "bfd"
- name: Test BGP - address-family - dampening
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "address-family"
bgpArg2: "ipv4"
bgpArg3: "dampening"
bgpArg4: 13
bgpArg5: 233
bgpArg6: 333
bgpArg7: 15
bgpArg8: 33
- name: Test BGP - address-family - network
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "address-family"
bgpArg2: "ipv4"
bgpArg3: "network"
bgpArg4: "1.2.3.4/5"
bgpArg5: "backdoor"
- name: Test BGP - bestpath - always-compare-med
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "bestpath"
bgpArg2: "always-compare-med"
- name: Test BGP - bestpath-compare-confed-aspat
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "bestpath"
bgpArg2: "compare-confed-aspath"
- name: Test BGP - bgp
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "bgp"
bgpArg2: 33
- name: Test BGP - cluster-id
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "cluster-id"
bgpArg2: "1.2.3.4"
- name: Test BGP - confederation-identifier
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "confederation"
bgpArg2: "identifier"
bgpArg3: 333
- name: Test BGP - enforce-first-as
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "enforce-first-as"
- name: Test BGP - fast-external-failover
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "fast-external-failover"
- name: Test BGP - graceful-restart
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "graceful-restart"
bgpArg2: 333
- name: Test BGP - graceful-restart-helper
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "graceful-restart-helper"
- name: Test BGP - maxas-limit
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "maxas-limit"
bgpArg2: 333
- name: Test BGP - neighbor
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "neighbor"
bgpArg2: "10.241.107.40"
bgpArg3: 13
bgpArg4: "address-family"
bgpArg5: "ipv4"
bgpArg6: "next-hop-self"
- name: Test BGP - router-id
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "router-id"
bgpArg2: "1.2.3.4"
- name: Test BGP - synchronization
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "synchronization"
- name: Test BGP - timers
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "timers"
bgpArg2: 333
bgpArg3: 3333
- name: Test BGP - vrf
community.network.cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "vrf"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **msg** string | always | Success or failure message. Upon any failure, the method returns an error display string. |
### Authors
* Anil Kumar Muraleedharan (@amuraleedhar)
| programming_docs |
ansible community.network.ig_config – Manage the configuration database on an Ingate SBC. community.network.ig\_config – Manage the configuration database on an Ingate SBC.
==================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ig_config`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage the configuration database on an Ingate SBC.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ingatesdk >= 1.0.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **add** boolean | **Choices:*** no
* yes
| Add a row to a table. |
| **client** string | | A dict object containing connection details. |
| | **address** string / required | | The hostname or IP address to the unit. |
| | **password** string / required | | The password for the REST API user. |
| | **port** integer | | Which HTTP(S) port to connect to. |
| | **scheme** string / required | **Choices:*** http
* https
| Which HTTP protocol to use. |
| | **timeout** integer | | The timeout (in seconds) for REST API requests. |
| | **username** string / required | | The username of the REST API user. |
| | **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| Verify the unit's HTTPS certificate.
aliases: verify\_ssl |
| | **version** string | **Choices:*** **v1** ←
| REST API version. |
| **columns** string | | A dict containing column names/values. |
| **delete** boolean | **Choices:*** no
* yes
| Delete all rows in a table or a specific row. |
| **download** boolean | **Choices:*** no
* yes
| Download the configuration database from the unit. |
| **factory** boolean | **Choices:*** no
* yes
| Reset the preliminary configuration to its factory defaults. |
| **filename** string | | The name of the file to store the downloaded configuration in. Refer to the `download` option. |
| **get** boolean | **Choices:*** no
* yes
| Return all rows in a table or a specific row. |
| **modify** boolean | **Choices:*** no
* yes
| Modify a row in a table. |
| **no\_response** boolean | **Choices:*** **no** ←
* yes
| Expect no response when storing the preliminary configuration. Refer to the `store` option. |
| **path** string | | Where in the filesystem to store the downloaded configuration. Refer to the `download` option. |
| **return\_rowid** boolean | **Choices:*** no
* yes
| Get rowid(s) from a table where the columns match. |
| **revert** boolean | **Choices:*** no
* yes
| Reset the preliminary configuration. |
| **rowid** integer | | A row id. |
| **store** boolean | **Choices:*** no
* yes
| Store the preliminary configuration. |
| **store\_download** boolean | **Choices:*** **no** ←
* yes
| If the downloaded configuration should be stored on disk. Refer to the `download` option. |
| **table** string | | The name of the table. |
Notes
-----
Note
* If `store_download` is set to True, and `path` and `filename` is omitted, the file will be stored in the current directory with an automatic filename.
* This module requires that the Ingate Python SDK is installed on the host. To install the SDK use the pip command from your shell `pip install ingatesdk`.
Examples
--------
```
- name: Add/remove DNS servers
hosts: 192.168.1.1
connection: local
vars:
client_rw:
version: v1
address: "{{ inventory_hostname }}"
scheme: http
username: alice
password: foobar
tasks:
- name: Load factory defaults
community.network.ig_config:
client: "{{ client_rw }}"
factory: true
register: result
- ansible.builtin.debug:
var: result
- name: Revert to last known applied configuration
community.network.ig_config:
client: "{{ client_rw }}"
revert: true
register: result
- ansible.builtin.debug:
var: result
- name: Change the unit name
community.network.ig_config:
client: "{{ client_rw }}"
modify: true
table: misc.unitname
columns:
unitname: "Test Ansible"
register: result
- ansible.builtin.debug:
var: result
- name: Add a DNS server
community.network.ig_config:
client: "{{ client_rw }}"
add: true
table: misc.dns_servers
columns:
server: 192.168.1.21
register: result
- ansible.builtin.debug:
var: result
- name: Add a DNS server
community.network.ig_config:
client: "{{ client_rw }}"
add: true
table: misc.dns_servers
columns:
server: 192.168.1.22
register: result
- ansible.builtin.debug:
var: result
- name: Add a DNS server
community.network.ig_config:
client: "{{ client_rw }}"
add: true
table: misc.dns_servers
columns:
server: 192.168.1.23
register: last_dns
- ansible.builtin.debug:
var: last_dns
- name: Modify the last added DNS server
community.network.ig_config:
client: "{{ client_rw }}"
modify: true
table: misc.dns_servers
rowid: "{{ last_dns['add'][0]['id'] }}"
columns:
server: 192.168.1.24
register: result
- ansible.builtin.debug:
var: result
- name: Return the last added DNS server
community.network.ig_config:
client: "{{ client_rw }}"
get: true
table: misc.dns_servers
rowid: "{{ last_dns['add'][0]['id'] }}"
register: result
- ansible.builtin.debug:
var: result
- name: Remove last added DNS server
community.network.ig_config:
client: "{{ client_rw }}"
delete: true
table: misc.dns_servers
rowid: "{{ last_dns['add'][0]['id'] }}"
register: result
- ansible.builtin.debug:
var: result
- name: Return the all rows from table misc.dns_servers
community.network.ig_config:
client: "{{ client_rw }}"
get: true
table: misc.dns_servers
register: result
- ansible.builtin.debug:
var: result
- name: Remove remaining DNS servers
community.network.ig_config:
client: "{{ client_rw }}"
delete: true
table: misc.dns_servers
register: result
- ansible.builtin.debug:
var: result
- name: Get rowid for interface eth0
community.network.ig_config:
client: "{{ client_rw }}"
return_rowid: true
table: network.local_nets
columns:
interface: eth0
register: result
- ansible.builtin.debug:
var: result
- name: Store the preliminary configuration
community.network.ig_config:
client: "{{ client_rw }}"
store: true
register: result
- ansible.builtin.debug:
var: result
- name: Do backup of the configuration database
community.network.ig_config:
client: "{{ client_rw }}"
download: true
store_download: true
register: result
- ansible.builtin.debug:
var: 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 |
| --- | --- | --- |
| **add** complex | when `add` is yes and success | A list containing information about the added row |
| | **data** complex | success | Column names/values **Sample:** {'number': '2', 'server': '10.48.254.33'} |
| | **href** string | success | The REST API URL to the added row **Sample:** http://192.168.1.1/api/v1/misc/dns\_servers/2 |
| | **id** integer | success | The row id **Sample:** 22 |
| **delete** complex | when `delete` is yes and success | A list containing information about the deleted row(s) |
| | **data** complex | success | Column names/values **Sample:** {'number': '2', 'server': '10.48.254.33'} |
| | **id** integer | success | The row id **Sample:** 22 |
| | **table** string | success | The name of the table **Sample:** misc.dns\_servers |
| **download** complex | when `download` is yes and success | Configuration database and meta data |
| | **config** string | success | The configuration database |
| | **filename** string | success | A suggested name for the configuration **Sample:** testname\_2018-10-01T214040.cfg |
| | **mimetype** string | success | The mimetype **Sample:** application/x-config-database |
| **factory** complex | when `factory` is yes and success | A command status message |
| | **msg** string | success | The command status message **Sample:** reverted the configuration to the factory configuration. |
| **get** complex | when `get` is yes and success | A list containing information about the row(s) |
| | **data** complex | success | Column names/values **Sample:** {'number': '2', 'server': '10.48.254.33'} |
| | **href** string | success | The REST API URL to the row **Sample:** http://192.168.1.1/api/v1/misc/dns\_servers/1 |
| | **id** integer | success | The row id **Sample:** 1 |
| | **table** string | success | The name of the table **Sample:** Testname |
| **modify** complex | when `modify` is yes and success | A list containing information about the modified row |
| | **data** complex | success | Column names/values **Sample:** {'number': '2', 'server': '10.48.254.33'} |
| | **href** string | success | The REST API URL to the modified row **Sample:** http://192.168.1.1/api/v1/misc/dns\_servers/1 |
| | **id** integer | success | The row id **Sample:** 10 |
| | **table** string | success | The name of the table **Sample:** Testname |
| **return\_rowid** list / elements=string | when `return_rowid` is yes and success | The matched row id(s). **Sample:** [1, 3] |
| **revert** complex | when `revert` is yes and success | A command status message |
| | **msg** string | success | The command status message **Sample:** reverted the configuration to the last applied configuration. |
| **store** complex | when `store` is yes and success | A command status message |
| | **msg** string | success | The command status message **Sample:** Successfully applied and saved the configuration. |
### Authors
* Ingate Systems AB (@ingatesystems)
ansible community.network.ce_ip_interface – Manages L3 attributes for IPv4 and IPv6 interfaces on HUAWEI CloudEngine switches. community.network.ce\_ip\_interface – Manages L3 attributes for IPv4 and IPv6 interfaces on HUAWEI CloudEngine switches.
========================================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_ip_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages Layer 3 attributes for IPv4 and IPv6 interfaces on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **addr** string | | IPv4 or IPv6 Address. |
| **interface** string / required | | Full name of interface, i.e. 40GE1/0/22, vlanif10. |
| **ipv4\_type** string | **Choices:*** **main** ←
* sub
| Specifies an address type. The value is an enumerated type. main, primary IP address. sub, secondary IP address. |
| **mask** string | | Subnet mask for IPv4 or IPv6 Address in decimal format. |
| **state** string | **Choices:*** **present** ←
* absent
| Specify desired state of the resource. |
| **version** string | **Choices:*** **v4** ←
* v6
| IP address version. |
Notes
-----
Note
* Interface must already be a L3 port when using this module.
* Logical interfaces (loopback, vlanif) must be created first.
* `mask` must be inserted in decimal format (i.e. 24) for both IPv6 and IPv4.
* A single interface can have multiple IPv6 configured.
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Ip_interface module test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Ensure ipv4 address is configured on 10GE1/0/22
community.network.ce_ip_interface:
interface: 10GE1/0/22
version: v4
state: present
addr: 20.20.20.20
mask: 24
provider: '{{ cli }}'
- name: Ensure ipv4 secondary address is configured on 10GE1/0/22
community.network.ce_ip_interface:
interface: 10GE1/0/22
version: v4
state: present
addr: 30.30.30.30
mask: 24
ipv4_type: sub
provider: '{{ cli }}'
- name: Ensure ipv6 is enabled on 10GE1/0/22
community.network.ce_ip_interface:
interface: 10GE1/0/22
version: v6
state: present
provider: '{{ cli }}'
- name: Ensure ipv6 address is configured on 10GE1/0/22
community.network.ce_ip_interface:
interface: 10GE1/0/22
version: v6
state: present
addr: 2001::db8:800:200c:cccb
mask: 64
provider: '{{ cli }}'
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of IP attributes after module execution **Sample:** {'interface': '10GE1/0/22', 'ipv4': [{'addrType': 'main', 'ifIpAddr': '20.20.20.20', 'subnetMask': '255.255.255.0'}]} |
| **existing** dictionary | always | k/v pairs of existing IP attributes on the interface **Sample:** {'interface': '10GE1/0/22', 'ipv4': [{'addrType': 'main', 'ifIpAddr': '11.11.11.11', 'subnetMask': '255.255.0.0'}]} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'addr': '20.20.20.20', 'interface': '10GE1/0/22', 'mask': '24'} |
| **updates** list / elements=string | always | commands sent to the device **Sample:** ['interface 10GE1/0/22', 'ip address 20.20.20.20 24'] |
### Authors
* QijunPan (@QijunPan)
ansible community.network.ce_acl – Manages base ACL configuration on HUAWEI CloudEngine switches. community.network.ce\_acl – Manages base ACL configuration on HUAWEI CloudEngine switches.
==========================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_acl`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages base ACL configurations on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **acl\_description** string | | ACL description. The value is a string of 1 to 127 characters. |
| **acl\_name** string / required | | ACL number or name. For a numbered rule group, the value ranging from 2000 to 2999 indicates a basic ACL. For a named rule group, the value is a string of 1 to 32 case-sensitive characters starting with a letter, spaces not supported. |
| **acl\_num** string | | ACL number. The value is an integer ranging from 2000 to 2999. |
| **acl\_step** string | | ACL step. The value is an integer ranging from 1 to 20. The default value is 5. |
| **frag\_type** string | **Choices:*** fragment
* clear\_fragment
| Type of packet fragmentation. |
| **log\_flag** boolean | **Choices:*** **no** ←
* yes
| Flag of logging matched data packets. |
| **rule\_action** string | **Choices:*** permit
* deny
| Matching mode of basic ACL rules. |
| **rule\_description** string | | Description about an ACL rule. The value is a string of 1 to 127 characters. |
| **rule\_id** string | | ID of a basic ACL rule in configuration mode. The value is an integer ranging from 0 to 4294967294. |
| **rule\_name** string | | Name of a basic ACL rule. The value is a string of 1 to 32 characters. The value is case-insensitive, and cannot contain spaces or begin with an underscore (\_). |
| **source\_ip** string | | Source IP address. The value is a string of 0 to 255 characters.The default value is 0.0.0.0. The value is in dotted decimal notation. |
| **src\_mask** string | | Mask of a source IP address. The value is an integer ranging from 1 to 32. |
| **state** string | **Choices:*** **present** ←
* absent
* delete\_acl
| Specify desired state of the resource. |
| **time\_range** string | | Name of a time range in which an ACL rule takes effect. The value is a string of 1 to 32 characters. The value is case-insensitive, and cannot contain spaces. The name must start with an uppercase or lowercase letter. In addition, the word "all" cannot be specified as a time range name. |
| **vrf\_name** string | | VPN instance name. The value is a string of 1 to 31 characters.The default value is \_public\_. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: CloudEngine acl test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Config ACL"
community.network.ce_acl:
state: present
acl_name: 2200
provider: "{{ cli }}"
- name: "Undo ACL"
community.network.ce_acl:
state: delete_acl
acl_name: 2200
provider: "{{ cli }}"
- name: "Config ACL base rule"
community.network.ce_acl:
state: present
acl_name: 2200
rule_name: test_rule
rule_id: 111
rule_action: permit
source_ip: 10.10.10.10
src_mask: 24
frag_type: fragment
time_range: wdz_acl_time
provider: "{{ cli }}"
- name: "undo ACL base rule"
community.network.ce_acl:
state: absent
acl_name: 2200
rule_name: test_rule
rule_id: 111
rule_action: permit
source_ip: 10.10.10.10
src_mask: 24
frag_type: fragment
time_range: wdz_acl_time
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of aaa params after module execution |
| **existing** dictionary | always | k/v pairs of existing aaa server **Sample:** {'aclNumOrName': 'test', 'aclType': 'Basic'} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'acl\_name': 'test', 'state': 'delete\_acl'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** ['undo acl name test'] |
### Authors
* wangdezhuang (@QijunPan)
| programming_docs |
ansible community.network.ce_is_is_instance – Manages isis process id configuration on HUAWEI CloudEngine devices. community.network.ce\_is\_is\_instance – Manages isis process id configuration on HUAWEI CloudEngine devices.
=============================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_is_is_instance`.
New in version 0.2.0: of community.network
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages isis process id, creates a isis instance id or deletes a process id on HUAWEI CloudEngine devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **instance\_id** integer / required | | Specifies the id of a isis process.The value is a number of 1 to 4294967295. |
| **state** string | **Choices:*** **present** ←
* absent
| Determines whether the config should be present or not on the device. |
| **vpn\_name** string | | VPN Instance, associate the VPN instance with the corresponding IS-IS process. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* This module works with connection `netconf`.
Examples
--------
```
- name: Set isis process
community.network.ce_is_is_instance:
instance_id: 3
state: present
- name: Unset isis process
community.network.ce_is_is_instance:
instance_id: 3
state: absent
- name: Check isis process
community.network.ce_is_is_instance:
instance_id: 4294967296
state: present
- name: Set vpn name
community.network.ce_is_is_instance:
instance_id: 22
vpn_name: vpn1
state: present
- name: Check vpn name
community.network.ce_is_is_instance:
instance_id: 22
vpn_name: vpn1234567896321452212221556asdasdasdasdsadvdv
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 |
| --- | --- | --- |
| **changed** boolean | always | check to see if a change was made on the device **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of configuration after module execution **Sample:** {'session': {'instance\_id': 1, 'vpn\_name': None}} |
| **existing** dictionary | always | k/v pairs of existing configuration **Sample:** {'session': {}} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'instance\_id': 1, 'vpn\_name': None} |
| **updates** list / elements=string | always | commands sent to the device **Sample:** ['isis 1'] |
### Authors
* xuxiaowei0512 (@CloudEngine-Ansible)
ansible community.network.pn_dhcp_filter – CLI command to create/modify/delete dhcp-filter community.network.pn\_dhcp\_filter – CLI command to create/modify/delete dhcp-filter
====================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_dhcp_filter`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to create, delete and modify a DHCP filter config.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_name** string | | name of the DHCP filter. |
| **pn\_trusted\_ports** string | | trusted ports of dhcp config. |
| **state** string / required | **Choices:*** present
* absent
* update
| State the action to perform. Use `present` to create dhcp-filter and `absent` to delete dhcp-filter `update` to modify the dhcp-filter. |
Examples
--------
```
- name: Dhcp filter create
community.network.pn_dhcp_filter:
pn_cliswitch: "sw01"
pn_name: "foo"
state: "present"
pn_trusted_ports: "1"
- name: Dhcp filter delete
community.network.pn_dhcp_filter:
pn_cliswitch: "sw01"
pn_name: "foo"
state: "absent"
pn_trusted_ports: "1"
- name: Dhcp filter modify
community.network.pn_dhcp_filter:
pn_cliswitch: "sw01"
pn_name: "foo"
state: "update"
pn_trusted_ports: "1,2"
```
Return Values
-------------
Common return 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 | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the dhcp-filter command. |
| **stdout** list / elements=string | always | set of responses from the dhcp-filter command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
ansible community.network.avi_backup – Module for setup of Backup Avi RESTful Object community.network.avi\_backup – Module for setup of Backup Avi RESTful Object
=============================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_backup`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure Backup object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **backup\_config\_ref** string | | Backupconfiguration information. It is a reference to an object of type backupconfiguration. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **file\_name** string / required | | The file name of backup. |
| **local\_file\_url** string | | Url to download the backup file. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **remote\_file\_url** string | | Url to download the backup file. |
| **scheduler\_ref** string | | Scheduler information. It is a reference to an object of type scheduler. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **timestamp** string | | Unix timestamp of when the backup file is created. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Unique object identifier of the object. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create Backup object
community.network.avi_backup:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_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 |
| --- | --- | --- |
| **obj** dictionary | success, changed | Backup (api/backup) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#d3b4a1b2a0a7bcb4baf5f0e0e4e8f5f0e6e1e8f5f0e7ebe8b2a5babdb6a7a4bca1b8a0f5f0e7e5e8b0bcbe)>
ansible community.network.ce_multicast_global – Manages multicast global configuration on HUAWEI CloudEngine switches. community.network.ce\_multicast\_global – Manages multicast global configuration on HUAWEI CloudEngine switches.
================================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_multicast_global`.
New in version 0.2.0: of community.network
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages multicast global on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aftype** string / required | **Choices:*** v4
* v6
| Destination ip address family type of static route. |
| **state** string | **Choices:*** **present** ←
* absent
| Specify desired state of the resource. |
| **vrf** string | | VPN instance of destination ip address. |
Notes
-----
Note
* If no vrf is supplied, vrf is set to default.
* If *state=absent*, the route will be removed, regardless of the non-required parameters.
* This module requires the netconf system service be enabled on the remote device being managed.
* This module works with connection `netconf`.
Examples
--------
```
---
- name: Multicast routing-enable
community.network.ce_multicast_global:
aftype: v4
state: absent
provider: "{{ cli }}"
- name: Multicast routing-enable
community.network.ce_multicast_global:
aftype: v4
state: present
provider: "{{ cli }}"
- name: Multicast routing-enable
community.network.ce_multicast_global:
aftype: v4
vrf: vrf1
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of switchport after module execution **Sample:** {'addressFamily': 'ipv4unicast', 'state': 'present', 'vrfName': '\_public\_'} |
| **existing** dictionary | always | k/v pairs of existing switchport |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'addressFamily': 'ipv4unicast', 'state': 'present', 'vrfName': '\_public\_'} |
| **updates** list / elements=string | always | command list sent to the device **Sample:** ['multicast routing-enable'] |
### Authors
* xuxiaowei0512 (@xuxiaowei0512)
ansible community.network.vdirect_file – Uploads a new or updates an existing runnable file into Radware vDirect server community.network.vdirect\_file – Uploads a new or updates an existing runnable file into Radware vDirect server
================================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.vdirect_file`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Uploads a new or updates an existing configuration template or workflow template into the Radware vDirect server. All parameters may be set as environment variables.
Requirements
------------
The below requirements are needed on the host that executes this module.
* vdirect-client >= 4.9.0-post4
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **file\_name** string / required | | vDirect runnable file name to be uploaded. May be velocity configuration template (.vm) or workflow template zip file (.zip). |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `no`, SSL certificates will not be validated, may be set as VDIRECT\_VALIDATE\_CERTS or VDIRECT\_VERIFY environment variable. This should only set to `no` used on personally controlled sites using self-signed certificates.
aliases: vdirect\_validate\_certs |
| **vdirect\_http\_port** string | **Default:**2188 | vDirect server HTTP port number, may be set as VDIRECT\_HTTP\_PORT environment variable. |
| **vdirect\_https\_port** string | **Default:**2189 | vDirect server HTTPS port number, may be set as VDIRECT\_HTTPS\_PORT environment variable. |
| **vdirect\_ip** string / required | | Primary vDirect server IP address, may be set as VDIRECT\_IP environment variable. |
| **vdirect\_password** string / required | | vDirect server password, may be set as VDIRECT\_PASSWORD environment variable. |
| **vdirect\_secondary\_ip** string | | Secondary vDirect server IP address, may be set as VDIRECT\_SECONDARY\_IP environment variable. |
| **vdirect\_timeout** string | **Default:**60 | Amount of time to wait for async operation completion [seconds], may be set as VDIRECT\_TIMEOUT environment variable. |
| **vdirect\_use\_ssl** boolean | **Choices:*** no
* **yes** ←
| If `no`, an HTTP connection will be used instead of the default HTTPS connection, may be set as VDIRECT\_HTTPS or VDIRECT\_USE\_SSL environment variable. |
| **vdirect\_user** string / required | | vDirect server username, may be set as VDIRECT\_USER environment variable. |
| **vdirect\_wait** boolean | **Choices:*** no
* **yes** ←
| Wait for async operation to complete, may be set as VDIRECT\_WAIT environment variable. |
Notes
-----
Note
* Requires the Radware vdirect-client Python package on the host. This is as easy as `pip install vdirect-client`
Examples
--------
```
- name: Upload a new or updates an existing runnable file
community.network.vdirect_file:
vdirect_ip: 10.10.10.10
vdirect_user: vDirect
vdirect_password: radware
file_name: /tmp/get_vlans.vm
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **result** string | success | Message detailing upload result **Sample:** Workflow template created |
### Authors
* Evgeny Fedoruk @ Radware LTD (@evgenyfedoruk)
ansible community.network.cnos_save – Save the running configuration as the startup configuration on devices running Lenovo CNOS community.network.cnos\_save – Save the running configuration as the startup configuration on devices running Lenovo CNOS
=========================================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.cnos_save`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module allows you to copy the running configuration of a switch over its startup configuration. It is recommended to use this module shortly after any major configuration changes so they persist after a switch restart. This module uses SSH to manage network device configuration. The results of the operation will be placed in a directory named ‘results’ that must be created by the user in their local directory to where the playbook is run.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **deviceType** string / required | **Choices:*** g8272\_cnos
* g8296\_cnos
* g8332\_cnos
* NE0152T
* NE1072T
* NE1032
* NE1032T
* NE10032
* NE2572
| This specifies the type of device where the method is executed. The choices NE1072T,NE1032,NE1032T,NE10032,NE2572 are added since Ansible 2.4. The choice NE0152T is added since 2.8 |
| **enablePassword** string | | Configures the password used to enter Global Configuration command mode on the switch. If the switch does not request this password, the parameter is ignored.While generally the value should come from the inventory file, you can also specify it as a variable. This parameter is optional. If it is not specified, no default value will be used. |
| **host** string / required | | This is the variable used to search the hosts file at /etc/ansible/hosts and identify the IP address of the device on which the template is going to be applied. Usually the Ansible keyword {{ inventory\_hostname }} is specified in the playbook as an abstraction of the group of network elements that need to be configured. |
| **outputfile** string / required | | This specifies the file path where the output of each command execution is saved. Each command that is specified in the merged template file and each response from the device are saved here. Usually the location is the results folder, but you can choose another location based on your write permission. |
| **password** string / required | | Configures the password used to authenticate the connection to the remote device. The value of the password parameter is used to authenticate the SSH session. While generally the value should come from the inventory file, you can also specify it as a variable. This parameter is optional. If it is not specified, no default value will be used. |
| **username** string / required | | Configures the username used to authenticate the connection to the remote device. The value of the username parameter is used to authenticate the SSH session. While generally the value should come from the inventory file, you can also specify it as a variable. This parameter is optional. If it is not specified, no default value will be used. |
Notes
-----
Note
* For more information on using Ansible to manage Lenovo Network devices see <https://www.ansible.com/ansible-lenovo>.
Examples
--------
```
Tasks : The following are examples of using the module cnos_save. These are
written in the main.yml file of the tasks directory.
---
- name: Test Save
community.network.cnos_save:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_save_{{ inventory_hostname }}_output.txt"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **msg** string | always | Success or failure message **Sample:** Switch Running Config is Saved to Startup Config |
### Authors
* Anil Kumar Muraleedharan (@amuraleedhar)
| programming_docs |
ansible community.network.avi_useraccountprofile – Module for setup of UserAccountProfile Avi RESTful Object community.network.avi\_useraccountprofile – Module for setup of UserAccountProfile Avi RESTful Object
=====================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_useraccountprofile`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure UserAccountProfile object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **account\_lock\_timeout** string | | Lock timeout period (in minutes). Default is 30 minutes. Default value when not specified in API or module is interpreted by Avi Controller as 30. |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **credentials\_timeout\_threshold** string | | The time period after which credentials expire. Default is 180 days. Default value when not specified in API or module is interpreted by Avi Controller as 180. |
| **max\_concurrent\_sessions** string | | Maximum number of concurrent sessions allowed. There are unlimited sessions by default. Default value when not specified in API or module is interpreted by Avi Controller as 0. |
| **max\_login\_failure\_count** string | | Number of login attempts before lockout. Default is 3 attempts. Default value when not specified in API or module is interpreted by Avi Controller as 3. |
| **max\_password\_history\_count** string | | Maximum number of passwords to be maintained in the password history. Default is 4 passwords. Default value when not specified in API or module is interpreted by Avi Controller as 4. |
| **name** string / required | | Name of the object. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Unique object identifier of the object. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create UserAccountProfile object
community.network.avi_useraccountprofile:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_useraccountprofile
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | UserAccountProfile (api/useraccountprofile) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#e384918290978c848ac5c0d0d4d8c5c0d6d1d8c5c0d7dbd882958a8d8697948c918890c5c0d7d5d8808c8e)>
ansible community.network.exos_vlans – Manage VLANs on Extreme Networks EXOS devices. community.network.exos\_vlans – Manage VLANs on Extreme Networks EXOS devices.
==============================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.exos_vlans`.
New in version 0.2.0: of community.network
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of VLANs on Extreme Networks EXOS network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A dictionary of VLANs options |
| | **name** string | | Ascii name of the VLAN. |
| | **state** string | **Choices:*** **active** ←
* suspend
| Operational state of the VLAN |
| | **vlan\_id** integer / required | | ID of the VLAN. Range 1-4094 |
| **state** string | **Choices:*** **merged** ←
* replaced
* overridden
* deleted
| The state the configuration should be left in |
Notes
-----
Note
* Tested against EXOS 30.2.1.8
* This module works with connection `httpapi`. See [EXOS Platform Options](user_guide/platform_exos)
Examples
--------
```
# Using deleted
# Before state:
# -------------
#
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
# "openconfig-vlan:vlans": {
# "vlan": [
# {
# "config": {
# "name": "Default",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 1
# },
# },
# {
# "config": {
# "name": "vlan_10",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 10
# },
# },
# {
# "config": {
# "name": "vlan_20",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 20
# },
# },
# {
# "config": {
# "name": "vlan_30",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 30
# },
# }
# ]
# }
# }
- name: Delete attributes of given VLANs
community.network.exos_vlans:
config:
- vlan_id: 10
- vlan_id: 20
- vlan_id: 30
state: deleted
# Module Execution Results:
# -------------------------
#
# "after": [
# {
# "name": "Default",
# "state": "active",
# "vlan_id": 1
# }
# ],
#
# "before": [
# {
# "name": "Default",
# "state": "active",
# "vlan_id": 1
# },
# {
# "name": "vlan_10",
# "state": "active",
# "vlan_id": 10
# },
# {
# "name": "vlan_20",
# "state": "active",
# "vlan_id": 20
# }
# {
# "name": "vlan_30",
# "state": "active",
# "vlan_id": 30
# }
# ],
#
# "requests": [
# {
# "data": null,
# "method": "DELETE",
# "path": "/rest/restconf/data/openconfig-vlan:vlans/vlan=10"
# },
# {
# "data": null,
# "method": "DELETE",
# "path": "/rest/restconf/data/openconfig-vlan:vlans/vlan=20"
# },
# {
# "data": null,
# "method": "DELETE",
# "path": "/rest/restconf/data/openconfig-vlan:vlans/vlan=30"
# }
# ]
#
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
# "openconfig-vlan:vlans": {
# "vlan": [
# {
# "config": {
# "name": "Default",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 1
# },
# }
# ]
# }
# }
# Using merged
# Before state:
# -------------
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
# "openconfig-vlan:vlans": {
# "vlan": [
# {
# "config": {
# "name": "Default",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 1
# },
# }
# ]
# }
# }
- name: Merge provided configuration with device configuration
community.network.exos_vlans:
config:
- name: vlan_10
vlan_id: 10
state: active
- name: vlan_20
vlan_id: 20
state: active
- name: vlan_30
vlan_id: 30
state: active
state: merged
# Module Execution Results:
# -------------------------
#
# "after": [
# {
# "name": "Default",
# "state": "active",
# "vlan_id": 1
# },
# {
# "name": "vlan_10",
# "state": "active",
# "vlan_id": 10
# },
# {
# "name": "vlan_20",
# "state": "active",
# "vlan_id": 20
# },
# {
# "name": "vlan_30",
# "state": "active",
# "vlan_id": 30
# }
# ],
#
# "before": [
# {
# "name": "Default",
# "state": "active",
# "vlan_id": 1
# }
# ],
#
# "requests": [
# {
# "data": {
# "openconfig-vlan:vlan": [
# {
# "config": {
# "name": "vlan_10",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 10
# }
# }
# ]
# },
# "method": "POST",
# "path": "/rest/restconf/data/openconfig-vlan:vlans/"
# },
# {
# "data": {
# "openconfig-vlan:vlan": [
# {
# "config": {
# "name": "vlan_20",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 20
# }
# }
# ]
# },
# "method": "POST",
# "path": "/rest/restconf/data/openconfig-vlan:vlans/"
# },
# "data": {
# "openconfig-vlan:vlan": [
# {
# "config": {
# "name": "vlan_30",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 30
# }
# }
# ]
# },
# "method": "POST",
# "path": "/rest/restconf/data/openconfig-vlan:vlans/"
# }
# ]
#
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
# "openconfig-vlan:vlans": {
# "vlan": [
# {
# "config": {
# "name": "Default",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 1
# },
# },
# {
# "config": {
# "name": "vlan_10",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 10
# },
# },
# {
# "config": {
# "name": "vlan_20",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 20
# },
# },
# {
# "config": {
# "name": "vlan_30",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 30
# },
# }
# ]
# }
# }
# Using overridden
# Before state:
# -------------
#
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
# "openconfig-vlan:vlans": {
# "vlan": [
# {
# "config": {
# "name": "Default",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 1
# },
# },
# {
# "config": {
# "name": "vlan_10",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 10
# },
# },
# {
# "config": {
# "name": "vlan_20",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 20
# },
# },
# {
# "config": {
# "name": "vlan_30",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 30
# },
# }
# ]
# }
# }
- name: Override device configuration of all VLANs with provided configuration
community.network.exos_vlans:
config:
- name: TEST_VLAN10
vlan_id: 10
state: overridden
# Module Execution Results:
# -------------------------
#
# "after": [
# {
# "name": "Default",
# "state": "active",
# "vlan_id": 1
# },
# {
# "name": "TEST_VLAN10",
# "state": "active",
# "vlan_id": 10
# },
# ],
#
# "before": [
# {
# "name": "Default",
# "state": "active",
# "vlan_id": 1
# },
# {
# "name": "vlan_10",
# "state": "active",
# "vlan_id": 10
# },
# {
# "name": "vlan_20",
# "state": "active",
# "vlan_id": 20
# },
# {
# "name": "vlan_30",
# "state": "active",
# "vlan_id": 30
# }
# ],
#
# "requests": [
# {
# "data": {
# "openconfig-vlan:vlan": {
# "vlan": [
# {
# "config": {
# "name": "TEST_VLAN10",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 10
# }
# }
# ]
# }
# }
# },
# "method": "PATCH",
# "path": "/rest/restconf/data/openconfig-vlan:vlans/"
# },
# {
# "data": null,
# "method": "DELETE",
# "path": "/rest/restconf/data/openconfig-vlan:vlans/vlan=20"
# },
# {
# "data": null,
# "method": "DELETE",
# "path": "/rest/restconf/data/openconfig-vlan:vlans/vlan=30"
# }
# ]
#
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
# "openconfig-vlan:vlans": {
# "vlan": [
# {
# "config": {
# "name": "Default",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 1
# },
# },
# {
# "config": {
# "name": "TEST_VLAN10",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 10
# },
# }
# ]
# }
# }
# Using replaced
# Before state:
# -------------
#
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
# "openconfig-vlan:vlans": {
# "vlan": [
# {
# "config": {
# "name": "Default",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 1
# },
# },
# {
# "config": {
# "name": "vlan_10",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 10
# },
# },
# {
# "config": {
# "name": "vlan_20",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 20
# },
# },
# {
# "config": {
# "name": "vlan_30",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 30
# },
# }
# ]
# }
# }
- name: Replaces device configuration of listed VLANs with provided configuration
community.network.exos_vlans:
config:
- name: Test_VLAN20
vlan_id: 20
- name: Test_VLAN30
vlan_id: 30
state: replaced
# Module Execution Results:
# -------------------------
#
# "after": [
# {
# "name": "Default",
# "state": "active",
# "vlan_id": 1
# },
# {
# "name": "vlan_10",
# "state": "active",
# "vlan_id": 10
# },
# {
# "name": "TEST_VLAN20",
# "state": "active",
# "vlan_id": 20
# },
# {
# "name": "TEST_VLAN30",
# "state": "active",
# "vlan_id": 30
# }
# ],
#
# "before": [
# {
# "name": "Default",
# "state": "active",
# "vlan_id": 1
# },
# {
# "name": "vlan_10",
# "state": "active",
# "vlan_id": 10
# },
# {
# "name": "vlan_20",
# "state": "active",
# "vlan_id": 20
# },
# {
# "name": "vlan_30",
# "state": "active",
# "vlan_id": 30
# }
# ],
#
# "requests": [
# {
# "data": {
# "openconfig-vlan:vlan": {
# "vlan": [
# {
# "config": {
# "name": "TEST_VLAN20",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 20
# }
# "config": {
# "name": "TEST_VLAN30",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 30
# }
# }
# ]
# },
# "method": "PATCH",
# "path": "/rest/restconf/data/openconfig-vlan:vlans/"
# }
# ]
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
# "openconfig-vlan:vlans": {
# "vlan": [
# {
# "config": {
# "name": "Default",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 1
# },
# },
# {
# "config": {
# "name": "vlan_10",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 10
# },
# },
# {
# "config": {
# "name": "TEST_VLAN20",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 20
# },
# },
# {
# "config": {
# "name": "TEST_VLAN30",
# "status": "ACTIVE",
# "tpid": "oc-vlan-types:TPID_0x8100",
# "vlan-id": 30
# },
# }
# ]
# }
# }
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The resulting configuration model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration prior to the model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **requests** list / elements=string | always | The set of requests pushed to the remote device. **Sample:** [{'data': '...', 'method': '...', 'path': '...'}, {'data': '...', 'method': '...', 'path': '...'}, {'data': '...', 'method': '...', 'path': '...'}] |
### Authors
* Jayalakshmi Viswanathan (@jayalakshmiV)
| programming_docs |
ansible community.network.ce_vrf – Manages VPN instance on HUAWEI CloudEngine switches. community.network.ce\_vrf – Manages VPN instance on HUAWEI CloudEngine switches.
================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_vrf`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages VPN instance of HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **description** string | | Description of the vrf, the string length is 1 - 242 . |
| **state** string | **Choices:*** **present** ←
* absent
| Manage the state of the resource. |
| **vrf** string / required | | VPN instance, the length of vrf name is 1 - 31, i.e. "test", but can not be `_public_`. |
Notes
-----
Note
* If *state=absent*, the route will be removed, regardless of the non-required options.
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Vrf module test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Config a vpn install named vpna, description is test
community.network.ce_vrf:
vrf: vpna
description: test
state: present
provider: "{{ cli }}"
- name: Delete a vpn install named vpna
community.network.ce_vrf:
vrf: vpna
state: absent
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of switchport after module execution **Sample:** {'description': 'test', 'present': 'present', 'vrf': 'vpna'} |
| **existing** dictionary | always | k/v pairs of existing switchport |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'description': 'test', 'state': 'present', 'vrf': 'vpna'} |
| **updates** list / elements=string | always | command list sent to the device **Sample:** ['ip vpn-instance vpna', 'description test'] |
### Authors
* Yang yang (@QijunPan)
ansible community.network.nuage_vspk – Manage Nuage VSP environments community.network.nuage\_vspk – Manage Nuage VSP environments
=============================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.nuage_vspk`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage or find Nuage VSP entities, this includes create, update, delete, assign, unassign and find, with all supported properties.
Requirements
------------
The below requirements are needed on the host that executes this module.
* Python 2.7
* Supports Nuage VSP 4.0Rx & 5.x.y
* Proper VSPK-Python installed for your Nuage version
* Tested with NuageX <https://nuagex.io>
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth** string / required | | Dict with the authentication information required to connect to a Nuage VSP environment. Requires a *api\_username* parameter (example csproot). Requires either a *api\_password* parameter (example csproot) or a *api\_certificate* and *api\_key* parameters, which point to the certificate and key files for certificate based authentication. Requires a *api\_enterprise* parameter (example csp). Requires a *api\_url* parameter (example https://10.0.0.10:8443). Requires a *api\_version* parameter (example v4\_0). |
| **children** string | | Can be used to specify a set of child entities. A mandatory property of each child is the *type*. Supported optional properties of each child are *id*, *properties* and *match\_filter*. The function of each of these properties is the same as in the general task definition. This can be used recursively Only useable in case *state=present*. |
| **command** string | **Choices:*** find
* change\_password
* wait\_for\_job
* get\_csp\_enterprise
| Specifies a command to be executed. With *command=find*, if *parent\_id* and *parent\_type* are defined, it will only search within the parent. Otherwise, if allowed, will search in the root object. With *command=find*, if *id* is specified, it will only return the single entity matching the id. With *command=find*, otherwise, if *match\_filter* is define, it will use that filter to search. With *command=find*, otherwise, if *properties* are defined, it will do an AND search using all properties. With *command=change\_password*, a password of a user can be changed. Warning - In case the password is the same as the existing, it will throw an error. With *command=wait\_for\_job*, the module will wait for a job to either have a status of SUCCESS or ERROR. In case an ERROR status is found, the module will exit with an error. With *command=wait\_for\_job*, the job will always be returned, even if the state is ERROR situation. Either *state* or *command* needs to be defined, both can not be defined at the same time. |
| **id** string | | The ID of the entity you want to work on. In combination with *command=find*, it will only return the single entity. In combination with *state*, it will either update or delete this entity. Will take precedence over *match\_filter* and *properties* whenever an entity needs to be found. |
| **match\_filter** string | | A filter used when looking (both in *command* and *state* for entities, in the format the Nuage VSP API expects. If *match\_filter* is defined, it will take precedence over the *properties*, but not on the *id*
|
| **parent\_id** string | | The ID of the parent of the entity you want to work on. When *state* is specified, the entity will be gathered from this parent, if it exists, unless an *id* is specified. When *command=find* is specified, the entity will be searched for in this parent, unless an *id* is specified. If specified, *parent\_type* also needs to be specified. |
| **parent\_type** string | | The type of parent the ID is specified for (example Enterprise). This should match the objects CamelCase class name in VSPK-Python. This Class name can be found on <https://nuagenetworks.github.io/vspkdoc/index.html>. If specified, *parent\_id* also needs to be specified. |
| **properties** string | | Properties are the key, value pairs of the different properties an entity has. If no *id* and no *match\_filter* is specified, these are used to find or determine if the entity exists. |
| **state** string | **Choices:*** present
* absent
| Specifies the desired state of the entity. If *state=present*, in case the entity already exists, will update the entity if it is needed. If *state=present*, in case the relationship with the parent is a member relationship, will assign the entity as a member of the parent. If *state=absent*, in case the relationship with the parent is a member relationship, will unassign the entity as a member of the parent. Either *state* or *command* needs to be defined, both can not be defined at the same time. |
| **type** string / required | | The type of entity you want to work on (example Enterprise). This should match the objects CamelCase class name in VSPK-Python. This Class name can be found on <https://nuagenetworks.github.io/vspkdoc/index.html>. |
Notes
-----
Note
* Check mode is supported, but with some caveats. It will not do any changes, and if possible try to determine if it is able do what is requested.
* In case a parent id is provided from a previous task, it might be empty and if a search is possible on root, it will do so, which can impact performance.
Examples
--------
```
# This can be executed as a single role, with the following vars
# vars:
# auth:
# api_username: csproot
# api_password: csproot
# api_enterprise: csp
# api_url: https://10.0.0.10:8443
# api_version: v5_0
# enterprise_name: Ansible-Enterprise
# enterprise_new_name: Ansible-Updated-Enterprise
#
# or, for certificate based authentication
# vars:
# auth:
# api_username: csproot
# api_certificate: /path/to/user-certificate.pem
# api_key: /path/to/user-Key.pem
# api_enterprise: csp
# api_url: https://10.0.0.10:8443
# api_version: v5_0
# enterprise_name: Ansible-Enterprise
# enterprise_new_name: Ansible-Updated-Enterprise
# Creating a new enterprise
- name: Create Enterprise
connection: local
community.network.nuage_vspk:
auth: "{{ nuage_auth }}"
type: Enterprise
state: present
properties:
name: "{{ enterprise_name }}-basic"
register: nuage_enterprise
# Checking if an Enterprise with the new name already exists
- name: Check if an Enterprise exists with the new name
connection: local
community.network.nuage_vspk:
auth: "{{ nuage_auth }}"
type: Enterprise
command: find
properties:
name: "{{ enterprise_new_name }}-basic"
ignore_errors: yes
register: nuage_check_enterprise
# Updating an enterprise's name
- name: Update Enterprise name
connection: local
community.network.nuage_vspk:
auth: "{{ nuage_auth }}"
type: Enterprise
id: "{{ nuage_enterprise.id }}"
state: present
properties:
name: "{{ enterprise_new_name }}-basic"
when: nuage_check_enterprise is failed
# Creating a User in an Enterprise
- name: Create admin user
connection: local
community.network.nuage_vspk:
auth: "{{ nuage_auth }}"
type: User
parent_id: "{{ nuage_enterprise.id }}"
parent_type: Enterprise
state: present
match_filter: "userName == 'ansible-admin'"
properties:
email: "[email protected]"
first_name: "Ansible"
last_name: "Admin"
password: "ansible-password"
user_name: "ansible-admin"
register: nuage_user
# Updating password for User
- name: Update admin password
connection: local
community.network.nuage_vspk:
auth: "{{ nuage_auth }}"
type: User
id: "{{ nuage_user.id }}"
command: change_password
properties:
password: "ansible-new-password"
ignore_errors: yes
# Finding a group in an enterprise
- name: Find Administrators group in Enterprise
connection: local
community.network.nuage_vspk:
auth: "{{ nuage_auth }}"
type: Group
parent_id: "{{ nuage_enterprise.id }}"
parent_type: Enterprise
command: find
properties:
name: "Administrators"
register: nuage_group
# Assign the user to the group
- name: Assign admin user to administrators
connection: local
community.network.nuage_vspk:
auth: "{{ nuage_auth }}"
type: User
id: "{{ nuage_user.id }}"
parent_id: "{{ nuage_group.id }}"
parent_type: Group
state: present
# Creating multiple DomainTemplates
- name: Create multiple DomainTemplates
connection: local
community.network.nuage_vspk:
auth: "{{ nuage_auth }}"
type: DomainTemplate
parent_id: "{{ nuage_enterprise.id }}"
parent_type: Enterprise
state: present
properties:
name: "{{ item }}"
description: "Created by Ansible"
with_items:
- "Template-1"
- "Template-2"
# Finding all DomainTemplates
- name: Fetching all DomainTemplates
connection: local
community.network.nuage_vspk:
auth: "{{ nuage_auth }}"
type: DomainTemplate
parent_id: "{{ nuage_enterprise.id }}"
parent_type: Enterprise
command: find
register: nuage_domain_templates
# Deleting all DomainTemplates
- name: Deleting all found DomainTemplates
connection: local
community.network.nuage_vspk:
auth: "{{ nuage_auth }}"
type: DomainTemplate
state: absent
id: "{{ item.ID }}"
with_items: "{{ nuage_domain_templates.entities }}"
when: nuage_domain_templates.entities is defined
# Unassign user from group
- name: Unassign admin user to administrators
connection: local
community.network.nuage_vspk:
auth: "{{ nuage_auth }}"
type: User
id: "{{ nuage_user.id }}"
parent_id: "{{ nuage_group.id }}"
parent_type: Group
state: absent
# Deleting an enterprise
- name: Delete Enterprise
connection: local
community.network.nuage_vspk:
auth: "{{ nuage_auth }}"
type: Enterprise
id: "{{ nuage_enterprise.id }}"
state: absent
# Setup an enterprise with Children
- name: Setup Enterprise and domain structure
connection: local
community.network.nuage_vspk:
auth: "{{ nuage_auth }}"
type: Enterprise
state: present
properties:
name: "Child-based-Enterprise"
children:
- type: L2DomainTemplate
properties:
name: "Unmanaged-Template"
children:
- type: EgressACLTemplate
match_filter: "name == 'Allow All'"
properties:
name: "Allow All"
active: true
default_allow_ip: true
default_allow_non_ip: true
default_install_acl_implicit_rules: true
description: "Created by Ansible"
priority_type: "TOP"
- type: IngressACLTemplate
match_filter: "name == 'Allow All'"
properties:
name: "Allow All"
active: true
default_allow_ip: true
default_allow_non_ip: true
description: "Created by Ansible"
priority_type: "TOP"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **entities** list / elements=string | On state=present and find, with only one element in case of state=present or find=one. | A list of entities handled. Each element is the to\_dict() of the entity. **Sample:** [{'ID': 'acabc435-3946-4117-a719-b8895a335830"', 'assocEntityType': 'DOMAIN', 'command': 'BEGIN\_POLICY\_CHANGES', 'creationDate': 1487515656000, 'entityScope': 'ENTERPRISE', 'externalID': None, 'lastUpdatedBy': '8a6f0e20-a4db-4878-ad84-9cc61756cd5e', 'lastUpdatedDate': 1487515656000, 'owner': '8a6f0e20-a4db-4878-ad84-9cc61756cd5e', 'parameters': None, 'parentID': 'a22fddb9-3da4-4945-bd2e-9d27fe3d62e0', 'parentType': 'domain', 'progress': 0.0, 'result': None, 'status': 'RUNNING'}] |
| **id** string | On state=present and command=find in case one entity was found. | The id of the entity that was found, created, updated or assigned. **Sample:** bae07d8d-d29c-4e2b-b6ba-621b4807a333 |
### Authors
* Philippe Dellaert (@pdellaert)
ansible community.network.ce_bfd_global – Manages BFD global configuration on HUAWEI CloudEngine devices. community.network.ce\_bfd\_global – Manages BFD global configuration on HUAWEI CloudEngine devices.
===================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_bfd_global`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages BFD global configuration on HUAWEI CloudEngine devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **bfd\_enable** string | **Choices:*** enable
* disable
| Enables the global Bidirectional Forwarding Detection (BFD) function. |
| **damp\_init\_wait\_time** string | | Specifies an initial flapping suppression time for a BFD session. The value is an integer ranging from 1 to 3600000, in milliseconds. The default value is 2000. |
| **damp\_max\_wait\_time** string | | Specifies a maximum flapping suppression time for a BFD session. The value is an integer ranging from 1 to 3600000, in milliseconds. The default value is 15000. |
| **damp\_second\_wait\_time** string | | Specifies a secondary flapping suppression time for a BFD session. The value is an integer ranging from 1 to 3600000, in milliseconds. The default value is 5000. |
| **default\_ip** string | | Specifies the default multicast IP address. The value ranges from 224.0.0.107 to 224.0.0.250. |
| **delay\_up\_time** string | | Specifies the delay before a BFD session becomes Up. The value is an integer ranging from 1 to 600, in seconds. The default value is 0, indicating that a BFD session immediately becomes Up. |
| **state** string | **Choices:*** **present** ←
* absent
| Determines whether the config should be present or not on the device. |
| **tos\_exp\_dynamic** string | | Indicates the priority of BFD control packets for dynamic BFD sessions. The value is an integer ranging from 0 to 7. The default priority is 7, which is the highest priority of BFD control packets. |
| **tos\_exp\_static** string | | Indicates the priority of BFD control packets for static BFD sessions. The value is an integer ranging from 0 to 7. The default priority is 7, which is the highest priority of BFD control packets. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Bfd global module test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Enable the global BFD function
community.network.ce_bfd_global:
bfd_enable: enable
provider: '{{ cli }}'
- name: Set the default multicast IP address to 224.0.0.150
community.network.ce_bfd_global:
bfd_enable: enable
default_ip: 224.0.0.150
state: present
provider: '{{ cli }}'
- name: Set the priority of BFD control packets for dynamic and static BFD sessions
community.network.ce_bfd_global:
bfd_enable: enable
tos_exp_dynamic: 5
tos_exp_static: 6
state: present
provider: '{{ cli }}'
- name: Disable the global BFD function
community.network.ce_bfd_global:
bfd_enable: disable
provider: '{{ cli }}'
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | verbose mode | k/v pairs of configuration after module execution **Sample:** {'global': {'bfdEnable': 'true', 'dampInitWaitTime': '2000', 'dampMaxWaitTime': '12000', 'dampSecondWaitTime': '5000', 'defaultIp': '224.0.0.184', 'delayUpTimer': None, 'tosExp': '7', 'tosExpStatic': '7'}} |
| **existing** dictionary | verbose mode | k/v pairs of existing configuration **Sample:** {'global': {'bfdEnable': 'false', 'dampInitWaitTime': '2000', 'dampMaxWaitTime': '12000', 'dampSecondWaitTime': '5000', 'defaultIp': '224.0.0.184', 'delayUpTimer': None, 'tosExp': '7', 'tosExpStatic': '7'}} |
| **proposed** dictionary | verbose mode | k/v pairs of parameters passed into module **Sample:** {'bfd\_enalbe': 'enable', 'damp\_init\_wait\_time': None, 'damp\_max\_wait\_time': None, 'damp\_second\_wait\_time': None, 'default\_ip': None, 'delayUpTimer': None, 'state': 'present', 'tos\_exp\_dynamic': None, 'tos\_exp\_static': None} |
| **updates** list / elements=string | always | commands sent to the device **Sample:** ['bfd'] |
### Authors
* QijunPan (@QijunPan)
| programming_docs |
ansible community.network.avi_customipamdnsprofile – Module for setup of CustomIpamDnsProfile Avi RESTful Object community.network.avi\_customipamdnsprofile – Module for setup of CustomIpamDnsProfile Avi RESTful Object
=========================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_customipamdnsprofile`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure CustomIpamDnsProfile object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **name** string / required | | Name of the custom ipam dns profile. Field introduced in 17.1.1. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **script\_params** string | | Parameters that are always passed to the ipam/dns script. Field introduced in 17.1.1. |
| **script\_uri** string / required | | Script uri of form controller //ipamdnsscripts/<file-name>. Field introduced in 17.1.1. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. Field introduced in 17.1.1. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Field introduced in 17.1.1. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create CustomIpamDnsProfile object
community.network.avi_customipamdnsprofile:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_customipamdnsprofile
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | CustomIpamDnsProfile (api/customipamdnsprofile) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#5037223123243f3739767363676b767365626b767364686b3126393e3524273f223b23767364666b333f3d)>
ansible community.network.netscaler_cs_action – Manage content switching actions community.network.netscaler\_cs\_action – Manage content switching actions
==========================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.netscaler_cs_action`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage content switching actions
* This module is intended to run either on the ansible control node or a bastion (jumpserver) with access to the actual netscaler instance
Requirements
------------
The below requirements are needed on the host that executes this module.
* nitro python sdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **comment** string | | Comments associated with this cs action. |
| **name** string | | Name for the content switching action. Must begin with an ASCII alphanumeric or underscore `_` character, and must contain only ASCII alphanumeric, underscore `_`, hash `#`, period `.`, space , colon `:`, at sign `@`, equal sign `=`, and hyphen `-` characters. Can be changed after the content switching action is created. |
| **nitro\_pass** string / required | | The password with which to authenticate to the netscaler node. |
| **nitro\_protocol** string | **Choices:*** **http** ←
* https
| Which protocol to use when accessing the nitro API objects. |
| **nitro\_timeout** float | **Default:**310 | Time in seconds until a timeout error is thrown when establishing a new session with Netscaler |
| **nitro\_user** string / required | | The username with which to authenticate to the netscaler node. |
| **nsip** string / required | | The ip address of the netscaler appliance where the nitro API calls will be made. The port can be specified with the colon (:). E.g. 192.168.1.1:555. |
| **save\_config** boolean | **Choices:*** no
* **yes** ←
| If `yes` the module will save the configuration on the netscaler node if it makes any changes. The module will not save the configuration on the netscaler node if it made no changes. |
| **state** string | **Choices:*** absent
* **present** ←
| The state of the resource being configured by the module on the netscaler node. When present the resource will be created if needed and configured according to the module's parameters. When absent the resource will be deleted from the netscaler node. |
| **targetlbvserver** string | | Name of the load balancing virtual server to which the content is switched. |
| **targetvserver** string | | Name of the VPN virtual server to which the content is switched. |
| **targetvserverexpr** string | | Information about this content switching action. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `no`, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. |
Notes
-----
Note
* For more information on using Ansible to manage Citrix NetScaler Network devices see <https://www.ansible.com/ansible-netscaler>.
Examples
--------
```
# lb_vserver_1 must have been already created with the netscaler_lb_vserver module
- name: Configure netscaler content switching action
delegate_to: localhost
community.network.netscaler_cs_action:
nsip: 172.18.0.2
nitro_user: nsroot
nitro_pass: nsroot
validate_certs: no
state: present
name: action-1
targetlbvserver: lb_vserver_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 |
| --- | --- | --- |
| **diff** dictionary | failure | List of differences between the actual configured object and the configuration specified in the module **Sample:** { 'targetlbvserver': 'difference. ours: (str) server1 other: (str) server2' } |
| **loglines** list / elements=string | always | list of logged messages by the module **Sample:** ['message 1', 'message 2'] |
| **msg** string | failure | Message detailing the failure reason **Sample:** Action does not exist |
### Authors
* George Nikolopoulos (@giorgos-nikolopoulos)
ansible community.network.ce_bgp_af – Manages BGP Address-family configuration on HUAWEI CloudEngine switches. community.network.ce\_bgp\_af – Manages BGP Address-family configuration on HUAWEI CloudEngine switches.
========================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_bgp_af`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages BGP Address-family configurations on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **active\_route\_advertise** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, BGP is enabled to advertise only optimal routes in the RM to peers. If the value is false, BGP is not enabled to advertise only optimal routes in the RM to peers. |
| **add\_path\_sel\_num** string | | Number of Add-Path routes. The value is an integer ranging from 2 to 64. |
| **af\_type** string / required | **Choices:*** ipv4uni
* ipv4multi
* ipv4vpn
* ipv6uni
* ipv6vpn
* evpn
| Address family type of a BGP instance. |
| **allow\_invalid\_as** string | **Choices:*** **no\_use** ←
* true
* false
| Allow routes with BGP origin AS validation result Invalid to be selected. If the value is true, invalid routes can participate in route selection. If the value is false, invalid routes cannot participate in route selection. |
| **always\_compare\_med** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, the MEDs of routes learned from peers in different autonomous systems are compared when BGP selects an optimal route. If the value is false, the MEDs of routes learned from peers in different autonomous systems are not compared when BGP selects an optimal route. |
| **as\_path\_neglect** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, the AS path attribute is ignored when BGP selects an optimal route. If the value is false, the AS path attribute is not ignored when BGP selects an optimal route. An AS path with a smaller length has a higher priority. |
| **auto\_frr\_enable** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, BGP auto FRR is enabled. If the value is false, BGP auto FRR is disabled. |
| **default\_local\_pref** string | | Set the Local-Preference attribute. The value is an integer. The value is an integer ranging from 0 to 4294967295. |
| **default\_med** string | | Specify the Multi-Exit-Discriminator (MED) of BGP routes. The value is an integer ranging from 0 to 4294967295. |
| **default\_rt\_import\_enable** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, importing default routes to the BGP routing table is allowed. If the value is false, importing default routes to the BGP routing table is not allowed. |
| **determin\_med** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, BGP deterministic-MED is enabled. If the value is false, BGP deterministic-MED is disabled. |
| **ebgp\_ecmp\_nexthop\_changed** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, the next hop of an advertised route is changed to the advertiser itself in EBGP load-balancing scenarios. If the value is false, the next hop of an advertised route is not changed to the advertiser itself in EBGP load-balancing scenarios. |
| **ebgp\_if\_sensitive** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, after the fast EBGP interface awareness function is enabled, EBGP sessions on an interface are deleted immediately when the interface goes Down. If the value is false, after the fast EBGP interface awareness function is enabled, EBGP sessions on an interface are not deleted immediately when the interface goes Down. |
| **ecmp\_nexthop\_changed** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, the next hop of an advertised route is changed to the advertiser itself in BGP load-balancing scenarios. If the value is false, the next hop of an advertised route is not changed to the advertiser itself in BGP load-balancing scenarios. |
| **ibgp\_ecmp\_nexthop\_changed** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, the next hop of an advertised route is changed to the advertiser itself in IBGP load-balancing scenarios. If the value is false, the next hop of an advertised route is not changed to the advertiser itself in IBGP load-balancing scenarios. |
| **igp\_metric\_ignore** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, the metrics of next-hop IGP routes are not compared when BGP selects an optimal route. If the value is false, the metrics of next-hop IGP routes are not compared when BGP selects an optimal route. A route with a smaller metric has a higher priority. |
| **import\_process\_id** string | | Process ID of an imported routing protocol. The value is an integer ranging from 0 to 4294967295. |
| **import\_protocol** string | **Choices:*** direct
* ospf
* isis
* static
* rip
* ospfv3
* ripng
| Routing protocol from which routes can be imported. |
| **ingress\_lsp\_policy\_name** string | | Ingress lsp policy name. |
| **load\_balancing\_as\_path\_ignore** string | **Choices:*** **no\_use** ←
* true
* false
| Load balancing as path ignore. |
| **lowest\_priority** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, enable reduce priority to advertise route. If the value is false, disable reduce priority to advertise route. |
| **mask\_len** string | | Specify the mask length of an IP address. The value is an integer ranging from 0 to 128. |
| **max\_load\_ebgp\_num** string | | Specify the maximum number of equal-cost EBGP routes. The value is an integer ranging from 1 to 65535. |
| **max\_load\_ibgp\_num** string | | Specify the maximum number of equal-cost IBGP routes. The value is an integer ranging from 1 to 65535. |
| **maximum\_load\_balance** string | | Specify the maximum number of equal-cost routes in the BGP routing table. The value is an integer ranging from 1 to 65535. |
| **med\_none\_as\_maximum** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, when BGP selects an optimal route, the system uses 4294967295 as the MED value of a route if the route's attribute does not carry a MED value. If the value is false, the system uses 0 as the MED value of a route if the route's attribute does not carry a MED value. |
| **network\_address** string | | Specify the IP address advertised by BGP. The value is a string of 0 to 255 characters. |
| **next\_hop\_sel\_depend\_type** string | **Choices:*** **default** ←
* dependTunnel
* dependIp
| Next hop select depend type. |
| **nexthop\_third\_party** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, the third-party next hop function is enabled. If the value is false, the third-party next hop function is disabled. |
| **nhp\_relay\_route\_policy\_name** string | | Specify the name of a route-policy for route iteration. The value is a string of 1 to 40 characters. |
| **originator\_prior** string | **Choices:*** **no\_use** ←
* true
* false
| Originator prior. |
| **policy\_ext\_comm\_enable** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, modifying extended community attributes is allowed. If the value is false, modifying extended community attributes is not allowed. |
| **policy\_vpn\_target** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, VPN-Target filtering function is performed for received VPN routes. If the value is false, VPN-Target filtering function is not performed for received VPN routes. |
| **preference\_external** string | | Set the protocol priority of EBGP routes. The value is an integer ranging from 1 to 255. |
| **preference\_internal** string | | Set the protocol priority of IBGP routes. The value is an integer ranging from 1 to 255. |
| **preference\_local** string | | Set the protocol priority of a local BGP route. The value is an integer ranging from 1 to 255. |
| **prefrence\_policy\_name** string | | Set a routing policy to filter routes so that a configured priority is applied to the routes that match the specified policy. The value is a string of 1 to 40 characters. |
| **reflect\_between\_client** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, route reflection is enabled between clients. If the value is false, route reflection is disabled between clients. |
| **reflect\_chg\_path** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, the route reflector is enabled to modify route path attributes based on an export policy. If the value is false, the route reflector is disabled from modifying route path attributes based on an export policy. |
| **reflector\_cluster\_id** string | | Set a cluster ID. Configuring multiple RRs in a cluster can enhance the stability of the network. The value is an integer ranging from 1 to 4294967295. |
| **reflector\_cluster\_ipv4** string | | Set a cluster ipv4 address. The value is expressed in the format of an IPv4 address. |
| **relay\_delay\_enable** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, relay delay enable. If the value is false, relay delay disable. |
| **rib\_only\_enable** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, BGP routes cannot be advertised to the IP routing table. If the value is false, Routes preferred by BGP are advertised to the IP routing table. |
| **rib\_only\_policy\_name** string | | Specify the name of a routing policy. The value is a string of 1 to 40 characters. |
| **route\_sel\_delay** string | | Route selection delay. The value is an integer ranging from 0 to 3600. |
| **router\_id** string | | ID of a router that is in IPv4 address format. The value is a string of 0 to 255 characters. The value is in dotted decimal notation. |
| **router\_id\_neglect** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, the router ID attribute is ignored when BGP selects the optimal route. If the value is false, the router ID attribute is not ignored when BGP selects the optimal route. |
| **rr\_filter\_number** string | | Set the number of the extended community filter supported by an RR group. The value is a string of 1 to 51 characters. |
| **state** string | **Choices:*** **present** ←
* absent
| Specify desired state of the resource. |
| **summary\_automatic** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, automatic aggregation is enabled for locally imported routes. If the value is false, automatic aggregation is disabled for locally imported routes. |
| **supernet\_label\_adv** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, the function to advertise supernetwork label is enabled. If the value is false, the function to advertise supernetwork label is disabled. |
| **supernet\_uni\_adv** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, the function to advertise supernetwork unicast routes is enabled. If the value is false, the function to advertise supernetwork unicast routes is disabled. |
| **vrf\_name** string / required | | Name of a BGP instance. The name is a case-sensitive string of characters. The BGP instance can be used only after the corresponding VPN instance is created. The value is a string of 1 to 31 case-sensitive characters. |
| **vrf\_rid\_auto\_sel** string | **Choices:*** **no\_use** ←
* true
* false
| If the value is true, VPN BGP instances are enabled to automatically select router IDs. If the value is false, VPN BGP instances are disabled from automatically selecting router IDs. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: CloudEngine BGP address family test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Config BGP Address_Family"
community.network.ce_bgp_af:
state: present
vrf_name: js
af_type: ipv4uni
provider: "{{ cli }}"
- name: "Undo BGP Address_Family"
community.network.ce_bgp_af:
state: absent
vrf_name: js
af_type: ipv4uni
provider: "{{ cli }}"
- name: "Config import route"
community.network.ce_bgp_af:
state: present
vrf_name: js
af_type: ipv4uni
import_protocol: ospf
import_process_id: 123
provider: "{{ cli }}"
- name: "Undo import route"
community.network.ce_bgp_af:
state: absent
vrf_name: js
af_type: ipv4uni
import_protocol: ospf
import_process_id: 123
provider: "{{ cli }}"
- name: "Config network route"
community.network.ce_bgp_af:
state: present
vrf_name: js
af_type: ipv4uni
network_address: 1.1.1.1
mask_len: 24
provider: "{{ cli }}"
- name: "Undo network route"
community.network.ce_bgp_af:
state: absent
vrf_name: js
af_type: ipv4uni
network_address: 1.1.1.1
mask_len: 24
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of aaa params after module execution **Sample:** {'af\_type': 'ipv4uni', 'vrf\_name': 'js'} |
| **existing** dictionary | always | k/v pairs of existing aaa server |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'af\_type': 'ipv4uni', 'state': 'present', 'vrf\_name': 'js'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** ['ipv4-family vpn-instance js'] |
### Authors
* wangdezhuang (@QijunPan)
| programming_docs |
ansible community.network.ce_file_copy – Copy a file to a remote cloudengine device over SCP on HUAWEI CloudEngine switches. community.network.ce\_file\_copy – Copy a file to a remote cloudengine device over SCP on HUAWEI CloudEngine switches.
======================================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_file_copy`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Copy a file to a remote cloudengine device over SCP on HUAWEI CloudEngine switches.
Requirements
------------
The below requirements are needed on the host that executes this module.
* paramiko
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **file\_system** string | **Default:**"flash:" | The remote file system of the device. If omitted, devices that support a *file\_system* parameter will use their default values. File system indicates the storage medium and can be set to as follows, 1) `flash` is root directory of the flash memory on the master MPU. 2) `slave#flash` is root directory of the flash memory on the slave MPU. If no slave MPU exists, this drive is unavailable. 3) `chassis ID/slot number#flash` is root directory of the flash memory on a device in a stack. For example, `1/5#flash` indicates the flash memory whose chassis ID is 1 and slot number is 5. |
| **local\_file** string / required | | Path to local file. Local directory must exist. The maximum length of *local\_file* is `4096`. |
| **remote\_file** string | | Remote file path of the copy. Remote directories must exist. If omitted, the name of the local file will be used. The maximum length of *remote\_file* is `4096`. |
Notes
-----
Note
* The feature must be enabled with feature scp-server.
* If the file is already present, no transfer will take place.
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: File copy test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Copy a local file to remote device"
community.network.ce_file_copy:
local_file: /usr/vrpcfg.cfg
remote_file: /vrpcfg.cfg
file_system: 'flash:'
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **local\_file** string | always | The path of the local file. **Sample:** /usr/work/vrpcfg.zip |
| **remote\_file** string | always | The path of the remote file. **Sample:** /vrpcfg.zip |
| **transfer\_result** string | always | information about transfer result. **Sample:** The local file has been successfully transferred to the device. |
### Authors
* Zhou Zhijin (@QijunPan)
ansible community.network.avi_alertemailconfig – Module for setup of AlertEmailConfig Avi RESTful Object community.network.avi\_alertemailconfig – Module for setup of AlertEmailConfig Avi RESTful Object
=================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_alertemailconfig`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure AlertEmailConfig object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **cc\_emails** string | | Alerts are copied to the comma separated list of email recipients. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **description** string | | User defined description for the object. |
| **name** string / required | | A user-friendly name of the email notification service. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **to\_emails** string / required | | Alerts are sent to the comma separated list of email recipients. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Unique object identifier of the object. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create AlertEmailConfig object
community.network.avi_alertemailconfig:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_alertemailconfig
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | AlertEmailConfig (api/alertemailconfig) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#86e1f4e7f5f2e9e1efa0a5b5b1bda0a5b3b4bda0a5b2bebde7f0efe8e3f2f1e9f4edf5a0a5b2b0bde5e9eb)>
ansible community.network.ig_unit_information – Get unit information from an Ingate SBC. community.network.ig\_unit\_information – Get unit information from an Ingate SBC.
==================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ig_unit_information`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get unit information from an Ingate SBC.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ingatesdk >= 1.0.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **client** string | | A dict object containing connection details. |
| | **address** string / required | | The hostname or IP address to the unit. |
| | **password** string / required | | The password for the REST API user. |
| | **port** integer | | Which HTTP(S) port to connect to. |
| | **scheme** string / required | **Choices:*** http
* https
| Which HTTP protocol to use. |
| | **timeout** integer | | The timeout (in seconds) for REST API requests. |
| | **username** string / required | | The username of the REST API user. |
| | **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| Verify the unit's HTTPS certificate.
aliases: verify\_ssl |
| | **version** string | **Choices:*** **v1** ←
| REST API version. |
Notes
-----
Note
* This module requires that the Ingate Python SDK is installed on the host. To install the SDK use the pip command from your shell `pip install ingatesdk`.
Examples
--------
```
- name: Get unit information
community.network.ig_unit_information:
client:
version: v1
scheme: http
address: 192.168.1.1
username: alice
password: foobar
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **unit-information** complex | success | Information about the unit |
| | **installid** string | success | The installation identifier **Sample:** any |
| | **interfaces** string | success | List of interface names **Sample:** eth0 eth1 eth2 eth3 eth4 eth5 |
| | **lang** string | success | The unit's language **Sample:** en |
| | **lic\_email** string | success | License email information **Sample:** [email protected] |
| | **lic\_mac** string | success | License MAC information **Sample:** any |
| | **lic\_name** string | success | License name information **Sample:** Example Inc |
| | **macaddr** string | success | The MAC address of the first interface **Sample:** 52:54:00:4c:e2:07 |
| | **mode** string | success | Operational mode of the unit **Sample:** Siparator |
| | **modules** string | success | Installed module licenses **Sample:** failover vpn sip qturn ems qos rsc voipsm |
| | **patches** list / elements=string | success | Installed patches on the unit |
| | **product** string | success | The product name **Sample:** Software SIParator/Firewall |
| | **serial** string | success | The serial number of the unit **Sample:** IG-200-839-2008-0 |
| | **systemid** string | success | The system identifier of the unit **Sample:** IG-200-839-2008-0 |
| | **unitname** string | success | The name of the unit **Sample:** Testname |
| | **version** string | success | Firmware version **Sample:** 6.2.0-beta2 |
### Authors
* Ingate Systems AB (@ingatesystems)
ansible community.network.exos_l2_interfaces – Manage L2 interfaces on Extreme Networks EXOS devices. community.network.exos\_l2\_interfaces – Manage L2 interfaces on Extreme Networks EXOS devices.
===============================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.exos_l2_interfaces`.
New in version 0.2.0: of community.network
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of L2 interfaces on Extreme Networks EXOS network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A dictionary of L2 interfaces options |
| | **access** dictionary | | Switchport mode access command to configure the interface as a layer 2 access. |
| | | **vlan** integer | | Configure given VLAN in access port. It's used as the access VLAN ID. |
| | **name** string / required | | Name of the interface |
| | **trunk** dictionary | | Switchport mode trunk command to configure the interface as a Layer 2 trunk. |
| | | **native\_vlan** integer | | Native VLAN to be configured in trunk port. It's used as the trunk native VLAN ID. |
| | | **trunk\_allowed\_vlans** list / elements=string | | List of allowed VLANs in a given trunk port. These are the only VLANs that will be configured on the trunk. |
| **state** string | **Choices:*** **merged** ←
* replaced
* overridden
* deleted
| The state the configuration should be left in |
Notes
-----
Note
* Tested against EXOS 30.2.1.8
* This module works with connection `httpapi`. See [EXOS Platform Options](user_guide/platform_exos)
Examples
--------
```
# Using deleted
# Before state:
# -------------
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 10
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 1,
# "trunk-vlans": [
# 10
# ]
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 10,
# "trunk-vlans": [
# 20,
# 30
# ]
# }
# }
# }
# }
# ]
# }
# }
- name: Delete L2 interface configuration for the given arguments
community.network.exos_l2_interfaces:
config:
- name: '3'
state: deleted
# Module Execution Results:
# -------------------------
#
# "before": [
# {
# "access": {
# "vlan": 10
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": null,
# "name": "2",
# "trunk": {
# "native_vlan": 1,
# "trunk_allowed_vlans": [
# 10
# ]
# }
# },
# {
# "access": null,
# "name": "3",
# "trunk": {
# "native_vlan": 10,
# "trunk_allowed_vlans": [
# 20,
# 30
# ]
# }
# }
# ],
#
# "requests": [
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 1,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=3/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# }
# ],
#
# "after": [
# {
# "access": {
# "vlan": 10
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": null,
# "name": "2",
# "trunk": {
# "native_vlan": 1,
# "trunk_allowed_vlans": [
# 10
# ]
# }
# },
# {
# "access": {
# "vlan": 1
# },
# "name": "3",
# "trunk": null
# }
# ]
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 10
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 1,
# "trunk-vlans": [
# 10
# ]
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# }
# }
# }
# }
# ]
# }
# }
# Using deleted without any config passed
#"(NOTE: This will delete all of configured resource module attributes from each configured interface)"
# Before state:
# -------------
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 10
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 1,
# "trunk-vlans": [
# 10
# ]
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 10,
# "trunk-vlans": [
# 20,
# 30
# ]
# }
# }
# }
# }
# ]
# }
# }
- name: Delete L2 interface configuration for the given arguments
community.network.exos_l2_interfaces:
state: deleted
# Module Execution Results:
# -------------------------
#
# "before": [
# {
# "access": {
# "vlan": 10
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": null,
# "name": "2",
# "trunk": {
# "native_vlan": 1,
# "trunk_allowed_vlans": [
# 10
# ]
# }
# },
# {
# "access": null,
# "name": "3",
# "trunk": {
# "native_vlan": 10,
# "trunk_allowed_vlans": [
# 20,
# 30
# ]
# }
# }
# ],
#
# "requests": [
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 1,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=1/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# },
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 1,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=2/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# },
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 1,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=3/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# }
# ],
#
# "after": [
# {
# "access": {
# "vlan": 1
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": {
# "vlan": 1
# },
# "name": "2",
# "trunk": null
# },
# {
# "access": {
# "vlan": 1
# },
# "name": "3",
# "trunk": null
# }
# ]
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# }
# }
# }
# }
# ]
# }
# }
# Using merged
# Before state:
# -------------
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# },
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# },
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# },
# }
# }
# },
# ]
# }
# }
- name: Merge provided configuration with device configuration
community.network.exos_l2_interfaces:
config:
- access:
vlan: 10
name: '1'
- name: '2'
trunk:
trunk_allowed_vlans: 10
- name: '3'
trunk:
native_vlan: 10
trunk_allowed_vlans: 20
state: merged
# Module Execution Results:
# -------------------------
#
# "before": [
# {
# "access": {
# "vlan": 1
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": {
# "vlan": 1
# },
# "name": "2",
# "trunk": null
# },
# {
# "access": {
# "vlan": 1
# },
# "name": "3",
# "trunk": null
# }
# ],
#
# "requests": [
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 10,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=1/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# },
# {
# "data": {
# "openconfig-vlan:config": {
# "trunk-vlans": [10],
# "interface-mode": "TRUNK"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=2/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# },
# {
# "data": {
# "openconfig-vlan:config": {
# "native-vlan": 10,
# "trunk-vlans": [20],
# "interface-mode": "TRUNK"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=3/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# }
# ],
#
# "after": [
# {
# "access": {
# "vlan": 10
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": null,
# "name": "2",
# "trunk": {
# "native_vlan": 1,
# "trunk_allowed_vlans": [
# 10
# ]
# }
# },
# {
# "access": null,
# "name": "3",
# "trunk": {
# "native_vlan": 10,
# "trunk_allowed_vlans": [
# 20
# ]
# }
# }
# ]
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 10
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 1,
# "trunk-vlans": [
# 10
# ]
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 10,
# "trunk-vlans": [
# 20
# ]
# }
# }
# }
# },
# ]
# }
# }
# Using overridden
# Before state:
# -------------
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 10
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 1,
# "trunk-vlans": [
# 10
# ]
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 10,
# "trunk-vlans": [
# 20,
# 30
# ]
# }
# }
# }
# }
# ]
# }
# }
- name: Overrride device configuration of all L2 interfaces with provided configuration
community.network.exos_l2_interfaces:
config:
- access:
vlan: 10
name: '2'
state: overridden
# Module Execution Results:
# -------------------------
#
# "before": [
# {
# "access": {
# "vlan": 10
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": null,
# "name": "2",
# "trunk": {
# "native_vlan": 1,
# "trunk_allowed_vlans": [
# 10
# ]
# }
# },
# {
# "access": null,
# "name": "3",
# "trunk": {
# "native_vlan": 10,
# "trunk_allowed_vlans": [
# 20,
# 30
# ]
# }
# }
# ],
#
# "requests": [
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 1,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=1/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# },
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 10,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=2/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# }
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 1,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=3/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# }
# ],
#
# "after": [
# {
# "access": {
# "vlan": 1
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": {
# "vlan": 10
# },
# "name": "2",
# "trunk": null
# },
# {
# "access": {
# "vlan": 1
# },
# "name": "3",
# "trunk": null
# }
# ]
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 10
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# }
# }
# }
# }
# ]
# }
# }
# Using replaced
# Before state:
# -------------
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 10
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 20
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 1,
# "trunk-vlans": [
# 10
# ]
# }
# }
# }
# }
# ]
# }
# }
- name: Replace device configuration of listed L2 interfaces with provided configuration
community.network.exos_l2_interfaces:
config:
- access:
vlan: 20
name: '1'
- name: '2'
trunk:
trunk_allowed_vlans: 10
- name: '3'
trunk:
native_vlan: 10
trunk_allowed_vlan: 20,30
state: replaced
# Module Execution Results:
# -------------------------
#
# "before": [
# {
# "access": {
# "vlan": 10
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": {
# "vlan": 20
# },
# "name": "2",
# "trunk": null
# },
# {
# "access": null,
# "name": "3",
# "trunk": {
# "native_vlan": 1,
# "trunk_allowed_vlans": [
# 10
# ]
# }
# }
# ],
#
# "requests": [
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 20,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=1/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# },
# {
# "data": {
# "openconfig-vlan:config": {
# "trunk-vlans": [10],
# "interface-mode": "TRUNK"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=2/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# },
# {
# "data": {
# "openconfig-vlan:config": {
# "native-vlan": 10,
# "trunk-vlans": [20, 30]
# "interface-mode": "TRUNK"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=3/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# }
# ],
#
# "after": [
# {
# "access": {
# "vlan": 20
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": null,
# "name": "2",
# "trunk": {
# "native_vlan": null,
# "trunk_allowed_vlans": [
# 10
# ]
# }
# },
# {
# "access": null,
# "name": "3",
# "trunk": {
# "native_vlan": 10,
# "trunk_allowed_vlans": [
# 20,
# 30
# ]
# }
# }
# ]
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 20
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "trunk-vlans": [
# 10
# ]
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 10,
# "trunk-vlans": [
# 20,
# 30
# ]
# }
# }
# }
# }
# ]
# }
# }
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The resulting configuration model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration prior to the model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **requests** list / elements=string | always | The set of requests pushed to the remote device. **Sample:** [{'data': '...', 'method': '...', 'path': '...'}, {'data': '...', 'method': '...', 'path': '...'}, {'data': '...', 'method': '...', 'path': '...'}] |
### Authors
* Jayalakshmi Viswanathan (@jayalakshmiV)
| programming_docs |
ansible community.network.avi_pool – Module for setup of Pool Avi RESTful Object community.network.avi\_pool – Module for setup of Pool Avi RESTful Object
=========================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_pool`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure Pool object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **a\_pool** string | | Name of container cloud application that constitutes a pool in a a-b pool configuration, if different from vs app. Field deprecated in 18.1.2. |
| **ab\_pool** string | | A/b pool configuration. Field deprecated in 18.1.2. |
| **ab\_priority** string | | Priority of this pool in a a-b pool pair. Internally used. Field deprecated in 18.1.2. |
| **analytics\_policy** string | | Determines analytics settings for the pool. Field introduced in 18.1.5, 18.2.1. |
| **analytics\_profile\_ref** string | | Specifies settings related to analytics. It is a reference to an object of type analyticsprofile. Field introduced in 18.1.4,18.2.1. |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **apic\_epg\_name** string | | Synchronize cisco apic epg members with pool servers. |
| **application\_persistence\_profile\_ref** string | | Persistence will ensure the same user sticks to the same server for a desired duration of time. It is a reference to an object of type applicationpersistenceprofile. |
| **autoscale\_launch\_config\_ref** string | | If configured then avi will trigger orchestration of pool server creation and deletion. It is only supported for container clouds like mesos, openshift, kubernetes, docker, etc. It is a reference to an object of type autoscalelaunchconfig. |
| **autoscale\_networks** string | | Network ids for the launch configuration. |
| **autoscale\_policy\_ref** string | | Reference to server autoscale policy. It is a reference to an object of type serverautoscalepolicy. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **capacity\_estimation** boolean | **Choices:*** no
* yes
| Inline estimation of capacity of servers. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **capacity\_estimation\_ttfb\_thresh** string | | The maximum time-to-first-byte of a server. Allowed values are 1-5000. Special values are 0 - 'automatic'. Default value when not specified in API or module is interpreted by Avi Controller as 0. |
| **cloud\_config\_cksum** string | | Checksum of cloud configuration for pool. Internally set by cloud connector. |
| **cloud\_ref** string | | It is a reference to an object of type cloud. |
| **conn\_pool\_properties** string | | Connection pool properties. Field introduced in 18.2.1. |
| **connection\_ramp\_duration** string | | Duration for which new connections will be gradually ramped up to a server recently brought online. Useful for lb algorithms that are least connection based. Allowed values are 1-300. Special values are 0 - 'immediate'. Default value when not specified in API or module is interpreted by Avi Controller as 10. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **created\_by** string | | Creator name. |
| **default\_server\_port** string | | Traffic sent to servers will use this destination server port unless overridden by the server's specific port attribute. The ssl checkbox enables avi to server encryption. Allowed values are 1-65535. Default value when not specified in API or module is interpreted by Avi Controller as 80. |
| **delete\_server\_on\_dns\_refresh** boolean | **Choices:*** no
* yes
| Indicates whether existing ips are disabled(false) or deleted(true) on dns hostname refreshdetail -- on a dns refresh, some ips set on pool may no longer be returned by the resolver. These ips are deleted from the pool when this knob is set to true. They are disabled, if the knob is set to false. Field introduced in 18.2.3. Default value when not specified in API or module is interpreted by Avi Controller as True. |
| **description** string | | A description of the pool. |
| **domain\_name** string | | Comma separated list of domain names which will be used to verify the common names or subject alternative names presented by server certificates. It is performed only when common name check host\_check\_enabled is enabled. |
| **east\_west** boolean | **Choices:*** no
* yes
| Inherited config from virtualservice. |
| **enabled** boolean | **Choices:*** no
* yes
| Enable or disable the pool. Disabling will terminate all open connections and pause health monitors. Default value when not specified in API or module is interpreted by Avi Controller as True. |
| **external\_autoscale\_groups** string | | Names of external auto-scale groups for pool servers. Currently available only for aws and azure. Field introduced in 17.1.2. |
| **fail\_action** string | | Enable an action - close connection, http redirect or local http response - when a pool failure happens. By default, a connection will be closed, in case the pool experiences a failure. |
| **fewest\_tasks\_feedback\_delay** string | | Periodicity of feedback for fewest tasks server selection algorithm. Allowed values are 1-300. Default value when not specified in API or module is interpreted by Avi Controller as 10. |
| **graceful\_disable\_timeout** string | | Used to gracefully disable a server. Virtual service waits for the specified time before terminating the existing connections to the servers that are disabled. Allowed values are 1-7200. Special values are 0 - 'immediate', -1 - 'infinite'. Default value when not specified in API or module is interpreted by Avi Controller as 1. |
| **gslb\_sp\_enabled** boolean | **Choices:*** no
* yes
| Indicates if the pool is a site-persistence pool. Field introduced in 17.2.1. |
| **health\_monitor\_refs** string | | Verify server health by applying one or more health monitors. Active monitors generate synthetic traffic from each service engine and mark a server up or down based on the response. The passive monitor listens only to client to server communication. It raises or lowers the ratio of traffic destined to a server based on successful responses. It is a reference to an object of type healthmonitor. |
| **host\_check\_enabled** boolean | **Choices:*** no
* yes
| Enable common name check for server certificate. If enabled and no explicit domain name is specified, avi will use the incoming host header to do the match. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **inline\_health\_monitor** boolean | **Choices:*** no
* yes
| The passive monitor will monitor client to server connections and requests and adjust traffic load to servers based on successful responses. This may alter the expected behavior of the lb method, such as round robin. Default value when not specified in API or module is interpreted by Avi Controller as True. |
| **ipaddrgroup\_ref** string | | Use list of servers from ip address group. It is a reference to an object of type ipaddrgroup. |
| **lb\_algorithm** string | | The load balancing algorithm will pick a server within the pool's list of available servers. Enum options - LB\_ALGORITHM\_LEAST\_CONNECTIONS, LB\_ALGORITHM\_ROUND\_ROBIN, LB\_ALGORITHM\_FASTEST\_RESPONSE, LB\_ALGORITHM\_CONSISTENT\_HASH, LB\_ALGORITHM\_LEAST\_LOAD, LB\_ALGORITHM\_FEWEST\_SERVERS, LB\_ALGORITHM\_RANDOM, LB\_ALGORITHM\_FEWEST\_TASKS, LB\_ALGORITHM\_NEAREST\_SERVER, LB\_ALGORITHM\_CORE\_AFFINITY, LB\_ALGORITHM\_TOPOLOGY. Default value when not specified in API or module is interpreted by Avi Controller as LB\_ALGORITHM\_LEAST\_CONNECTIONS. |
| **lb\_algorithm\_consistent\_hash\_hdr** string | | Http header name to be used for the hash key. |
| **lb\_algorithm\_core\_nonaffinity** string | | Degree of non-affinity for core affinity based server selection. Allowed values are 1-65535. Field introduced in 17.1.3. Default value when not specified in API or module is interpreted by Avi Controller as 2. |
| **lb\_algorithm\_hash** string | | Criteria used as a key for determining the hash between the client and server. Enum options - LB\_ALGORITHM\_CONSISTENT\_HASH\_SOURCE\_IP\_ADDRESS, LB\_ALGORITHM\_CONSISTENT\_HASH\_SOURCE\_IP\_ADDRESS\_AND\_PORT, LB\_ALGORITHM\_CONSISTENT\_HASH\_URI, LB\_ALGORITHM\_CONSISTENT\_HASH\_CUSTOM\_HEADER, LB\_ALGORITHM\_CONSISTENT\_HASH\_CUSTOM\_STRING, LB\_ALGORITHM\_CONSISTENT\_HASH\_CALLID. Default value when not specified in API or module is interpreted by Avi Controller as LB\_ALGORITHM\_CONSISTENT\_HASH\_SOURCE\_IP\_ADDRESS. |
| **lookup\_server\_by\_name** boolean | **Choices:*** no
* yes
| Allow server lookup by name. Field introduced in 17.1.11,17.2.4. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **max\_concurrent\_connections\_per\_server** string | | The maximum number of concurrent connections allowed to each server within the pool. Note applied value will be no less than the number of service engines that the pool is placed on. If set to 0, no limit is applied. Default value when not specified in API or module is interpreted by Avi Controller as 0. |
| **max\_conn\_rate\_per\_server** string | | Rate limit connections to each server. |
| **min\_health\_monitors\_up** string | | Minimum number of health monitors in up state to mark server up. Field introduced in 18.2.1, 17.2.12. |
| **min\_servers\_up** string | | Minimum number of servers in up state for marking the pool up. Field introduced in 18.2.1, 17.2.12. |
| **name** string / required | | The name of the pool. |
| **networks** string | | (internal-use) networks designated as containing servers for this pool. The servers may be further narrowed down by a filter. This field is used internally by avi, not editable by the user. |
| **nsx\_securitygroup** string | | A list of nsx service groups where the servers for the pool are created. Field introduced in 17.1.1. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **pki\_profile\_ref** string | | Avi will validate the ssl certificate present by a server against the selected pki profile. It is a reference to an object of type pkiprofile. |
| **placement\_networks** string | | Manually select the networks and subnets used to provide reachability to the pool's servers. Specify the subnet using the following syntax 10-1-1-0/24. Use static routes in vrf configuration when pool servers are not directly connected butroutable from the service engine. |
| **prst\_hdr\_name** string | | Header name for custom header persistence. Field deprecated in 18.1.2. |
| **request\_queue\_depth** string | | Minimum number of requests to be queued when pool is full. Default value when not specified in API or module is interpreted by Avi Controller as 128. |
| **request\_queue\_enabled** boolean | **Choices:*** no
* yes
| Enable request queue when pool is full. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **rewrite\_host\_header\_to\_server\_name** boolean | **Choices:*** no
* yes
| Rewrite incoming host header to server name of the server to which the request is proxied. Enabling this feature rewrites host header for requests to all servers in the pool. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **rewrite\_host\_header\_to\_sni** boolean | **Choices:*** no
* yes
| If sni server name is specified, rewrite incoming host header to the sni server name. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **server\_auto\_scale** boolean | **Choices:*** no
* yes
| Server autoscale. Not used anymore. Field deprecated in 18.1.2. |
| **server\_count** string | | Field deprecated in 18.2.1. |
| **server\_name** string | | Fully qualified dns hostname which will be used in the tls sni extension in server connections if sni is enabled. If no value is specified, avi will use the incoming host header instead. |
| **server\_reselect** string | | Server reselect configuration for http requests. |
| **server\_timeout** string | | Server timeout value specifies the time within which a server connection needs to be established and a request-response exchange completes between avi and the server. Value of 0 results in using default timeout of 60 minutes. Allowed values are 0-3600000. Field introduced in 18.1.5,18.2.1. Default value when not specified in API or module is interpreted by Avi Controller as 0. |
| **servers** string | | The pool directs load balanced traffic to this list of destination servers. The servers can be configured by ip address, name, network or via ip address group. |
| **service\_metadata** string | | Metadata pertaining to the service provided by this pool. In openshift/kubernetes environments, app metadata info is stored. Any user input to this field will be overwritten by avi vantage. Field introduced in 17.2.14,18.1.5,18.2.1. |
| **sni\_enabled** boolean | **Choices:*** no
* yes
| Enable tls sni for server connections. If disabled, avi will not send the sni extension as part of the handshake. Default value when not specified in API or module is interpreted by Avi Controller as True. |
| **ssl\_key\_and\_certificate\_ref** string | | Service engines will present a client ssl certificate to the server. It is a reference to an object of type sslkeyandcertificate. |
| **ssl\_profile\_ref** string | | When enabled, avi re-encrypts traffic to the backend servers. The specific ssl profile defines which ciphers and ssl versions will be supported. It is a reference to an object of type sslprofile. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **use\_service\_port** boolean | **Choices:*** no
* yes
| Do not translate the client's destination port when sending the connection to the server. The pool or servers specified service port will still be used for health monitoring. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Uuid of the pool. |
| **vrf\_ref** string | | Virtual routing context that the pool is bound to. This is used to provide the isolation of the set of networks the pool is attached to. The pool inherits the virtual routing context of the virtual service, and this field is used only internally, and is set by pb-transform. It is a reference to an object of type vrfcontext. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Create a Pool with two servers and HTTP monitor
community.network.avi_pool:
controller: 10.10.1.20
username: avi_user
password: avi_password
name: testpool1
description: testpool1
state: present
health_monitor_refs:
- '/api/healthmonitor?name=System-HTTP'
servers:
- ip:
addr: 10.10.2.20
type: V4
- ip:
addr: 10.10.2.21
type: V4
- name: Patch pool with a single server using patch op and avi_credentials
community.network.avi_pool:
avi_api_update_method: patch
avi_api_patch_op: delete
avi_credentials: "{{avi_credentials}}"
name: test-pool
servers:
- ip:
addr: 10.90.64.13
type: 'V4'
register: pool
when:
- state | default("present") == "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 |
| --- | --- | --- |
| **obj** dictionary | success, changed | Pool (api/pool) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#ed8a9f8c9e99828a84cbcededad6cbced8dfd6cbced9d5d68c9b848388999a829f869ecbced9dbd68e8280)>
ansible community.network.ce_acl_interface – Manages applying ACLs to interfaces on HUAWEI CloudEngine switches. community.network.ce\_acl\_interface – Manages applying ACLs to interfaces on HUAWEI CloudEngine switches.
==========================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_acl_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages applying ACLs to interfaces on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **acl\_name** string / required | | ACL number or name. For a numbered rule group, the value ranging from 2000 to 4999. For a named rule group, the value is a string of 1 to 32 case-sensitive characters starting with a letter, spaces not supported. |
| **direction** string / required | **Choices:*** inbound
* outbound
| Direction ACL to be applied in on the interface. |
| **interface** string / required | | Interface name. Only support interface full name, such as "40GE2/0/1". |
| **state** string | **Choices:*** **present** ←
* absent
| Determines whether the config should be present or not on the device. |
Notes
-----
Note
* Recommended connection is `network_cli`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: CloudEngine acl interface test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Apply acl to interface"
community.network.ce_acl_interface:
state: present
acl_name: 2000
interface: 40GE1/0/1
direction: outbound
provider: "{{ cli }}"
- name: "Undo acl from interface"
community.network.ce_acl_interface:
state: absent
acl_name: 2000
interface: 40GE1/0/1
direction: outbound
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of aaa params after module execution **Sample:** {'acl interface': ['traffic-filter acl lb inbound', 'traffic-filter acl 2000 outbound']} |
| **existing** dictionary | always | k/v pairs of existing aaa server **Sample:** {'acl interface': 'traffic-filter acl lb inbound'} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'acl\_name': '2000', 'direction': 'outbound', 'interface': '40GE2/0/1', 'state': 'present'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** ['interface 40ge2/0/1', 'traffic-filter acl 2000 outbound'] |
### Authors
* wangdezhuang (@QijunPan)
| programming_docs |
ansible community.network.ce – Use ce cliconf to run command on HUAWEI CloudEngine platform community.network.ce – Use ce cliconf to run command on HUAWEI CloudEngine platform
===================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce`.
Synopsis
--------
* This ce plugin provides low level abstraction apis for sending and receiving CLI commands from HUAWEI CloudEngine network devices.
### Authors
* Unknown (!UNKNOWN)
ansible community.network.cnos_l2_interface – Manage Layer-2 interface on Lenovo CNOS devices. community.network.cnos\_l2\_interface – Manage Layer-2 interface on Lenovo CNOS devices.
========================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.cnos_l2_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of Layer-2 interfaces on Lenovo CNOS devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_vlan** string | | Configure given VLAN in access port. If `mode=access`, used as the access VLAN ID. |
| **aggregate** string | | List of Layer-2 interface definitions. |
| **mode** string | **Choices:*** **access** ←
* trunk
| Mode in which interface needs to be configured. |
| **name** string / required | | Full name of the interface excluding any logical unit number, i.e. Ethernet1/3.
aliases: interface |
| **native\_vlan** string | | Native VLAN to be configured in trunk port. If `mode=trunk`, used as the trunk native VLAN ID. |
| **provider** string | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [CNOS Platform Options guide](user_guide/platform_cnos). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** ←
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string / required | | 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. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** string | **Default:**22 | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** string | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE`will be used instead. |
| | **timeout** string | **Default:**10 | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **state** string | **Choices:*** **present** ←
* absent
* unconfigured
| Manage the state of the Layer-2 Interface configuration. |
| **trunk\_allowed\_vlans** string | | List of allowed VLANs in a given trunk port. If `mode=trunk`, these are the only VLANs that will be configured on the trunk, i.e. "2-10,15". |
| **trunk\_vlans** string | | List of VLANs to be configured in trunk port. If `mode=trunk`, used as the VLAN range to ADD or REMOVE from the trunk. |
Examples
--------
```
- name: Ensure Ethernet1/5 is in its default l2 interface state
community.network.cnos_l2_interface:
name: Ethernet1/5
state: unconfigured
- name: Ensure Ethernet1/5 is configured for access vlan 20
community.network.cnos_l2_interface:
name: Ethernet1/5
mode: access
access_vlan: 20
- name: Ensure Ethernet1/5 only has vlans 5-10 as trunk vlans
community.network.cnos_l2_interface:
name: Ethernet1/5
mode: trunk
native_vlan: 10
trunk_vlans: 5-10
- name: Ensure Ethernet1/5 is a trunk port and ensure 2-50 are being tagged
(doesn't mean others aren't also being tagged)
community.network.cnos_l2_interface:
name: Ethernet1/5
mode: trunk
native_vlan: 10
trunk_vlans: 2-50
- name: Ensure these VLANs are not being tagged on the trunk
community.network.cnos_l2_interface:
name: Ethernet1/5
mode: trunk
trunk_vlans: 51-4094
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 |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['interface Ethernet1/5', 'switchport access vlan 20'] |
### Authors
* Anil Kumar Muraleedharan (@amuraleedhar)
ansible community.network.pn_admin_session_timeout – CLI command to modify admin-session-timeout community.network.pn\_admin\_session\_timeout – CLI command to modify admin-session-timeout
===========================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_admin_session_timeout`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to modify admin session timeout.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_timeout** string | | Maximum time to wait for user activity before terminating login session. Minimum should be 60s. |
| **state** string / required | **Choices:*** update
| State the action to perform. `update` to modify the admin-session-timeout. |
Examples
--------
```
- name: Admin session timeout functionality
community.network.pn_admin_session_timeout:
pn_cliswitch: "sw01"
state: "update"
pn_timeout: "61s"
- name: Admin session timeout functionality
community.network.pn_admin_session_timeout:
pn_cliswitch: "sw01"
state: "update"
pn_timeout: "1d"
- name: Admin session timeout functionality
community.network.pn_admin_session_timeout:
pn_cliswitch: "sw01"
state: "update"
pn_timeout: "10d20m3h15s"
```
Return Values
-------------
Common return 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 | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the admin-session-timeout command. |
| **stdout** list / elements=string | always | set of responses from the admin-session-timeout command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
ansible community.network.avi_api_version – Avi API Version Module community.network.avi\_api\_version – Avi API Version Module
============================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_api_version`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to obtain the version of the Avi REST API. <https://avinetworks.com/>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Get AVI API version
community.network.avi_api_version:
controller: ""
username: ""
password: ""
tenant: ""
register: avi_controller_version
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | Avi REST resource |
### Authors
* Vilian Atmadzhov (@vivobg) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#8afce3e6e3ebe4aca9bebcb1ebfee7ebeef0e2e5fcaca9b9bdb1aca9bfb8b1aca9beb2b1faebeeeef3fae5fdeff8e8effeecebe3f8aca9bebcb1e9e5e7)>
ansible community.network.ce_reboot – Reboot a HUAWEI CloudEngine switches. community.network.ce\_reboot – Reboot a HUAWEI CloudEngine switches.
====================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_reboot`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Reboot a HUAWEI CloudEngine switches.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ncclient
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **confirm** boolean / required | **Choices:*** no
* yes
| Safeguard boolean. Set to true if you're sure you want to reboot. |
| **save\_config** boolean | **Choices:*** **no** ←
* yes
| Flag indicating whether to save the configuration. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Reboot module test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Reboot the device
community.network.ce_reboot:
confirm: true
save_config: true
provider: "{{ cli }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **rebooted** boolean | success | Whether the device was instructed to reboot. **Sample:** True |
### Authors
* Gong Jianjun (@QijunPan)
ansible community.network.dladm_vlan – Manage VLAN interfaces on Solaris/illumos systems. community.network.dladm\_vlan – Manage VLAN interfaces on Solaris/illumos systems.
==================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.dladm_vlan`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create or delete VLAN interfaces on Solaris/illumos systems.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **link** string / required | | VLAN underlying link name. |
| **name** string / required | | VLAN interface name. |
| **state** string | **Choices:*** **present** ←
* absent
| Create or delete Solaris/illumos VNIC. |
| **temporary** boolean | **Choices:*** **no** ←
* yes
| Specifies that the VLAN interface is temporary. Temporary VLANs do not persist across reboots. |
| **vlan\_id** string | **Default:**"no" | VLAN ID value for VLAN interface.
aliases: vid |
Examples
--------
```
- name: Create 'vlan42' VLAN over 'bnx0' link
community.network.dladm_vlan: name=vlan42 link=bnx0 vlan_id=42 state=present
- name: Remove 'vlan1337' VLAN interface
community.network.dladm_vlan: name=vlan1337 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 |
| --- | --- | --- |
| **link** string | always | VLAN's underlying link name **Sample:** e100g0 |
| **name** string | always | VLAN name **Sample:** vlan42 |
| **state** string | always | state of the target **Sample:** present |
| **temporary** boolean | always | specifies if operation will persist across reboots **Sample:** True |
| **vlan\_id** string | always | VLAN ID **Sample:** 42 |
### Authors
* Adam Števko (@xen0l)
ansible community.network.pn_user – CLI command to create/modify/delete user community.network.pn\_user – CLI command to create/modify/delete user
=====================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_user`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to create a user and apply a role, update a user and delete a user.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_initial\_role** string | | initial role for user. |
| **pn\_name** string | | username. |
| **pn\_password** string | | plain text password. |
| **pn\_scope** string | **Choices:*** local
* fabric
| local or fabric. |
| **state** string / required | **Choices:*** present
* absent
* update
| State the action to perform. Use `present` to create user and `absent` to delete user `update` to update user. |
Examples
--------
```
- name: Create user
community.network.pn_user:
pn_cliswitch: "sw01"
state: "present"
pn_scope: "fabric"
pn_password: "foo123"
pn_name: "foo"
- name: Delete user
community.network.pn_user:
pn_cliswitch: "sw01"
state: "absent"
pn_name: "foo"
- name: Modify user
community.network.pn_user:
pn_cliswitch: "sw01"
state: "update"
pn_password: "test1234"
pn_name: "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 |
| --- | --- | --- |
| **changed** boolean | always | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the user command. |
| **stdout** list / elements=string | always | set of responses from the user command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
| programming_docs |
ansible community.network.ce_snmp_traps – Manages SNMP traps configuration on HUAWEI CloudEngine switches. community.network.ce\_snmp\_traps – Manages SNMP traps configuration on HUAWEI CloudEngine switches.
====================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_snmp_traps`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages SNMP traps configurations on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **feature\_name** string | **Choices:*** aaa
* arp
* bfd
* bgp
* cfg
* configuration
* dad
* devm
* dhcpsnp
* dldp
* driver
* efm
* erps
* error-down
* fcoe
* fei
* fei\_comm
* fm
* ifnet
* info
* ipsg
* ipv6
* isis
* l3vpn
* lacp
* lcs
* ldm
* ldp
* ldt
* lldp
* mpls\_lspm
* msdp
* mstp
* nd
* netconf
* nqa
* nvo3
* openflow
* ospf
* ospfv3
* pim
* pim-std
* qos
* radius
* rm
* rmon
* securitytrap
* smlktrap
* snmp
* ssh
* stackmng
* sysclock
* sysom
* system
* tcp
* telnet
* trill
* trunk
* tty
* vbst
* vfs
* virtual-perception
* vrrp
* vstm
* all
| Alarm feature name. |
| **interface\_number** string | | Interface number. |
| **interface\_type** string | **Choices:*** Ethernet
* Eth-Trunk
* Tunnel
* NULL
* LoopBack
* Vlanif
* 100GE
* 40GE
* MTunnel
* 10GE
* GE
* MEth
* Vbdif
* Nve
| Interface type. |
| **port\_number** string | | Source port number. |
| **trap\_name** string | | Alarm trap name. |
Notes
-----
Note
* Recommended connection is `network_cli`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: CloudEngine snmp traps test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Config SNMP trap all enable"
community.network.ce_snmp_traps:
state: present
feature_name: all
provider: "{{ cli }}"
- name: "Config SNMP trap interface"
community.network.ce_snmp_traps:
state: present
interface_type: 40GE
interface_number: 2/0/1
provider: "{{ cli }}"
- name: "Config SNMP trap port"
community.network.ce_snmp_traps:
state: present
port_number: 2222
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of aaa params after module execution **Sample:** {'snmp-agent trap': ['enable'], 'undo snmp-agent trap': []} |
| **existing** dictionary | always | k/v pairs of existing aaa server **Sample:** {'snmp-agent trap': [], 'undo snmp-agent trap': []} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'feature\_name': 'all', 'state': 'present'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** ['snmp-agent trap enable'] |
### Authors
* wangdezhuang (@QijunPan)
ansible community.network.slxos_vlan – Manage VLANs on Extreme Networks SLX-OS network devices community.network.slxos\_vlan – Manage VLANs on Extreme Networks SLX-OS network devices
=======================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.slxos_vlan`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of VLANs on Extreme SLX-OS network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of VLANs definitions. |
| **delay** string | **Default:**10 | Delay the play should wait to check for declarative intent params values. |
| **interfaces** string / required | | List of interfaces that should be associated to the VLAN. |
| **name** string | | Name of the VLAN. |
| **purge** boolean | **Choices:*** **no** ←
* yes
| Purge VLANs not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** ←
* absent
| State of the VLAN configuration. |
| **vlan\_id** string / required | | ID of the VLAN. Range 1-4094. |
Notes
-----
Note
* Tested against SLX-OS 18r.1.00
Examples
--------
```
- name: Create vlan
community.network.slxos_vlan:
vlan_id: 100
name: test-vlan
state: present
- name: Add interfaces to VLAN
community.network.slxos_vlan:
vlan_id: 100
interfaces:
- Ethernet 0/1
- Ethernet 0/2
- name: Delete vlan
community.network.slxos_vlan:
vlan_id: 100
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 |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['vlan 100', 'name test-vlan'] |
### Authors
* Lindsay Hill (@lindsayhill)
ansible community.network.opx_cps – CPS operations on networking device running Openswitch (OPX) community.network.opx\_cps – CPS operations on networking device running Openswitch (OPX)
=========================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.opx_cps`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Executes the given operation on the YANG object, using CPS API in the networking device running OpenSwitch (OPX). It uses the YANG models provided in <https://github.com/open-switch/opx-base-model>.
Requirements
------------
The below requirements are needed on the host that executes this module.
* cps
* cps\_object
* cps\_utils
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **attr\_data** string | | Attribute Yang path and their corresponding data. |
| **attr\_type** string | | Attribute Yang type. |
| **commit\_event** boolean | **Choices:*** **no** ←
* yes
| Attempts to force the auto-commit event to the specified yang object. |
| **db** boolean | **Choices:*** **no** ←
* yes
| Queries/Writes the specified yang path from/to the db. |
| **module\_name** string | | Yang path to be configured. |
| **operation** string | **Choices:*** delete
* **create** ←
* set
* action
* get
| Operation to be performed on the object. |
| **qualifier** string | **Choices:*** **target** ←
* observed
* proposed
* realtime
* registration
* running
* startup
| A qualifier provides the type of object data to retrieve or act on. |
Examples
--------
```
- name: Create VLAN
community.network.opx_cps:
module_name: "dell-base-if-cmn/if/interfaces/interface"
attr_data: {
"base-if-vlan/if/interfaces/interface/id": 230,
"if/interfaces/interface/name": "br230",
"if/interfaces/interface/type": "ianaift:l2vlan"
}
operation: "create"
- name: Get VLAN
community.network.opx_cps:
module_name: "dell-base-if-cmn/if/interfaces/interface"
attr_data: {
"if/interfaces/interface/name": "br230",
}
operation: "get"
- name: Modify some attributes in VLAN
community.network.opx_cps:
module_name: "dell-base-if-cmn/if/interfaces/interface"
attr_data: {
"cps/key_data":
{ "if/interfaces/interface/name": "br230" },
"dell-if/if/interfaces/interface/untagged-ports": ["e101-008-0"],
}
operation: "set"
- name: Delete VLAN
community.network.opx_cps:
module_name: "dell-base-if-cmn/if/interfaces/interface"
attr_data: {
"if/interfaces/interface/name": "br230",
}
operation: "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 |
| --- | --- | --- |
| **commit\_event** boolean | when commit\_event is set to True in module options | Denotes if auto-commit event is set **Sample:** True |
| **cps\_curr\_config** dictionary | when CPS operations set, delete | Returns the CPS Get output i.e. the running configuration before CPS operation of set/delete is performed **Sample:** [{'data': {'base-if-vlan/if/interfaces/interface/id': 230, 'cps/key\_data': {'if/interfaces/interface/name': 'br230'}, 'dell-base-if-cmn/if/interfaces/interface/if-index': 44, 'dell-if/if/interfaces/interface/learning-mode': 1, 'dell-if/if/interfaces/interface/mtu': 1532, 'dell-if/if/interfaces/interface/phys-address': '', 'dell-if/if/interfaces/interface/vlan-type': 1, 'if/interfaces/interface/enabled': 0, 'if/interfaces/interface/type': 'ianaift:l2vlan'}, 'key': 'target/dell-base-if-cmn/if/interfaces/interface'}] |
| **db** boolean | when db is set to True in module options | Denotes if CPS DB transaction was performed **Sample:** True |
| **diff** dictionary | when CPS operations set, delete | The actual configuration that will be pushed comparing the running configuration and input attributes **Sample:** {'cps/key\_data': {'if/interfaces/interface/name': 'br230'}, 'dell-if/if/interfaces/interface/untagged-ports': ['e101-007-0']} |
| **response** list / elements=string | when a CPS transaction is successfully performed. | Output from the CPS transaction. Output of CPS Get operation if CPS set/create/delete not done. **Sample:** [{'data': {'base-if-vlan/if/interfaces/interface/id': 230, 'cps/object-group/return-code': 0, 'dell-base-if-cmn/if/interfaces/interface/if-index': 46, 'if/interfaces/interface/name': 'br230', 'if/interfaces/interface/type': 'ianaift:l2vlan'}, 'key': 'target/dell-base-if-cmn/if/interfaces/interface'}] |
### Authors
* Senthil Kumar Ganesan (@skg-net)
ansible community.network.pn_ipv6security_raguard_port – CLI command to add/remove ipv6security-raguard-port community.network.pn\_ipv6security\_raguard\_port – CLI command to add/remove ipv6security-raguard-port
=======================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_ipv6security_raguard_port`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to add ports to RA Guard Policy and remove ports to RA Guard Policy.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_name** string / required | | RA Guard Policy Name. |
| **pn\_ports** string / required | | Ports attached to RA Guard Policy. |
| **state** string | **Choices:*** **present** ←
* absent
| ipv6security-raguard-port configuration command. |
Examples
--------
```
- name: Ipv6 security raguard port add
community.network.pn_ipv6security_raguard_port:
pn_cliswitch: "sw01"
pn_name: "foo"
pn_ports: "1"
- name: Ipv6 security raguard port remove
community.network.pn_ipv6security_raguard_port:
pn_cliswitch: "sw01"
pn_name: "foo"
state: "absent"
pn_ports: "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 |
| --- | --- | --- |
| **changed** boolean | always | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the ipv6security-raguard-port command. |
| **stdout** list / elements=string | always | set of responses from the ipv6security-raguard-port command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
ansible community.network.ce_mlag_interface – Manages MLAG interfaces on HUAWEI CloudEngine switches. community.network.ce\_mlag\_interface – Manages MLAG interfaces on HUAWEI CloudEngine switches.
===============================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_mlag_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages MLAG interface attributes on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **dfs\_group\_id** string | **Default:**"present" | ID of a DFS group.The value is 1. |
| **eth\_trunk\_id** string | | Name of the local M-LAG interface. The value is ranging from 0 to 511. |
| **interface** string | | Name of the interface that enters the Error-Down state when the peer-link fails. The value is a string of 1 to 63 characters. |
| **mlag\_error\_down** string | **Choices:*** enable
* disable
| Configure the interface on the slave device to enter the Error-Down state. |
| **mlag\_id** string | | ID of the M-LAG. The value is an integer that ranges from 1 to 2048. |
| **mlag\_priority\_id** string | | M-LAG global LACP system priority. The value is an integer ranging from 0 to 65535. The default value is 32768. |
| **mlag\_system\_id** string | | M-LAG global LACP system MAC address. The value is a string of 0 to 255 characters. The default value is the MAC address of the Ethernet port of MPU. |
| **state** string | **Choices:*** **present** ←
* absent
| Specify desired state of the resource. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Mlag interface module test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Set interface mlag error down
community.network.ce_mlag_interface:
interface: 10GE2/0/1
mlag_error_down: enable
provider: "{{ cli }}"
- name: Create mlag
community.network.ce_mlag_interface:
eth_trunk_id: 1
dfs_group_id: 1
mlag_id: 4
provider: "{{ cli }}"
- name: Set mlag global attribute
community.network.ce_mlag_interface:
mlag_system_id: 0020-1409-0407
mlag_priority_id: 5
provider: "{{ cli }}"
- name: Set mlag interface attribute
community.network.ce_mlag_interface:
eth_trunk_id: 1
mlag_system_id: 0020-1409-0400
mlag_priority_id: 3
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of aaa params after module execution |
| **existing** dictionary | always | k/v pairs of existing aaa server **Sample:** {'mlagErrorDownInfos': [{'dfsgroupId': '1', 'portName': 'Eth-Trunk1'}]} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'interface': 'eth-trunk1', 'mlag\_error\_down': 'disable', 'state': 'present'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** {'interface eth-trunk1': None, 'undo m-lag unpaired-port suspend': None} |
### Authors
* Li Yanfeng (@QijunPan)
ansible community.network.edgeos_config – Manage EdgeOS configuration on remote device community.network.edgeos\_config – Manage EdgeOS configuration on remote device
===============================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.edgeos_config`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides configuration file management of EdgeOS devices. It provides arguments for managing both the configuration file and state of the active configuration. All configuration statements are based on `set` and `delete` commands in the device configuration.
* This is a network module and requires the `connection: network_cli` in order to work properly.
* For more information please see the [Network Guide](getting_started/index).
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **backup** boolean | **Choices:*** **no** ←
* yes
| The `backup` argument will backup the current device's active configuration to the Ansible control host prior to making any changes. If the `backup_options` value is not given, the backup file will be located in the backup folder in the playbook root directory or role root directory if the playbook is part of an ansible role. If the directory does not exist, it is created. |
| **backup\_options** dictionary | | This is a dict object containing configurable options related to backup file path. The value of this option is read only when `backup` is set to *yes*, if `backup` is set to *no* this option will be silently ignored. |
| | **dir\_path** path | | This option provides the path ending with directory name in which the backup configuration file will be stored. If the directory does not exist it will be first created and the filename is either the value of `filename` or default filename as described in `filename` options description. If the path value is not given in that case a *backup* directory will be created in the current working directory and backup configuration will be copied in `filename` within *backup* directory. |
| | **filename** string | | The filename to be used to store the backup configuration. If the filename is not given it will be generated based on the hostname, current time and date in format defined by <hostname>\_config.<current-date>@<current-time> |
| **comment** string | **Default:**"configured by edgeos\_config" | Allows a commit description to be specified to be included when the configuration is committed. If the configuration is not changed or committed, this argument is ignored. |
| **config** string | | The `config` argument specifies the base configuration to use to compare against the desired configuration. If this value is not specified, the module will automatically retrieve the current active configuration from the remote device. |
| **lines** string | | The ordered set of configuration lines to be managed and compared with the existing configuration on the remote device. |
| **match** string | **Choices:*** **line** ←
* none
| The `match` argument controls the method used to match against the current active configuration. By default, the desired config is matched against the active config and the deltas are loaded. If the `match` argument is set to `none` the active configuration is ignored and the configuration is always loaded. |
| **save** boolean | **Choices:*** **no** ←
* yes
| The `save` argument controls whether or not changes made to the active configuration are saved to disk. This is independent of committing the config. When set to `True`, the active configuration is saved. |
| **src** string | | The `src` argument specifies the path to the source config file to load. The source config file can either be in bracket format or set format. The source file can include Jinja2 template variables. |
Notes
-----
Note
* Tested against EdgeOS 1.9.7
* Setting `ANSIBLE_PERSISTENT_COMMAND_TIMEOUT` to 30 is recommended since the save command can take longer than the default of 10 seconds on some EdgeOS hardware.
Examples
--------
```
- name: Configure the remote device
community.network.edgeos_config:
lines:
- set system host-name {{ inventory_hostname }}
- set service lldp
- delete service dhcp-server
- name: Backup and load from file
community.network.edgeos_config:
src: edgeos.cfg
backup: yes
- name: Configurable backup path
community.network.edgeos_config:
src: edgeos.cfg
backup: yes
backup_options:
filename: backup.cfg
dir_path: /home/user
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **backup\_path** string | when backup is yes | The full path to the backup file **Sample:** /playbooks/ansible/backup/edgeos\_config.2016-07-16@22:28:34 |
| **commands** list / elements=string | always | The list of configuration commands sent to the device **Sample:** ['...', '...'] |
### Authors
* Nathaniel Case (@Qalthos)
* Sam Doran (@samdoran)
| programming_docs |
ansible community.network.ce_netstream_export – Manages netstream export on HUAWEI CloudEngine switches. community.network.ce\_netstream\_export – Manages netstream export on HUAWEI CloudEngine switches.
==================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_netstream_export`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Configure NetStream flow statistics exporting and versions for exported packets on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **as\_option** string | **Choices:*** origin
* peer
| Specifies the AS number recorded in the statistics as the original or the peer AS number. |
| **bgp\_nexthop** string | **Choices:*** enable
* **disable** ←
| Configures the statistics to carry BGP next hop information. Currently, only V9 supports the exported packets carrying BGP next hop information. |
| **host\_ip** string | | Specifies destination address which can be IPv6 or IPv4 of the exported NetStream packet. |
| **host\_port** string | | Specifies the destination UDP port number of the exported packets. The value is an integer that ranges from 1 to 65535. |
| **host\_vpn** string | | Specifies the VPN instance of the exported packets carrying flow statistics. Ensure the VPN instance has been created on the device. |
| **source\_ip** string | | Specifies source address which can be IPv6 or IPv4 of the exported NetStream packet. |
| **state** string | **Choices:*** **present** ←
* absent
| Manage the state of the resource. |
| **type** string / required | **Choices:*** ip
* vxlan
| Specifies NetStream feature. |
| **version** string | **Choices:*** 5
* 9
| Sets the version of exported packets. |
Notes
-----
Note
* Recommended connection is `network_cli`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Netstream export module test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Configures the source address for the exported packets carrying IPv4 flow statistics.
community.network.ce_netstream_export:
type: ip
source_ip: 192.8.2.2
provider: "{{ cli }}"
- name: Configures the source IP address for the exported packets carrying VXLAN flexible flow statistics.
community.network.ce_netstream_export:
type: vxlan
source_ip: 192.8.2.3
provider: "{{ cli }}"
- name: Configures the destination IP address and destination UDP port number for the exported packets carrying IPv4 flow statistics.
community.network.ce_netstream_export:
type: ip
host_ip: 192.8.2.4
host_port: 25
host_vpn: test
provider: "{{ cli }}"
- name: Configures the destination IP address and destination UDP port number for the exported packets carrying VXLAN flexible flow statistics.
community.network.ce_netstream_export:
type: vxlan
host_ip: 192.8.2.5
host_port: 26
host_vpn: test
provider: "{{ cli }}"
- name: Configures the version number of the exported packets carrying IPv4 flow statistics.
community.network.ce_netstream_export:
type: ip
version: 9
as_option: origin
bgp_nexthop: enable
provider: "{{ cli }}"
- name: Configures the version for the exported packets carrying VXLAN flexible flow statistics.
community.network.ce_netstream_export:
type: vxlan
version: 9
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of end attributes on the device **Sample:** {'as\_option': 'origin', 'bgp\_nexthop': 'enable', 'host\_ip': '192.8.5.6', 'host\_port': '26', 'host\_vpn': 'test', 'source\_ip': '192.8.2.5', 'type': 'ip', 'version': '9'} |
| **existing** dictionary | always | k/v pairs of existing attributes on the device **Sample:** {'as\_option': None, 'bgp\_nexthop': 'disable', 'host\_ip': None, 'host\_port': None, 'host\_vpn': None, 'source\_ip': None, 'type': 'ip', 'version': None} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'as\_option': 'origin', 'bgp\_nexthop': 'enable', 'host\_ip': '192.8.5.6', 'host\_port': '26', 'host\_vpn': 'test', 'source\_ip': '192.8.2.5', 'state': 'present', 'type': 'ip', 'version': '9'} |
| **updates** list / elements=string | always | command list sent to the device **Sample:** ['netstream export ip source 192.8.2.5', 'netstream export ip host 192.8.5.6 26 vpn-instance test', 'netstream export ip version 9 origin-as bgp-nexthop'] |
### Authors
* Zhijin Zhou (@QijunPan)
ansible community.network.pn_snmp_community – CLI command to create/modify/delete snmp-community community.network.pn\_snmp\_community – CLI command to create/modify/delete snmp-community
==========================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_snmp_community`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to create SNMP communities for SNMPv1 or delete SNMP communities for SNMPv1 or modify SNMP communities for SNMPv1.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_community\_string** string | | community name. |
| **pn\_community\_type** string | **Choices:*** read-only
* read-write
| community type. |
| **state** string / required | **Choices:*** present
* absent
* update
| State the action to perform. Use `present` to create snmp-community and `absent` to delete snmp-community `update` to update snmp-community. |
Examples
--------
```
- name: Create snmp community
community.network.pn_snmp_community:
pn_cliswitch: "sw01"
state: "present"
pn_community_string: "foo"
pn_community_type: "read-write"
- name: Delete snmp community
community.network.pn_snmp_community:
pn_cliswitch: "sw01"
state: "absent"
pn_community_string: "foo"
- name: Modify snmp community
community.network.pn_snmp_community:
pn_cliswitch: "sw01"
state: "update"
pn_community_string: "foo"
pn_community_type: "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 |
| --- | --- | --- |
| **changed** boolean | always | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the snmp-community command. |
| **stdout** list / elements=string | always | set of responses from the snmp-community command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
ansible community.network.pn_vrouter_interface_ip – CLI command to add/remove vrouter-interface-ip community.network.pn\_vrouter\_interface\_ip – CLI command to add/remove vrouter-interface-ip
=============================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_vrouter_interface_ip`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to add an IP address on interface from a vRouter or remove an IP address on interface from a vRouter.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_bd** string | | interface Bridge Domain. |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_ip** string | | IP address. |
| **pn\_netmask** string | | netmask. |
| **pn\_nic** string | | virtual NIC assigned to interface. |
| **pn\_vnet** string | | interface VLAN VNET. |
| **pn\_vrouter\_name** string | | name of service config. |
| **state** string / required | **Choices:*** present
* absent
| State the action to perform. Use `present` to addvrouter-interface-ip and `absent` to remove vrouter-interface-ip. |
Examples
--------
```
- name: Add vrouter interface to nic
community.network.pn_vrouter_interface_ip:
state: "present"
pn_cliswitch: "sw01"
pn_vrouter_name: "foo-vrouter"
pn_ip: "2620:0:1651:1::30"
pn_netmask: "127"
pn_nic: "eth0.4092"
- name: Remove vrouter interface to nic
community.network.pn_vrouter_interface_ip:
state: "absent"
pn_cliswitch: "sw01"
pn_vrouter_name: "foo-vrouter"
pn_ip: "2620:0:1651:1::30"
pn_nic: "eth0.4092"
```
Return Values
-------------
Common return 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 | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the vrouter-interface-ip command. |
| **stdout** list / elements=string | always | set of responses from the vrouter-interface-ip command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
ansible community.network.slxos_facts – Collect facts from devices running Extreme SLX-OS community.network.slxos\_facts – Collect facts from devices running Extreme SLX-OS
==================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.slxos_facts`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Collects a base set of device facts from a remote device that is running SLX-OS. This module prepends all of the base network fact keys with `ansible_net_<fact>`. The facts module will always collect a base set of facts from the device and can enable or disable collection of additional facts.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **gather\_subset** string | **Default:**["!config"] | When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument include all, hardware, config, and interfaces. Can specify a list of values to include a larger subset. Values can also be used with an initial `!` to specify that a specific subset should not be collected. |
Notes
-----
Note
* Tested against SLX-OS 17s.1.02
Examples
--------
```
- name: Collect all facts from the device
community.network.slxos_facts:
gather_subset: all
- name: Collect only the config and default facts
community.network.slxos_facts:
gather_subset:
- config
- name: Do not collect hardware facts
community.network.slxos_facts:
gather_subset:
- "!hardware"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **ansible\_net\_all\_ipv4\_addresses** list / elements=string | when interfaces is configured | All IPv4 addresses configured on the device |
| **ansible\_net\_all\_ipv6\_addresses** list / elements=string | when interfaces is configured | All Primary IPv6 addresses configured on the device |
| **ansible\_net\_config** string | when config is configured | The current active config from the device |
| **ansible\_net\_gather\_subset** list / elements=string | always | The list of fact subsets collected from the device |
| **ansible\_net\_hostname** string | always | The configured hostname of the device |
| **ansible\_net\_interfaces** dictionary | when interfaces is configured | A hash of all interfaces running on the system |
| **ansible\_net\_memfree\_mb** integer | when hardware is configured | The available free memory on the remote device in Mb |
| **ansible\_net\_memtotal\_mb** integer | when hardware is configured | The total memory on the remote device in Mb |
| **ansible\_net\_model** string | always | The model name returned from the device |
| **ansible\_net\_neighbors** dictionary | when interfaces is configured | The list of LLDP neighbors from the remote device |
| **ansible\_net\_serialnum** string | always | The serial number of the remote device |
| **ansible\_net\_version** string | always | The operating system version running on the remote device |
### Authors
* Lindsay Hill (@LindsayHill)
ansible community.network.avi_poolgroupdeploymentpolicy – Module for setup of PoolGroupDeploymentPolicy Avi RESTful Object community.network.avi\_poolgroupdeploymentpolicy – Module for setup of PoolGroupDeploymentPolicy Avi RESTful Object
===================================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_poolgroupdeploymentpolicy`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure PoolGroupDeploymentPolicy object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **auto\_disable\_old\_prod\_pools** boolean | **Choices:*** no
* yes
| It will automatically disable old production pools once there is a new production candidate. Default value when not specified in API or module is interpreted by Avi Controller as True. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **description** string | | User defined description for the object. |
| **evaluation\_duration** string | | Duration of evaluation period for automatic deployment. Allowed values are 60-86400. Default value when not specified in API or module is interpreted by Avi Controller as 300. |
| **name** string / required | | The name of the pool group deployment policy. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **rules** string | | List of pgdeploymentrule. |
| **scheme** string | | Deployment scheme. Enum options - BLUE\_GREEN, CANARY. Default value when not specified in API or module is interpreted by Avi Controller as BLUE\_GREEN. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **target\_test\_traffic\_ratio** string | | Target traffic ratio before pool is made production. Allowed values are 1-100. Default value when not specified in API or module is interpreted by Avi Controller as 100. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **test\_traffic\_ratio\_rampup** string | | Ratio of the traffic that is sent to the pool under test. Test ratio of 100 means blue green. Allowed values are 1-100. Default value when not specified in API or module is interpreted by Avi Controller as 100. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Uuid of the pool group deployment policy. |
| **webhook\_ref** string | | Webhook configured with url that avi controller will pass back information about pool group, old and new pool information and current deployment rule results. It is a reference to an object of type webhook. Field introduced in 17.1.1. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create PoolGroupDeploymentPolicy object
community.network.avi_poolgroupdeploymentpolicy:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_poolgroupdeploymentpolicy
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | PoolGroupDeploymentPolicy (api/poolgroupdeploymentpolicy) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#cfa8bdaebcbba0a8a6e9ecfcf8f4e9ecfafdf4e9ecfbf7f4aeb9a6a1aabbb8a0bda4bce9ecfbf9f4aca0a2)>
| programming_docs |
ansible community.network.ce_bfd_session – Manages BFD session configuration on HUAWEI CloudEngine devices. community.network.ce\_bfd\_session – Manages BFD session configuration on HUAWEI CloudEngine devices.
=====================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_bfd_session`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages BFD session configuration, creates a BFD session or deletes a specified BFD session on HUAWEI CloudEngine devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **addr\_type** string | **Choices:*** ipv4
| Specifies the peer IP address type. |
| **create\_type** string | **Choices:*** **static** ←
* auto
| BFD session creation mode, the currently created BFD session only supports static or static auto-negotiation mode. |
| **dest\_addr** string | | Specifies the peer IP address bound to the BFD session. |
| **local\_discr** string | | The BFD session local identifier does not need to be configured when the mode is auto. |
| **out\_if\_name** string | | Specifies the type and number of the interface bound to the BFD session. |
| **remote\_discr** string | | The BFD session remote identifier does not need to be configured when the mode is auto. |
| **session\_name** string / required | | Specifies the name of a BFD session. The value is a string of 1 to 15 case-sensitive characters without spaces. |
| **src\_addr** string | | Indicates the source IP address carried in BFD packets. |
| **state** string | **Choices:*** **present** ←
* absent
| Determines whether the config should be present or not on the device. |
| **use\_default\_ip** boolean | **Choices:*** **no** ←
* yes
| Indicates the default multicast IP address that is bound to a BFD session. By default, BFD uses the multicast IP address 224.0.0.184. You can set the multicast IP address by running the default-ip-address command. The value is a bool type. |
| **vrf\_name** string | | Specifies the name of a Virtual Private Network (VPN) instance that is bound to a BFD session. The value is a string of 1 to 31 case-sensitive characters, spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. The value \_public\_ is reserved and cannot be used as the VPN instance name. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Bfd session module test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Configuring Single-hop BFD for Detecting Faults on a Layer 2 Link
community.network.ce_bfd_session:
session_name: bfd_l2link
use_default_ip: true
out_if_name: 10GE1/0/1
local_discr: 163
remote_discr: 163
provider: '{{ cli }}'
- name: Configuring Single-Hop BFD on a VLANIF Interface
community.network.ce_bfd_session:
session_name: bfd_vlanif
dest_addr: 10.1.1.6
out_if_name: Vlanif100
local_discr: 163
remote_discr: 163
provider: '{{ cli }}'
- name: Configuring Multi-Hop BFD
community.network.ce_bfd_session:
session_name: bfd_multi_hop
dest_addr: 10.1.1.1
local_discr: 163
remote_discr: 163
provider: '{{ cli }}'
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of configuration after module execution **Sample:** {'session': {'addrType': 'IPV4', 'createType': 'SESS\_STATIC', 'destAddr': None, 'outIfName': '10GE1/0/1', 'sessName': 'bfd\_l2link', 'srcAddr': None, 'useDefaultIp': 'true', 'vrfName': None}} |
| **existing** dictionary | always | k/v pairs of existing configuration **Sample:** {'session': {}} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'addr\_type': None, 'create\_type': None, 'dest\_addr': None, 'out\_if\_name': '10GE1/0/1', 'session\_name': 'bfd\_l2link', 'src\_addr': None, 'state': 'present', 'use\_default\_ip': True, 'vrf\_name': None} |
| **updates** list / elements=string | always | commands sent to the device **Sample:** ['bfd bfd\_l2link bind peer-ip default-ip interface 10ge1/0/1'] |
### Authors
* QijunPan (@QijunPan)
ansible community.network.aruba_config – Manage Aruba configuration sections community.network.aruba\_config – Manage Aruba configuration sections
=====================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.aruba_config`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Aruba configurations use a simple block indent file syntax for segmenting configuration into sections. This module provides an implementation for working with Aruba configuration sections in a deterministic way.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **after** string | | The ordered set of commands to append to the end of the command stack if a change needs to be made. Just like with *before* this allows the playbook designer to append a set of commands to be executed after the command set. |
| **backup** boolean | **Choices:*** **no** ←
* yes
| This argument will cause the module to create a full backup of the current `running-config` from the remote device before any changes are made. If the `backup_options` value is not given, the backup file is written to the `backup` folder in the playbook root directory. If the directory does not exist, it is created. |
| **backup\_options** dictionary | | This is a dict object containing configurable options related to backup file path. The value of this option is read only when `backup` is set to *yes*, if `backup` is set to *no* this option will be silently ignored. |
| | **dir\_path** path | | This option provides the path ending with directory name in which the backup configuration file will be stored. If the directory does not exist it will be first created and the filename is either the value of `filename` or default filename as described in `filename` options description. If the path value is not given in that case a *backup* directory will be created in the current working directory and backup configuration will be copied in `filename` within *backup* directory. |
| | **filename** string | | The filename to be used to store the backup configuration. If the filename is not given it will be generated based on the hostname, current time and date in format defined by <hostname>\_config.<current-date>@<current-time> |
| **before** string | | The ordered set of commands to push on to the command stack if a change needs to be made. This allows the playbook designer the opportunity to perform configuration commands prior to pushing any changes without affecting how the set of commands are matched against the system. |
| **diff\_against** string | **Choices:*** startup
* intended
* running
| When using the `ansible-playbook --diff` command line argument the module can generate diffs against different sources. When this option is configure as *startup*, the module will return the diff of the running-config against the startup configuration. When this option is configured as *intended*, the module will return the diff of the running-config against the configuration provided in the `intended_config` argument. When this option is configured as *running*, the module will return the before and after diff of the running-config with respect to any changes made to the device configuration. |
| **diff\_ignore\_lines** string | | Use this argument to specify one or more lines that should be ignored during the diff. This is used for lines in the configuration that are automatically updated by the system. This argument takes a list of regular expressions or exact line matches. |
| **encrypt** boolean | **Choices:*** no
* **yes** ←
| This allows an Aruba controller's passwords and keys to be displayed in plain text when set to *false* or encrypted when set to *true*. If set to *false*, the setting will re-encrypt at the end of the module run. Backups are still encrypted even when set to *false*. |
| **intended\_config** string | | The `intended_config` provides the master configuration that the node should conform to and is used to check the final running-config against. This argument will not modify any settings on the remote device and is strictly used to check the compliance of the current device's configuration against. When specifying this argument, the task should also modify the `diff_against` value and set it to *intended*. |
| **lines** string | | The ordered set of commands that should be configured in the section. The commands must be the exact same commands as found in the device running-config. Be sure to note the configuration command syntax as some commands are automatically modified by the device config parser.
aliases: commands |
| **match** string | **Choices:*** **line** ←
* strict
* exact
* none
| Instructs the module on the way to perform the matching of the set of commands against the current device config. If match is set to *line*, commands are matched line by line. If match is set to *strict*, command lines are matched with respect to position. If match is set to *exact*, command lines must be an equal match. Finally, if match is set to *none*, the module will not attempt to compare the source configuration with the running configuration on the remote device. |
| **parents** string | | The ordered set of parents that uniquely identify the section or hierarchy the commands should be checked against. If the parents argument is omitted, the commands are checked against the set of top level or global commands. |
| **provider** string | | A dict object containing connection details. |
| | **host** string / required | | 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. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | **Default:**22 | Specifies the port to use when building the connection to the remote. device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | **Default:**10 | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **replace** string | **Choices:*** **line** ←
* block
| Instructs the module on the way to perform the configuration on the device. If the replace argument is set to *line* then the modified lines are pushed to the device in configuration mode. If the replace argument is set to *block* then the entire command block is pushed to the device in configuration mode if any line is not correct. |
| **running\_config** string | | The module, by default, will connect to the remote device and retrieve the current running-config to use as a base for comparing against the contents of source. There are times when it is not desirable to have the task get the current running-config for every task in a playbook. The *running\_config* argument allows the implementer to pass in the configuration to use as the base config for comparison.
aliases: config |
| **save\_when** string | **Choices:*** always
* **never** ←
* modified
* changed
| When changes are made to the device running-configuration, the changes are not copied to non-volatile storage by default. Using this argument will change that before. If the argument is set to *always*, then the running-config will always be copied to the startup configuration and the *modified* flag will always be set to True. If the argument is set to *modified*, then the running-config will only be copied to the startup configuration if it has changed since the last save to startup configuration. If the argument is set to *never*, the running-config will never be copied to the startup configuration. If the argument is set to *changed*, then the running-config will only be copied to the startup configuration if the task has made a change. |
| **src** string | | Specifies the source path to the file that contains the configuration or configuration template to load. The path to the source file can either be the full path on the Ansible control host or a relative path from the playbook or role root directory. This argument is mutually exclusive with *lines*, *parents*. |
Examples
--------
```
- name: Configure top level configuration
community.network.aruba_config:
lines: hostname {{ inventory_hostname }}
- name: Diff the running-config against a provided config
community.network.aruba_config:
diff_against: intended
intended_config: "{{ lookup('file', 'master.cfg') }}"
- name: Configure interface settings
community.network.aruba_config:
lines:
- description test interface
- ip access-group 1 in
parents: interface gigabitethernet 0/0/0
- name: Load new acl into device
community.network.aruba_config:
lines:
- permit host 10.10.10.10
- ipv6 permit host fda9:97d6:32a3:3e59::3333
parents: ip access-list standard 1
before: no ip access-list standard 1
match: exact
- name: Configurable backup path
community.network.aruba_config:
backup: yes
lines: hostname {{ inventory_hostname }}
backup_options:
filename: backup.cfg
dir_path: /home/user
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **backup\_path** string | when backup is yes | The full path to the backup file **Sample:** /playbooks/ansible/backup/aruba\_config.2016-07-16@22:28:34 |
| **commands** list / elements=string | always | The set of commands that will be pushed to the remote device **Sample:** ['hostname foo', 'vlan 1', 'name default'] |
| **updates** list / elements=string | always | The set of commands that will be pushed to the remote device **Sample:** ['hostname foo', 'vlan 1', 'name default'] |
### Authors
* James Mighion (@jmighion)
ansible community.network.ce_vxlan_vap – Manages VXLAN virtual access point on HUAWEI CloudEngine Devices. community.network.ce\_vxlan\_vap – Manages VXLAN virtual access point on HUAWEI CloudEngine Devices.
====================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_vxlan_vap`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages VXLAN Virtual access point on HUAWEI CloudEngine Devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **bind\_vlan\_id** string | | Specifies the VLAN binding to a BD(Bridge Domain). The value is an integer ranging ranging from 1 to 4094. |
| **bridge\_domain\_id** string | | Specifies a bridge domain ID. The value is an integer ranging from 1 to 16777215. |
| **ce\_vid** string | | When *encapsulation* is 'dot1q', specifies a VLAN ID in the outer VLAN tag. When *encapsulation* is 'qinq', specifies an outer VLAN ID for double-tagged packets to be received by a Layer 2 sub-interface. The value is an integer ranging from 1 to 4094. |
| **encapsulation** string | **Choices:*** dot1q
* default
* untag
* qinq
* none
| Specifies an encapsulation type of packets allowed to pass through a Layer 2 sub-interface. |
| **l2\_sub\_interface** string | | Specifies an Sub-Interface full name, i.e. "10GE1/0/41.1". The value is a string of 1 to 63 case-insensitive characters, spaces supported. |
| **pe\_vid** string | | When *encapsulation* is 'qinq', specifies an inner VLAN ID for double-tagged packets to be received by a Layer 2 sub-interface. The value is an integer ranging from 1 to 4094. |
| **state** string | **Choices:*** **present** ←
* absent
| Determines whether the config should be present or not on the device. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Vxlan vap module test
hosts: ce128
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Create a mapping between a VLAN and a BD
community.network.ce_vxlan_vap:
bridge_domain_id: 100
bind_vlan_id: 99
provider: "{{ cli }}"
- name: Bind a Layer 2 sub-interface to a BD
community.network.ce_vxlan_vap:
bridge_domain_id: 100
l2_sub_interface: 10GE2/0/20.1
provider: "{{ cli }}"
- name: Configure an encapsulation type on a Layer 2 sub-interface
community.network.ce_vxlan_vap:
l2_sub_interface: 10GE2/0/20.1
encapsulation: dot1q
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | verbose mode | k/v pairs of configuration after module execution **Sample:** {'bind\_intf\_list': ['110GE2/0/20.1', '10GE2/0/20.2'], 'bind\_vlan\_list': ['99'], 'bridge\_domain\_id': '100'} |
| **existing** dictionary | verbose mode | k/v pairs of existing configuration **Sample:** {'bind\_intf\_list': ['10GE2/0/20.1', '10GE2/0/20.2'], 'bind\_vlan\_list': [], 'bridge\_domain\_id': '100'} |
| **proposed** dictionary | verbose mode | k/v pairs of parameters passed into module **Sample:** {'bind\_vlan\_id': '99', 'bridge\_domain\_id': '100', 'state="present"': None} |
| **updates** list / elements=string | always | commands sent to the device **Sample:** ['bridge-domain 100', 'l2 binding vlan 99'] |
### Authors
* QijunPan (@QijunPan)
| programming_docs |
ansible community.network.avi_dnspolicy – Module for setup of DnsPolicy Avi RESTful Object community.network.avi\_dnspolicy – Module for setup of DnsPolicy Avi RESTful Object
===================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_dnspolicy`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure DnsPolicy object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **created\_by** string | | Creator name. Field introduced in 17.1.1. |
| **description** string | | Field introduced in 17.1.1. |
| **name** string / required | | Name of the dns policy. Field introduced in 17.1.1. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **rule** string | | Dns rules. Field introduced in 17.1.1. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. Field introduced in 17.1.1. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Uuid of the dns policy. Field introduced in 17.1.1. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create DnsPolicy object
community.network.avi_dnspolicy:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_dnspolicy
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | DnsPolicy (api/dnspolicy) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#c2a5b0a3b1b6ada5abe4e1f1f5f9e4e1f7f0f9e4e1f6faf9a3b4abaca7b6b5adb0a9b1e4e1f6f4f9a1adaf)>
ansible community.network.ce_rollback – Set a checkpoint or rollback to a checkpoint on HUAWEI CloudEngine switches. community.network.ce\_rollback – Set a checkpoint or rollback to a checkpoint on HUAWEI CloudEngine switches.
=============================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_rollback`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module offers the ability to set a configuration checkpoint file or rollback to a configuration checkpoint file on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **action** string / required | **Choices:*** rollback
* clear
* set
* display
* commit
| The operation of configuration rollback. |
| **commit\_id** string | | Specifies the label of the configuration rollback point to which system configurations are expected to roll back. The value is an integer that the system generates automatically. |
| **filename** string | | Specifies a configuration file for configuration rollback. The value is a string of 5 to 64 case-sensitive characters in the format of \*.zip, \*.cfg, or \*.dat, spaces not supported. |
| **label** string | | Specifies a user label for a configuration rollback point. The value is a string of 1 to 256 case-sensitive ASCII characters, spaces not supported. The value must start with a letter and cannot be presented in a single hyphen (-). |
| **last** string | | Specifies the number of configuration rollback points. The value is an integer that ranges from 1 to 80. |
| **oldest** string | | Specifies the number of configuration rollback points. The value is an integer that ranges from 1 to 80. |
Notes
-----
Note
* Recommended connection is `network_cli`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Rollback module test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Ensure commit_id is exist, and specifies the label of the configuration rollback point to
which system configurations are expected to roll back.
community.network.ce_rollback:
commit_id: 1000000748
action: rollback
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of configuration after module execution **Sample:** {'commitId': '1000000748', 'userLabel': 'abc'} |
| **existing** dictionary | sometimes | k/v pairs of existing rollback **Sample:** {'commitId': '1000000748', 'userLabel': 'abc'} |
| **proposed** dictionary | sometimes | k/v pairs of parameters passed into module **Sample:** {'action': 'rollback', 'commit\_id': '1000000748'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** ['rollback configuration to file a.cfg', 'set configuration commit 1000000783 label ddd', 'clear configuration commit 1000000783 label', 'display configuration commit list'] |
### Authors
* Li Yanfeng (@QijunPan)
ansible community.network.nos_config – Manage Extreme Networks NOS configuration sections community.network.nos\_config – Manage Extreme Networks NOS configuration sections
==================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.nos_config`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Extreme NOS configurations use a simple block indent file syntax for segmenting configuration into sections. This module provides an implementation for working with NOS configuration sections in a deterministic way.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **after** string | | The ordered set of commands to append to the end of the command stack if a change needs to be made. Just like with *before* this allows the playbook designer to append a set of commands to be executed after the command set. |
| **backup** boolean | **Choices:*** **no** ←
* yes
| This argument will cause the module to create a full backup of the current `running-config` from the remote device before any changes are made. If the `backup_options` value is not given, the backup file is written to the `backup` folder in the playbook root directory. If the directory does not exist, it is created. |
| **backup\_options** dictionary | | This is a dict object containing configurable options related to backup file path. The value of this option is read only when `backup` is set to *yes*, if `backup` is set to *no* this option will be silently ignored. |
| | **dir\_path** path | | This option provides the path ending with directory name in which the backup configuration file will be stored. If the directory does not exist it will be first created and the filename is either the value of `filename` or default filename as described in `filename` options description. If the path value is not given in that case a *backup* directory will be created in the current working directory and backup configuration will be copied in `filename` within *backup* directory. |
| | **filename** string | | The filename to be used to store the backup configuration. If the filename is not given it will be generated based on the hostname, current time and date in format defined by <hostname>\_config.<current-date>@<current-time> |
| **before** string | | The ordered set of commands to push on to the command stack if a change needs to be made. This allows the playbook designer the opportunity to perform configuration commands prior to pushing any changes without affecting how the set of commands are matched against the system. |
| **diff\_against** string | **Choices:*** running
* intended
| When using the `ansible-playbook --diff` command line argument the module can generate diffs against different sources. When this option is configured as *intended*, the module will return the diff of the running-config against the configuration provided in the `intended_config` argument. When this option is configured as *running*, the module will return the before and after diff of the running-config with respect to any changes made to the device configuration. |
| **diff\_ignore\_lines** string | | Use this argument to specify one or more lines that should be ignored during the diff. This is used for lines in the configuration that are automatically updated by the system. This argument takes a list of regular expressions or exact line matches. |
| **intended\_config** string | | The `intended_config` provides the master configuration that the node should conform to and is used to check the final running-config against. This argument will not modify any settings on the remote device and is strictly used to check the compliance of the current device's configuration against. When specifying this argument, the task should also modify the `diff_against` value and set it to *intended*. |
| **lines** string | | The ordered set of commands that should be configured in the section. The commands must be the exact same commands as found in the device running-config. Be sure to note the configuration command syntax as some commands are automatically modified by the device config parser.
aliases: commands |
| **match** string | **Choices:*** **line** ←
* strict
* exact
* none
| Instructs the module on the way to perform the matching of the set of commands against the current device config. If match is set to *line*, commands are matched line by line. If match is set to *strict*, command lines are matched with respect to position. If match is set to *exact*, command lines must be an equal match. Finally, if match is set to *none*, the module will not attempt to compare the source configuration with the running configuration on the remote device. |
| **multiline\_delimiter** string | **Default:**"@" | This argument is used when pushing a multiline configuration element to the NOS device. It specifies the character to use as the delimiting character. This only applies to the configuration action. |
| **parents** string | | The ordered set of parents that uniquely identify the section or hierarchy the commands should be checked against. If the parents argument is omitted, the commands are checked against the set of top level or global commands. |
| **replace** string | **Choices:*** **line** ←
* block
| Instructs the module on the way to perform the configuration on the device. If the replace argument is set to *line* then the modified lines are pushed to the device in configuration mode. If the replace argument is set to *block* then the entire command block is pushed to the device in configuration mode if any line is not correct. |
| **running\_config** string | | The module, by default, will connect to the remote device and retrieve the current running-config to use as a base for comparing against the contents of source. There are times when it is not desirable to have the task get the current running-config for every task in a playbook. The *running\_config* argument allows the implementer to pass in the configuration to use as the base config for comparison.
aliases: config |
| **src** string | | Specifies the source path to the file that contains the configuration or configuration template to load. The path to the source file can either be the full path on the Ansible control host or a relative path from the playbook or role root directory. This argument is mutually exclusive with *lines*, *parents*. |
Notes
-----
Note
* Tested against NOS 7.2.0
Examples
--------
```
- name: Configure top level configuration
community.network.nos_config:
lines: logging raslog console INFO
- name: Configure interface settings
community.network.nos_config:
lines:
- description test interface
- ip address 172.31.1.1/24
parents:
- interface TenGigabitEthernet 104/0/1
- name: Configure multiple interfaces
community.network.nos_config:
lines:
- lacp timeout long
parents: "{{ item }}"
with_items:
- interface TenGigabitEthernet 104/0/1
- interface TenGigabitEthernet 104/0/2
- name: Load new acl into device
community.network.nos_config:
lines:
- seq 10 permit ip host 1.1.1.1 any log
- seq 20 permit ip host 2.2.2.2 any log
- seq 30 permit ip host 3.3.3.3 any log
- seq 40 permit ip host 4.4.4.4 any log
- seq 50 permit ip host 5.5.5.5 any log
parents: ip access-list extended test
before: no ip access-list extended test
match: exact
- name: Check the running-config against master config
community.network.nos_config:
diff_against: intended
intended_config: "{{ lookup('file', 'master.cfg') }}"
- name: Configurable backup path
community.network.nos_config:
lines: logging raslog console INFO
backup: yes
backup_options:
filename: backup.cfg
dir_path: /home/user
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **backup\_path** string | when backup is yes | The full path to the backup file **Sample:** /playbooks/ansible/backup/nos\_config.2018-02-12@18:26:34 |
| **commands** list / elements=string | always | The set of commands that will be pushed to the remote device **Sample:** ['switch-attributes hostname foo', 'router ospf', 'area 0'] |
| **updates** list / elements=string | always | The set of commands that will be pushed to the remote device **Sample:** ['switch-attributes hostname foo', 'router ospf', 'area 0'] |
### Authors
* Lindsay Hill (@LindsayHill)
ansible community.network.sros_command – Run commands on remote devices running Nokia SR OS community.network.sros\_command – Run commands on remote devices running Nokia SR OS
====================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.sros_command`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Sends arbitrary commands to an SR OS node and returns the results read from the device. This module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met.
* This module does not support running commands in configuration mode. Please use [community.network.sros\_config](sros_config_module#ansible-collections-community-network-sros-config-module) to configure SR OS devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **commands** string / required | | List of commands to send to the remote SR OS device over the configured provider. The resulting output from the command is returned. If the *wait\_for* argument is provided, the module is not returned until the condition is satisfied or the number of retries has expired. |
| **interval** string | **Default:**1 | Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified conditions, the interval indicates how long to wait before trying the command again. |
| **match** string | **Choices:*** any
* **all** ←
| The *match* argument is used in conjunction with the *wait\_for* argument to specify the match policy. Valid values are `all` or `any`. If the value is set to `all` then all conditionals in the wait\_for must be satisfied. If the value is set to `any` then only one of the values must be satisfied. |
| **provider** dictionary | | A dict object containing connection details. |
| | **host** string / required | | 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. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | **Default:**22 | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | **Default:**10 | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **retries** string | **Default:**10 | Specifies the number of retries a command should by tried before it is considered failed. The command is run on the target device every retry and evaluated against the *wait\_for* conditions. |
| **wait\_for** string | | List of conditions to evaluate against the output of the command. The task will wait for each condition to be true before moving forward. If the conditional is not true within the configured number of retries, the task fails. See examples.
aliases: waitfor |
Notes
-----
Note
* For more information on using Ansible to manage Nokia SR OS Network devices see <https://www.ansible.com/ansible-nokia>.
Examples
--------
```
# Note: examples below use the following provider dict to handle
# transport and authentication to the node.
---
vars:
cli:
host: "{{ inventory_hostname }}"
username: admin
password: admin
transport: cli
---
tasks:
- name: Run show version on remote devices
community.network.sros_command:
commands: show version
provider: "{{ cli }}"
- name: Run show version and check to see if output contains sros
community.network.sros_command:
commands: show version
wait_for: result[0] contains sros
provider: "{{ cli }}"
- name: Run multiple commands on remote nodes
community.network.sros_command:
commands:
- show version
- show port detail
provider: "{{ cli }}"
- name: Run multiple commands and evaluate the output
community.network.sros_command:
commands:
- show version
- show port detail
wait_for:
- result[0] contains TiMOS-B-14.0.R4
provider: "{{ cli }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **failed\_conditions** list / elements=string | failed | The list of conditionals that have failed **Sample:** ['...', '...'] |
| **stdout** list / elements=string | always apart from low level errors (such as action plugin) | The set of responses from the commands **Sample:** ['...', '...'] |
| **stdout\_lines** list / elements=string | always apart from low level errors (such as action plugin) | The value of stdout split into a list **Sample:** [['...', '...'], ['...'], ['...']] |
### Authors
* Peter Sprygada (@privateip)
| programming_docs |
ansible community.network.ce_command – Run arbitrary command on HUAWEI CloudEngine devices. community.network.ce\_command – Run arbitrary command on HUAWEI CloudEngine devices.
====================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_command`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Sends an arbitrary command to an HUAWEI CloudEngine node and returns the results read from the device. The ce\_command module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **commands** string / required | | The commands to send to the remote HUAWEI CloudEngine device over the configured provider. The resulting output from the command is returned. If the *wait\_for* argument is provided, the module is not returned until the condition is satisfied or the number of *retries* has been exceeded. |
| **interval** string | **Default:**1 | Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified conditional, the interval indicates how to long to wait before trying the command again. |
| **match** string | **Default:**"all" | The *match* argument is used in conjunction with the *wait\_for* argument to specify the match policy. Valid values are `all` or `any`. If the value is set to `all` then all conditionals in the *wait\_for* must be satisfied. If the value is set to `any` then only one of the values must be satisfied. |
| **retries** string | **Default:**10 | Specifies the number of retries a command should by tried before it is considered failed. The command is run on the target device every retry and evaluated against the *wait\_for* conditionals. |
| **wait\_for** string | | Specifies what to evaluate from the output of the command and what conditionals to apply. This argument will cause the task to wait for a particular conditional to be true before moving forward. If the conditional is not true by the configured retries, the task fails. See examples. |
Notes
-----
Note
* Recommended connection is `network_cli`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
# Note: examples below use the following provider dict to handle
# transport and authentication to the node.
- name: CloudEngine command test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Run display version on remote devices"
community.network.ce_command:
commands: display version
provider: "{{ cli }}"
- name: "Run display version and check to see if output contains HUAWEI"
community.network.ce_command:
commands: display version
wait_for: result[0] contains HUAWEI
provider: "{{ cli }}"
- name: "Run multiple commands on remote nodes"
community.network.ce_command:
commands:
- display version
- display device
provider: "{{ cli }}"
- name: "Run multiple commands and evaluate the output"
community.network.ce_command:
commands:
- display version
- display device
wait_for:
- result[0] contains HUAWEI
- result[1] contains Device
provider: "{{ cli }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **failed\_conditions** list / elements=string | failed | the conditionals that failed **Sample:** ['...', '...'] |
| **stdout** list / elements=string | always | the set of responses from the commands **Sample:** ['...', '...'] |
| **stdout\_lines** list / elements=string | always | The value of stdout split into a list **Sample:** [['...', '...'], ['...'], ['...']] |
### Authors
* JackyGao2016 (@CloudEngine-Ansible)
ansible community.network.icx_banner – Manage multiline banners on Ruckus ICX 7000 series switches community.network.icx\_banner – Manage multiline banners on Ruckus ICX 7000 series switches
===========================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.icx_banner`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This will configure both login and motd banners on remote ruckus ICX 7000 series switches. It allows playbooks to add or remove banner text from the active running configuration.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **banner** string / required | **Choices:*** motd
* exec
* incoming
| Specifies which banner should be configured on the remote device. |
| **check\_running\_config** boolean | **Choices:*** no
* **yes** ←
| Check running configuration. This can be set as environment variable. Module will use environment variable value(default:True), unless it is overridden, by specifying it as module parameter. |
| **enterkey** boolean | **Choices:*** no
* yes
| Specifies whether or not the motd configuration should accept the require-enter-key Default is false. |
| **state** string | **Choices:*** **present** ←
* absent
| Specifies whether or not the configuration is present in the current devices active running configuration. |
| **text** string | | The banner text that should be present in the remote device running configuration. This argument accepts a multiline string, with no empty lines. |
Notes
-----
Note
* Tested against ICX 10.1
Examples
--------
```
- name: Configure the motd banner
community.network.icx_banner:
banner: motd
text: |
this is my motd banner
that contains a multiline
string
state: present
- name: Remove the motd banner
community.network.icx_banner:
banner: motd
state: absent
- name: Configure require-enter-key for motd
community.network.icx_banner:
banner: motd
enterkey: True
- name: Remove require-enter-key for motd
community.network.icx_banner:
banner: motd
enterkey: False
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['banner motd', 'this is my motd banner', 'that contains a multiline', 'string'] |
### Authors
* Ruckus Wireless (@Commscope)
ansible community.network.ce_vrrp – Manages VRRP interfaces on HUAWEI CloudEngine devices. community.network.ce\_vrrp – Manages VRRP interfaces on HUAWEI CloudEngine devices.
===================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_vrrp`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages VRRP interface attributes on HUAWEI CloudEngine devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **admin\_flowdown** boolean | **Choices:*** no
* yes
**Default:**"false" | Disable the flowdown function for service VRRP. |
| **admin\_ignore\_if\_down** boolean | **Choices:*** no
* yes
**Default:**"false" | mVRRP ignores an interface Down event. |
| **admin\_interface** string | | Tracked mVRRP interface name. The value is a string of 1 to 63 characters. |
| **admin\_vrid** string | | Tracked mVRRP ID. The value is an integer ranging from 1 to 255. |
| **advertise\_interval** string | | Configured interval between sending advertisements, in milliseconds. Only the master router sends VRRP advertisements. The default value is 1000 milliseconds. |
| **auth\_key** string | | This object is set based on the authentication type. When noAuthentication is specified, the value is empty. When simpleTextPassword or md5Authentication is specified, the value is a string of 1 to 8 characters in plaintext and displayed as a blank text for security. |
| **auth\_mode** string | **Choices:*** simple
* md5
* none
| Authentication type used for VRRP packet exchanges between virtual routers. The values are noAuthentication, simpleTextPassword, md5Authentication. The default value is noAuthentication. |
| **fast\_resume** string | **Choices:*** enable
* disable
| mVRRP's fast resume mode. |
| **gratuitous\_arp\_interval** string | | Interval at which gratuitous ARP packets are sent, in seconds. The value ranges from 30 to 1200.The default value is 300. |
| **holding\_multiplier** string | | The configured holdMultiplier.The value is an integer ranging from 3 to 10. The default value is 3. |
| **interface** string | | Name of an interface. The value is a string of 1 to 63 characters. |
| **is\_plain** boolean | **Choices:*** no
* yes
**Default:**"false" | Select the display mode of an authentication key. By default, an authentication key is displayed in ciphertext. |
| **preempt\_timer\_delay** string | | Preemption delay. The value is an integer ranging from 0 to 3600. The default value is 0. |
| **priority** string | | Configured VRRP priority. The value ranges from 1 to 254. The default value is 100. A larger value indicates a higher priority. |
| **recover\_delay** string | | Delay in recovering after an interface goes Up. The delay is used for interface flapping suppression. The value is an integer ranging from 0 to 3600. The default value is 0 seconds. |
| **state** string | **Choices:*** **present** ←
* absent
| Specify desired state of the resource. |
| **version** string | **Choices:*** v2
* v3
| VRRP version. The default version is v2. |
| **virtual\_ip** string | | Virtual IP address. The value is a string of 0 to 255 characters. |
| **vrid** string | **Default:**"present" | VRRP backup group ID. The value is an integer ranging from 1 to 255. |
| **vrrp\_type** string | **Choices:*** normal
* member
* admin
| Type of a VRRP backup group. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Vrrp module test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Set vrrp version
community.network.ce_vrrp:
version: v3
provider: "{{ cli }}"
- name: Set vrrp gratuitous-arp interval
community.network.ce_vrrp:
gratuitous_arp_interval: 40
mlag_id: 4
provider: "{{ cli }}"
- name: Set vrrp recover-delay
community.network.ce_vrrp:
recover_delay: 10
provider: "{{ cli }}"
- name: Set vrrp vrid virtual-ip
community.network.ce_vrrp:
interface: 40GE2/0/8
vrid: 1
virtual_ip: 10.14.2.7
provider: "{{ cli }}"
- name: Set vrrp vrid admin
community.network.ce_vrrp:
interface: 40GE2/0/8
vrid: 1
vrrp_type: admin
provider: "{{ cli }}"
- name: Set vrrp vrid fast_resume
community.network.ce_vrrp:
interface: 40GE2/0/8
vrid: 1
fast_resume: enable
provider: "{{ cli }}"
- name: Set vrrp vrid holding-multiplier
community.network.ce_vrrp:
interface: 40GE2/0/8
vrid: 1
holding_multiplier: 4
provider: "{{ cli }}"
- name: Set vrrp vrid preempt timer delay
community.network.ce_vrrp:
interface: 40GE2/0/8
vrid: 1
preempt_timer_delay: 10
provider: "{{ cli }}"
- name: Set vrrp vrid admin-vrrp
community.network.ce_vrrp:
interface: 40GE2/0/8
vrid: 1
admin_interface: 40GE2/0/9
admin_vrid: 2
vrrp_type: member
provider: "{{ cli }}"
- name: Set vrrp vrid authentication-mode
community.network.ce_vrrp:
interface: 40GE2/0/8
vrid: 1
is_plain: true
auth_mode: simple
auth_key: aaa
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of aaa params after module execution **Sample:** {'auth\_mode': 'simple', 'interface': '40GE2/0/8', 'is\_plain': 'true', 'vrid': '1', 'vrrp\_type': 'normal'} |
| **existing** dictionary | always | k/v pairs of existing aaa server **Sample:** {'auth\_mode': 'none', 'interface': '40GE2/0/8', 'is\_plain': 'false', 'vrid': '1', 'vrrp\_type': 'normal'} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'auth\_key': 'aaa', 'auth\_mode': 'simple', 'interface': '40GE2/0/8', 'is\_plain': True, 'state': 'present', 'vrid': '1'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** {'interface 40GE2/0/8': None, 'vrrp vrid 1 authentication-mode simple plain aaa': None} |
### Authors
* Li Yanfeng (@numone213)
ansible community.network.ce_interface – Manages physical attributes of interfaces on HUAWEI CloudEngine switches. community.network.ce\_interface – Manages physical attributes of interfaces on HUAWEI CloudEngine switches.
===========================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages physical attributes of interfaces on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **admin\_state** string | **Choices:*** up
* down
| Specifies the interface management status. The value is an enumerated type. up, An interface is in the administrative Up state. down, An interface is in the administrative Down state. |
| **description** string | | Specifies an interface description. The value is a string of 1 to 242 case-sensitive characters, spaces supported but question marks (?) not supported. |
| **interface** string | | Full name of interface, i.e. 40GE1/0/10, Tunnel1. |
| **interface\_type** string | **Choices:*** ge
* 10ge
* 25ge
* 4x10ge
* 40ge
* 100ge
* vlanif
* loopback
* meth
* eth-trunk
* nve
* tunnel
* ethernet
* fcoe-port
* fabric-port
* stack-port
* null
| Interface type to be configured from the device. |
| **l2sub** boolean | **Choices:*** **no** ←
* yes
| Specifies whether the interface is a Layer 2 sub-interface. |
| **mode** string | **Choices:*** layer2
* layer3
| Manage Layer 2 or Layer 3 state of the interface. |
| **state** string | **Choices:*** **present** ←
* absent
* default
| Specify desired state of the resource. |
Notes
-----
Note
* This module is also used to create logical interfaces such as vlanif and loopbacks.
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Interface module test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Ensure an interface is a Layer 3 port and that it has the proper description
community.network.ce_interface:
interface: 10GE1/0/22
description: 'Configured by Ansible'
mode: layer3
provider: '{{ cli }}'
- name: Admin down an interface
community.network.ce_interface:
interface: 10GE1/0/22
admin_state: down
provider: '{{ cli }}'
- name: Remove all tunnel interfaces
community.network.ce_interface:
interface_type: tunnel
state: absent
provider: '{{ cli }}'
- name: Remove all logical interfaces
community.network.ce_interface:
interface_type: '{{ item }}'
state: absent
provider: '{{ cli }}'
with_items:
- loopback
- eth-trunk
- nve
- name: Admin up all 10GE interfaces
community.network.ce_interface:
interface_type: 10GE
admin_state: up
provider: '{{ cli }}'
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of switchport after module execution **Sample:** {'admin\_state': 'down', 'description': 'None', 'interface': '10GE1/0/10', 'mode': 'layer2'} |
| **existing** dictionary | always | k/v pairs of existing switchport **Sample:** {'admin\_state': 'up', 'description': 'None', 'interface': '10GE1/0/10', 'mode': 'layer2'} |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'admin\_state': 'down', 'interface': '10GE1/0/10'} |
| **updates** list / elements=string | always | command list sent to the device **Sample:** ['interface 10GE1/0/10', 'shutdown'] |
### Authors
* QijunPan (@QijunPan)
| programming_docs |
ansible community.network.ce_snmp_contact – Manages SNMP contact configuration on HUAWEI CloudEngine switches. community.network.ce\_snmp\_contact – Manages SNMP contact configuration on HUAWEI CloudEngine switches.
========================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_snmp_contact`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages SNMP contact configurations on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **contact** string / required | | Contact information. |
| **state** string | **Choices:*** **present** ←
* absent
| Manage the state of the resource. |
Notes
-----
Note
* Recommended connection is `network_cli`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: CloudEngine snmp contact test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Config SNMP contact"
community.network.ce_snmp_contact:
state: present
contact: call Operator at 010-99999999
provider: "{{ cli }}"
- name: "Undo SNMP contact"
community.network.ce_snmp_contact:
state: absent
contact: call Operator at 010-99999999
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of aaa params after module execution **Sample:** {'contact': 'call Operator at 010-99999999'} |
| **existing** dictionary | always | k/v pairs of existing aaa server |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'contact': 'call Operator at 010-99999999', 'state': 'present'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** ['snmp-agent sys-info contact call Operator at 010-99999999'] |
### Authors
* wangdezhuang (@QijunPan)
ansible community.network.pn_connection_stats_settings – CLI command to modify connection-stats-settings community.network.pn\_connection\_stats\_settings – CLI command to modify connection-stats-settings
===================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_connection_stats_settings`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to modify the settings for collecting statistical data about connections.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_client\_server\_stats\_log\_disk\_space** string | | disk-space allocated for statistics (including rotated log files). |
| **pn\_client\_server\_stats\_log\_enable** boolean | **Choices:*** no
* yes
| Enable or disable statistics. |
| **pn\_client\_server\_stats\_log\_interval** string | | interval to collect statistics. |
| **pn\_client\_server\_stats\_max\_memory** string | | maximum memory for client server statistics. |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_connection\_backup\_enable** boolean | **Choices:*** no
* yes
| Enable backup for connection statistics collection. |
| **pn\_connection\_backup\_interval** string | | backup interval for connection statistics collection. |
| **pn\_connection\_max\_memory** string | | maximum memory allowed for connection statistics. |
| **pn\_connection\_stats\_log\_disk\_space** string | | disk-space allocated for statistics (including rotated log files). |
| **pn\_connection\_stats\_log\_enable** boolean | **Choices:*** no
* yes
| enable or disable statistics. |
| **pn\_connection\_stats\_log\_interval** string | | interval to collect statistics. |
| **pn\_connection\_stats\_max\_memory** string | | maximum memory allowed for connection statistics. |
| **pn\_enable** boolean | **Choices:*** no
* yes
| Enable or disable collecting connections statistics. |
| **pn\_fabric\_connection\_backup\_enable** boolean | **Choices:*** no
* yes
| enable backup for fabric connection statistics collection. |
| **pn\_fabric\_connection\_backup\_interval** string | | backup interval for fabric connection statistics collection. |
| **pn\_fabric\_connection\_max\_memory** string | | maximum memory allowed for fabric connection statistics. |
| **pn\_service\_stat\_max\_memory** string | | maximum memory allowed for service statistics. |
| **state** string / required | **Choices:*** update
| State the action to perform. Use `update` to modify the connection-stats-settings. |
Examples
--------
```
- name: "Modify connection stats settings"
community.network.pn_connection_stats_settings:
pn_cliswitch: "sw01"
state: "update"
pn_enable: False
pn_fabric_connection_max_memory: "1000"
- name: "Modify connection stats settings"
community.network.pn_connection_stats_settings:
pn_cliswitch: "sw01"
state: "update"
pn_enable: 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 |
| --- | --- | --- |
| **changed** boolean | always | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the connection-stats-settings command. |
| **stdout** list / elements=string | always | set of responses from the connection-stats-settings command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
ansible community.network.apconos – Use apconos cliconf to run command on APCON network devices community.network.apconos – Use apconos cliconf to run command on APCON network devices
=======================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.apconos`.
Synopsis
--------
* This apconos plugin provides low level abstraction apis for sending and receiving CLI commands from APCON network devices.
### Authors
* David Li (@davidlee-ap)
ansible community.network.edgeswitch_vlan – Manage VLANs on Ubiquiti Edgeswitch network devices community.network.edgeswitch\_vlan – Manage VLANs on Ubiquiti Edgeswitch network devices
========================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.edgeswitch_vlan`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of VLANs on Ubiquiti Edgeswitch network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of VLANs definitions. |
| **auto\_exclude** boolean | **Choices:*** no
* yes
| Each of the switch interfaces will be excluded from *vlan\_id* unless defined in *\*\_interfaces*. This is a default setting for all switch interfaces. |
| **auto\_tag** boolean | **Choices:*** no
* yes
| Each of the switch interfaces will be set to accept and transmit untagged frames for *vlan\_id* unless defined in *\*\_interfaces*. This is a default setting for all switch interfaces. |
| **auto\_untag** boolean | **Choices:*** no
* yes
| Each of the switch interfaces will be set to accept untagged frames and transmit them tagged for *vlan\_id* unless defined in *\*\_interfaces*. This is a default setting for all switch interfaces. |
| **excluded\_interfaces** string | | List of interfaces that should be excluded of the VLAN. Accept range of interfaces. |
| **name** string | | Name of the VLAN. |
| **purge** boolean | **Choices:*** **no** ←
* yes
| Purge VLANs not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** ←
* absent
| action on the VLAN configuration. |
| **tagged\_interfaces** string | | List of interfaces that should accept and transmit tagged frames for the VLAN. Accept range of interfaces. |
| **untagged\_interfaces** string | | List of interfaces that should accept untagged frames and transmit them tagged for the VLAN. Accept range of interfaces. |
| **vlan\_id** string | | ID of the VLAN. Range 1-4093. |
Notes
-----
Note
* Tested against edgeswitch 1.7.4
* This module use native Ubiquiti vlan syntax and does not support switchport compatibility syntax. For clarity, it is strongly advised to not use both syntaxes on the same interface.
* Edgeswitch does not support deleting or changing name of VLAN 1
* As auto\_tag, auto\_untag and auto\_exclude are a kind of default setting for all interfaces, they are mutually exclusive
Examples
--------
```
- name: Create vlan
community.network.edgeswitch_vlan:
vlan_id: 100
name: voice
action: present
- name: Add interfaces to VLAN
community.network.edgeswitch_vlan:
vlan_id: 100
tagged_interfaces:
- 0/1
- 0/4-0/6
- name: Setup three vlans and delete the rest
community.network.edgeswitch_vlan:
purge: true
aggregate:
- { vlan_id: 1, name: default, auto_untag: true, excluded_interfaces: 0/45-0/48 }
- { vlan_id: 100, name: voice, auto_tag: true }
- { vlan_id: 200, name: video, auto_exclude: true, untagged_interfaces: 0/45-0/48, tagged_interfaces: 0/49 }
- name: Delete vlan
community.network.edgeswitch_vlan:
vlan_id: 100
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 |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['vlan database', 'vlan 100', 'vlan name 100 "test vlan"', 'exit', 'interface 0/1', 'vlan pvid 50', 'vlan participation include 50,100', 'vlan tagging 100', 'vlan participation exclude 200', 'no vlan tagging 200'] |
### Authors
* Frederic Bor (@f-bor)
ansible community.network.avi_prioritylabels – Module for setup of PriorityLabels Avi RESTful Object community.network.avi\_prioritylabels – Module for setup of PriorityLabels Avi RESTful Object
=============================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_prioritylabels`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure PriorityLabels object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **cloud\_ref** string | | It is a reference to an object of type cloud. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **description** string | | A description of the priority labels. |
| **equivalent\_labels** string | | Equivalent priority labels in descending order. |
| **name** string / required | | The name of the priority labels. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Uuid of the priority labels. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create PriorityLabels object
community.network.avi_prioritylabels:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_prioritylabels
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | PriorityLabels (api/prioritylabels) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#26415447555249414f000515111d000513141d0005121e1d47504f4843525149544d55000512101d45494b)>
ansible community.network.avi_cloud – Module for setup of Cloud Avi RESTful Object community.network.avi\_cloud – Module for setup of Cloud Avi RESTful Object
===========================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_cloud`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure Cloud object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **apic\_configuration** string | | Apicconfiguration settings for cloud. |
| **apic\_mode** boolean | **Choices:*** no
* yes
| Boolean flag to set apic\_mode. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **autoscale\_polling\_interval** string | | Cloudconnector polling interval for external autoscale groups. Field introduced in 18.2.2. Default value when not specified in API or module is interpreted by Avi Controller as 60. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **aws\_configuration** string | | Awsconfiguration settings for cloud. |
| **azure\_configuration** string | | Field introduced in 17.2.1. |
| **cloudstack\_configuration** string | | Cloudstackconfiguration settings for cloud. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **custom\_tags** string | | Custom tags for all avi created resources in the cloud infrastructure. Field introduced in 17.1.5. |
| **dhcp\_enabled** boolean | **Choices:*** no
* yes
| Select the ip address management scheme. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **dns\_provider\_ref** string | | Dns profile for the cloud. It is a reference to an object of type ipamdnsproviderprofile. |
| **docker\_configuration** string | | Dockerconfiguration settings for cloud. |
| **east\_west\_dns\_provider\_ref** string | | Dns profile for east-west services. It is a reference to an object of type ipamdnsproviderprofile. |
| **east\_west\_ipam\_provider\_ref** string | | Ipam profile for east-west services. Warning - please use virtual subnets in this ipam profile that do not conflict with the underlay networks or any overlay networks in the cluster. For example in aws and gcp, 169.254.0.0/16 is used for storing instance metadata. Hence, it should not be used in this profile. It is a reference to an object of type ipamdnsproviderprofile. |
| **enable\_vip\_static\_routes** boolean | **Choices:*** no
* yes
| Use static routes for vip side network resolution during virtualservice placement. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **gcp\_configuration** string | | Google cloud platform configuration. Field introduced in 18.2.1. |
| **ip6\_autocfg\_enabled** boolean | **Choices:*** no
* yes
| Enable ipv6 auto configuration. Field introduced in 18.1.1. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **ipam\_provider\_ref** string | | Ipam profile for the cloud. It is a reference to an object of type ipamdnsproviderprofile. |
| **license\_tier** string | | Specifies the default license tier which would be used by new se groups. This field by default inherits the value from system configuration. Enum options - ENTERPRISE\_16, ENTERPRISE\_18. Field introduced in 17.2.5. |
| **license\_type** string | | If no license type is specified then default license enforcement for the cloud type is chosen. The default mappings are container cloud is max ses, openstack and vmware is cores and linux it is sockets. Enum options - LIC\_BACKEND\_SERVERS, LIC\_SOCKETS, LIC\_CORES, LIC\_HOSTS, LIC\_SE\_BANDWIDTH, LIC\_METERED\_SE\_BANDWIDTH. |
| **linuxserver\_configuration** string | | Linuxserverconfiguration settings for cloud. |
| **mesos\_configuration** string | | Field deprecated in 18.2.2. |
| **mtu** string | | Mtu setting for the cloud. Default value when not specified in API or module is interpreted by Avi Controller as 1500. |
| **name** string / required | | Name of the object. |
| **nsx\_configuration** string | | Configuration parameters for nsx manager. Field introduced in 17.1.1. |
| **obj\_name\_prefix** string | | Default prefix for all automatically created objects in this cloud. This prefix can be overridden by the se-group template. |
| **openstack\_configuration** string | | Openstackconfiguration settings for cloud. |
| **oshiftk8s\_configuration** string | | Oshiftk8sconfiguration settings for cloud. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **prefer\_static\_routes** boolean | **Choices:*** no
* yes
| Prefer static routes over interface routes during virtualservice placement. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **proxy\_configuration** string | | Proxyconfiguration settings for cloud. |
| **rancher\_configuration** string | | Rancherconfiguration settings for cloud. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **state\_based\_dns\_registration** boolean | **Choices:*** no
* yes
| Dns records for vips are added/deleted based on the operational state of the vips. Field introduced in 17.1.12. Default value when not specified in API or module is interpreted by Avi Controller as True. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Unique object identifier of the object. |
| **vca\_configuration** string | | Vcloudairconfiguration settings for cloud. |
| **vcenter\_configuration** string | | Vcenterconfiguration settings for cloud. |
| **vtype** string / required | | Cloud type. Enum options - CLOUD\_NONE, CLOUD\_VCENTER, CLOUD\_OPENSTACK, CLOUD\_AWS, CLOUD\_VCA, CLOUD\_APIC, CLOUD\_MESOS, CLOUD\_LINUXSERVER, CLOUD\_DOCKER\_UCP, CLOUD\_RANCHER, CLOUD\_OSHIFT\_K8S, CLOUD\_AZURE, CLOUD\_GCP. Default value when not specified in API or module is interpreted by Avi Controller as CLOUD\_NONE. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Create a VMware cloud with write access mode
community.network.avi_cloud:
username: '{{ username }}'
controller: '{{ controller }}'
password: '{{ password }}'
apic_mode: false
dhcp_enabled: true
enable_vip_static_routes: false
license_type: LIC_CORES
mtu: 1500
name: vCenter Cloud
prefer_static_routes: false
tenant_ref: admin
vcenter_configuration:
datacenter_ref: /api/vimgrdcruntime/datacenter-2-10.10.20.100
management_network: /api/vimgrnwruntime/dvportgroup-103-10.10.20.100
password: password
privilege: WRITE_ACCESS
username: user
vcenter_url: 10.10.20.100
vtype: CLOUD_VCENTER
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | Cloud (api/cloud) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#cbacb9aab8bfa4aca2ede8f8fcf0ede8fef9f0ede8fff3f0aabda2a5aebfbca4b9a0b8ede8fffdf0a8a4a6)>
| programming_docs |
ansible community.network.avi – Look up Avi objects. community.network.avi – Look up Avi objects.
============================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Given an object\_type, fetch all the objects of that type or fetch the specific object that matches the name/uuid given via options.
* For single object lookup. If you want the output to be a list, you may want to pass option wantlist=True to the plugin.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **api\_context** dictionary | | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | | Avi API version of to use for Avi API and objects. |
| **avi\_credentials** dictionary | | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | | Avi controller version |
| | **controller** string | | | Avi controller IP or SQDN |
| | **csrftoken** string | | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | | Avi controller password |
| | **port** string | | | Avi controller port |
| | **session\_id** string | | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | | Avi controller tenant |
| | **tenant\_uuid** string | | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | | Avi controller request timeout |
| | **token** string | | | Avi controller API token |
| | **username** string | | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| | It disables avi session information to be cached as a fact. |
| **controller** string | **Default:**"" | | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **obj\_name** string | | | name of the object to query |
| **obj\_type** string / required | | | type of object to query |
| **obj\_uuid** string | | | UUID of the object to query |
| **password** string | **Default:**"" | | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **tenant** string | **Default:**"admin" | | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_uuid** string | **Default:**"" | | UUID of tenant used for all Avi API calls and context of object. |
| **username** string | **Default:**"" | | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
# Lookup query for all the objects of a specific type.
- ansible.builtin.debug: msg="{{ lookup('community.network.avi', avi_credentials=avi_credentials, obj_type='virtualservice') }}"
# Lookup query for an object with the given name and type.
- ansible.builtin.debug: msg="{{ lookup('community.network.avi', avi_credentials=avi_credentials, obj_name='vs1', obj_type='virtualservice', wantlist=True) }}"
# Lookup query for an object with the given UUID and type.
- ansible.builtin.debug: msg="{{ lookup('community.network.avi', obj_uuid='virtualservice-5c0e183a-690a-45d8-8d6f-88c30a52550d', obj_type='virtualservice') }}"
# We can replace lookup with query function to always the get the output as list.
# This is helpful for looping.
- ansible.builtin.debug: msg="{{ query('community.network.avi', obj_uuid='virtualservice-5c0e183a-690a-45d8-8d6f-88c30a52550d', obj_type='virtualservice') }}"
```
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** list / elements=dictionary | success | One ore more objects returned from ``Avi`` API. |
### Authors
* Sandeep Bandi (@sabandi) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#463527282223233624606575717d606573747d6065727e7d27302f2823323129342d35606572707d25292b)>
ansible community.network.avi_hardwaresecuritymodulegroup – Module for setup of HardwareSecurityModuleGroup Avi RESTful Object community.network.avi\_hardwaresecuritymodulegroup – Module for setup of HardwareSecurityModuleGroup Avi RESTful Object
=======================================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_hardwaresecuritymodulegroup`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure HardwareSecurityModuleGroup object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **hsm** string / required | | Hardware security module configuration. |
| **name** string / required | | Name of the hsm group configuration object. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Uuid of the hsm group configuration object. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create HardwareSecurityModuleGroup object
community.network.avi_hardwaresecuritymodulegroup:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_hardwaresecuritymodulegroup
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | HardwareSecurityModuleGroup (api/hardwaresecuritymodulegroup) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#9bfce9fae8eff4fcf2bdb8a8aca0bdb8aea9a0bdb8afa3a0faedf2f5feefecf4e9f0e8bdb8afada0f8f4f6)>
ansible community.network.slxos – Use slxos cliconf to run command on Extreme SLX-OS platform community.network.slxos – Use slxos cliconf to run command on Extreme SLX-OS platform
=====================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.slxos`.
Synopsis
--------
* This slxos plugin provides low level abstraction apis for sending and receiving CLI commands from Extreme SLX-OS network devices.
### Authors
* Unknown (!UNKNOWN)
ansible community.network.eric_eccli_command – Run commands on remote devices running ERICSSON ECCLI community.network.eric\_eccli\_command – Run commands on remote devices running ERICSSON ECCLI
==============================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.eric_eccli_command`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Sends arbitrary commands to an ERICSSON eccli node and returns the results read from the device. This module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met.
* This module also support running commands in configuration mode in raw command style.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **commands** list / elements=string / required | | List of commands to send to the remote ECCLI device over the configured provider. The resulting output from the command is returned. If the *wait\_for* argument is provided, the module is not returned until the condition is satisfied or the number of retries has expired. If a command sent to the device requires answering a prompt, it is possible to pass a dict containing *command*, *answer* and *prompt*. Common answers are 'y' or "\r" (carriage return, must be double quotes). See examples. |
| **interval** integer | **Default:**1 | Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified conditions, the interval indicates how long to wait before trying the command again. |
| **match** string | **Choices:*** any
* **all** ←
| The *match* argument is used in conjunction with the *wait\_for* argument to specify the match policy. Valid values are `all` or `any`. If the value is set to `all` then all conditionals in the wait\_for must be satisfied. If the value is set to `any` then only one of the values must be satisfied. |
| **retries** integer | **Default:**10 | Specifies the number of retries a command should by tried before it is considered failed. The command is run on the target device every retry and evaluated against the *wait\_for* conditions. |
| **wait\_for** list / elements=string | | List of conditions to evaluate against the output of the command. The task will wait for each condition to be true before moving forward. If the conditional is not true within the configured number of retries, the task fails. See examples.
aliases: waitfor |
Notes
-----
Note
* Tested against IPOS 19.3
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Ericsson devices see the Ericsson documents.
* Starting with Ansible 2.5 we recommend using `connection: network_cli`.
* For more information please see the [ERIC\_ECCLI Platform Options guide](user_guide/platform_eric_eccli).
Examples
--------
```
tasks:
- name: Run show version on remote devices
community.network.eric_eccli_command:
commands: show version
- name: Run show version and check to see if output contains IPOS
community.network.eric_eccli_command:
commands: show version
wait_for: result[0] contains IPOS
- name: Run multiple commands on remote nodes
community.network.eric_eccli_command:
commands:
- show version
- show running-config interfaces
- name: Run multiple commands and evaluate the output
community.network.eric_eccli_command:
commands:
- show version
- show running-config interfaces
wait_for:
- result[0] contains IPOS
- result[1] contains management
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **failed\_conditions** list / elements=string | failed | The list of conditionals that have failed **Sample:** ['...', '...'] |
| **stdout** list / elements=string | always apart from low level errors (such as action plugin) | The set of responses from the commands **Sample:** ['...', '...'] |
| **stdout\_lines** list / elements=string | always apart from low level errors (such as action plugin) | The value of stdout split into a list **Sample:** [['...', '...'], ['...'], ['...']] |
### Authors
* Ericsson IPOS OAM team (@itercheng)
ansible community.network.exos_config – Manage Extreme Networks EXOS configuration sections community.network.exos\_config – Manage Extreme Networks EXOS configuration sections
====================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.exos_config`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Extreme EXOS configurations use a simple flat text file syntax. This module provides an implementation for working with EXOS configuration lines in a deterministic way.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **after** string | | The ordered set of commands to append to the end of the command stack if a change needs to be made. Just like with *before* this allows the playbook designer to append a set of commands to be executed after the command set. |
| **backup** boolean | **Choices:*** **no** ←
* yes
| This argument will cause the module to create a full backup of the current `running-config` from the remote device before any changes are made. If the `backup_options` value is not given, the backup file is written to the `backup` folder in the playbook root directory. If the directory does not exist, it is created. |
| **backup\_options** dictionary | | This is a dict object containing configurable options related to backup file path. The value of this option is read only when `backup` is set to *yes*, if `backup` is set to *no* this option will be silently ignored. |
| | **dir\_path** path | | This option provides the path ending with directory name in which the backup configuration file will be stored. If the directory does not exist it will be first created and the filename is either the value of `filename` or default filename as described in `filename` options description. If the path value is not given in that case a *backup* directory will be created in the current working directory and backup configuration will be copied in `filename` within *backup* directory. |
| | **filename** string | | The filename to be used to store the backup configuration. If the filename is not given it will be generated based on the hostname, current time and date in format defined by <hostname>\_config.<current-date>@<current-time> |
| **before** string | | The ordered set of commands to push on to the command stack if a change needs to be made. This allows the playbook designer the opportunity to perform configuration commands prior to pushing any changes without affecting how the set of commands are matched against the system. |
| **defaults** boolean | **Choices:*** **no** ←
* yes
| This argument specifies whether or not to collect all defaults when getting the remote device running config. When enabled, the module will get the current config by issuing the command `show running-config all`. |
| **diff\_against** string | **Choices:*** **running** ←
* startup
* intended
| When using the `ansible-playbook --diff` command line argument the module can generate diffs against different sources. When this option is configure as *startup*, the module will return the diff of the running-config against the startup-config. When this option is configured as *intended*, the module will return the diff of the running-config against the configuration provided in the `intended_config` argument. When this option is configured as *running*, the module will return the before and after diff of the running-config with respect to any changes made to the device configuration. |
| **diff\_ignore\_lines** string | | Use this argument to specify one or more lines that should be ignored during the diff. This is used for lines in the configuration that are automatically updated by the system. This argument takes a list of regular expressions or exact line matches. |
| **intended\_config** string | | The `intended_config` provides the master configuration that the node should conform to and is used to check the final running-config against. This argument will not modify any settings on the remote device and is strictly used to check the compliance of the current device's configuration against. When specifying this argument, the task should also modify the `diff_against` value and set it to *intended*. |
| **lines** string | | The ordered set of commands that should be configured in the section. The commands must be the exact same commands as found in the device running-config. Be sure to note the configuration command syntax as some commands are automatically modified by the device config parser.
aliases: commands |
| **match** string | **Choices:*** **line** ←
* strict
* exact
* none
| Instructs the module on the way to perform the matching of the set of commands against the current device config. If match is set to *line*, commands are matched line by line. If match is set to *strict*, command lines are matched with respect to position. If match is set to *exact*, command lines must be an equal match. Finally, if match is set to *none*, the module will not attempt to compare the source configuration with the running configuration on the remote device. |
| **replace** string | **Choices:*** **line** ←
* block
| Instructs the module on the way to perform the configuration on the device. If the replace argument is set to *line* then the modified lines are pushed to the device in configuration mode. If the replace argument is set to *block* then the entire command block is pushed to the device in configuration mode if any line is not correct. |
| **running\_config** string | | The module, by default, will connect to the remote device and retrieve the current running-config to use as a base for comparing against the contents of source. There are times when it is not desirable to have the task get the current running-config for every task in a playbook. The *running\_config* argument allows the implementer to pass in the configuration to use as the base config for comparison.
aliases: config |
| **save\_when** string | **Choices:*** always
* **never** ←
* modified
* changed
| When changes are made to the device running-configuration, the changes are not copied to non-volatile storage by default. Using this argument will change that behavior. If the argument is set to *always*, then the running-config will always be copied to the startup-config and the *modified* flag will always be set to True. If the argument is set to *modified*, then the running-config will only be copied to the startup-config if it has changed since the last save to startup-config. If the argument is set to *never*, the running-config will never be copied to the startup-config. If the argument is set to *changed*, then the running-config will only be copied to the startup-config if the task has made a change. |
| **src** string | | Specifies the source path to the file that contains the configuration or configuration template to load. The path to the source file can either be the full path on the Ansible control host or a relative path from the playbook or role root directory. This argument is mutually exclusive with *lines*. |
Notes
-----
Note
* Tested against EXOS version 22.6.0b19
Examples
--------
```
- name: Configure SNMP system name
community.network.exos_config:
lines: configure snmp sysName "{{ inventory_hostname }}"
- name: Configure interface settings
community.network.exos_config:
lines:
- configure ports 2 description-string "Master Uplink"
backup: yes
- name: Check the running-config against master config
community.network.exos_config:
diff_against: intended
intended_config: "{{ lookup('file', 'master.cfg') }}"
- name: Check the startup-config against the running-config
community.network.exos_config:
diff_against: startup
diff_ignore_lines:
- ntp clock .*
- name: Save running to startup when modified
community.network.exos_config:
save_when: modified
- name: Configurable backup path
community.network.exos_config:
lines:
- configure ports 2 description-string "Master Uplink"
backup: yes
backup_options:
filename: backup.cfg
dir_path: /home/user
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **backup\_path** string | when backup is yes | The full path to the backup file **Sample:** /playbooks/ansible/backup/x870\_config.2018-08-08@15:00:21 |
| **commands** list / elements=string | always | The set of commands that will be pushed to the remote device **Sample:** ['create vlan "foo"', 'configure snmp sysName "x620-red"'] |
| **updates** list / elements=string | always | The set of commands that will be pushed to the remote device **Sample:** ['switch-attributes hostname foo', 'router ospf', 'area 0'] |
### Authors
* Lance Richardson (@hlrichardson)
| programming_docs |
ansible community.network.ce_mlag_config – Manages MLAG configuration on HUAWEI CloudEngine switches. community.network.ce\_mlag\_config – Manages MLAG configuration on HUAWEI CloudEngine switches.
===============================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_mlag_config`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages MLAG configuration on HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **dfs\_group\_id** string | **Default:**"present" | ID of a DFS group. The value is 1. |
| **eth\_trunk\_id** string | | Name of the peer-link interface. The value is in the range from 0 to 511. |
| **ip\_address** string | | IP address bound to the DFS group. The value is in dotted decimal notation. |
| **nickname** string | | The nickname bound to a DFS group. The value is an integer that ranges from 1 to 65471. |
| **peer\_link\_id** string | | Number of the peer-link interface. The value is 1. |
| **priority\_id** string | | Priority of a DFS group. The value is an integer that ranges from 1 to 254. The default value is 100. |
| **pseudo\_nickname** string | | A pseudo nickname of a DFS group. The value is an integer that ranges from 1 to 65471. |
| **pseudo\_priority** string | | The priority of a pseudo nickname. The value is an integer that ranges from 128 to 255. The default value is 192. A larger value indicates a higher priority. |
| **state** string | **Choices:*** **present** ←
* absent
| Specify desired state of the resource. |
| **vpn\_instance\_name** string | | Name of the VPN instance bound to the DFS group. The value is a string of 1 to 31 case-sensitive characters without spaces. If the character string is quoted by double quotation marks, the character string can contain spaces. The value \_public\_ is reserved and cannot be used as the VPN instance name. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: Mlag config module test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: Create DFS Group id
community.network.ce_mlag_config:
dfs_group_id: 1
provider: "{{ cli }}"
- name: Set dfs-group priority
community.network.ce_mlag_config:
dfs_group_id: 1
priority_id: 3
state: present
provider: "{{ cli }}"
- name: Set pseudo nickname
community.network.ce_mlag_config:
dfs_group_id: 1
pseudo_nickname: 3
pseudo_priority: 130
state: present
provider: "{{ cli }}"
- name: Set ip
community.network.ce_mlag_config:
dfs_group_id: 1
ip_address: 11.1.1.2
vpn_instance_name: 6
provider: "{{ cli }}"
- name: Set peer link
community.network.ce_mlag_config:
eth_trunk_id: 3
peer_link_id: 2
state: present
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | always | k/v pairs of aaa params after module execution **Sample:** {'eth\_trunk\_id': 'Eth-Trunk3', 'peer\_link\_id': '1'} |
| **existing** dictionary | always | k/v pairs of existing aaa server |
| **proposed** dictionary | always | k/v pairs of parameters passed into module **Sample:** {'eth\_trunk\_id': '3', 'peer\_link\_id': '1', 'state': 'present'} |
| **updates** list / elements=string | always | command sent to the device **Sample:** {'peer-link 1': None} |
### Authors
* Li Yanfeng (@QijunPan)
ansible community.network.ce_info_center_log – Manages information center log configuration on HUAWEI CloudEngine switches. community.network.ce\_info\_center\_log – Manages information center log configuration on HUAWEI CloudEngine switches.
======================================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_info_center_log`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Setting the Timestamp Format of Logs. Configuring the Device to Output Logs to the Log Buffer.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **channel\_id** string | | Specifies a channel ID. The value is an integer ranging from 0 to 9. |
| **log\_buff\_enable** string | **Choices:*** **no\_use** ←
* true
* false
| Enables the Switch to send logs to the log buffer. |
| **log\_buff\_size** string | | Specifies the maximum number of logs in the log buffer. The value is an integer that ranges from 0 to 10240. If logbuffer-size is 0, logs are not displayed. |
| **log\_enable** string | **Choices:*** **no\_use** ←
* true
* false
| Indicates whether log filtering is enabled. |
| **log\_level** string | **Choices:*** emergencies
* alert
* critical
* error
* warning
* notification
* informational
* debugging
| Specifies a log severity. |
| **log\_time\_stamp** string | **Choices:*** date\_boot
* date\_second
* date\_tenthsecond
* date\_millisecond
* shortdate\_second
* shortdate\_tenthsecond
* shortdate\_millisecond
* formatdate\_second
* formatdate\_tenthsecond
* formatdate\_millisecond
| Sets the timestamp format of logs. |
| **module\_name** string | | Specifies the name of a module. The value is a module name in registration logs. |
| **state** string | **Choices:*** **present** ←
* absent
| Determines whether the config should be present or not on the device. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: CloudEngine info center log test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Setting the timestamp format of logs"
community.network.ce_info_center_log:
log_time_stamp: date_tenthsecond
provider: "{{ cli }}"
- name: "Enabled to output information to the log buffer"
community.network.ce_info_center_log:
log_buff_enable: true
provider: "{{ cli }}"
- name: "Set the maximum number of logs in the log buffer"
community.network.ce_info_center_log:
log_buff_size: 100
provider: "{{ cli }}"
- name: "Set a rule for outputting logs to a channel"
community.network.ce_info_center_log:
module_name: aaa
channel_id: 1
log_enable: true
log_level: critical
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | verbose mode | k/v pairs of configuration after module execution **Sample:** {'log\_time\_stamp': 'date\_tenthsecond'} |
| **existing** dictionary | verbose mode | k/v pairs of existing configuration **Sample:** {'log\_time\_stamp': 'date\_second'} |
| **proposed** dictionary | verbose mode | k/v pairs of parameters passed into module **Sample:** {'log\_time\_stamp': 'date\_tenthsecond', 'state': 'present'} |
| **updates** list / elements=string | always | commands sent to the device **Sample:** ['info-center timestamp log date precision-time tenth-second'] |
### Authors
* QijunPan (@QijunPan)
ansible community.network.avi_healthmonitor – Module for setup of HealthMonitor Avi RESTful Object community.network.avi\_healthmonitor – Module for setup of HealthMonitor Avi RESTful Object
===========================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_healthmonitor`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure HealthMonitor object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **description** string | | User defined description for the object. |
| **dns\_monitor** string | | Healthmonitordns settings for healthmonitor. |
| **external\_monitor** string | | Healthmonitorexternal settings for healthmonitor. |
| **failed\_checks** string | | Number of continuous failed health checks before the server is marked down. Allowed values are 1-50. Default value when not specified in API or module is interpreted by Avi Controller as 2. |
| **http\_monitor** string | | Healthmonitorhttp settings for healthmonitor. |
| **https\_monitor** string | | Healthmonitorhttp settings for healthmonitor. |
| **is\_federated** boolean | **Choices:*** no
* yes
| This field describes the object's replication scope. If the field is set to false, then the object is visible within the controller-cluster and its associated service-engines. If the field is set to true, then the object is replicated across the federation. Field introduced in 17.1.3. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **monitor\_port** string | | Use this port instead of the port defined for the server in the pool. If the monitor succeeds to this port, the load balanced traffic will still be sent to the port of the server defined within the pool. Allowed values are 1-65535. Special values are 0 - 'use server port'. |
| **name** string / required | | A user friendly name for this health monitor. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **radius\_monitor** string | | Health monitor for radius. Field introduced in 18.2.3. |
| **receive\_timeout** string | | A valid response from the server is expected within the receive timeout window. This timeout must be less than the send interval. If server status is regularly flapping up and down, consider increasing this value. Allowed values are 1-2400. Default value when not specified in API or module is interpreted by Avi Controller as 4. |
| **send\_interval** string | | Frequency, in seconds, that monitors are sent to a server. Allowed values are 1-3600. Default value when not specified in API or module is interpreted by Avi Controller as 10. |
| **sip\_monitor** string | | Health monitor for sip. Field introduced in 17.2.8, 18.1.3, 18.2.1. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **successful\_checks** string | | Number of continuous successful health checks before server is marked up. Allowed values are 1-50. Default value when not specified in API or module is interpreted by Avi Controller as 2. |
| **tcp\_monitor** string | | Healthmonitortcp settings for healthmonitor. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **type** string / required | | Type of the health monitor. Enum options - HEALTH\_MONITOR\_PING, HEALTH\_MONITOR\_TCP, HEALTH\_MONITOR\_HTTP, HEALTH\_MONITOR\_HTTPS, HEALTH\_MONITOR\_EXTERNAL, HEALTH\_MONITOR\_UDP, HEALTH\_MONITOR\_DNS, HEALTH\_MONITOR\_GSLB, HEALTH\_MONITOR\_SIP, HEALTH\_MONITOR\_RADIUS. |
| **udp\_monitor** string | | Healthmonitorudp settings for healthmonitor. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Uuid of the health monitor. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Create a HTTPS health monitor
community.network.avi_healthmonitor:
controller: 10.10.27.90
username: admin
password: AviNetworks123!
https_monitor:
http_request: HEAD / HTTP/1.0
http_response_code:
- HTTP_2XX
- HTTP_3XX
receive_timeout: 4
failed_checks: 3
send_interval: 10
successful_checks: 3
type: HEALTH_MONITOR_HTTPS
name: MyWebsite-HTTPS
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | HealthMonitor (api/healthmonitor) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#cfa8bdaebcbba0a8a6e9ecfcf8f4e9ecfafdf4e9ecfbf7f4aeb9a6a1aabbb8a0bda4bce9ecfbf9f4aca0a2)>
ansible community.network.exos – Use EXOS REST APIs to communicate with EXOS platform community.network.exos – Use EXOS REST APIs to communicate with EXOS platform
=============================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.exos`.
Synopsis
--------
* This plugin provides low level abstraction api’s to send REST API requests to EXOS network devices and receive JSON responses.
### Authors
* Ujwal Komarla (@ujwalkomarla)
ansible community.network.ce – Use ce netconf plugin to run netconf commands on Huawei Cloudengine platform community.network.ce – Use ce netconf plugin to run netconf commands on Huawei Cloudengine platform
===================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
Synopsis
--------
* This ce plugin provides low level abstraction apis for sending and receiving netconf commands from Huawei Cloudengine network devices.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **ncclient\_device\_handler** string | **Default:**"huawei" | | Specifies the ncclient device handler name for Huawei Cloudengine. To identify the ncclient device handler name refer ncclient library documentation. |
### Authors
* Unknown (!UNKNOWN)
ansible community.network.avi_cluster – Module for setup of Cluster Avi RESTful Object community.network.avi\_cluster – Module for setup of Cluster Avi RESTful Object
===============================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_cluster`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure Cluster object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **name** string / required | | Name of the object. |
| **nodes** string | | List of clusternode. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **rejoin\_nodes\_automatically** boolean | **Choices:*** no
* yes
| Re-join cluster nodes automatically in the event one of the node is reset to factory. Default value when not specified in API or module is interpreted by Avi Controller as True. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Unique object identifier of the object. |
| **virtual\_ip** string | | A virtual ip address. This ip address will be dynamically reconfigured so that it always is the ip of the cluster leader. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create Cluster object
community.network.avi_cluster:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_cluster
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | Cluster (api/cluster) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#f196839082859e9698d7d2c2c6cad7d2c4c3cad7d2c5c9ca9087989f9485869e839a82d7d2c5c7ca929e9c)>
| programming_docs |
ansible community.network.ce_vrf_interface – Manages interface specific VPN configuration on HUAWEI CloudEngine switches. community.network.ce\_vrf\_interface – Manages interface specific VPN configuration on HUAWEI CloudEngine switches.
===================================================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.ce_vrf_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages interface specific VPN configuration of HUAWEI CloudEngine switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **state** string | **Choices:*** **present** ←
* absent
| Manage the state of the resource. |
| **vpn\_interface** string / required | | An interface that can binding VPN instance, i.e. 40GE1/0/22, Vlanif10. Must be fully qualified interface name. Interface types, such as 10GE, 40GE, 100GE, LoopBack, MEth, Tunnel, Vlanif.... |
| **vrf** string / required | | VPN instance, the length of vrf name is 1 ~ 31, i.e. "test", but can not be `_public_`. |
Notes
-----
Note
* Ensure that a VPN instance has been created and the IPv4 address family has been enabled for the VPN instance.
* This module requires the netconf system service be enabled on the remote device being managed.
* Recommended connection is `netconf`.
* This module also works with `local` connections for legacy playbooks.
Examples
--------
```
- name: VRF interface test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Configure a VPN instance for the interface"
community.network.ce_vrf_interface:
vpn_interface: 40GE1/0/2
vrf: test
state: present
provider: "{{ cli }}"
- name: "Disable the association between a VPN instance and an interface"
community.network.ce_vrf_interface:
vpn_interface: 40GE1/0/2
vrf: test
state: absent
provider: "{{ cli }}"
```
Return Values
-------------
Common return 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 **Sample:** True |
| **end\_state** dictionary | verbose mode | k/v pairs of end attributes on the interface **Sample:** {'vpn\_interface': '40GE2/0/17', 'vrf': 'jss'} |
| **existing** dictionary | verbose mode | k/v pairs of existing attributes on the interface **Sample:** {'vpn\_interface': '40GE2/0/17', 'vrf': None} |
| **proposed** dictionary | verbose mode | k/v pairs of parameters passed into module **Sample:** {'state': 'present', 'vpn\_interface': '40GE2/0/17', 'vrf': 'jss'} |
| **updates** list / elements=string | always | command list sent to the device **Sample:** ['ip binding vpn-instance jss'] |
### Authors
* Zhijin Zhou (@QijunPan)
ansible community.network.pn_cpu_class – CLI command to create/modify/delete cpu-class community.network.pn\_cpu\_class – CLI command to create/modify/delete cpu-class
================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.pn_cpu_class`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to create, modify and delete CPU class information.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **pn\_cliswitch** string | | Target switch to run the CLI on. |
| **pn\_hog\_protect** string | **Choices:*** disable
* enable
* enable-and-drop
| enable host-based hog protection. |
| **pn\_name** string | | name for the CPU class. |
| **pn\_rate\_limit** string | | rate-limit for CPU class. |
| **pn\_scope** string | **Choices:*** local
* fabric
| scope for CPU class. |
| **state** string / required | **Choices:*** present
* absent
* update
| State the action to perform. Use `present` to create cpu-class and `absent` to delete cpu-class `update` to modify the cpu-class. |
Examples
--------
```
- name: Create cpu class
community.network.pn_cpu_class:
pn_cliswitch: 'sw01'
state: 'present'
pn_name: 'icmp'
pn_rate_limit: '1000'
pn_scope: 'local'
- name: Delete cpu class
community.network.pn_cpu_class:
pn_cliswitch: 'sw01'
state: 'absent'
pn_name: 'icmp'
- name: Modify cpu class
community.network.pn_cpu_class:
pn_cliswitch: 'sw01'
state: 'update'
pn_name: 'icmp'
pn_rate_limit: '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 |
| --- | --- | --- |
| **changed** boolean | always | indicates whether the CLI caused changes on the target. |
| **command** string | always | the CLI command run on the target node. |
| **stderr** list / elements=string | on error | set of error responses from the cpu-class command. |
| **stdout** list / elements=string | always | set of responses from the cpu-class command. |
### Authors
* Pluribus Networks (@rajaspachipulusu17)
ansible community.network.avi_vsvip – Module for setup of VsVip Avi RESTful Object community.network.avi\_vsvip – Module for setup of VsVip Avi RESTful Object
===========================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_vsvip`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure VsVip object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **cloud\_ref** string | | It is a reference to an object of type cloud. Field introduced in 17.1.1. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **dns\_info** string | | Service discovery specific data including fully qualified domain name, type and time-to-live of the dns record. Field introduced in 17.1.1. |
| **east\_west\_placement** boolean | **Choices:*** no
* yes
| Force placement on all service engines in the service engine group (container clouds only). Field introduced in 17.1.1. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **name** string / required | | Name for the vsvip object. Field introduced in 17.1.1. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. Field introduced in 17.1.1. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **use\_standard\_alb** boolean | **Choices:*** no
* yes
| This overrides the cloud level default and needs to match the se group value in which it will be used if the se group use\_standard\_alb value is set. This is only used when fip is used for vs on azure cloud. Field introduced in 18.2.3. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Uuid of the vsvip object. Field introduced in 17.1.1. |
| **vip** string | | List of virtual service ips and other shareable entities. Field introduced in 17.1.1. |
| **vrf\_context\_ref** string | | Virtual routing context that the virtual service is bound to. This is used to provide the isolation of the set of networks the application is attached to. It is a reference to an object of type vrfcontext. Field introduced in 17.1.1. |
| **vsvip\_cloud\_config\_cksum** string | | Checksum of cloud configuration for vsvip. Internally set by cloud connector. Field introduced in 17.2.9, 18.1.2. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create VsVip object
community.network.avi_vsvip:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_vsvip
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | VsVip (api/vsvip) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#aec9dccfdddac1c9c7888d9d9995888d9b9c95888d9a9695cfd8c7c0cbdad9c1dcc5dd888d9a9895cdc1c3)>
ansible community.network.avi_vsdatascriptset – Module for setup of VSDataScriptSet Avi RESTful Object community.network.avi\_vsdatascriptset – Module for setup of VSDataScriptSet Avi RESTful Object
===============================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_vsdatascriptset`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure VSDataScriptSet object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **created\_by** string | | Creator name. Field introduced in 17.1.11,17.2.4. |
| **datascript** string | | Datascripts to execute. |
| **description** string | | User defined description for the object. |
| **ipgroup\_refs** string | | Uuid of ip groups that could be referred by vsdatascriptset objects. It is a reference to an object of type ipaddrgroup. |
| **name** string / required | | Name for the virtual service datascript collection. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **pool\_group\_refs** string | | Uuid of pool groups that could be referred by vsdatascriptset objects. It is a reference to an object of type poolgroup. |
| **pool\_refs** string | | Uuid of pools that could be referred by vsdatascriptset objects. It is a reference to an object of type pool. |
| **protocol\_parser\_refs** string | | List of protocol parsers that could be referred by vsdatascriptset objects. It is a reference to an object of type protocolparser. Field introduced in 18.2.3. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **string\_group\_refs** string | | Uuid of string groups that could be referred by vsdatascriptset objects. It is a reference to an object of type stringgroup. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Uuid of the virtual service datascript collection. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create VSDataScriptSet object
community.network.avi_vsdatascriptset:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_vsdatascriptset
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | VSDataScriptSet (api/vsdatascriptset) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#0463766577706b636d222737333f222731363f2227303c3f65726d6a6170736b766f77222730323f676b69)>
ansible community.network.avi_pkiprofile – Module for setup of PKIProfile Avi RESTful Object community.network.avi\_pkiprofile – Module for setup of PKIProfile Avi RESTful Object
=====================================================================================
Note
This plugin is part of the [community.network collection](https://galaxy.ansible.com/community/network) (version 3.0.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 community.network`.
To use it in a playbook, specify: `community.network.avi_pkiprofile`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module is used to configure PKIProfile object
* more examples at <https://github.com/avinetworks/devops>
Requirements
------------
The below requirements are needed on the host that executes this module.
* avisdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_context** dictionary | | Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. |
| **api\_version** string | **Default:**"16.4.4" | Avi API version of to use for Avi API and objects. |
| **avi\_api\_patch\_op** string | **Choices:*** add
* replace
* delete
| Patch operation to use when using avi\_api\_update\_method as patch. |
| **avi\_api\_update\_method** string | **Choices:*** **put** ←
* patch
| Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. |
| **avi\_credentials** dictionary | | Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. |
| | **api\_version** string | **Default:**"16.4.4" | Avi controller version |
| | **controller** string | | Avi controller IP or SQDN |
| | **csrftoken** string | | Avi controller API csrftoken to reuse existing session with session id |
| | **password** string | | Avi controller password |
| | **port** string | | Avi controller port |
| | **session\_id** string | | Avi controller API session id to reuse existing session with csrftoken |
| | **tenant** string | **Default:**"admin" | Avi controller tenant |
| | **tenant\_uuid** string | | Avi controller tenant UUID |
| | **timeout** string | **Default:**300 | Avi controller request timeout |
| | **token** string | | Avi controller API token |
| | **username** string | | Avi controller username |
| **avi\_disable\_session\_cache\_as\_fact** boolean | **Choices:*** **no** ←
* yes
| It disables avi session information to be cached as a fact. |
| **ca\_certs** string | | List of certificate authorities (root and intermediate) trusted that is used for certificate validation. |
| **controller** string | **Default:**"" | IP address or hostname of the controller. The default value is the environment variable `AVI_CONTROLLER`. |
| **created\_by** string | | Creator name. |
| **crl\_check** boolean | **Choices:*** no
* yes
| When enabled, avi will verify via crl checks that certificates in the trust chain have not been revoked. Default value when not specified in API or module is interpreted by Avi Controller as True. |
| **crls** string | | Certificate revocation lists. |
| **ignore\_peer\_chain** boolean | **Choices:*** no
* yes
| When enabled, avi will not trust intermediate and root certs presented by a client. Instead, only the chain certs configured in the certificate authority section will be used to verify trust of the client's cert. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **is\_federated** boolean | **Choices:*** no
* yes
| This field describes the object's replication scope. If the field is set to false, then the object is visible within the controller-cluster and its associated service-engines. If the field is set to true, then the object is replicated across the federation. Field introduced in 17.1.3. Default value when not specified in API or module is interpreted by Avi Controller as False. |
| **name** string / required | | Name of the pki profile. |
| **password** string | **Default:**"" | Password of Avi user in Avi controller. The default value is the environment variable `AVI_PASSWORD`. |
| **state** string | **Choices:*** absent
* **present** ←
| The state that should be applied on the entity. |
| **tenant** string | **Default:**"admin" | Name of tenant used for all Avi API calls and context of object. |
| **tenant\_ref** string | | It is a reference to an object of type tenant. |
| **tenant\_uuid** string | **Default:**"" | UUID of tenant used for all Avi API calls and context of object. |
| **url** string | | Avi controller URL of the object. |
| **username** string | **Default:**"" | Username used for accessing Avi controller. The default value is the environment variable `AVI_USERNAME`. |
| **uuid** string | | Unique object identifier of the object. |
| **validate\_only\_leaf\_crl** boolean | **Choices:*** no
* yes
| When enabled, avi will only validate the revocation status of the leaf certificate using crl. To enable validation for the entire chain, disable this option and provide all the relevant crls. Default value when not specified in API or module is interpreted by Avi Controller as True. |
Notes
-----
Note
* For more information on using Ansible to manage Avi Network devices see <https://www.ansible.com/ansible-avi-networks>.
Examples
--------
```
- name: Example to create PKIProfile object
community.network.avi_pkiprofile:
controller: 10.10.25.42
username: admin
password: something
state: present
name: sample_pkiprofile
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **obj** dictionary | success, changed | PKIProfile (api/pkiprofile) object |
### Authors
* Gaurav Rastogi (@grastogi23) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#f6918497858299919fd0d5c5c1cdd0d5c3c4cdd0d5c2cecd97809f9893828199849d85d0d5c2c0cd95999b)>
| programming_docs |
ansible Community.Hashi_Vault Community.Hashi\_Vault
======================
Collection version 1.4.1
Guides
------
* [User guide](docsite/user_guide)
* [Contributor guide](docsite/contributor_guide)
* [localenv developer guide](docsite/localenv_developer_guide)
Plugin Index
------------
These are the plugins in the community.hashi\_vault collection
### Lookup Plugins
* [hashi\_vault](hashi_vault_lookup#ansible-collections-community-hashi-vault-hashi-vault-lookup) – Retrieve secrets from HashiCorp’s Vault
* [vault\_read](vault_read_lookup#ansible-collections-community-hashi-vault-vault-read-lookup) – Perform a read operation against HashiCorp Vault
### Modules
* [vault\_read](vault_read_module#ansible-collections-community-hashi-vault-vault-read-module) – Perform a read operation against HashiCorp Vault
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible community.hashi_vault.vault_read – Perform a read operation against HashiCorp Vault community.hashi\_vault.vault\_read – Perform a read operation against HashiCorp Vault
=====================================================================================
Note
This plugin is part of the [community.hashi\_vault collection](https://galaxy.ansible.com/community/hashi_vault) (version 1.4.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 community.hashi_vault`.
To use it in a playbook, specify: `community.hashi_vault.vault_read`.
New in version 1.4.0: of community.hashi\_vault
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Performs a generic read operation against a given path in HashiCorp Vault.
Requirements
------------
The below requirements are needed on the local controller node that executes this lookup.
* `hvac` ([Python library](https://hvac.readthedocs.io/en/stable/overview.html))
* For detailed requirements, see [the collection requirements page](docsite/user_guide#ansible-collections-community-hashi-vault-docsite-user-guide-requirements).
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **\_terms** string / required | | | Vault path(s) to be read. |
| **auth\_method** string | **Choices:*** **token** ←
* userpass
* ldap
* approle
* aws\_iam\_login
* jwt
* cert
* none
| ini entries: [hashi\_vault\_collection]auth\_method = token
added in 1.4.0 of community.hashi\_vault env:VAULT\_AUTH\_METHOD Removed in: version 2.0.0 Why: standardizing environment variables Alternative: ANSIBLE\_HASHI\_VAULT\_AUTH\_METHOD env:ANSIBLE\_HASHI\_VAULT\_AUTH\_METHOD added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_auth\_method added in 1.2.0 of community.hashi\_vault | Authentication method to be used.
`none` auth method was added in collection version `1.2.0`.
`cert` auth method was added in collection version `1.4.0`. |
| **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\_iam\_server\_id** string added in 0.2.0 of community.hashi\_vault | | ini entries: [hashi\_vault\_collection]aws\_iam\_server\_id = None
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_AWS\_IAM\_SERVER\_ID | If specified, sets the value to use for the `X-Vault-AWS-IAM-Server-ID` header as part of `GetCallerIdentity` request. |
| **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. |
| **ca\_cert** string | | ini entries: [hashi\_vault\_collection]ca\_cert = None
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_CA\_CERT added in 1.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_ca\_cert added in 1.2.0 of community.hashi\_vault | Path to certificate to use for authentication. If not specified by any other means, the `VAULT_CACERT` environment variable will be used.
aliases: cacert |
| **cert\_auth\_private\_key** path added in 1.4.0 of community.hashi\_vault | | ini entries: [hashi\_vault\_collection]cert\_auth\_private\_key = None env:ANSIBLE\_HASHI\_VAULT\_CERT\_AUTH\_PRIVATE\_KEY | For `cert` auth, path to the private key file to authenticate with, in PEM format. |
| **cert\_auth\_public\_key** path added in 1.4.0 of community.hashi\_vault | | ini entries: [hashi\_vault\_collection]cert\_auth\_public\_key = None env:ANSIBLE\_HASHI\_VAULT\_CERT\_AUTH\_PUBLIC\_KEY | For `cert` auth, path to the certificate file to authenticate with, in PEM format. |
| **jwt** string | | env:ANSIBLE\_HASHI\_VAULT\_JWT | The JSON Web Token (JWT) to use for JWT authentication to Vault. |
| **mount\_point** string | | | Vault mount point. If not specified, the default mount point for a given auth method is used. Does not apply to token authentication. |
| **namespace** string | | ini entries: [hashi\_vault\_collection]namespace = None
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_NAMESPACE added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_namespace added in 1.2.0 of community.hashi\_vault | Vault namespace where secrets reside. This option requires HVAC 0.7.0+ and Vault 0.11+. Optionally, this may be achieved by prefixing the authentication mount point and/or secret path with the namespace (e.g `mynamespace/secret/mysecret`). If environment variable `VAULT_NAMESPACE` is set, its value will be used last among all ways to specify *namespace*. |
| **password** string | | env:ANSIBLE\_HASHI\_VAULT\_PASSWORD added in 1.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_password added in 1.2.0 of community.hashi\_vault | Authentication password. |
| **proxies** raw added in 1.1.0 of community.hashi\_vault | | ini entries: [hashi\_vault\_collection]proxies = None
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_PROXIES var: ansible\_hashi\_vault\_proxies added in 1.2.0 of community.hashi\_vault | URL(s) to the proxies used to access the Vault service. It can be a string or a dict. If it's a dict, provide the scheme (eg. `http` or `https`) as the key, and the URL as the value. If it's a string, provide a single URL that will be used as the proxy for both `http` and `https` schemes. A string that can be interpreted as a dictionary will be converted to one (see examples). You can specify a different proxy for HTTP and HTTPS resources. If not specified, [environment variables from the Requests library](https://requests.readthedocs.io/en/master/user/advanced/#proxies) are used. |
| **region** string | | env:EC2\_REGION env:AWS\_REGION | The AWS region for which to create the connection. |
| **retries** raw added in 1.3.0 of community.hashi\_vault | | ini entries: [hashi\_vault\_collection]retries = None
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_RETRIES var: ansible\_hashi\_vault\_retries | Allows for retrying on errors, based on the [Retry class in the urllib3 library](https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html#urllib3.util.Retry). This collection defines recommended defaults for retrying connections to Vault. This option can be specified as a positive number (integer) or dictionary. If this option is not specified or the number is `0`, then retries are disabled. A number sets the total number of retries, and uses collection defaults for the other settings. A dictionary value is used directly to initialize the `Retry` class, so it can be used to fully customize retries. For detailed information on retries, see the collection User Guide. |
| **retry\_action** string added in 1.3.0 of community.hashi\_vault | **Choices:*** ignore
* **warn** ←
| ini entries: [hashi\_vault\_collection]retry\_action = warn
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_RETRY\_ACTION var: ansible\_hashi\_vault\_retry\_action | Controls whether and how to show messages on *retries*. This has no effect if a request is not retried. |
| **role\_id** string | | ini entries: [hashi\_vault\_collection]role\_id = None
added in 1.4.0 of community.hashi\_vault env:VAULT\_ROLE\_ID Removed in: version 2.0.0 Why: standardizing environment variables Alternative: ANSIBLE\_HASHI\_VAULT\_ROLE\_ID env:ANSIBLE\_HASHI\_VAULT\_ROLE\_ID added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_role\_id added in 1.2.0 of community.hashi\_vault | Vault Role ID or name. Used in `approle`, `aws_iam_login`, and `cert` auth methods. For `cert` auth, if no *role\_id* is supplied, the default behavior is to try all certificate roles and return any one that matches. |
| **secret\_id** string | | env:VAULT\_SECRET\_ID Removed in: version 2.0.0 Why: standardizing environment variables Alternative: ANSIBLE\_HASHI\_VAULT\_SECRET\_ID env:ANSIBLE\_HASHI\_VAULT\_SECRET\_ID added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_secret\_id added in 1.2.0 of community.hashi\_vault | Secret ID to be used for Vault AppRole authentication. |
| **timeout** integer added in 1.3.0 of community.hashi\_vault | | ini entries: [hashi\_vault\_collection]timeout = None
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_TIMEOUT var: ansible\_hashi\_vault\_timeout | Sets the connection timeout in seconds. If not set, then the `hvac` library's default is used. |
| **token** string | | env:ANSIBLE\_HASHI\_VAULT\_TOKEN added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_token added in 1.2.0 of community.hashi\_vault | Vault token. Token may be specified explicitly, through the listed [env] vars, and also through the `VAULT_TOKEN` env var. If no token is supplied, explicitly or through env, then the plugin will check for a token file, as determined by *token\_path* and *token\_file*. The order of token loading (first found wins) is `token param -> ansible var -> ANSIBLE_HASHI_VAULT_TOKEN -> VAULT_TOKEN -> token file`. |
| **token\_file** string | **Default:**".vault-token" | ini entries: [hashi\_vault\_collection]token\_file = .vault-token
added in 1.4.0 of community.hashi\_vault env:VAULT\_TOKEN\_FILE Removed in: version 2.0.0 Why: standardizing environment variables Alternative: ANSIBLE\_HASHI\_VAULT\_TOKEN\_FILE env:ANSIBLE\_HASHI\_VAULT\_TOKEN\_FILE added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_token\_file added in 1.2.0 of community.hashi\_vault | If no token is specified, will try to read the token from this file in *token\_path*. |
| **token\_path** string | | ini entries: [hashi\_vault\_collection]token\_path = None
added in 1.4.0 of community.hashi\_vault env:VAULT\_TOKEN\_PATH Removed in: version 2.0.0 Why: standardizing environment variables Alternative: ANSIBLE\_HASHI\_VAULT\_TOKEN\_PATH env:ANSIBLE\_HASHI\_VAULT\_TOKEN\_PATH added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_token\_path added in 1.2.0 of community.hashi\_vault | If no token is specified, will try to read the *token\_file* from this path. |
| **token\_validate** boolean added in 0.2.0 of community.hashi\_vault | **Choices:*** no
* **yes** ←
| ini entries: [hashi\_vault\_collection]token\_validate = yes
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_TOKEN\_VALIDATE var: ansible\_hashi\_vault\_token\_validate added in 1.2.0 of community.hashi\_vault | For token auth, will perform a `lookup-self` operation to determine the token's validity before using it. Disable if your token does not have the `lookup-self` capability. |
| **url** string | | ini entries: [hashi\_vault\_collection]url = None
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_ADDR added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_url added in 1.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_addr added in 1.2.0 of community.hashi\_vault | URL to the Vault service. If not specified by any other means, the value of the `VAULT_ADDR` environment variable will be used. If `VAULT_ADDR` is also not defined then a default of `http://127.0.0.1:8200` will be used. |
| **username** string | | env:ANSIBLE\_HASHI\_VAULT\_USERNAME added in 1.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_username added in 1.2.0 of community.hashi\_vault | Authentication user name. |
| **validate\_certs** boolean | **Choices:*** no
* yes
| var: ansible\_hashi\_vault\_validate\_certs added in 1.2.0 of community.hashi\_vault | Controls verification and validation of SSL certificates, mostly you only want to turn off with self signed ones. Will be populated with the inverse of `VAULT_SKIP_VERIFY` if that is set and *validate\_certs* is not explicitly provided. Will default to `true` if neither *validate\_certs* or `VAULT_SKIP_VERIFY` are set. |
See Also
--------
See also
[community.hashi\_vault.vault\_read](vault_read_module#ansible-collections-community-hashi-vault-vault-read-module)
The official documentation on the **community.hashi\_vault.vault\_read** module.
[community.hashi\_vault.hashi\_vault lookup](hashi_vault_lookup#ansible-collections-community-hashi-vault-hashi-vault-lookup)
The official documentation for the `community.hashi_vault.hashi_vault` lookup plugin.
Examples
--------
```
- name: Read a kv2 secret
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.vault_read', 'secret/data/hello', url='https://vault:8201') }}"
- name: Retrieve an approle role ID
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.vault_read', 'auth/approle/role/role-name/role-id', url='https://vault:8201') }}"
- name: Perform multiple reads with a single Vault login
vars:
paths:
- secret/data/hello
- auth/approle/role/role-one/role-id
- auth/approle/role/role-two/role-id
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.vault_read', *paths, auth_method='userpass', username=user, password=pwd) }}"
- name: Perform multiple reads with a single Vault login in a loop
vars:
paths:
- secret/data/hello
- auth/approle/role/role-one/role-id
- auth/approle/role/role-two/role-id
ansible.builtin.debug:
msg: '{{ item }}'
loop: "{{ query('community.hashi_vault.vault_read', *paths, auth_method='userpass', username=user, password=pwd) }}"
- name: Perform multiple reads with a single Vault login in a loop (via with_)
vars:
ansible_hashi_vault_auth_method: userpass
ansible_hashi_vault_username: '{{ user }}'
ansible_hashi_vault_passowrd: '{{ pwd }}'
ansible.builtin.debug:
msg: '{{ item }}'
with_community.hashi_vault.vault_read:
- secret/data/hello
- auth/approle/role/role-one/role-id
- auth/approle/role/role-two/role-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 lookup:
| Key | Returned | Description |
| --- | --- | --- |
| **\_raw** list / elements=dictionary | success | The raw result of the read against the given path. |
### Authors
* Brian Scholer (@briantist)
ansible community.hashi_vault.vault_read – Perform a read operation against HashiCorp Vault community.hashi\_vault.vault\_read – Perform a read operation against HashiCorp Vault
=====================================================================================
Note
This plugin is part of the [community.hashi\_vault collection](https://galaxy.ansible.com/community/hashi_vault) (version 1.4.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 community.hashi_vault`.
To use it in a playbook, specify: `community.hashi_vault.vault_read`.
New in version 1.4.0: of community.hashi\_vault
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Performs a generic read operation against a given path in HashiCorp Vault.
Requirements
------------
The below requirements are needed on the host that executes this module.
* `hvac` ([Python library](https://hvac.readthedocs.io/en/stable/overview.html))
* For detailed requirements, see [the collection requirements page](docsite/user_guide#ansible-collections-community-hashi-vault-docsite-user-guide-requirements).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_method** string | **Choices:*** **token** ←
* userpass
* ldap
* approle
* aws\_iam\_login
* jwt
* cert
* none
| Authentication method to be used.
`none` auth method was added in collection version `1.2.0`.
`cert` auth method was added in collection version `1.4.0`. |
| **aws\_access\_key** string | | The AWS access key to use.
aliases: aws\_access\_key\_id |
| **aws\_iam\_server\_id** string added in 0.2.0 of community.hashi\_vault | | If specified, sets the value to use for the `X-Vault-AWS-IAM-Server-ID` header as part of `GetCallerIdentity` request. |
| **aws\_profile** string | | The AWS profile
aliases: boto\_profile |
| **aws\_secret\_key** string | | The AWS secret key that corresponds to the access key.
aliases: aws\_secret\_access\_key |
| **aws\_security\_token** string | | The AWS security token if using temporary access and secret keys. |
| **ca\_cert** string | | Path to certificate to use for authentication. If not specified by any other means, the `VAULT_CACERT` environment variable will be used.
aliases: cacert |
| **cert\_auth\_private\_key** path added in 1.4.0 of community.hashi\_vault | | For `cert` auth, path to the private key file to authenticate with, in PEM format. |
| **cert\_auth\_public\_key** path added in 1.4.0 of community.hashi\_vault | | For `cert` auth, path to the certificate file to authenticate with, in PEM format. |
| **jwt** string | | The JSON Web Token (JWT) to use for JWT authentication to Vault. |
| **mount\_point** string | | Vault mount point. If not specified, the default mount point for a given auth method is used. Does not apply to token authentication. |
| **namespace** string | | Vault namespace where secrets reside. This option requires HVAC 0.7.0+ and Vault 0.11+. Optionally, this may be achieved by prefixing the authentication mount point and/or secret path with the namespace (e.g `mynamespace/secret/mysecret`). If environment variable `VAULT_NAMESPACE` is set, its value will be used last among all ways to specify *namespace*. |
| **password** string | | Authentication password. |
| **path** string / required | | Vault path to be read. |
| **proxies** raw added in 1.1.0 of community.hashi\_vault | | URL(s) to the proxies used to access the Vault service. It can be a string or a dict. If it's a dict, provide the scheme (eg. `http` or `https`) as the key, and the URL as the value. If it's a string, provide a single URL that will be used as the proxy for both `http` and `https` schemes. A string that can be interpreted as a dictionary will be converted to one (see examples). You can specify a different proxy for HTTP and HTTPS resources. If not specified, [environment variables from the Requests library](https://requests.readthedocs.io/en/master/user/advanced/#proxies) are used. |
| **region** string | | The AWS region for which to create the connection. |
| **retries** raw added in 1.3.0 of community.hashi\_vault | | Allows for retrying on errors, based on the [Retry class in the urllib3 library](https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html#urllib3.util.Retry). This collection defines recommended defaults for retrying connections to Vault. This option can be specified as a positive number (integer) or dictionary. If this option is not specified or the number is `0`, then retries are disabled. A number sets the total number of retries, and uses collection defaults for the other settings. A dictionary value is used directly to initialize the `Retry` class, so it can be used to fully customize retries. For detailed information on retries, see the collection User Guide. |
| **retry\_action** string added in 1.3.0 of community.hashi\_vault | **Choices:*** ignore
* **warn** ←
| Controls whether and how to show messages on *retries*. This has no effect if a request is not retried. |
| **role\_id** string | | Vault Role ID or name. Used in `approle`, `aws_iam_login`, and `cert` auth methods. For `cert` auth, if no *role\_id* is supplied, the default behavior is to try all certificate roles and return any one that matches. |
| **secret\_id** string | | Secret ID to be used for Vault AppRole authentication. |
| **timeout** integer added in 1.3.0 of community.hashi\_vault | | Sets the connection timeout in seconds. If not set, then the `hvac` library's default is used. |
| **token** string | | Vault token. Token may be specified explicitly, through the listed [env] vars, and also through the `VAULT_TOKEN` env var. If no token is supplied, explicitly or through env, then the plugin will check for a token file, as determined by *token\_path* and *token\_file*. The order of token loading (first found wins) is `token param -> ansible var -> ANSIBLE_HASHI_VAULT_TOKEN -> VAULT_TOKEN -> token file`. |
| **token\_file** string | **Default:**".vault-token" | If no token is specified, will try to read the token from this file in *token\_path*. |
| **token\_path** string | | If no token is specified, will try to read the *token\_file* from this path. |
| **token\_validate** boolean added in 0.2.0 of community.hashi\_vault | **Choices:*** no
* **yes** ←
| For token auth, will perform a `lookup-self` operation to determine the token's validity before using it. Disable if your token does not have the `lookup-self` capability. |
| **url** string | | URL to the Vault service. If not specified by any other means, the value of the `VAULT_ADDR` environment variable will be used. If `VAULT_ADDR` is also not defined then a default of `http://127.0.0.1:8200` will be used. |
| **username** string | | Authentication user name. |
| **validate\_certs** boolean | **Choices:*** no
* yes
| Controls verification and validation of SSL certificates, mostly you only want to turn off with self signed ones. Will be populated with the inverse of `VAULT_SKIP_VERIFY` if that is set and *validate\_certs* is not explicitly provided. Will default to `true` if neither *validate\_certs* or `VAULT_SKIP_VERIFY` are set. |
See Also
--------
See also
[community.hashi\_vault.vault\_read lookup](vault_read_lookup#ansible-collections-community-hashi-vault-vault-read-lookup)
The official documentation for the `community.hashi_vault.vault_read` lookup plugin.
[community.hashi\_vault.hashi\_vault lookup](hashi_vault_lookup#ansible-collections-community-hashi-vault-hashi-vault-lookup)
The official documentation for the `community.hashi_vault.hashi_vault` lookup plugin.
Examples
--------
```
- name: Read a kv2 secret from Vault via the remote host with userpass auth
community.hashi_vault.vault_read:
url: https://vault:8201
path: secret/data/hello
auth_method: userpass
username: user
password: '{{ passwd }}'
register: secret
- name: Display the secret data
ansible.builtin.debug:
msg: "{{ secret.data.data.data }}"
- name: Retrieve an approle role ID from Vault via the remote host
community.hashi_vault.vault_read:
url: https://vault:8201
path: auth/approle/role/role-name/role-id
register: approle_id
- name: Display the role ID
ansible.builtin.debug:
msg: "{{ approle_id.data.data.role_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 |
| --- | --- | --- |
| **data** dictionary | success | The raw result of the read against the given path. |
### Authors
* Brian Scholer (@briantist)
| programming_docs |
ansible community.hashi_vault.hashi_vault – Retrieve secrets from HashiCorp’s Vault community.hashi\_vault.hashi\_vault – Retrieve secrets from HashiCorp’s Vault
=============================================================================
Note
This plugin is part of the [community.hashi\_vault collection](https://galaxy.ansible.com/community/hashi_vault) (version 1.4.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 community.hashi_vault`.
To use it in a playbook, specify: `community.hashi_vault.hashi_vault`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Retrieve secrets from HashiCorp’s Vault.
Requirements
------------
The below requirements are needed on the local controller node that executes this lookup.
* `hvac` ([Python library](https://hvac.readthedocs.io/en/stable/overview.html))
* For detailed requirements, see [the collection requirements page](docsite/user_guide#ansible-collections-community-hashi-vault-docsite-user-guide-requirements).
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **auth\_method** string | **Choices:*** **token** ←
* userpass
* ldap
* approle
* aws\_iam\_login
* jwt
* cert
* none
| ini entries: [lookup\_hashi\_vault]auth\_method = token
Removed in: version 3.0.0 Why: collection-wide config section Alternative: use section [hashi\_vault\_collection] [hashi\_vault\_collection]auth\_method = token
added in 1.4.0 of community.hashi\_vault env:VAULT\_AUTH\_METHOD Removed in: version 2.0.0 Why: standardizing environment variables Alternative: ANSIBLE\_HASHI\_VAULT\_AUTH\_METHOD env:ANSIBLE\_HASHI\_VAULT\_AUTH\_METHOD added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_auth\_method added in 1.2.0 of community.hashi\_vault | Authentication method to be used.
`none` auth method was added in collection version `1.2.0`.
`cert` auth method was added in collection version `1.4.0`. |
| **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\_iam\_server\_id** string added in 0.2.0 of community.hashi\_vault | | ini entries: [lookup\_hashi\_vault]aws\_iam\_server\_id = None
Removed in: version 3.0.0 Why: collection-wide config section Alternative: use section [hashi\_vault\_collection] [hashi\_vault\_collection]aws\_iam\_server\_id = None
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_AWS\_IAM\_SERVER\_ID | If specified, sets the value to use for the `X-Vault-AWS-IAM-Server-ID` header as part of `GetCallerIdentity` request. |
| **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. |
| **ca\_cert** string | | ini entries: [lookup\_hashi\_vault]ca\_cert = None
added in 1.2.0 of community.hashi\_vault Removed in: version 3.0.0 Why: collection-wide config section Alternative: use section [hashi\_vault\_collection] [hashi\_vault\_collection]ca\_cert = None
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_CA\_CERT added in 1.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_ca\_cert added in 1.2.0 of community.hashi\_vault | Path to certificate to use for authentication. If not specified by any other means, the `VAULT_CACERT` environment variable will be used.
aliases: cacert |
| **cert\_auth\_private\_key** path added in 1.4.0 of community.hashi\_vault | | ini entries: [hashi\_vault\_collection]cert\_auth\_private\_key = None env:ANSIBLE\_HASHI\_VAULT\_CERT\_AUTH\_PRIVATE\_KEY | For `cert` auth, path to the private key file to authenticate with, in PEM format. |
| **cert\_auth\_public\_key** path added in 1.4.0 of community.hashi\_vault | | ini entries: [hashi\_vault\_collection]cert\_auth\_public\_key = None env:ANSIBLE\_HASHI\_VAULT\_CERT\_AUTH\_PUBLIC\_KEY | For `cert` auth, path to the certificate file to authenticate with, in PEM format. |
| **jwt** string | | env:ANSIBLE\_HASHI\_VAULT\_JWT | The JSON Web Token (JWT) to use for JWT authentication to Vault. |
| **mount\_point** string | | | Vault mount point. If not specified, the default mount point for a given auth method is used. Does not apply to token authentication. |
| **namespace** string | | ini entries: [lookup\_hashi\_vault]namespace = None
added in 0.2.0 of community.hashi\_vault Removed in: version 3.0.0 Why: collection-wide config section Alternative: use section [hashi\_vault\_collection] [hashi\_vault\_collection]namespace = None
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_NAMESPACE added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_namespace added in 1.2.0 of community.hashi\_vault | Vault namespace where secrets reside. This option requires HVAC 0.7.0+ and Vault 0.11+. Optionally, this may be achieved by prefixing the authentication mount point and/or secret path with the namespace (e.g `mynamespace/secret/mysecret`). If environment variable `VAULT_NAMESPACE` is set, its value will be used last among all ways to specify *namespace*. |
| **password** string | | env:ANSIBLE\_HASHI\_VAULT\_PASSWORD added in 1.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_password added in 1.2.0 of community.hashi\_vault | Authentication password. |
| **proxies** raw added in 1.1.0 of community.hashi\_vault | | ini entries: [lookup\_hashi\_vault]proxies = None
Removed in: version 3.0.0 Why: collection-wide config section Alternative: use section [hashi\_vault\_collection] [hashi\_vault\_collection]proxies = None
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_PROXIES var: ansible\_hashi\_vault\_proxies added in 1.2.0 of community.hashi\_vault | URL(s) to the proxies used to access the Vault service. It can be a string or a dict. If it's a dict, provide the scheme (eg. `http` or `https`) as the key, and the URL as the value. If it's a string, provide a single URL that will be used as the proxy for both `http` and `https` schemes. A string that can be interpreted as a dictionary will be converted to one (see examples). You can specify a different proxy for HTTP and HTTPS resources. If not specified, [environment variables from the Requests library](https://requests.readthedocs.io/en/master/user/advanced/#proxies) are used. |
| **region** string | | env:EC2\_REGION env:AWS\_REGION | The AWS region for which to create the connection. |
| **retries** raw added in 1.3.0 of community.hashi\_vault | | ini entries: [lookup\_hashi\_vault]retries = None
Removed in: version 3.0.0 Why: collection-wide config section Alternative: use section [hashi\_vault\_collection] [hashi\_vault\_collection]retries = None
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_RETRIES var: ansible\_hashi\_vault\_retries | Allows for retrying on errors, based on the [Retry class in the urllib3 library](https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html#urllib3.util.Retry). This collection defines recommended defaults for retrying connections to Vault. This option can be specified as a positive number (integer) or dictionary. If this option is not specified or the number is `0`, then retries are disabled. A number sets the total number of retries, and uses collection defaults for the other settings. A dictionary value is used directly to initialize the `Retry` class, so it can be used to fully customize retries. For detailed information on retries, see the collection User Guide. |
| **retry\_action** string added in 1.3.0 of community.hashi\_vault | **Choices:*** ignore
* **warn** ←
| ini entries: [lookup\_hashi\_vault]retry\_action = warn
Removed in: version 3.0.0 Why: collection-wide config section Alternative: use section [hashi\_vault\_collection] [hashi\_vault\_collection]retry\_action = warn
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_RETRY\_ACTION var: ansible\_hashi\_vault\_retry\_action | Controls whether and how to show messages on *retries*. This has no effect if a request is not retried. |
| **return\_format** string | **Choices:*** **dict** ←
* values
* raw
| | Controls how multiple key/value pairs in a path are treated on return.
`dict` returns a single dict containing the key/value pairs.
`values` returns a list of all the values only. Use when you don't care about the keys.
`raw` returns the actual API result (deserialized), which includes metadata and may have the data nested in other keys.
aliases: as |
| **role\_id** string | | ini entries: [lookup\_hashi\_vault]role\_id = None
Removed in: version 3.0.0 Why: collection-wide config section Alternative: use section [hashi\_vault\_collection] [hashi\_vault\_collection]role\_id = None
added in 1.4.0 of community.hashi\_vault env:VAULT\_ROLE\_ID Removed in: version 2.0.0 Why: standardizing environment variables Alternative: ANSIBLE\_HASHI\_VAULT\_ROLE\_ID env:ANSIBLE\_HASHI\_VAULT\_ROLE\_ID added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_role\_id added in 1.2.0 of community.hashi\_vault | Vault Role ID or name. Used in `approle`, `aws_iam_login`, and `cert` auth methods. For `cert` auth, if no *role\_id* is supplied, the default behavior is to try all certificate roles and return any one that matches. |
| **secret** string / required | | | Vault path to the secret being requested in the format `path[:field]`. |
| **secret\_id** string | | env:VAULT\_SECRET\_ID Removed in: version 2.0.0 Why: standardizing environment variables Alternative: ANSIBLE\_HASHI\_VAULT\_SECRET\_ID env:ANSIBLE\_HASHI\_VAULT\_SECRET\_ID added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_secret\_id added in 1.2.0 of community.hashi\_vault | Secret ID to be used for Vault AppRole authentication. |
| **timeout** integer added in 1.3.0 of community.hashi\_vault | | ini entries: [lookup\_hashi\_vault]timeout = None
Removed in: version 3.0.0 Why: collection-wide config section Alternative: use section [hashi\_vault\_collection] [hashi\_vault\_collection]timeout = None
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_TIMEOUT var: ansible\_hashi\_vault\_timeout | Sets the connection timeout in seconds. If not set, then the `hvac` library's default is used. |
| **token** string | | env:ANSIBLE\_HASHI\_VAULT\_TOKEN added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_token added in 1.2.0 of community.hashi\_vault | Vault token. Token may be specified explicitly, through the listed [env] vars, and also through the `VAULT_TOKEN` env var. If no token is supplied, explicitly or through env, then the plugin will check for a token file, as determined by *token\_path* and *token\_file*. The order of token loading (first found wins) is `token param -> ansible var -> ANSIBLE_HASHI_VAULT_TOKEN -> VAULT_TOKEN -> token file`. |
| **token\_file** string | **Default:**".vault-token" | ini entries: [lookup\_hashi\_vault]token\_file = .vault-token
Removed in: version 3.0.0 Why: collection-wide config section Alternative: use section [hashi\_vault\_collection] [hashi\_vault\_collection]token\_file = .vault-token
added in 1.4.0 of community.hashi\_vault env:VAULT\_TOKEN\_FILE Removed in: version 2.0.0 Why: standardizing environment variables Alternative: ANSIBLE\_HASHI\_VAULT\_TOKEN\_FILE env:ANSIBLE\_HASHI\_VAULT\_TOKEN\_FILE added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_token\_file added in 1.2.0 of community.hashi\_vault | If no token is specified, will try to read the token from this file in *token\_path*. |
| **token\_path** string | | ini entries: [lookup\_hashi\_vault]token\_path = None
Removed in: version 3.0.0 Why: collection-wide config section Alternative: use section [hashi\_vault\_collection] [hashi\_vault\_collection]token\_path = None
added in 1.4.0 of community.hashi\_vault env:VAULT\_TOKEN\_PATH Removed in: version 2.0.0 Why: standardizing environment variables Alternative: ANSIBLE\_HASHI\_VAULT\_TOKEN\_PATH env:ANSIBLE\_HASHI\_VAULT\_TOKEN\_PATH added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_token\_path added in 1.2.0 of community.hashi\_vault | If no token is specified, will try to read the *token\_file* from this path. |
| **token\_validate** boolean added in 0.2.0 of community.hashi\_vault | **Choices:*** no
* **yes** ←
| ini entries: [lookup\_hashi\_vault]token\_validate = yes
Removed in: version 3.0.0 Why: collection-wide config section Alternative: use section [hashi\_vault\_collection] [hashi\_vault\_collection]token\_validate = yes
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_TOKEN\_VALIDATE var: ansible\_hashi\_vault\_token\_validate added in 1.2.0 of community.hashi\_vault | For token auth, will perform a `lookup-self` operation to determine the token's validity before using it. Disable if your token does not have the `lookup-self` capability. |
| **url** string | | ini entries: [lookup\_hashi\_vault]url = None
Removed in: version 3.0.0 Why: collection-wide config section Alternative: use section [hashi\_vault\_collection] [hashi\_vault\_collection]url = None
added in 1.4.0 of community.hashi\_vault env:ANSIBLE\_HASHI\_VAULT\_ADDR added in 0.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_url added in 1.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_addr added in 1.2.0 of community.hashi\_vault | URL to the Vault service. If not specified by any other means, the value of the `VAULT_ADDR` environment variable will be used. If `VAULT_ADDR` is also not defined then a default of `http://127.0.0.1:8200` will be used. |
| **username** string | | env:ANSIBLE\_HASHI\_VAULT\_USERNAME added in 1.2.0 of community.hashi\_vault var: ansible\_hashi\_vault\_username added in 1.2.0 of community.hashi\_vault | Authentication user name. |
| **validate\_certs** boolean | **Choices:*** no
* yes
| var: ansible\_hashi\_vault\_validate\_certs added in 1.2.0 of community.hashi\_vault | Controls verification and validation of SSL certificates, mostly you only want to turn off with self signed ones. Will be populated with the inverse of `VAULT_SKIP_VERIFY` if that is set and *validate\_certs* is not explicitly provided. Will default to `true` if neither *validate\_certs* or `VAULT_SKIP_VERIFY` are set. |
Notes
-----
Note
* Due to a current limitation in the HVAC library there won’t necessarily be an error if a bad endpoint is specified.
* As of community.hashi\_vault 0.1.0, only the latest version of a secret is returned when specifying a KV v2 path.
* As of community.hashi\_vault 0.1.0, all options can be supplied via term string (space delimited key=value pairs) or by parameters (see examples).
* As of community.hashi\_vault 0.1.0, when *secret* is the first option in the term string, `secret=` is not required (see examples).
See Also
--------
See also
[community.hashi\_vault.vault\_read lookup](vault_read_lookup#ansible-collections-community-hashi-vault-vault-read-lookup)
The official documentation for the `community.hashi_vault.vault_read` lookup plugin.
[community.hashi\_vault.vault\_read](vault_read_module#ansible-collections-community-hashi-vault-vault-read-module)
The official documentation on the **community.hashi\_vault.vault\_read** module.
Examples
--------
```
- ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=secret/hello:value token=c975b780-d1be-8016-866b-01d0f9b688a5 url=http://myvault:8200') }}"
- name: Return all secrets from a path
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=secret/hello token=c975b780-d1be-8016-866b-01d0f9b688a5 url=http://myvault:8200') }}"
- name: Vault that requires authentication via LDAP
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/hello:value auth_method=ldap mount_point=ldap username=myuser password=mypas') }}"
- name: Vault that requires authentication via username and password
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=secret/hola:val auth_method=userpass username=myuser password=psw url=http://vault:8200') }}"
- name: Connect to Vault using TLS
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=secret/hola:value token=c975b780-d1be-8016-866b-01d0f9b688a5 validate_certs=False') }}"
- name: using certificate auth
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/hi:val token=xxxx url=https://vault:8200 validate_certs=True cacert=/cacert/path/ca.pem') }}"
- name: Authenticate with a Vault app role
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=secret/hello:value auth_method=approle role_id=myroleid secret_id=mysecretid') }}"
- name: Return all secrets from a path in a namespace
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=secret/hello token=c975b780-d1be-8016-866b-01d0f9b688a5 namespace=teama/admins') }}"
# When using KV v2 the PATH should include "data" between the secret engine mount and path (e.g. "secret/data/:path")
# see: https://www.vaultproject.io/api/secret/kv/kv-v2.html#read-secret-version
- name: Return latest KV v2 secret from path
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=secret/data/hello token=my_vault_token url=http://myvault_url:8200') }}"
# The following examples show more modern syntax, with parameters specified separately from the term string.
- name: secret= is not required if secret is first
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/data/hello token=<token> url=http://myvault_url:8200') }}"
- name: options can be specified as parameters rather than put in term string
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/data/hello', token=my_token_var, url='http://myvault_url:8200') }}"
# return_format (or its alias 'as') can control how secrets are returned to you
- name: return secrets as a dict (default)
ansible.builtin.set_fact:
my_secrets: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/data/manysecrets', token=my_token_var, url='http://myvault_url:8200') }}"
- ansible.builtin.debug:
msg: "{{ my_secrets['secret_key'] }}"
- ansible.builtin.debug:
msg: "Secret '{{ item.key }}' has value '{{ item.value }}'"
loop: "{{ my_secrets | dict2items }}"
- name: return secrets as values only
ansible.builtin.debug:
msg: "A secret value: {{ item }}"
loop: "{{ query('community.hashi_vault.hashi_vault', 'secret/data/manysecrets', token=my_token_var, url='http://vault_url:8200', return_format='values') }}"
- name: return raw secret from API, including metadata
ansible.builtin.set_fact:
my_secret: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/data/hello:value', token=my_token_var, url='http://myvault_url:8200', as='raw') }}"
- ansible.builtin.debug:
msg: "This is version {{ my_secret['metadata']['version'] }} of hello:value. The secret data is {{ my_secret['data']['data']['value'] }}"
# AWS IAM authentication method
# uses Ansible standard AWS options
- name: authenticate with aws_iam_login
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/hello:value', auth_method='aws_iam_login', role_id='myroleid', profile=my_boto_profile) }}"
# JWT auth
- name: Authenticate with a JWT
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/hola:val', auth_method='jwt', role_id='myroleid', jwt='myjwt', url='https://vault:8200') }}"
# Disabling Token Validation
# Use this when your token does not have the lookup-self capability. Usually this is applied to all tokens via the default policy.
# However you can choose to create tokens without applying the default policy, or you can modify your default policy not to include it.
# When disabled, your invalid or expired token will be indistinguishable from insufficent permissions.
- name: authenticate without token validation
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/hello:value', token=my_token, token_validate=False) }}"
# "none" auth method does no authentication and does not send a token to the Vault address.
# One example of where this could be used is with a Vault agent where the agent will handle authentication to Vault.
# https://www.vaultproject.io/docs/agent
- name: authenticate with vault agent
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/hello:value', auth_method='none', url='http://127.0.0.1:8100') }}"
# Use a proxy
- name: use a proxy with login/password
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=... token=... url=https://... proxies=https://user:pass@myproxy:8080') }}"
- name: 'use a socks proxy (need some additional dependencies, see: https://requests.readthedocs.io/en/master/user/advanced/#socks )'
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=... token=... url=https://... proxies=socks5://myproxy:1080') }}"
- name: use proxies with a dict (as param)
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', '...', proxies={'http': 'http://myproxy1', 'https': 'http://myproxy2'}) }}"
- name: use proxies with a dict (as param, pre-defined var)
vars:
prox:
http: http://myproxy1
https: https://myproxy2
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', '...', proxies=prox }}"
- name: use proxies with a dict (as direct ansible var)
vars:
ansible_hashi_vault_proxies:
http: http://myproxy1
https: https://myproxy2
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', '...' }}"
- name: use proxies with a dict (in the term string, JSON syntax)
ansible.builtin.debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', '... proxies={\"http\":\"http://myproxy1\",\"https\":\"http://myproxy2\"}') }}"
- name: use ansible vars to supply some options
vars:
ansible_hashi_vault_url: 'https://myvault:8282'
ansible_hashi_vault_auth_method: token
set_fact:
secret1: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/data/secret1') }}"
secret2: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/data/secret2') }}"
- name: use a custom timeout
debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/data/secret1', timeout=120) }}"
- name: use a custom timeout and retry on failure 3 times (with collection retry defaults)
vars:
ansible_hashi_vault_timeout: 5
ansible_hashi_vault_retries: 3
debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/data/secret1') }}"
- name: retry on failure (with custom retry settings and no warnings)
vars:
ansible_hashi_vault_retries:
total: 6
backoff_factor: 0.9
status_forcelist: [500, 502]
allowed_methods:
- GET
- PUT
debug:
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/data/secret1', retry_action='warn') }}"
```
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** list / elements=dictionary | success | secrets(s) requested |
### Authors
* Julie Davila (@juliedavila) <julie(at)davila.io>
* Brian Scholer (@briantist)
| programming_docs |
ansible community.grafana.grafana_user – Manage Grafana User community.grafana.grafana\_user – Manage Grafana User
=====================================================
Note
This plugin is part of the [community.grafana collection](https://galaxy.ansible.com/community/grafana) (version 1.2.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install community.grafana`.
To use it in a playbook, specify: `community.grafana.grafana_user`.
New in version 1.0.0: of community.grafana
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create/update/delete Grafana User through the users and admin API.
* Tested with Grafana v6.4.3
* Password update is not supported at the time
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **client\_cert** path | | PEM formatted certificate chain file to be used for SSL client authentication. This file can also include the key as well, and if the key is included, *client\_key* is not required |
| **client\_key** path | | PEM formatted file that contains your private key to be used for SSL client authentication. If *client\_cert* contains both the certificate and key, this option is not required. |
| **email** string | | The email of the Grafana User. |
| **is\_admin** boolean | **Choices:*** **no** ←
* yes
| The Grafana User is an admin. |
| **login** string / required | | The login of the Grafana User. |
| **name** string | | The name of the Grafana User. |
| **password** string | | The password of the Grafana User. At the moment, this field is not updated yet. |
| **state** string | **Choices:*** **present** ←
* absent
| State if the user should be present in Grafana or not |
| **url** string / required | | The Grafana URL.
aliases: grafana\_url |
| **url\_password** string | **Default:**"admin" | The Grafana password for API authentication.
aliases: grafana\_password |
| **url\_username** string | **Default:**"admin" | The Grafana user for API authentication.
aliases: grafana\_user |
| **use\_proxy** boolean | **Choices:*** no
* **yes** ←
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `no`, SSL certificates will not be validated. This should only set to `no` used on personally controlled sites using self-signed certificates. |
Examples
--------
```
---
- name: Create or update a Grafana user
community.grafana.grafana_user:
url: "https://grafana.example.com"
url_username: admin
url_password: changeme
name: "Bruce Wayne"
email: [email protected]
login: batman
password: robin
is_admin: true
state: present
- name: Delete a Grafana user
community.grafana.grafana_user:
url: "https://grafana.example.com"
url_username: admin
url_password: changeme
login: batman
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 |
| --- | --- | --- |
| **user** complex | when state present | Information about the User |
| | **email** string | always | The User email address **Sample:** ['[email protected]'] |
| | **id** integer | always | The User id **Sample:** [42] |
| | **isDisabled** boolean | always | The Grafana account status **Sample:** [False] |
| | **isExternal** boolean | always | The Grafana account information on external user provider **Sample:** [False] |
| | **isGrafanaAdmin** boolean | always | The Grafana user permission for admin **Sample:** [False] |
| | **login** string | always | The User login **Sample:** ['batman'] |
| | **orgId** integer | always | The organization id that the team is part of. **Sample:** [1] |
| | **theme** string | always | The Grafana theme **Sample:** ['light'] |
### Authors
* Antoine Tanzilli (@Tailzip)
* Hong Viet LE (@pomverte)
* Julien Alexandre (@jual)
* Marc Cyprien (@LeFameux)
ansible community.grafana.grafana_datasource – Manage Grafana datasources community.grafana.grafana\_datasource – Manage Grafana datasources
==================================================================
Note
This plugin is part of the [community.grafana collection](https://galaxy.ansible.com/community/grafana) (version 1.2.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install community.grafana`.
To use it in a playbook, specify: `community.grafana.grafana_datasource`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create/update/delete Grafana datasources via API.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access** string | **Choices:*** direct
* **proxy** ←
| The access mode for this datasource. |
| **additional\_json\_data** dictionary | **Default:**{} | Defined data is used for datasource jsonData Data may be overridden by specifically defined parameters (like zabbix\_user) |
| **additional\_secure\_json\_data** dictionary | **Default:**{} | Defined data is used for datasource secureJsonData Data may be overridden by specifically defined parameters (like tls\_client\_cert) Stored as secure data, see `enforce_secure_data` and notes! |
| **aws\_access\_key** string | **Default:**"" | AWS access key for CloudWatch datasource type when `aws_auth_type` is `keys`
|
| **aws\_assume\_role\_arn** string | **Default:**"" | AWS IAM role arn to assume for CloudWatch datasource type when `aws_auth_type` is `arn`
|
| **aws\_auth\_type** string | **Choices:*** **keys** ←
* credentials
* arn
| Type for AWS authentication for CloudWatch datasource type (authType of grafana api) |
| **aws\_credentials\_profile** string | **Default:**"" | Profile for AWS credentials for CloudWatch datasource type when `aws_auth_type` is `credentials`
|
| **aws\_custom\_metrics\_namespaces** string | **Default:**"" | Namespaces of Custom Metrics for CloudWatch datasource type |
| **aws\_default\_region** string | **Choices:*** ap-northeast-1
* ap-northeast-2
* ap-southeast-1
* ap-southeast-2
* ap-south-1
* ca-central-1
* cn-north-1
* cn-northwest-1
* eu-central-1
* eu-west-1
* eu-west-2
* eu-west-3
* sa-east-1
* **us-east-1** ←
* us-east-2
* us-gov-west-1
* us-west-1
* us-west-2
| AWS default region for CloudWatch datasource type |
| **aws\_secret\_key** string | **Default:**"" | AWS secret key for CloudWatch datasource type when `aws_auth_type` is `keys`
|
| **basic\_auth\_password** string | | The datasource basic auth password, when `basic auth` is `yes`. |
| **basic\_auth\_user** string | | The datasource basic auth user. Setting this option with basic\_auth\_password will enable basic auth. |
| **client\_cert** path | | PEM formatted certificate chain file to be used for SSL client authentication. This file can also include the key as well, and if the key is included, *client\_key* is not required |
| **client\_key** path | | PEM formatted file that contains your private key to be used for SSL client authentication. If *client\_cert* contains both the certificate and key, this option is not required. |
| **database** string | | Name of the database for the datasource. This options is required when the `ds_type` is `influxdb`, `elasticsearch` (index name), `mysql` or `postgres`. |
| **ds\_type** string / required | **Choices:*** graphite
* prometheus
* elasticsearch
* influxdb
* opentsdb
* mysql
* postgres
* cloudwatch
* alexanderzobnin-zabbix-datasource
* sni-thruk-datasource
* camptocamp-prometheus-alertmanager-datasource
* loki
* redis-datasource
| The type of the datasource. |
| **ds\_url** string / required | | The URL of the datasource. |
| **enforce\_secure\_data** boolean | **Choices:*** **no** ←
* yes
| Secure data is not updated per default (see notes!) To update secure data you have to enable this option! Enabling this, the task will always report changed=True |
| **es\_version** integer | **Choices:*** 2
* 5
* 56
* 60
* 70
**Default:**5 | Elasticsearch version (for `ds_type = elasticsearch` only) Version 56 is for elasticsearch 5.6+ where you can specify the `max_concurrent_shard_requests` option. |
| **grafana\_api\_key** string | | The Grafana API key. If set, `url_username` and `url_password` will be ignored. |
| **interval** string | **Choices:*** * Hourly
* Daily
* Weekly
* Monthly
* Yearly
| For elasticsearch `ds_type`, this is the index pattern used. |
| **is\_default** boolean | **Choices:*** **no** ←
* yes
| Make this datasource the default one. |
| **max\_concurrent\_shard\_requests** integer | **Default:**256 | Starting with elasticsearch 5.6, you can specify the max concurrent shard per requests. |
| **name** string / required | | The name of the datasource. |
| **org\_id** integer | **Default:**1 | Grafana Organisation ID in which the datasource should be created. Not used when `grafana_api_key` is set, because the `grafana_api_key` only belong to one organisation. |
| **password** string | | The datasource password. For encrypted password use `additional_secure_json_data.password`. |
| **sslmode** string | **Choices:*** **disable** ←
* require
* verify-ca
* verify-full
| SSL mode for `postgres` datasource type. |
| **state** string | **Choices:*** absent
* **present** ←
| Status of the datasource |
| **time\_field** string | **Default:**"@timestamp" | Name of the time field in elasticsearch ds. For example `@timestamp`. |
| **time\_interval** string | | Minimum group by interval for `influxdb` or `elasticsearch` datasources. for example `>10s`. |
| **tls\_ca\_cert** string | | The TLS CA certificate for self signed certificates. Only used when `tls_client_cert` and `tls_client_key` are set. Stored as secure data, see `enforce_secure_data` and notes! |
| **tls\_client\_cert** string | | The client TLS certificate. If `tls_client_cert` and `tls_client_key` are set, this will enable TLS authentication. Starts with ----- BEGIN CERTIFICATE ----- Stored as secure data, see `enforce_secure_data` and notes! |
| **tls\_client\_key** string | | The client TLS private key Starts with ----- BEGIN RSA PRIVATE KEY ----- Stored as secure data, see `enforce_secure_data` and notes! |
| **tls\_skip\_verify** boolean | **Choices:*** **no** ←
* yes
| Skip the TLS datasource certificate verification. |
| **trends** boolean | **Choices:*** **no** ←
* yes
| Use trends or not for zabbix datasource type. |
| **tsdb\_resolution** string | **Choices:*** millisecond
* **second** ←
| The opentsdb time resolution. |
| **tsdb\_version** integer | **Choices:*** 1
* 2
* 3
**Default:**1 | The opentsdb version. Use `1` for <=2.1, `2` for ==2.2, `3` for ==2.3. |
| **url** string / required | | The Grafana URL.
aliases: grafana\_url |
| **url\_password** string | **Default:**"admin" | The Grafana password for API authentication.
aliases: grafana\_password |
| **url\_username** string | **Default:**"admin" | The Grafana user for API authentication.
aliases: grafana\_user |
| **use\_proxy** boolean | **Choices:*** no
* **yes** ←
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **user** string | | The datasource login user for influxdb datasources. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `no`, SSL certificates will not be validated. This should only set to `no` used on personally controlled sites using self-signed certificates. |
| **with\_credentials** boolean | **Choices:*** **no** ←
* yes
| Whether credentials such as cookies or auth headers should be sent with cross-site requests. |
| **zabbix\_password** string | | Password for Zabbix API |
| **zabbix\_user** string | | User for Zabbix API |
Notes
-----
Note
* Secure data will get encrypted by the Grafana API, thus it can not be compared on subsequent runs. To workaround this, secure data will not be updated after initial creation! To force the secure data update you have to set *enforce\_secure\_data=True*.
* Hint, with the `enforce_secure_data` always reporting changed=True, you might just do one Task updating the datasource without any secure data and make a separate playbook/task also changing the secure data. This way it will not break any workflow.
Examples
--------
```
---
- name: Create elasticsearch datasource
community.grafana.grafana_datasource:
name: "datasource-elastic"
grafana_url: "https://grafana.company.com"
grafana_user: "admin"
grafana_password: "xxxxxx"
org_id: "1"
ds_type: "elasticsearch"
ds_url: "https://elastic.company.com:9200"
database: "[logstash_]YYYY.MM.DD"
basic_auth_user: "grafana"
basic_auth_password: "******"
time_field: "@timestamp"
time_interval: "1m"
interval: "Daily"
es_version: 56
max_concurrent_shard_requests: 42
tls_ca_cert: "/etc/ssl/certs/ca.pem"
- name: Create influxdb datasource
community.grafana.grafana_datasource:
name: "datasource-influxdb"
grafana_url: "https://grafana.company.com"
grafana_user: "admin"
grafana_password: "xxxxxx"
org_id: "1"
ds_type: "influxdb"
ds_url: "https://influx.company.com:8086"
database: "telegraf"
time_interval: ">10s"
tls_ca_cert: "/etc/ssl/certs/ca.pem"
- name: Create postgres datasource
community.grafana.grafana_datasource:
name: "datasource-postgres"
grafana_url: "https://grafana.company.com"
grafana_user: "admin"
grafana_password: "xxxxxx"
org_id: "1"
ds_type: "postgres"
ds_url: "postgres.company.com:5432"
database: "db"
user: "postgres"
sslmode: "verify-full"
additional_json_data:
postgresVersion: 12
timescaledb: false
additional_secure_json_data:
password: "iampgroot"
- name: Create cloudwatch datasource
community.grafana.grafana_datasource:
name: "datasource-cloudwatch"
grafana_url: "https://grafana.company.com"
grafana_user: "admin"
grafana_password: "xxxxxx"
org_id: "1"
ds_type: "cloudwatch"
ds_url: "http://monitoring.us-west-1.amazonaws.com"
aws_auth_type: "keys"
aws_default_region: "us-west-1"
aws_access_key: "speakFriendAndEnter"
aws_secret_key: "mel10n"
aws_custom_metrics_namespaces: "n1,n2"
- name: grafana - add thruk datasource
community.grafana.grafana_datasource:
name: "datasource-thruk"
grafana_url: "https://grafana.company.com"
grafana_user: "admin"
grafana_password: "xxxxxx"
org_id: "1"
ds_type: "sni-thruk-datasource"
ds_url: "https://thruk.company.com/sitename/thruk"
basic_auth_user: "thruk-user"
basic_auth_password: "******"
# handle secure data - workflow example
# this will create/update the datasource but dont update the secure data on updates
# so you can assert if all tasks are changed=False
- name: create prometheus datasource
community.grafana.grafana_datasource:
name: openshift_prometheus
ds_type: prometheus
ds_url: https://openshift-monitoring.company.com
access: proxy
tls_skip_verify: true
additional_json_data:
httpHeaderName1: "Authorization"
additional_secure_json_data:
httpHeaderValue1: "Bearer ihavenogroot"
# in a separate task or even play you then can force to update
# and assert if each datasource is reporting changed=True
- name: update prometheus datasource
community.grafana.grafana_datasource:
name: openshift_prometheus
ds_type: prometheus
ds_url: https://openshift-monitoring.company.com
access: proxy
tls_skip_verify: true
additional_json_data:
httpHeaderName1: "Authorization"
additional_secure_json_data:
httpHeaderValue1: "Bearer ihavenogroot"
enforce_secure_data: 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 |
| --- | --- | --- |
| **datasource** dictionary | changed | datasource created/updated by module **Sample:** {'access': 'proxy', 'basicAuth': False, 'database': 'test\_\*', 'id': 1035, 'isDefault': False, 'jsonData': {'esVersion': 5, 'timeField': '@timestamp', 'timeInterval': '10s'}, 'name': 'grafana\_datasource\_test', 'orgId': 1, 'password': '', 'secureJsonFields': {'JustASecureTest': True}, 'type': 'elasticsearch', 'url': 'http://elastic.company.com:9200', 'user': '', 'withCredentials': False} |
### Authors
* Thierry Sallé (@seuf)
* Martin Wang (@martinwangjian)
* Rémi REY (@rrey)
ansible Community.Grafana Community.Grafana
=================
Collection version 1.2.3
Plugin Index
------------
These are the plugins in the community.grafana collection
### Callback Plugins
* [grafana\_annotations](grafana_annotations_callback#ansible-collections-community-grafana-grafana-annotations-callback) – send ansible events as annotations on charts to grafana over http api.
### Lookup Plugins
* [grafana\_dashboard](grafana_dashboard_lookup#ansible-collections-community-grafana-grafana-dashboard-lookup) – list or search grafana dashboards
### Modules
* [grafana\_dashboard](grafana_dashboard_module#ansible-collections-community-grafana-grafana-dashboard-module) – Manage Grafana dashboards
* [grafana\_datasource](grafana_datasource_module#ansible-collections-community-grafana-grafana-datasource-module) – Manage Grafana datasources
* [grafana\_folder](grafana_folder_module#ansible-collections-community-grafana-grafana-folder-module) – Manage Grafana Folders
* [grafana\_notification\_channel](grafana_notification_channel_module#ansible-collections-community-grafana-grafana-notification-channel-module) – Manage Grafana Notification Channels
* [grafana\_plugin](grafana_plugin_module#ansible-collections-community-grafana-grafana-plugin-module) – Manage Grafana plugins via grafana-cli
* [grafana\_team](grafana_team_module#ansible-collections-community-grafana-grafana-team-module) – Manage Grafana Teams
* [grafana\_user](grafana_user_module#ansible-collections-community-grafana-grafana-user-module) – Manage Grafana User
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible community.grafana.grafana_dashboard – list or search grafana dashboards community.grafana.grafana\_dashboard – list or search grafana dashboards
========================================================================
Note
This plugin is part of the [community.grafana collection](https://galaxy.ansible.com/community/grafana) (version 1.2.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install community.grafana`.
To use it in a playbook, specify: `community.grafana.grafana_dashboard`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* This lookup returns a list of grafana dashboards with possibility to filter them by query.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **grafana\_api\_key** string | | env:GRAFANA\_API\_KEY | Grafana API key. When `grafana_api_key` is set, the options `grafana_user`, `grafana_password` and `grafana_org_id` are ignored. |
| **grafana\_org\_id** string | **Default:**1 | env:GRAFANA\_ORG\_ID | grafana organisation id. |
| **grafana\_password** string | **Default:**"admin" | env:GRAFANA\_PASSWORD | grafana authentication password. |
| **grafana\_url** string | **Default:**"http://127.0.0.1:3000" | env:GRAFANA\_URL | url of grafana. |
| **grafana\_user** string | **Default:**"admin" | env:GRAFANA\_USER | grafana authentication user. |
| **search** string | | env:GRAFANA\_DASHBOARD\_SEARCH | optional filter for dashboard search. |
Examples
--------
```
- name: get project foo grafana dashboards
set_fact:
grafana_dashboards: "{{ lookup('grafana_dashboard', 'grafana_url=http://grafana.company.com grafana_user=admin grafana_password=admin search=foo') }}"
- name: get all grafana dashboards
set_fact:
grafana_dashboards: "{{ lookup('grafana_dashboard', 'grafana_url=http://grafana.company.com grafana_api_key=' ~ grafana_api_key) }}"
```
### Authors
* Thierry Salle (@seuf)
| programming_docs |
ansible community.grafana.grafana_dashboard – Manage Grafana dashboards community.grafana.grafana\_dashboard – Manage Grafana dashboards
================================================================
Note
This plugin is part of the [community.grafana collection](https://galaxy.ansible.com/community/grafana) (version 1.2.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install community.grafana`.
To use it in a playbook, specify: `community.grafana.grafana_dashboard`.
New in version 1.0.0: of community.grafana
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update, delete, export Grafana dashboards via API.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **client\_cert** path | | PEM formatted certificate chain file to be used for SSL client authentication. This file can also include the key as well, and if the key is included, *client\_key* is not required |
| **client\_key** path | | PEM formatted file that contains your private key to be used for SSL client authentication. If *client\_cert* contains both the certificate and key, this option is not required. |
| **commit\_message** string | | Set a commit message for the version history. Only used when `state` is `present`.
`message` alias is deprecated in Ansible 2.10, since it is used internally by Ansible Core Engine.
aliases: message |
| **dashboard\_id** string added in 1.0.0 of community.grafana | | Public Grafana.com dashboard id to import |
| **dashboard\_revision** string added in 1.0.0 of community.grafana | **Default:**1 | Revision of the public grafana dashboard to import |
| **folder** string added in 1.0.0 of community.grafana | **Default:**"General" | The Grafana folder where this dashboard will be imported to. |
| **grafana\_api\_key** string | | The Grafana API key. If set, `url_username` and `url_password` will be ignored. |
| **org\_id** integer | **Default:**1 | The Grafana Organisation ID where the dashboard will be imported / exported. Not used when *grafana\_api\_key* is set, because the grafana\_api\_key only belongs to one organisation.. |
| **overwrite** boolean | **Choices:*** **no** ←
* yes
| Override existing dashboard when state is present. |
| **path** string | | The path to the json file containing the Grafana dashboard to import or export. A http URL is also accepted (since 2.10). Required if `state` is `export` or `present`.
aliases: dashboard\_url |
| **slug** string | | Deprecated since Grafana 5. Use grafana dashboard uid instead. slug of the dashboard. It's the friendly url name of the dashboard. When `state` is `present`, this parameter can override the slug in the meta section of the json file. If you want to import a json dashboard exported directly from the interface (not from the api), you have to specify the slug parameter because there is no meta section in the exported json. |
| **state** string | **Choices:*** absent
* export
* **present** ←
| State of the dashboard. |
| **uid** string added in 1.0.0 of community.grafana | | uid of the dashboard to export when `state` is `export` or `absent`. |
| **url** string / required | | The Grafana URL.
aliases: grafana\_url |
| **url\_password** string | **Default:**"admin" | The Grafana password for API authentication.
aliases: grafana\_password |
| **url\_username** string | **Default:**"admin" | The Grafana user for API authentication.
aliases: grafana\_user |
| **use\_proxy** boolean | **Choices:*** no
* **yes** ←
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `no`, SSL certificates will not be validated. This should only set to `no` used on personally controlled sites using self-signed certificates. |
Examples
--------
```
- hosts: localhost
connection: local
tasks:
- name: Import Grafana dashboard foo
community.grafana.grafana_dashboard:
grafana_url: http://grafana.company.com
grafana_api_key: "{{ grafana_api_key }}"
state: present
commit_message: Updated by ansible
overwrite: yes
path: /path/to/dashboards/foo.json
- name: Import Grafana dashboard Zabbix
community.grafana.grafana_dashboard:
grafana_url: http://grafana.company.com
grafana_api_key: "{{ grafana_api_key }}"
folder: zabbix
dashboard_id: 6098
dashbord_revision: 1
- name: Import Grafana dashboard zabbix
community.grafana.grafana_dashboard:
grafana_url: http://grafana.company.com
grafana_api_key: "{{ grafana_api_key }}"
folder: public
dashboard_url: https://grafana.com/api/dashboards/6098/revisions/1/download
- name: Export dashboard
community.grafana.grafana_dashboard:
grafana_url: http://grafana.company.com
grafana_user: "admin"
grafana_password: "{{ grafana_password }}"
org_id: 1
state: export
uid: "000000653"
path: "/path/to/dashboards/000000653.json"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **uid** string | success | uid or slug of the created / deleted / exported dashboard. **Sample:** 51 |
### Authors
* Thierry Sallé (@seuf)
ansible community.grafana.grafana_folder – Manage Grafana Folders community.grafana.grafana\_folder – Manage Grafana Folders
==========================================================
Note
This plugin is part of the [community.grafana collection](https://galaxy.ansible.com/community/grafana) (version 1.2.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install community.grafana`.
To use it in a playbook, specify: `community.grafana.grafana_folder`.
New in version 1.0.0: of community.grafana
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create/update/delete Grafana Folders through the Folders API.
Requirements
------------
The below requirements are needed on the host that executes this module.
* The Folders API is only available starting Grafana 5 and the module will fail if the server version is lower than version 5.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **client\_cert** path | | PEM formatted certificate chain file to be used for SSL client authentication. This file can also include the key as well, and if the key is included, *client\_key* is not required |
| **client\_key** path | | PEM formatted file that contains your private key to be used for SSL client authentication. If *client\_cert* contains both the certificate and key, this option is not required. |
| **grafana\_api\_key** string | | The Grafana API key. If set, `url_username` and `url_password` will be ignored. |
| **name** string / required | | The title of the Grafana Folder.
aliases: title |
| **skip\_version\_check** boolean added in 1.2.0 of community.grafana | **Choices:*** **no** ←
* yes
| Skip Grafana version check and try to reach api endpoint anyway. This parameter can be useful if you enabled `hide\_version` in grafana.ini |
| **state** string | **Choices:*** **present** ←
* absent
| Delete the members not found in the `members` parameters from the list of members found on the Folder. |
| **url** string / required | | The Grafana URL.
aliases: grafana\_url |
| **url\_password** string | **Default:**"admin" | The Grafana password for API authentication.
aliases: grafana\_password |
| **url\_username** string | **Default:**"admin" | The Grafana user for API authentication.
aliases: grafana\_user |
| **use\_proxy** boolean | **Choices:*** no
* **yes** ←
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `no`, SSL certificates will not be validated. This should only set to `no` used on personally controlled sites using self-signed certificates. |
Examples
--------
```
---
- name: Create a folder
community.grafana.grafana_folder:
url: "https://grafana.example.com"
grafana_api_key: "{{ some_api_token_value }}"
title: "grafana_working_group"
state: present
- name: Delete a folder
community.grafana.grafana_folder:
url: "https://grafana.example.com"
grafana_api_key: "{{ some_api_token_value }}"
title: "grafana_working_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 |
| --- | --- | --- |
| **folder** complex | On success | Information about the Folder |
| | **canAdmin** boolean | always | Boolean specifying if current user can admin in folder **Sample:** [False] |
| | **canEdit** boolean | always | Boolean specifying if current user can edit in folder **Sample:** [False] |
| | **canSave** boolean | always | Boolean specifying if current user can save in folder **Sample:** [False] |
| | **created** string | always | The folder creation date **Sample:** ['2018-01-31T17:43:12+01:00'] |
| | **createdBy** string | always | The name of the user who created the folder **Sample:** ['admin'] |
| | **hasAcl** boolean | always | Boolean specifying if folder has acl **Sample:** [False] |
| | **id** integer | always | The Folder identifier **Sample:** [42] |
| | **title** string | always | The Folder title **Sample:** ['Department ABC'] |
| | **uid** string | always | The Folder uid **Sample:** ['nErXDvCkzz'] |
| | **updated** string | always | The date the folder was last updated **Sample:** ['2018-01-31T17:43:12+01:00'] |
| | **updatedBy** string | always | The name of the user who last updated the folder **Sample:** ['admin'] |
| | **url** string | always | The Folder url **Sample:** ['/dashboards/f/nErXDvCkzz/department-abc'] |
| | **version** integer | always | The folder version **Sample:** [1] |
### Authors
* Rémi REY (@rrey)
ansible community.grafana.grafana_annotations – send ansible events as annotations on charts to grafana over http api. community.grafana.grafana\_annotations – send ansible events as annotations on charts to grafana over http api.
===============================================================================================================
Note
This plugin is part of the [community.grafana collection](https://galaxy.ansible.com/community/grafana) (version 1.2.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install community.grafana`.
To use it in a playbook, specify: `community.grafana.grafana_annotations`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
Synopsis
--------
* This callback will report start, failed and stats events to Grafana as annotations (<https://grafana.com>)
Requirements
------------
The below requirements are needed on the local controller node that executes this callback.
* whitelisting in configuration
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **grafana\_api\_key** string | | ini entries: [callback\_grafana\_annotations]grafana\_api\_key = None env:GRAFANA\_API\_KEY | Grafana API key, allowing to authenticate when posting on the HTTP API. If not provided, grafana\_login and grafana\_password will be required. |
| **grafana\_dashboard\_id** integer | | ini entries: [callback\_grafana\_annotations]grafana\_dashboard\_id = None env:GRAFANA\_DASHBOARD\_ID | The grafana dashboard id where the annotation shall be created. |
| **grafana\_panel\_ids** list / elements=string | **Default:**[] | ini entries: [callback\_grafana\_annotations]grafana\_panel\_ids = [] env:GRAFANA\_PANEL\_IDS | The grafana panel ids where the annotation shall be created. Give a single integer or a comma-separated list of integers. |
| **grafana\_password** string | **Default:**"ansible" | ini entries: [callback\_grafana\_annotations]grafana\_password = ansible env:GRAFANA\_PASSWORD | Grafana password used for authentication. Ignored if grafana\_api\_key is provided. |
| **grafana\_url** string / required | | ini entries: [callback\_grafana\_annotations]grafana\_url = None env:GRAFANA\_URL | Grafana annotations api URL |
| **grafana\_user** string | **Default:**"ansible" | ini entries: [callback\_grafana\_annotations]grafana\_user = ansible env:GRAFANA\_USER | Grafana user used for authentication. Ignored if grafana\_api\_key is provided. |
| **http\_agent** string | **Default:**"Ansible (grafana\_annotations callback)" | ini entries: [callback\_grafana\_annotations]http\_agent = Ansible (grafana\_annotations callback) env:HTTP\_AGENT | The HTTP 'User-agent' value to set in HTTP requets. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| ini entries: [callback\_grafana\_annotations]validate\_grafana\_certs = yes [callback\_grafana\_annotations]validate\_certs = yes env:GRAFANA\_VALIDATE\_CERT | validate the SSL certificate of the Grafana server. (For HTTPS url)
aliases: validate\_grafana\_certs |
### Authors
* Rémi REY (@rrey)
ansible community.grafana.grafana_plugin – Manage Grafana plugins via grafana-cli community.grafana.grafana\_plugin – Manage Grafana plugins via grafana-cli
==========================================================================
Note
This plugin is part of the [community.grafana collection](https://galaxy.ansible.com/community/grafana) (version 1.2.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install community.grafana`.
To use it in a playbook, specify: `community.grafana.grafana_plugin`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Install and remove Grafana plugins.
* See <https://grafana.com/docs/plugins/installation/> for upstream documentation.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **grafana\_plugin\_url** string | | Full URL to the plugin zip file instead of downloading the file from <https://grafana.com/api/plugins>. Requires grafana 4.6.x or later. |
| **grafana\_plugins\_dir** string | | Directory where the Grafana plugin will be installed. If omitted, defaults to `/var/lib/grafana/plugins`. |
| **grafana\_repo** string | | URL to the Grafana plugin repository. If omitted, grafana-cli will use the default value: <https://grafana.com/api/plugins>. |
| **name** string / required | | Name of the plugin. |
| **state** string | **Choices:*** **present** ←
* absent
| Whether the plugin should be installed. |
| **version** string | | Version of the plugin to install. Defaults to `latest`. |
Examples
--------
```
---
- name: Install/update Grafana piechart panel plugin
community.grafana.grafana_plugin:
name: grafana-piechart-panel
version: latest
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 |
| --- | --- | --- |
| **version** string | always | version of the installed/removed/updated plugin. |
### Authors
* Thierry Sallé (@seuf)
ansible community.grafana.grafana_team – Manage Grafana Teams community.grafana.grafana\_team – Manage Grafana Teams
======================================================
Note
This plugin is part of the [community.grafana collection](https://galaxy.ansible.com/community/grafana) (version 1.2.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install community.grafana`.
To use it in a playbook, specify: `community.grafana.grafana_team`.
New in version 1.0.0: of community.grafana
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create/update/delete Grafana Teams through the Teams API.
* Also allows to add members in the team (if members exists).
Requirements
------------
The below requirements are needed on the host that executes this module.
* The Teams API is only available starting Grafana 5 and the module will fail if the server version is lower than version 5.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **client\_cert** path | | PEM formatted certificate chain file to be used for SSL client authentication. This file can also include the key as well, and if the key is included, *client\_key* is not required |
| **client\_key** path | | PEM formatted file that contains your private key to be used for SSL client authentication. If *client\_cert* contains both the certificate and key, this option is not required. |
| **email** string / required | | The mail address associated with the Team. |
| **enforce\_members** boolean | **Choices:*** **no** ←
* yes
| Delete the members not found in the `members` parameters from the list of members found on the Team. |
| **grafana\_api\_key** string | | The Grafana API key. If set, `url_username` and `url_password` will be ignored. |
| **members** list / elements=string | | List of team members (emails). The list can be enforced with `enforce_members` parameter. |
| **name** string / required | | The name of the Grafana Team. |
| **skip\_version\_check** boolean added in 1.2.0 of community.grafana | **Choices:*** **no** ←
* yes
| Skip Grafana version check and try to reach api endpoint anyway. This parameter can be useful if you enabled `hide\_version` in grafana.ini |
| **state** string | **Choices:*** **present** ←
* absent
| Delete the members not found in the `members` parameters from the list of members found on the Team. |
| **url** string / required | | The Grafana URL.
aliases: grafana\_url |
| **url\_password** string | **Default:**"admin" | The Grafana password for API authentication.
aliases: grafana\_password |
| **url\_username** string | **Default:**"admin" | The Grafana user for API authentication.
aliases: grafana\_user |
| **use\_proxy** boolean | **Choices:*** no
* **yes** ←
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `no`, SSL certificates will not be validated. This should only set to `no` used on personally controlled sites using self-signed certificates. |
Examples
--------
```
---
- name: Create a team
community.grafana.grafana_team:
url: "https://grafana.example.com"
grafana_api_key: "{{ some_api_token_value }}"
name: "grafana_working_group"
email: "[email protected]"
state: present
- name: Create a team with members
community.grafana.grafana_team:
url: "https://grafana.example.com"
grafana_api_key: "{{ some_api_token_value }}"
name: "grafana_working_group"
email: "[email protected]"
members:
- [email protected]
- [email protected]
state: present
- name: Create a team with members and enforce the list of members
community.grafana.grafana_team:
url: "https://grafana.example.com"
grafana_api_key: "{{ some_api_token_value }}"
name: "grafana_working_group"
email: "[email protected]"
members:
- [email protected]
- [email protected]
enforce_members: yes
state: present
- name: Delete a team
community.grafana.grafana_team:
url: "https://grafana.example.com"
grafana_api_key: "{{ some_api_token_value }}"
name: "grafana_working_group"
email: "[email protected]"
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 |
| --- | --- | --- |
| **team** complex | On success | Information about the Team |
| | **avatarUrl** string | always | The url of the Team avatar on Grafana server **Sample:** ['/avatar/a7440323a684ea47406313a33156e5e9'] |
| | **email** string | always | The Team email address **Sample:** ['[email protected]'] |
| | **id** integer | always | The Team email address **Sample:** [42] |
| | **memberCount** integer | always | The number of Team members **Sample:** [42] |
| | **members** list / elements=string | always | The list of Team members **Sample:** [['[email protected]']] |
| | **name** string | always | The name of the team. **Sample:** ['grafana\_working\_group'] |
| | **orgId** integer | always | The organization id that the team is part of. **Sample:** [1] |
### Authors
* Rémi REY (@rrey)
| programming_docs |
ansible community.grafana.grafana_notification_channel – Manage Grafana Notification Channels community.grafana.grafana\_notification\_channel – Manage Grafana Notification Channels
=======================================================================================
Note
This plugin is part of the [community.grafana collection](https://galaxy.ansible.com/community/grafana) (version 1.2.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install community.grafana`.
To use it in a playbook, specify: `community.grafana.grafana_notification_channel`.
New in version 1.1.0: of community.grafana
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create/Update/Delete Grafana Notification Channels via API.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **client\_cert** path | | PEM formatted certificate chain file to be used for SSL client authentication. This file can also include the key as well, and if the key is included, *client\_key* is not required |
| **client\_key** path | | PEM formatted file that contains your private key to be used for SSL client authentication. If *client\_cert* contains both the certificate and key, this option is not required. |
| **dingding\_message\_type** list / elements=string | **Choices:*** link
* action\_card
| DingDing message type. |
| **dingding\_url** string | | DingDing webhook URL. |
| **disable\_resolve\_message** boolean | **Choices:*** **no** ←
* yes
| Disable the resolve message. |
| **discord\_message\_content** string | | Overrides message content. |
| **discord\_url** string | | Discord webhook URL. |
| **email\_addresses** list / elements=string | | List of recipients. |
| **email\_single** boolean | **Choices:*** no
* yes
| Send single email to all recipients. |
| **googlechat\_url** string | | Google Hangouts webhook URL. |
| **grafana\_api\_key** string | | The Grafana API key. If set, `url_username` and `url_password` will be ignored. |
| **hipchat\_api\_key** string | | HipChat API key. |
| **hipchat\_room\_id** string | | HipChat room ID. |
| **hipchat\_url** string | | HipChat webhook URL. |
| **include\_image** boolean | **Choices:*** **no** ←
* yes
| Capture a visualization image and attach it to notifications. |
| **is\_default** boolean | **Choices:*** **no** ←
* yes
| Use this channel for all alerts. |
| **kafka\_topic** string | | Kafka topic name. |
| **kafka\_url** string | | Kafka REST proxy URL. |
| **line\_token** string | | LINE token. |
| **name** string | | The name of the notification channel. Required when *state* is `present`. |
| **opsgenie\_api\_key** string | | OpsGenie API key. |
| **opsgenie\_auto\_close** boolean | **Choices:*** no
* yes
| Automatically close alerts in OpsGenie once the alert goes back to ok. |
| **opsgenie\_override\_priority** boolean | **Choices:*** no
* yes
| Allow the alert priority to be set using the og\_priority tag. |
| **opsgenie\_url** string | | OpsGenie webhook URL. |
| **org\_id** integer | **Default:**1 | The Grafana Organisation ID where the dashboard will be imported / exported. Not used when *grafana\_api\_key* is set, because the grafana\_api\_key only belongs to one organisation.. |
| **pagerduty\_auto\_resolve** boolean | **Choices:*** no
* yes
| Resolve incidents in PagerDuty once the alert goes back to ok. |
| **pagerduty\_integration\_key** string | | PagerDuty integration key. |
| **pagerduty\_message\_in\_details** boolean | **Choices:*** no
* yes
| Move the alert message from the PD summary into the custom details. This changes the custom details object and may break event rules you have configured. |
| **pagerduty\_severity** list / elements=string | **Choices:*** critical
* error
* warning
* info
| Alert severity in PagerDuty. |
| **prometheus\_password** string | | Prometheus password. |
| **prometheus\_url** string | | Prometheus API URL. |
| **prometheus\_username** string | | Prometheus username. |
| **pushover\_alert\_sound** string | | Alert sound in Pushover. L(https://pushover.net/api#sounds) |
| **pushover\_api\_token** string | | Pushover API token. |
| **pushover\_devices** list / elements=string | | Devices list in Pushover. |
| **pushover\_expire** integer | | Expire alert in `n` minutes. Only when priority is `emergency`. |
| **pushover\_ok\_sound** string | | OK sound in Pushover. L(https://pushover.net/api#sounds) |
| **pushover\_priority** list / elements=string | **Choices:*** emergency
* high
* normal
* low
* lowest
| Alert priority in Pushover. |
| **pushover\_retry** integer | | Retry in `n` minutes. Only when priority is `emergency`. |
| **pushover\_user\_key** string | | Pushover user key. |
| **reminder\_frequency** string | | Additional notifications interval for triggered alerts. For example `15m`. |
| **sensu\_handler** string | | Sensu handler name. |
| **sensu\_password** string | | Sensu password. |
| **sensu\_source** string | | Source in Sensu. |
| **sensu\_url** string | | Sensu webhook URL. |
| **sensu\_username** string | | Sensu user. |
| **slack\_icon\_emoji** string | | An emoji to use for the bot's message. |
| **slack\_icon\_url** string | | URL to an image to use as the icon for the bot's message |
| **slack\_mention\_channel** list / elements=string | **Choices:*** here
* channel
| Mention whole channel or just active members. |
| **slack\_mention\_groups** list / elements=string | | Mention groups list. |
| **slack\_mention\_users** list / elements=string | | Mention users list. |
| **slack\_recipient** string | | Override default Slack channel or user. |
| **slack\_token** string | | Slack token. |
| **slack\_url** string | | Slack webhook URL. |
| **slack\_username** string | | Set the username for the bot's message. |
| **state** string | **Choices:*** **present** ←
* absent
| Status of the notification channel. |
| **teams\_url** string | | Microsoft Teams webhook URL. |
| **telegram\_bot\_token** string | | Telegram bot token; |
| **telegram\_chat\_id** string | | Telegram chat id. |
| **threema\_api\_secret** string | | Threema Gateway API secret. |
| **threema\_gateway\_id** string | | 8 character Threema Gateway ID (starting with a \*). |
| **threema\_recepient\_id** string | | 8 character Threema ID that should receive the alerts. |
| **type** string | **Choices:*** dingding
* discord
* email
* googlechat
* hipchat
* kafka
* line
* teams
* opsgenie
* pagerduty
* prometheus
* pushover
* sensu
* slack
* telegram
* threema
* victorops
* webhook
| The channel notification type. Required when *state* is `present`. |
| **uid** string | | The channel unique identifier. |
| **url** string / required | | The Grafana URL.
aliases: grafana\_url |
| **url\_password** string | **Default:**"admin" | The Grafana password for API authentication.
aliases: grafana\_password |
| **url\_username** string | **Default:**"admin" | The Grafana user for API authentication.
aliases: grafana\_user |
| **use\_proxy** boolean | **Choices:*** no
* **yes** ←
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| If `no`, SSL certificates will not be validated. This should only set to `no` used on personally controlled sites using self-signed certificates. |
| **victorops\_auto\_resolve** boolean | **Choices:*** no
* yes
| Resolve incidents in VictorOps once the alert goes back to ok. |
| **victorops\_url** string | | VictorOps webhook URL. |
| **webhook\_http\_method** list / elements=string | **Choices:*** POST
* PUT
| Webhook HTTP verb to use. |
| **webhook\_password** string | | Webhook password. |
| **webhook\_url** string | | Webhook URL |
| **webhook\_username** string | | Webhook username. |
Examples
--------
```
- name: Create slack notification channel
register: result
grafana_notification_channel:
uid: slack
name: slack
type: slack
slack_url: https://hooks.slack.com/services/xxx/yyy/zzz
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password}}"
- name: Delete slack notification channel
register: result
grafana_notification_channel:
state: absent
uid: slack
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_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 |
| --- | --- | --- |
| **notification\_channel** dictionary | changed | Notification channel created or updated by the module. **Sample:** { "created": "2020-11-10T21:10:19.675308051+03:00", "disableResolveMessage": false, "frequency": "", "id": 37, "isDefault": false, "name": "Oops", "secureFields": {}, "sendReminder": false, "settings": { "uploadImage": false, "url": "VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER" }, "type": "slack", "uid": "slack-oops", "updated": "2020-11-10T21:10:19.675308112+03:00" } |
### Authors
* Aliaksandr Mianzhynski (@amenzhinsky)
ansible community.rabbitmq.rabbitmq_user_limits – Manage RabbitMQ user limits community.rabbitmq.rabbitmq\_user\_limits – Manage RabbitMQ user limits
=======================================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq_user_limits`.
New in version 1.1.0: of community.rabbitmq
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Manage the state of user limits in RabbitMQ. Supported since RabbitMQ version 3.8.10.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **max\_channels** integer | **Default:**-1 | Max number of channels. Negative value means "no limit". Ignored when the *state* is `absent`. |
| **max\_connections** integer | **Default:**-1 | Max number of concurrent client connections. Negative value means "no limit". Ignored when the *state* is `absent`. |
| **node** string | | Name of the RabbitMQ Erlang node to manage. |
| **state** string | **Choices:*** **present** ←
* absent
| Specify whether the limits are to be set or cleared. If set to `absent`, the limits of both *max\_connections* and *max\_channels* will be cleared. |
| **user** string / required | | Name of user to manage limits for.
aliases: username, name |
Notes
-----
Note
* Supports `check_mode`.
Examples
--------
```
- name: Limit both of the max number of connections and channels on the user 'guest'.
community.rabbitmq.rabbitmq_user_limits:
user: guest
max_connections: 64
max_channels: 256
state: present
# This task implicitly clears the max number of channels limit using default value: -1.
- name: Limit the max number of connections on the user 'guest'.
community.rabbitmq.rabbitmq_user_limits:
user: guest
max_connections: 64
state: present
- name: Clear the limits on the user 'guest'.
community.rabbitmq.rabbitmq_user_limits:
user: guest
state: absent
```
### Authors
* Aitor Pazos (@aitorpazos)
ansible Community.Rabbitmq Community.Rabbitmq
==================
Collection version 1.1.0
Plugin Index
------------
These are the plugins in the community.rabbitmq collection
### Lookup Plugins
* [rabbitmq](rabbitmq_lookup#ansible-collections-community-rabbitmq-rabbitmq-lookup) – Retrieve messages from an AMQP/AMQPS RabbitMQ queue.
### Modules
* [rabbitmq\_binding](rabbitmq_binding_module#ansible-collections-community-rabbitmq-rabbitmq-binding-module) – Manage rabbitMQ bindings
* [rabbitmq\_exchange](rabbitmq_exchange_module#ansible-collections-community-rabbitmq-rabbitmq-exchange-module) – Manage rabbitMQ exchanges
* [rabbitmq\_feature\_flag](rabbitmq_feature_flag_module#ansible-collections-community-rabbitmq-rabbitmq-feature-flag-module) – Enables feature flag
* [rabbitmq\_global\_parameter](rabbitmq_global_parameter_module#ansible-collections-community-rabbitmq-rabbitmq-global-parameter-module) – Manage RabbitMQ global parameters
* [rabbitmq\_parameter](rabbitmq_parameter_module#ansible-collections-community-rabbitmq-rabbitmq-parameter-module) – Manage RabbitMQ parameters
* [rabbitmq\_plugin](rabbitmq_plugin_module#ansible-collections-community-rabbitmq-rabbitmq-plugin-module) – Manage RabbitMQ plugins
* [rabbitmq\_policy](rabbitmq_policy_module#ansible-collections-community-rabbitmq-rabbitmq-policy-module) – Manage the state of policies in RabbitMQ
* [rabbitmq\_publish](rabbitmq_publish_module#ansible-collections-community-rabbitmq-rabbitmq-publish-module) – Publish a message to a RabbitMQ queue.
* [rabbitmq\_queue](rabbitmq_queue_module#ansible-collections-community-rabbitmq-rabbitmq-queue-module) – Manage rabbitMQ queues
* [rabbitmq\_upgrade](rabbitmq_upgrade_module#ansible-collections-community-rabbitmq-rabbitmq-upgrade-module) – Execute rabbitmq-upgrade commands
* [rabbitmq\_user](rabbitmq_user_module#ansible-collections-community-rabbitmq-rabbitmq-user-module) – Manage RabbitMQ users
* [rabbitmq\_user\_limits](rabbitmq_user_limits_module#ansible-collections-community-rabbitmq-rabbitmq-user-limits-module) – Manage RabbitMQ user limits
* [rabbitmq\_vhost](rabbitmq_vhost_module#ansible-collections-community-rabbitmq-rabbitmq-vhost-module) – Manage the state of a virtual host in RabbitMQ
* [rabbitmq\_vhost\_limits](rabbitmq_vhost_limits_module#ansible-collections-community-rabbitmq-rabbitmq-vhost-limits-module) – Manage the state of virtual host limits in RabbitMQ
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible community.rabbitmq.rabbitmq_vhost – Manage the state of a virtual host in RabbitMQ community.rabbitmq.rabbitmq\_vhost – Manage the state of a virtual host in RabbitMQ
===================================================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq_vhost`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Manage the state of a virtual host in RabbitMQ
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **name** string / required | | The name of the vhost to manage
aliases: vhost |
| **node** string | **Default:**"rabbit" | erlang node name of the rabbit we wish to configure |
| **state** string | **Choices:*** **present** ←
* absent
| The state of vhost |
| **tracing** boolean | **Choices:*** **no** ←
* yes
| Enable/disable tracing for a vhost
aliases: trace |
Examples
--------
```
# Ensure that the vhost /test exists.
- community.rabbitmq.rabbitmq_vhost:
name: /test
state: present
```
### Authors
* Chris Hoffman (@chrishoffman)
ansible community.rabbitmq.rabbitmq_policy – Manage the state of policies in RabbitMQ community.rabbitmq.rabbitmq\_policy – Manage the state of policies in RabbitMQ
==============================================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq_policy`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Manage the state of a policy in RabbitMQ.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **apply\_to** string | **Choices:*** **all** ←
* exchanges
* queues
| What the policy applies to. Requires RabbitMQ 3.2.0 or later. |
| **name** string / required | | The name of the policy to manage. |
| **node** string | **Default:**"rabbit" | Erlang node name of the rabbit we wish to configure. |
| **pattern** string | | A regex of queues to apply the policy to. Required when `state=present`. This option is no longer required as of Ansible 2.9. |
| **priority** string | **Default:**"0" | The priority of the policy. |
| **state** string | **Choices:*** **present** ←
* absent
| The state of the policy. |
| **tags** dictionary | | A dict or string describing the policy. Required when `state=present`. This option is no longer required as of Ansible 2.9. |
| **vhost** string | **Default:**"/" | The name of the vhost to apply to. |
Examples
--------
```
- name: ensure the default vhost contains the HA policy via a dict
community.rabbitmq.rabbitmq_policy:
name: HA
pattern: .*
args:
tags:
ha-mode: all
- name: ensure the default vhost contains the HA policy
community.rabbitmq.rabbitmq_policy:
name: HA
pattern: .*
tags:
ha-mode: all
```
### Authors
* John Dewey (@retr0h)
ansible community.rabbitmq.rabbitmq – Retrieve messages from an AMQP/AMQPS RabbitMQ queue. community.rabbitmq.rabbitmq – Retrieve messages from an AMQP/AMQPS RabbitMQ queue.
==================================================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This lookup uses a basic get to retrieve all, or a limited number `count`, messages from a RabbitMQ queue.
Requirements
------------
The below requirements are needed on the local controller node that executes this lookup.
* The python pika package <https://pypi.org/project/pika/>.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **count** string | | | How many messages to collect from the queue. If not set, defaults to retrieving all the messages from the queue. |
| **queue** string / required | | | The queue to get messages from. |
| **url** string / required | | | An URI connection string to connect to the AMQP/AMQPS RabbitMQ server. For more information refer to the URI spec <https://www.rabbitmq.com/uri-spec.html>. |
Notes
-----
Note
* This lookup implements BlockingChannel.basic\_get to get messages from a RabbitMQ server.
* After retrieving a message from the server, receipt of the message is acknowledged and the message on the server is deleted.
* Pika is a pure-Python implementation of the AMQP 0-9-1 protocol that tries to stay fairly independent of the underlying network support library.
* More information about pika can be found at <https://pika.readthedocs.io/en/stable/>.
* This plugin is tested against RabbitMQ. Other AMQP 0.9.1 protocol based servers may work but not tested/guaranteed.
* Assigning the return messages to a variable under `vars` may result in unexpected results as the lookup is evaluated every time the variable is referenced.
* Currently this plugin only handles text based messages from a queue. Unexpected results may occur when retrieving binary data.
Examples
--------
```
- name: Get all messages off a queue
debug:
msg: "{{ lookup('community.rabbitmq.rabbitmq', url='amqp://guest:[email protected]:5672/%2F', queue='hello') }}"
# If you are intending on using the returned messages as a variable in more than
# one task (eg. debug, template), it is recommended to set_fact.
- name: Get 2 messages off a queue and set a fact for re-use
set_fact:
messages: "{{ lookup('community.rabbitmq.rabbiotmq', url='amqp://guest:[email protected]:5672/%2F', queue='hello', count=2) }}"
- name: Dump out contents of the messages
debug:
var: messages
```
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 |
| --- | --- | --- |
| **\_list** list / elements=string | success | A list of dictionaries with keys and value from the queue. |
| | **content\_type** string | success | The content\_type on the message in the queue. |
| | **delivery\_mode** string | success | The delivery\_mode on the message in the queue. |
| | **delivery\_tag** string | success | The delivery\_tag on the message in the queue. |
| | **exchange** string | success | The exchange the message came from. |
| | **headers** dictionary | success | The headers for the message returned from the queue. |
| | **json** dictionary | success | If application/json is specified in content\_type, json will be loaded into variables. |
| | **message\_count** string | success | The message\_count for the message on the queue. |
| | **msg** string | success | The content of the message. |
| | **redelivered** boolean | success | The redelivered flag. True if the message has been delivered before. |
| | **routing\_key** string | success | The routing\_key on the message in the queue. |
### Authors
* John Imison <@Im0>
| programming_docs |
ansible community.rabbitmq.rabbitmq_publish – Publish a message to a RabbitMQ queue. community.rabbitmq.rabbitmq\_publish – Publish a message to a RabbitMQ queue.
=============================================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq_publish`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Publish a message on a RabbitMQ queue using a blocking connection.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pika
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auto\_delete** boolean | **Choices:*** **no** ←
* yes
| Set the queue to auto delete. |
| **body** string | | The body of the message. A `body` cannot be provided if a `src` is specified. |
| **cafile** string | | CA file used during connection to the RabbitMQ server over SSL. If this option is specified, also *certfile* and *keyfile* must be specified. |
| **certfile** string | | Client certificate to establish SSL connection. If this option is specified, also *cafile* and *keyfile* must be specified. |
| **content\_type** string | **Default:**"text/plain" | The content type of the body. |
| **durable** boolean | **Choices:*** **no** ←
* yes
| Set the queue to be durable. |
| **exchange** string | | The exchange to publish a message to. |
| **exclusive** boolean | **Choices:*** **no** ←
* yes
| Set the queue to be exclusive. |
| **headers** dictionary | **Default:**{} | A dictionary of headers to post with the message. |
| **host** string | | The RabbitMQ server hostname or IP. |
| **keyfile** string | | Client key to establish SSL connection. If this option is specified, also *cafile* and *certfile* must be specified. |
| **password** string | | The RabbitMQ password. |
| **port** integer | | The RabbitMQ server port. |
| **proto** string | **Choices:*** amqps
* amqp
| The protocol to use. |
| **queue** string | | The queue to publish a message to. If no queue is specified, RabbitMQ will return a random queue name. |
| **routing\_key** string | | The routing key. |
| **src** path | | A file to upload to the queue. Automatic mime type detection is attempted if content\_type is not defined (left as default). A `src` cannot be provided if a `body` is specified. The filename is added to the headers of the posted message to RabbitMQ. Key being the `filename`, value is the filename.
aliases: file |
| **url** string | | An URL connection string to connect to the RabbitMQ server.
*url* and *host*/*port*/*user*/*pass*/*vhost* are mutually exclusive, use either or but not both. |
| **username** string | | The RabbitMQ username. |
| **vhost** string | | The virtual host to target. If default vhost is required, use `'%2F'`. |
Notes
-----
Note
* This module requires the pika python library <https://pika.readthedocs.io/>.
* Pika is a pure-Python implementation of the AMQP 0-9-1 protocol that tries to stay fairly independent of the underlying network support library.
* This module is tested against RabbitMQ. Other AMQP 0.9.1 protocol based servers may work but not tested/guaranteed.
* The certificate authentication was tested with certificates created via <https://www.rabbitmq.com/ssl.html#automated-certificate-generation> and RabbitMQ configuration variables `ssl_options.verify = verify_peer` & `ssl_options.fail_if_no_peer_cert = true`.
Examples
--------
```
- name: Publish a message to a queue with headers
community.rabbitmq.rabbitmq_publish:
url: "amqp://guest:[email protected]:5672/%2F"
queue: 'test'
body: "Hello world from ansible module rabbitmq_publish"
content_type: "text/plain"
headers:
myHeader: myHeaderValue
- name: Publish a file to a queue
community.rabbitmq.rabbitmq_publish:
url: "amqp://guest:[email protected]:5672/%2F"
queue: 'images'
file: 'path/to/logo.gif'
- name: RabbitMQ auto generated queue
community.rabbitmq.rabbitmq_publish:
url: "amqp://guest:[email protected]:5672/%2F"
body: "Hello world random queue from ansible module rabbitmq_publish"
content_type: "text/plain"
- name: Publish with certs
community.rabbitmq.rabbitmq_publish:
url: "amqps://guest:[email protected]:5671/%2F"
body: "Hello test queue from ansible module rabbitmq_publish via SSL certs"
queue: 'test'
content_type: "text/plain"
cafile: 'ca_certificate.pem'
certfile: 'client_certificate.pem'
keyfile: 'client_key.pem'
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **result** dictionary | success | Contains the status *msg*, content type *content\_type* and the queue name *queue*. **Sample:** 'result': { 'content\_type': 'text/plain', 'msg': 'Successfully published to queue test', 'queue': 'test' } |
### Authors
* John Imison (@Im0)
ansible community.rabbitmq.rabbitmq_vhost_limits – Manage the state of virtual host limits in RabbitMQ community.rabbitmq.rabbitmq\_vhost\_limits – Manage the state of virtual host limits in RabbitMQ
================================================================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq_vhost_limits`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* This module sets/clears certain limits on a virtual host.
* The configurable limits are *max\_connections* and *max-queues*.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **max\_connections** integer | **Default:**-1 | Max number of concurrent client connections. Negative value means "no limit". Ignored when the *state* is `absent`. |
| **max\_queues** integer | **Default:**-1 | Max number of queues. Negative value means "no limit". Ignored when the *state* is `absent`. |
| **node** string | | Name of the RabbitMQ Erlang node to manage. |
| **state** string | **Choices:*** **present** ←
* absent
| Specify whether the limits are to be set or cleared. If set to `absent`, the limits of both *max\_connections* and *max-queues* will be cleared. |
| **vhost** string | **Default:**"/" | Name of the virtual host to manage. |
Examples
--------
```
# Limit both of the max number of connections and queues on the vhost '/'.
- community.rabbitmq.rabbitmq_vhost_limits:
vhost: /
max_connections: 64
max_queues: 256
state: present
# Limit the max number of connections on the vhost '/'.
# This task implicitly clears the max number of queues limit using default value: -1.
- community.rabbitmq.rabbitmq_vhost_limits:
vhost: /
max_connections: 64
state: present
# Clear the limits on the vhost '/'.
- community.rabbitmq.rabbitmq_vhost_limits:
vhost: /
state: absent
```
### Authors
* Hiroyuki Matsuo (@h-matsuo)
ansible community.rabbitmq.rabbitmq_user – Manage RabbitMQ users community.rabbitmq.rabbitmq\_user – Manage RabbitMQ users
=========================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq_user`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Add or remove users to RabbitMQ and assign permissions
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **configure\_priv** string | **Default:**"^$" | Regular expression to restrict configure actions on a resource for the specified vhost. By default all actions are restricted. This option will be ignored when permissions option is used. |
| **force** boolean | **Choices:*** **no** ←
* yes
| Deletes and recreates the user. |
| **node** string | **Default:**"rabbit" | erlang node name of the rabbit we wish to configure |
| **password** string | | Password of user to add. To change the password of an existing user, you must also specify `update_password=always`. |
| **permissions** list / elements=dictionary | **Default:**[] | a list of dicts, each dict contains vhost, configure\_priv, write\_priv, and read\_priv, and represents a permission rule for that vhost. This option should be preferable when you care about all permissions of the user. You should use vhost, configure\_priv, write\_priv, and read\_priv options instead if you care about permissions for just some vhosts. |
| **read\_priv** string | **Default:**"^$" | Regular expression to restrict configure actions on a resource for the specified vhost. By default all actions are restricted. This option will be ignored when permissions option is used. |
| **state** string | **Choices:*** **present** ←
* absent
| Specify if user is to be added or removed |
| **tags** string | | User tags specified as comma delimited |
| **update\_password** string | **Choices:*** **on\_create** ←
* always
|
`on_create` will only set the password for newly created users. `always` will update passwords if they differ. |
| **user** string / required | | Name of user to add
aliases: username, name |
| **vhost** string | **Default:**"/" | vhost to apply access privileges. This option will be ignored when permissions option is used. |
| **write\_priv** string | **Default:**"^$" | Regular expression to restrict configure actions on a resource for the specified vhost. By default all actions are restricted. This option will be ignored when permissions option is used. |
Examples
--------
```
# Add user to server and assign full access control on / vhost.
# The user might have permission rules for other vhost but you don't care.
- community.rabbitmq.rabbitmq_user:
user: joe
password: changeme
vhost: /
configure_priv: .*
read_priv: .*
write_priv: .*
state: present
# Add user to server and assign full access control on / vhost.
# The user doesn't have permission rules for other vhosts
- community.rabbitmq.rabbitmq_user:
user: joe
password: changeme
permissions:
- vhost: /
configure_priv: .*
read_priv: .*
write_priv: .*
state: present
```
### Authors
* Chris Hoffman (@chrishoffman)
ansible community.rabbitmq.rabbitmq_binding – Manage rabbitMQ bindings community.rabbitmq.rabbitmq\_binding – Manage rabbitMQ bindings
===============================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq_binding`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* This module uses rabbitMQ REST APIs to create / delete bindings.
Requirements
------------
The below requirements are needed on the host that executes this module.
* requests >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **arguments** dictionary | **Default:**{} | extra arguments for exchange. If defined this argument is a key/value dictionary |
| **ca\_cert** path | | CA certificate to verify SSL connection to management API.
aliases: cacert |
| **client\_cert** path | | Client certificate to send on SSL connections to management API.
aliases: cert |
| **client\_key** path | | Private key matching the client certificate.
aliases: key |
| **destination** string / required | | destination exchange or queue for the binding.
aliases: dst, dest |
| **destination\_type** string / required | **Choices:*** queue
* exchange
| Either queue or exchange.
aliases: type, dest\_type |
| **login\_host** string | **Default:**"localhost" | RabbitMQ host for connection. |
| **login\_password** string | **Default:**"guest" | RabbitMQ password for connection. |
| **login\_port** string | **Default:**"15672" | RabbitMQ management API port. |
| **login\_protocol** string | **Choices:*** **http** ←
* https
| RabbitMQ management API protocol. |
| **login\_user** string | **Default:**"guest" | RabbitMQ user for connection. |
| **name** string / required | | source exchange to create binding on.
aliases: src, source |
| **routing\_key** string | **Default:**"#" | routing key for the binding. |
| **state** string | **Choices:*** **present** ←
* absent
| Whether the bindings should be present or absent. |
| **vhost** string | **Default:**"/" | RabbitMQ virtual host. |
Examples
--------
```
# Bind myQueue to directExchange with routing key info
- community.rabbitmq.rabbitmq_binding:
name: directExchange
destination: myQueue
type: queue
routing_key: info
# Bind directExchange to topicExchange with routing key *.info
- community.rabbitmq.rabbitmq_binding:
name: topicExchange
destination: topicExchange
type: exchange
routing_key: '*.info'
```
### Authors
* Manuel Sousa (@manuel-sousa)
ansible community.rabbitmq.rabbitmq_queue – Manage rabbitMQ queues community.rabbitmq.rabbitmq\_queue – Manage rabbitMQ queues
===========================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq_queue`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* This module uses rabbitMQ Rest API to create/delete queues.
* Due to limitations in the API, it cannot modify existing queues.
Requirements
------------
The below requirements are needed on the host that executes this module.
* requests >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **arguments** dictionary | **Default:**{} | extra arguments for queue. If defined this argument is a key/value dictionary Arguments here take precedence over parameters. If both are defined, the argument will be used. |
| **auto\_delete** boolean | **Choices:*** **no** ←
* yes
| if the queue should delete itself after all queues/queues unbound from it |
| **auto\_expires** integer | | How long a queue can be unused before it is automatically deleted (milliseconds) |
| **ca\_cert** path | | CA certificate to verify SSL connection to management API.
aliases: cacert |
| **client\_cert** path | | Client certificate to send on SSL connections to management API.
aliases: cert |
| **client\_key** path | | Private key matching the client certificate.
aliases: key |
| **dead\_letter\_exchange** string | | Optional name of an exchange to which messages will be republished if they are rejected or expire |
| **dead\_letter\_routing\_key** string | | Optional replacement routing key to use when a message is dead-lettered. Original routing key will be used if unset |
| **durable** boolean | **Choices:*** no
* **yes** ←
| whether queue is durable or not |
| **login\_host** string | **Default:**"localhost" | RabbitMQ host for connection. |
| **login\_password** string | **Default:**"guest" | RabbitMQ password for connection. |
| **login\_port** string | **Default:**"15672" | RabbitMQ management API port. |
| **login\_protocol** string | **Choices:*** **http** ←
* https
| RabbitMQ management API protocol. |
| **login\_user** string | **Default:**"guest" | RabbitMQ user for connection. |
| **max\_length** integer | | How many messages can the queue contain before it starts rejecting |
| **max\_priority** integer | | Maximum number of priority levels for the queue to support. If not set, the queue will not support message priorities. Larger numbers indicate higher priority. |
| **message\_ttl** integer | | How long a message can live in queue before it is discarded (milliseconds) |
| **name** string / required | | Name of the queue |
| **state** string | **Choices:*** **present** ←
* absent
| Whether the queue should be present or absent |
| **vhost** string | **Default:**"/" | RabbitMQ virtual host. |
Examples
--------
```
# Create a queue
- community.rabbitmq.rabbitmq_queue:
name: myQueue
# Create a queue on remote host
- community.rabbitmq.rabbitmq_queue:
name: myRemoteQueue
login_user: user
login_password: secret
login_host: remote.example.org
```
### Authors
* Manuel Sousa (@manuel-sousa)
ansible community.rabbitmq.rabbitmq_exchange – Manage rabbitMQ exchanges community.rabbitmq.rabbitmq\_exchange – Manage rabbitMQ exchanges
=================================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq_exchange`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* This module uses rabbitMQ Rest API to create/delete exchanges
Requirements
------------
The below requirements are needed on the host that executes this module.
* requests >= 1.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **arguments** dictionary | **Default:**{} | extra arguments for exchange. If defined this argument is a key/value dictionary |
| **auto\_delete** boolean | **Choices:*** **no** ←
* yes
| if the exchange should delete itself after all queues/exchanges unbound from it |
| **ca\_cert** path | | CA certificate to verify SSL connection to management API.
aliases: cacert |
| **client\_cert** path | | Client certificate to send on SSL connections to management API.
aliases: cert |
| **client\_key** path | | Private key matching the client certificate.
aliases: key |
| **durable** boolean | **Choices:*** no
* **yes** ←
| whether exchange is durable or not |
| **exchange\_type** string | **Choices:*** fanout
* **direct** ←
* headers
* topic
* x-delayed-message
| type for the exchange
aliases: type |
| **internal** boolean | **Choices:*** **no** ←
* yes
| exchange is available only for other exchanges |
| **login\_host** string | **Default:**"localhost" | RabbitMQ host for connection. |
| **login\_password** string | **Default:**"guest" | RabbitMQ password for connection. |
| **login\_port** string | **Default:**"15672" | RabbitMQ management API port. |
| **login\_protocol** string | **Choices:*** **http** ←
* https
| RabbitMQ management API protocol. |
| **login\_user** string | **Default:**"guest" | RabbitMQ user for connection. |
| **name** string / required | | Name of the exchange to create |
| **state** string | **Choices:*** **present** ←
* absent
| Whether the exchange should be present or absent |
| **vhost** string | **Default:**"/" | RabbitMQ virtual host. |
Examples
--------
```
# Create direct exchange
- community.rabbitmq.rabbitmq_exchange:
name: directExchange
# Create topic exchange on vhost
- community.rabbitmq.rabbitmq_exchange:
name: topicExchange
type: topic
vhost: myVhost
```
### Authors
* Manuel Sousa (@manuel-sousa)
| programming_docs |
ansible community.rabbitmq.rabbitmq_global_parameter – Manage RabbitMQ global parameters community.rabbitmq.rabbitmq\_global\_parameter – Manage RabbitMQ global parameters
==================================================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq_global_parameter`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage dynamic, cluster-wide global parameters for RabbitMQ
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **name** string / required | | Name of the global parameter being set |
| **node** string | **Default:**"rabbit" | erlang node name of the rabbit we wish to configure |
| **state** string | **Choices:*** **present** ←
* absent
| Specify if global parameter is to be added or removed |
| **value** string | | Value of the global parameter, as a JSON term |
Examples
--------
```
# Set the global parameter 'cluster_name' to a value of 'mq-cluster' (in quotes)
- community.rabbitmq.rabbitmq_global_parameter:
name: cluster_name
value: "{{ 'mq-cluster' | to_json }}"
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 |
| --- | --- | --- |
| **name** string | success | name of the global parameter being set **Sample:** cluster\_name |
| **value** string | changed | value of the global parameter, as a JSON term **Sample:** the-cluster-name |
### Authors
* Juergen Kirschbaum (@jgkirschbaum)
ansible community.rabbitmq.rabbitmq_parameter – Manage RabbitMQ parameters community.rabbitmq.rabbitmq\_parameter – Manage RabbitMQ parameters
===================================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq_parameter`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Manage dynamic, cluster-wide parameters for RabbitMQ
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **component** string / required | | Name of the component of which the parameter is being set |
| **name** string / required | | Name of the parameter being set |
| **node** string | **Default:**"rabbit" | erlang node name of the rabbit we wish to configure |
| **state** string | **Choices:*** **present** ←
* absent
| Specify if parameter is to be added or removed |
| **value** string | | Value of the parameter, as a JSON term |
| **vhost** string | **Default:**"/" | vhost to apply access privileges. |
Examples
--------
```
# Set the federation parameter 'local_username' to a value of 'guest' (in quotes)
- community.rabbitmq.rabbitmq_parameter:
component: federation
name: local-username
value: '"guest"'
state: present
```
### Authors
* Chris Hoffman (@chrishoffman)
ansible community.rabbitmq.rabbitmq_plugin – Manage RabbitMQ plugins community.rabbitmq.rabbitmq\_plugin – Manage RabbitMQ plugins
=============================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq_plugin`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to enable or disable RabbitMQ plugins.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **broker\_state** string | **Choices:*** **online** ←
* offline
| Specify whether the broker should be online or offline for the plugin change. |
| **names** string / required | | Comma-separated list of plugin names. Also, accepts plugin name.
aliases: name |
| **new\_only** boolean | **Choices:*** **no** ←
* yes
| Only enable missing plugins. Does not disable plugins that are not in the names list. |
| **prefix** string | | Specify a custom install prefix to a Rabbit. |
| **state** string | **Choices:*** **enabled** ←
* disabled
| Specify if plugins are to be enabled or disabled. |
Examples
--------
```
- name: Enables the rabbitmq_management plugin
community.rabbitmq.rabbitmq_plugin:
names: rabbitmq_management
state: enabled
- name: Enable multiple rabbitmq plugins
community.rabbitmq.rabbitmq_plugin:
names: rabbitmq_management,rabbitmq_management_visualiser
state: enabled
- name: Disable plugin
community.rabbitmq.rabbitmq_plugin:
names: rabbitmq_management
state: disabled
- name: Enable every plugin in list with existing plugins
community.rabbitmq.rabbitmq_plugin:
names: rabbitmq_management,rabbitmq_management_visualiser,rabbitmq_shovel,rabbitmq_shovel_management
state: enabled
new_only: 'yes'
- name: Enables the rabbitmq_peer_discovery_aws plugin without requiring a broker connection.
community.rabbitmq.rabbitmq_plugin:
names: rabbitmq_peer_discovery_aws_plugin
state: enabled
broker_state: offline
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **disabled** list / elements=string | always | list of plugins disabled during task run **Sample:** ['rabbitmq\_management'] |
| **enabled** list / elements=string | always | list of plugins enabled during task run **Sample:** ['rabbitmq\_management'] |
### Authors
* Chris Hoffman (@chrishoffman)
ansible community.rabbitmq.rabbitmq_feature_flag – Enables feature flag community.rabbitmq.rabbitmq\_feature\_flag – Enables feature flag
=================================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq_feature_flag`.
New in version 1.1.0: of community.rabbitmq
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Allows to enable specified feature flag.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **name** string / required | | Feature flag name. |
| **node** string | **Default:**"rabbit" | Erlang node name of the target rabbit node. |
Examples
--------
```
- name: Enable the 'maintenance_mode_status' feature flag on 'rabbit@node-1'
community.rabbitmq.rabbitmq_feature_flag:
name: maintenance_mode_status
node: rabbit@node-1
```
### Authors
* Damian Dabrowski (@damiandabrowski5)
ansible community.rabbitmq.rabbitmq_upgrade – Execute rabbitmq-upgrade commands community.rabbitmq.rabbitmq\_upgrade – Execute rabbitmq-upgrade commands
========================================================================
Note
This plugin is part of the [community.rabbitmq collection](https://galaxy.ansible.com/community/rabbitmq) (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 community.rabbitmq`.
To use it in a playbook, specify: `community.rabbitmq.rabbitmq_upgrade`.
New in version 1.1.0: of community.rabbitmq
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Allows to execute rabbitmq-upgrade commands
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **action** string / required | **Choices:*** await\_online\_quorum\_plus\_one
* await\_online\_synchronized\_mirror
* post\_upgrade
* drain
* revive
| Specify action to be executed. |
| **node** string | **Default:**"rabbit" | Erlang node name of the target rabbit node. |
Examples
--------
```
- name: Drain 'rabbit@node-1' node (in other words, put it into maintenance mode)
community.rabbitmq.rabbitmq_upgrade:
action: drain
node: rabbit@node-1
```
### Authors
* Damian Dabrowski (@damiandabrowski5)
ansible Community.Libvirt Community.Libvirt
=================
Collection version 1.0.2
Plugin Index
------------
These are the plugins in the community.libvirt collection
### Connection Plugins
* [libvirt\_lxc](libvirt_lxc_connection#ansible-collections-community-libvirt-libvirt-lxc-connection) – Run tasks in lxc containers via libvirt
* [libvirt\_qemu](libvirt_qemu_connection#ansible-collections-community-libvirt-libvirt-qemu-connection) – Run tasks on libvirt/qemu virtual machines
### Inventory Plugins
* [libvirt](libvirt_inventory#ansible-collections-community-libvirt-libvirt-inventory) – Libvirt inventory source
### Modules
* [virt](virt_module#ansible-collections-community-libvirt-virt-module) – Manages virtual machines supported by libvirt
* [virt\_net](virt_net_module#ansible-collections-community-libvirt-virt-net-module) – Manage libvirt network configuration
* [virt\_pool](virt_pool_module#ansible-collections-community-libvirt-virt-pool-module) – Manage libvirt storage pools
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible community.libvirt.virt_net – Manage libvirt network configuration community.libvirt.virt\_net – Manage libvirt network configuration
==================================================================
Note
This plugin is part of the [community.libvirt collection](https://galaxy.ansible.com/community/libvirt) (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 community.libvirt`.
To use it in a playbook, specify: `community.libvirt.virt_net`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Manage *libvirt* networks.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.6
* python-libvirt
* python-lxml
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **autostart** boolean | **Choices:*** no
* yes
| Specify if a given network should be started automatically on system boot. |
| **command** string | **Choices:*** define
* create
* start
* stop
* destroy
* undefine
* get\_xml
* list\_nets
* facts
* info
* status
* modify
| in addition to state management, various non-idempotent commands are available. See examples. Modify was added in version 2.1 |
| **name** string | | name of the network being managed. Note that network must be previously defined with xml.
aliases: network |
| **state** string | **Choices:*** active
* inactive
* present
* absent
| specify which state you want a network to be in. If 'active', network will be started. If 'present', ensure that network is present but do not change its state; if it's missing, you need to specify xml argument. If 'inactive', network will be stopped. If 'undefined' or 'absent', network will be removed from *libvirt* configuration. |
| **uri** string | **Default:**"qemu:///system" | libvirt connection uri. |
| **xml** string | | XML document used with the define command. |
Examples
--------
```
# Define a new network
- community.libvirt.virt_net:
command: define
name: br_nat
xml: '{{ lookup("template", "network/bridge.xml.j2") }}'
# Start a network
- community.libvirt.virt_net:
command: create
name: br_nat
# List available networks
- community.libvirt.virt_net:
command: list_nets
# Get XML data of a specified network
- community.libvirt.virt_net:
command: get_xml
name: br_nat
# Stop a network
- community.libvirt.virt_net:
command: destroy
name: br_nat
# Undefine a network
- community.libvirt.virt_net:
command: undefine
name: br_nat
# Gather facts about networks
# Facts will be available as 'ansible_libvirt_networks'
- community.libvirt.virt_net:
command: facts
# Gather information about network managed by 'libvirt' remotely using uri
- community.libvirt.virt_net:
command: info
uri: '{{ item }}'
with_items: '{{ libvirt_uris }}'
register: networks
# Ensure that a network is active (needs to be defined and built first)
- community.libvirt.virt_net:
state: active
name: br_nat
# Ensure that a network is inactive
- community.libvirt.virt_net:
state: inactive
name: br_nat
# Ensure that a given network will be started at boot
- community.libvirt.virt_net:
autostart: yes
name: br_nat
# Disable autostart for a given network
- community.libvirt.virt_net:
autostart: no
name: br_nat
# Add a new host in the dhcp pool
- community.libvirt.virt_net:
name: br_nat
command: modify
xml: "<host mac='FC:C2:33:00:6c:3c' name='my_vm' ip='192.168.122.30'/>"
```
### Authors
* Maciej Delmanowski (@drybjed)
ansible community.libvirt.libvirt_qemu – Run tasks on libvirt/qemu virtual machines community.libvirt.libvirt\_qemu – Run tasks on libvirt/qemu virtual machines
============================================================================
Note
This plugin is part of the [community.libvirt collection](https://galaxy.ansible.com/community/libvirt) (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 community.libvirt`.
To use it in a playbook, specify: `community.libvirt.libvirt_qemu`.
New in version 2.10: of community.libvirt
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
Synopsis
--------
* Run commands or put/fetch files to libvirt/qemu virtual machines using the qemu agent API.
Requirements
------------
The below requirements are needed on the local controller node that executes this connection.
* libvirt-python
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **executable** string | **Default:**"/bin/sh" | var: ansible\_executable | Shell to use for execution inside container |
| **remote\_addr** string | **Default:**"inventory\_hostname" | var: ansible\_host | Virtual machine name |
| **virt\_uri** string | **Default:**"qemu:///system" | var: ansible\_libvirt\_uri | libvirt URI to connect to to access the virtual machine |
Notes
-----
Note
* Currently DOES NOT work with selinux set to enforcing in the VM.
* Requires the qemu-agent installed in the VM.
* Requires access to the qemu-ga commands guest-exec, guest-exec-status, guest-file-close, guest-file-open, guest-file-read, guest-file-write.
### Authors
* Jesse Pretorius <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#6e040b1d1d0b484d5d5955484d5b5c55484d5a5655010a171d1d0b175a484d5a5855030b)>
ansible community.libvirt.libvirt_lxc – Run tasks in lxc containers via libvirt community.libvirt.libvirt\_lxc – Run tasks in lxc containers via libvirt
========================================================================
Note
This plugin is part of the [community.libvirt collection](https://galaxy.ansible.com/community/libvirt) (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 community.libvirt`.
To use it in a playbook, specify: `community.libvirt.libvirt_lxc`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
Synopsis
--------
* Run commands or put/fetch files to an existing lxc container using libvirt
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **remote\_addr** string | **Default:**"The set user as per docker\u0027s configuration" | var: ansible\_host var: ansible\_libvirt\_lxc\_host | Container identifier |
### Authors
* Michael Scherer <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#4e23273d2d686d7d7975686d7b7c75686d7a7675342f3c2c686d7a7875213c29)>
ansible community.libvirt.libvirt – Libvirt inventory source community.libvirt.libvirt – Libvirt inventory source
====================================================
Note
This plugin is part of the [community.libvirt collection](https://galaxy.ansible.com/community/libvirt) (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 community.libvirt`.
To use it in a playbook, specify: `community.libvirt.libvirt`.
New in version 2.10: of community.libvirt
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Get libvirt guests in an inventory source
Requirements
------------
The below requirements are needed on the local controller node that executes this inventory.
* libvirt-python
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **compose** dictionary | **Default:**{} | | Create vars from jinja2 expressions. |
| **groups** dictionary | **Default:**{} | | Add hosts to group based on Jinja2 conditionals. |
| **inventory\_hostname** string | **Choices:*** **name** ←
* uuid
| | What to register as the inventory hostname. If set to 'uuid' the uuid of the server will be used and a group will be created for the server name. If set to 'name' the name of the server will be used unless there are more than one server with the same name in which case the 'uuid' logic will be used. Default is to do 'name' |
| **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:*** libvirt
* community.libvirt.libvirt
| | Token that ensures this is a source file for the 'libvirt' 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. |
| **uri** string / required | | | Libvirt Connection URI |
| **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
--------
```
# Connect to lxc host
plugin: community.libvirt.libvirt
uri: 'lxc:///'
# Connect to qemu
plugin: community.libvirt.libvirt
uri: 'qemu:///system'
```
### Authors
* Dave Olsthoorn <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#5034312635767363676b767365626b767364686b323527313122767364666b3d35)>
| programming_docs |
ansible community.libvirt.virt_pool – Manage libvirt storage pools community.libvirt.virt\_pool – Manage libvirt storage pools
===========================================================
Note
This plugin is part of the [community.libvirt collection](https://galaxy.ansible.com/community/libvirt) (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 community.libvirt`.
To use it in a playbook, specify: `community.libvirt.virt_pool`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Manage *libvirt* storage pools.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.6
* python-libvirt
* python-lxml
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **autostart** boolean | **Choices:*** no
* yes
| Specify if a given storage pool should be started automatically on system boot. |
| **command** string | **Choices:*** define
* build
* create
* start
* stop
* destroy
* delete
* undefine
* get\_xml
* list\_pools
* facts
* info
* status
* refresh
| in addition to state management, various non-idempotent commands are available. See examples. |
| **mode** string | **Choices:*** new
* repair
* resize
* no\_overwrite
* overwrite
* normal
* zeroed
| Pass additional parameters to 'build' or 'delete' commands. |
| **name** string | | name of the storage pool being managed. Note that pool must be previously defined with xml.
aliases: pool |
| **state** string | **Choices:*** active
* inactive
* present
* absent
* undefined
* deleted
| specify which state you want a storage pool to be in. If 'active', pool will be started. If 'present', ensure that pool is present but do not change its state; if it's missing, you need to specify xml argument. If 'inactive', pool will be stopped. If 'undefined' or 'absent', pool will be removed from *libvirt* configuration. If 'deleted', pool contents will be deleted and then pool undefined. |
| **uri** string | **Default:**"qemu:///system" |
*libvirt* connection uri. |
| **xml** string | | XML document used with the define command. |
Examples
--------
```
# Define a new storage pool
- community.libvirt.virt_pool:
command: define
name: vms
xml: '{{ lookup("template", "pool/dir.xml.j2") }}'
# Build a storage pool if it does not exist
- community.libvirt.virt_pool:
command: build
name: vms
# Start a storage pool
- community.libvirt.virt_pool:
command: create
name: vms
# List available pools
- community.libvirt.virt_pool:
command: list_pools
# Get XML data of a specified pool
- community.libvirt.virt_pool:
command: get_xml
name: vms
# Stop a storage pool
- community.libvirt.virt_pool:
command: destroy
name: vms
# Delete a storage pool (destroys contents)
- community.libvirt.virt_pool:
command: delete
name: vms
# Undefine a storage pool
- community.libvirt.virt_pool:
command: undefine
name: vms
# Gather facts about storage pools
# Facts will be available as 'ansible_libvirt_pools'
- community.libvirt.virt_pool:
command: facts
# Gather information about pools managed by 'libvirt' remotely using uri
- community.libvirt.virt_pool:
command: info
uri: '{{ item }}'
with_items: '{{ libvirt_uris }}'
register: storage_pools
# Ensure that a pool is active (needs to be defined and built first)
- community.libvirt.virt_pool:
state: active
name: vms
# Ensure that a pool is inactive
- community.libvirt.virt_pool:
state: inactive
name: vms
# Ensure that a given pool will be started at boot
- community.libvirt.virt_pool:
autostart: yes
name: vms
# Disable autostart for a given pool
- community.libvirt.virt_pool:
autostart: no
name: vms
```
### Authors
* Maciej Delmanowski (@drybjed)
ansible community.libvirt.virt – Manages virtual machines supported by libvirt community.libvirt.virt – Manages virtual machines supported by libvirt
======================================================================
Note
This plugin is part of the [community.libvirt collection](https://galaxy.ansible.com/community/libvirt) (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 community.libvirt`.
To use it in a playbook, specify: `community.libvirt.virt`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages virtual machines supported by *libvirt*.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.6
* libvirt-python
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **autostart** boolean | **Choices:*** no
* yes
| start VM at host startup. |
| **command** string | **Choices:*** create
* define
* destroy
* freemem
* get\_xml
* info
* list\_vms
* nodeinfo
* pause
* shutdown
* start
* status
* stop
* undefine
* unpause
* virttype
| In addition to state management, various non-idempotent commands are available. |
| **name** string | | name of the guest VM being managed. Note that VM must be previously defined with xml. This option is required unless *command* is `list_vms` or `info`.
aliases: guest |
| **state** string | **Choices:*** destroyed
* paused
* running
* shutdown
| Note that there may be some lag for state requests like `shutdown` since these refer only to VM states. After starting a guest, it may not be immediately accessible. state and command are mutually exclusive except when command=list\_vms. In this case all VMs in specified state will be listed. |
| **uri** string | **Default:**"qemu:///system" | libvirt connection uri. |
| **xml** string | | XML document used with the define command. Must be raw XML content using `lookup`. XML cannot be reference to a file. |
Examples
--------
```
# a playbook task line:
- community.libvirt.virt:
name: alpha
state: running
# /usr/bin/ansible invocations
# ansible host -m virt -a "name=alpha command=status"
# ansible host -m virt -a "name=alpha command=get_xml"
# ansible host -m virt -a "name=alpha command=create uri=lxc:///"
# defining and launching an LXC guest
- name: define vm
community.libvirt.virt:
command: define
xml: "{{ lookup('template', 'container-template.xml.j2') }}"
uri: 'lxc:///'
- name: start vm
community.libvirt.virt:
name: foo
state: running
uri: 'lxc:///'
# setting autostart on a qemu VM (default uri)
- name: set autostart for a VM
community.libvirt.virt:
name: foo
autostart: yes
# Defining a VM and making is autostart with host. VM will be off after this task
- name: define vm from xml and set autostart
community.libvirt.virt:
command: define
xml: "{{ lookup('template', 'vm_template.xml.j2') }}"
autostart: yes
# Listing VMs
- name: list all VMs
community.libvirt.virt:
command: list_vms
register: all_vms
- name: list only running VMs
community.libvirt.virt:
command: list_vms
state: running
register: running_vms
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **list\_vms** list / elements=string | success | The list of vms defined on the remote system **Sample:** ['build.example.org', 'dev.example.org'] |
| **status** string | success | The status of the VM, among running, crashed, paused and shutdown **Sample:** success |
### Authors
* Ansible Core Team
* Michael DeHaan
* Seth Vidal (@skvidal)
ansible community.mongodb.mongodb_shell – Run commands via the MongoDB shell. community.mongodb.mongodb\_shell – Run commands via the MongoDB shell.
======================================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_shell`.
New in version 1.1.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Run commands via the MongoDB shell.
* Commands provided with the eval parameter or included in a Javascript file.
* Attempts to parse returned data into a format that Ansible can use.
* Module currently uses the mongo shell by default. This will change to mongosh in an upcoming version and support for mongo will be dropped
Requirements
------------
The below requirements are needed on the host that executes this module.
* mongo or mongosh
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **additional\_args** raw | | Additional arguments to supply to the mongo command. Supply as key-value pairs. If the parameter is a valueless flag supply an empty string as the value. |
| **db** string | **Default:**"test" | The database to run commands against |
| **debug** boolean | **Choices:*** **no** ←
* yes
| show additional debug info. |
| **eval** string | | A MongoDB command to run. |
| **file** string | | Path to a file containing MongoDB commands. |
| **idempotent** boolean | **Choices:*** **no** ←
* yes
| Provides a form of pseudo-idempotency to the module. We perform a hash calculation on the contents of the eval key or the file name provided in the file key. When the command is first execute a filed called <hash>.success will be created. The module will not rerun the command if this file exists and idempotent is set to true. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **mongo\_cmd** string | **Default:**"mongo" | The MongoDB shell command. |
| **nodb** boolean | **Choices:*** **no** ←
* yes
| Specify a non-default encoding for output. |
| **norc** boolean | **Choices:*** **no** ←
* yes
| Prevents the shell from sourcing and evaluating ~/.mongorc.js on start up. |
| **quiet** boolean | **Choices:*** no
* **yes** ←
| Silences output from the shell during the connection process.. |
| **split\_char** string | **Default:**" " | Used by the split action in the transform stage. |
| **stringify** boolean | **Choices:*** no
* yes
| Wraps the command in eval in JSON.stringify(<js cmd>) (mongo) or EJSON.stringify(<js cmd>) (mongosh). Useful for escaping documents that are returned in Extended JSON format. Automatically set to false when using mongo. Automatically set to true when using mongosh. Set explicitly to override automatic selection. |
| **transform** string | **Choices:*** **auto** ←
* split
* json
* raw
| Transform the output returned to the user. auto - Attempt to automatically decide the best tranformation. split - Split output on a character. json - parse as json. raw - Return the raw output. |
Examples
--------
```
- name: Run the listDatabases command
community.mongodb.mongodb_shell:
login_user: user
login_password: secret
eval: "db.adminCommand('listDatabases')"
- name: List collections and stringify the output
community.mongodb.mongodb_shell:
login_user: user
login_password: secret
eval: "db.adminCommand('listCollections')"
stringify: yes
- name: Run the showBuiltinRoles command
community.mongodb.mongodb_shell:
login_user: user
login_password: secret
eval: "db.getRoles({showBuiltinRoles: true})"
- name: Run a js file containing MongoDB commands with pseudo-idempotency
community.mongodb.mongodb_shell:
login_user: user
login_password: secret
file: "/path/to/mongo/file.js"
idempotent: yes
- name: Provide a couple of additional cmd args
community.mongodb.mongodb_shell:
login_user: user
login_password: secret
eval: "db.adminCommand('listDatabases')"
additional_args:
verbose: True
networkMessageCompressors: "snappy"
```
Return Values
-------------
Common return 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 | Change status. |
| **err** string | when debug is set to true | Raw stderr from mongo. |
| **failed** boolean | on failure | Something went wrong. |
| **file** string | When a js file is used. | JS file that was executed successfully. |
| **msg** string | always | A message indicating what has happened. |
| **out** string | when debug is set to true | Raw stdout from mongo. |
| **rc** integer | when debug is set to true | Return code from mongo. |
| **transformed\_output** list / elements=string | on success | Output from the mongo command. We attempt to parse this into a list or json where possible. |
### Authors
* Rhys Campbell (@rhysmeister)
ansible community.mongodb.mongodb_parameter – Change an administrative parameter on a MongoDB server community.mongodb.mongodb\_parameter – Change an administrative parameter on a MongoDB server
=============================================================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_parameter`.
New in version 1.0.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Change an administrative parameter on a MongoDB server.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **param** string / required | | MongoDB administrative parameter to modify. |
| **param\_type** string | **Choices:*** int
* **str** ←
| Define the type of parameter value. |
| **replica\_set** string | | Replica set to connect to (automatically connects to primary for writes). |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
| **value** string / required | | MongoDB administrative parameter value to set. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+.
* This can be installed using pip or the OS package manager.
* See also <http://api.mongodb.org/python/current/installation.html>
Examples
--------
```
- name: Set MongoDB syncdelay to 60 (this is an int)
community.mongodb.mongodb_parameter:
param: syncdelay
value: 60
param_type: int
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** string | success | value after modification |
| **before** string | success | value before modification |
### Authors
* Loic Blot (@nerzhul)
ansible community.mongodb.mongodb_user – Adds or removes a user from a MongoDB database community.mongodb.mongodb\_user – Adds or removes a user from a MongoDB database
================================================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_user`.
New in version 1.0.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Adds or removes a user from a MongoDB database.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **create\_for\_localhost\_exception** path | | This is parmeter is only useful for handling special treatment around the localhost exception. If `login_user` is defined, then the localhost exception is not active and this parameter has no effect. If this file is NOT present (and `login_user` is not defined), then touch this file after successfully adding the user. If this file is present (and `login_user` is not defined), then skip this task. |
| **database** string / required | | The name of the database to add/remove the user from.
aliases: db |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **name** string / required | | The name of the user to add or remove.
aliases: user |
| **password** string | | The password to use for the user.
aliases: pass |
| **replica\_set** string | | Replica set to connect to (automatically connects to primary for writes). |
| **roles** list / elements=raw | | The database user roles valid values could either be one or more of the following strings: 'read', 'readWrite', 'dbAdmin', 'userAdmin', 'clusterAdmin', 'readAnyDatabase', 'readWriteAnyDatabase', 'userAdminAnyDatabase', 'dbAdminAnyDatabase' Or the following dictionary '{ db: DATABASE\_NAME, role: ROLE\_NAME }'. This param requires pymongo 2.5+. If it is a string, mongodb 2.4+ is also required. If it is a dictionary, mongo 2.6+ is required. |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
| **state** string | **Choices:*** absent
* **present** ←
| The database user state. |
| **update\_password** string | **Choices:*** **always** ←
* on\_create
|
`always` will always update passwords and cause the module to return changed.
`on_create` will only set the password for newly created users. This must be `always` to use the localhost exception when adding the first admin user. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+. This can be installed using pip or the OS package manager. Newer mongo server versions require newer pymongo versions. @see <http://api.mongodb.org/python/current/installation.html>
Examples
--------
```
- name: Create 'burgers' database user with name 'bob' and password '12345'.
community.mongodb.mongodb_user:
database: burgers
name: bob
password: 12345
state: present
- name: Create a database user via SSL (MongoDB must be compiled with the SSL option and configured properly)
community.mongodb.mongodb_user:
database: burgers
name: bob
password: 12345
state: present
ssl: True
- name: Delete 'burgers' database user with name 'bob'.
community.mongodb.mongodb_user:
database: burgers
name: bob
state: absent
- name: Define more users with various specific roles (if not defined, no roles is assigned, and the user will be added via pre mongo 2.2 style)
community.mongodb.mongodb_user:
database: burgers
name: ben
password: 12345
roles: read
state: present
- name: Define roles
community.mongodb.mongodb_user:
database: burgers
name: jim
password: 12345
roles: readWrite,dbAdmin,userAdmin
state: present
- name: Define roles
community.mongodb.mongodb_user:
database: burgers
name: joe
password: 12345
roles: readWriteAnyDatabase
state: present
- name: Add a user to database in a replica set, the primary server is automatically discovered and written to
community.mongodb.mongodb_user:
database: burgers
name: bob
replica_set: belcher
password: 12345
roles: readWriteAnyDatabase
state: present
# add a user 'oplog_reader' with read only access to the 'local' database on the replica_set 'belcher'. This is useful for oplog access (MONGO_OPLOG_URL).
# please notice the credentials must be added to the 'admin' database because the 'local' database is not synchronized and can't receive user credentials
# To login with such user, the connection string should be MONGO_OPLOG_URL="mongodb://oplog_reader:oplog_reader_password@server1,server2/local?authSource=admin"
# This syntax requires mongodb 2.6+ and pymongo 2.5+
- name: Roles as a dictionary
community.mongodb.mongodb_user:
login_user: root
login_password: root_password
database: admin
user: oplog_reader
password: oplog_reader_password
state: present
replica_set: belcher
roles:
- db: local
role: read
- name: Adding a user with X.509 Member Authentication
community.mongodb.mongodb_user:
login_host: "mongodb-host.test"
login_port: 27001
login_database: "$external"
database: "admin"
name: "admin"
password: "test"
roles:
- dbAdminAnyDatabase
ssl: true
ssl_ca_certs: "/tmp/ca.crt"
ssl_certfile: "/tmp/tls.key" #cert and key in one file
state: present
auth_mechanism: "MONGODB-X509"
connection_options:
- "tlsAllowInvalidHostnames=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 |
| --- | --- | --- |
| **user** string | success | The name of the user to add or remove. |
### Authors
* Elliott Foster (@elliotttf)
* Julien Thebault (@Lujeni)
| programming_docs |
ansible community.mongodb.mongodb community.mongodb.mongodb
=========================
The documentation for the cache plugin, community.mongodb.mongodb, was malformed.
The errors were:
* ```
1 validation error for PluginDocSchema
doc -> __root__
Cannot specify dict_keys(['cache']) if `name` has been specified. (type=value_error)
```
File a bug with the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) in order to have it corrected.
ansible Community.Mongodb Community.Mongodb
=================
Collection version 1.3.1
Plugin Index
------------
These are the plugins in the community.mongodb collection
### Cache Plugins
* [mongodb](mongodb_cache#ansible-collections-community-mongodb-mongodb-cache) –
### Lookup Plugins
* [mongodb](mongodb_lookup#ansible-collections-community-mongodb-mongodb-lookup) –
### Modules
* [mongodb\_balancer](mongodb_balancer_module#ansible-collections-community-mongodb-mongodb-balancer-module) – Manages the MongoDB Sharded Cluster Balancer.
* [mongodb\_index](mongodb_index_module#ansible-collections-community-mongodb-mongodb-index-module) – Creates or drops indexes on MongoDB collections.
* [mongodb\_info](mongodb_info_module#ansible-collections-community-mongodb-mongodb-info-module) – Gather information about MongoDB instance.
* [mongodb\_maintenance](mongodb_maintenance_module#ansible-collections-community-mongodb-mongodb-maintenance-module) – Enables or disables maintenance mode for a secondary member.
* [mongodb\_monitoring](mongodb_monitoring_module#ansible-collections-community-mongodb-mongodb-monitoring-module) – Manages the free monitoring feature.
* [mongodb\_oplog](mongodb_oplog_module#ansible-collections-community-mongodb-mongodb-oplog-module) – Resizes the MongoDB oplog.
* [mongodb\_parameter](mongodb_parameter_module#ansible-collections-community-mongodb-mongodb-parameter-module) – Change an administrative parameter on a MongoDB server
* [mongodb\_replicaset](mongodb_replicaset_module#ansible-collections-community-mongodb-mongodb-replicaset-module) – Initialises a MongoDB replicaset.
* [mongodb\_schema](mongodb_schema_module#ansible-collections-community-mongodb-mongodb-schema-module) – Manages MongoDB Document Schema Validators.
* [mongodb\_shard](mongodb_shard_module#ansible-collections-community-mongodb-mongodb-shard-module) – Add or remove shards from a MongoDB Cluster
* [mongodb\_shard\_tag](mongodb_shard_tag_module#ansible-collections-community-mongodb-mongodb-shard-tag-module) – Manage Shard Tags.
* [mongodb\_shard\_zone](mongodb_shard_zone_module#ansible-collections-community-mongodb-mongodb-shard-zone-module) – Manage Shard Zones.
* [mongodb\_shell](mongodb_shell_module#ansible-collections-community-mongodb-mongodb-shell-module) – Run commands via the MongoDB shell.
* [mongodb\_shutdown](mongodb_shutdown_module#ansible-collections-community-mongodb-mongodb-shutdown-module) – Cleans up all database resources and then terminates the mongod/mongos process.
* [mongodb\_status](mongodb_status_module#ansible-collections-community-mongodb-mongodb-status-module) – Validates the status of the replicaset.
* [mongodb\_stepdown](mongodb_stepdown_module#ansible-collections-community-mongodb-mongodb-stepdown-module) – Step down the MongoDB node from a PRIMARY state.
* [mongodb\_user](mongodb_user_module#ansible-collections-community-mongodb-mongodb-user-module) – Adds or removes a user from a MongoDB database
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible community.mongodb.mongodb_shutdown – Cleans up all database resources and then terminates the mongod/mongos process. community.mongodb.mongodb\_shutdown – Cleans up all database resources and then terminates the mongod/mongos process.
=====================================================================================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_shutdown`.
New in version 1.0.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Cleans up all database resources and then terminates the process.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **force** boolean | **Choices:*** **no** ←
* yes
| Specify true to force the mongod to shut down. Force shutdown interrupts any ongoing operations on the mongod and may result in unexpected behavior. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
| **timeout** integer | **Default:**10 | The number of seconds the primary should wait for a secondary to catch up. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+. This can be installed using pip or the OS package manager. @see <http://api.mongodb.org/python/current/installation.html>
Examples
--------
```
- name: Attempt to perform a clean shutdown
community.mongodb.mongodb_shutdown:
- name: Force shutdown with a timeout of 60 seconds
mongodb_maintenance:
force: true
timeout: 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 |
| --- | --- | --- |
| **changed** boolean | success | Whether the member was shutdown. |
| **failed** boolean | failed | If something went wrong |
| **msg** string | success | A short description of what happened. |
### Authors
* Rhys Campbell (@rhysmeister)
ansible community.mongodb.mongodb_info – Gather information about MongoDB instance. community.mongodb.mongodb\_info – Gather information about MongoDB instance.
============================================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_info`.
New in version 1.0.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about MongoDB instance.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **filter** list / elements=string | | Limit the collected information by comma separated string or YAML list. Allowable values are `general`, `databases`, `total_size`, `parameters`, `users`, `roles`. By default, collects all subsets. You can use '!' before value (for example, `!users`) to exclude it from the information. If you pass including and excluding values to the filter, for example, *filter=!general,users*, the excluding values, `!general` in this case, will be ignored. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+.
Examples
--------
```
- name: Gather all supported information
community.mongodb.mongodb_info:
login_user: admin
login_password: secret
register: result
- name: Show gathered info
debug:
msg: '{{ result }}'
- name: Gather only information about databases and their total size
community.mongodb.mongodb_info:
login_user: admin
login_password: secret
filter: databases, total_size
- name: Gather all information except parameters
community.mongodb.mongodb_info:
login_user: admin
login_password: secret
filter: '!parameters'
```
Return Values
-------------
Common return 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** dictionary | always | Database information. **Sample:** {'admin': {'empty': False, 'sizeOnDisk': 245760}, 'config': {'empty': False, 'sizeOnDisk': 110592}} |
| **general** dictionary | always | General instance information. **Sample:** {'allocator': 'tcmalloc', 'bits': 64, 'maxBsonObjectSize': 16777216, 'storageEngines': ['biggie'], 'version': '4.2.3'} |
| **parameters** dictionary | always | Server parameters information. **Sample:** {'maxOplogTruncationPointsAfterStartup': 100, 'maxOplogTruncationPointsDuringStartup': 100, 'maxSessions': 1000000} |
| **roles** dictionary | always | Role information. **Sample:** {'db': {'restore': {'inheritedRoles': [], 'isBuiltin': True, 'roles': []}}} |
| **total\_size** integer | always | Total size of all databases in bytes. **Sample:** 397312 |
| **users** dictionary | always | User information. **Sample:** {'db': {'new\_user': {'\_id': 'config.new\_user', 'mechanisms': ['SCRAM-SHA-1', 'SCRAM-SHA-256'], 'roles': []}}} |
### Authors
* Andrew Klychkov (@Andersson007)
ansible community.mongodb.mongodb_replicaset – Initialises a MongoDB replicaset. community.mongodb.mongodb\_replicaset – Initialises a MongoDB replicaset.
=========================================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_replicaset`.
New in version 1.0.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Initialises a MongoDB replicaset in a new deployment.
* Validates the replicaset name for existing deployments.
* Advanced replicaset member configuration possible (see examples).
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **arbiter\_at\_index** integer | | Identifies the position of the member in the array that is an arbiter. |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **chaining\_allowed** boolean | **Choices:*** no
* **yes** ←
| When *settings.chaining\_allowed=true*, the replicaset allows secondary members to replicate from other secondary members. When *settings.chaining\_allowed=false*, secondaries can replicate only from the primary. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **election\_timeout\_millis** integer | **Default:**10000 | The time limit in milliseconds for detecting when a replicaset's primary is unreachable. |
| **heartbeat\_timeout\_secs** integer | **Default:**10 | Number of seconds that the replicaset members wait for a successful heartbeat from each other. If a member does not respond in time, other members mark the delinquent member as inaccessible. The setting only applies when using *protocol\_version=0*. When using *protocol\_version=1* the relevant setting is *settings.election\_timeout\_millis*. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **members** list / elements=raw | | Yaml list consisting of the replicaset members. Csv string will also be accepted i.e. mongodb1:27017,mongodb2:27017,mongodb3:27017. A dictionary can also be used to specify advanced replicaset member options. If a port number is not provided then 27017 is assumed. |
| **protocol\_version** integer | **Choices:*** 0
* 1
**Default:**1 | Version of the replicaset election protocol. |
| **replica\_set** string | **Default:**"rs0" | Replicaset name. |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
| **validate** boolean | **Choices:*** no
* **yes** ←
| Performs some basic validation on the provided replicaset config. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+. This can be installed using pip or the OS package manager. @see <http://api.mongodb.org/python/current/installation.html>
Examples
--------
```
# Create a replicaset called 'rs0' with the 3 provided members
- name: Ensure replicaset rs0 exists
community.mongodb.mongodb_replicaset:
login_host: localhost
login_user: admin
login_password: admin
replica_set: rs0
members:
- mongodb1:27017
- mongodb2:27017
- mongodb3:27017
when: groups.mongod.index(inventory_hostname) == 0
# Create two single-node replicasets on the localhost for testing
- name: Ensure replicaset rs0 exists
community.mongodb.mongodb_replicaset:
login_host: localhost
login_port: 3001
login_user: admin
login_password: secret
login_database: admin
replica_set: rs0
members: localhost:3001
validate: no
- name: Ensure replicaset rs1 exists
community.mongodb.mongodb_replicaset:
login_host: localhost
login_port: 3002
login_user: admin
login_password: secret
login_database: admin
replica_set: rs1
members: localhost:3002
validate: no
- name: Create a replicaset and use a custom priority for each member
community.mongodb.mongodb_replicaset:
login_host: localhost
login_user: admin
login_password: admin
replica_set: rs0
members:
- host: "localhost:3001"
priority: 1
- host: "localhost:3002"
priority: 0.5
- host: "localhost:3003"
priority: 0.5
when: groups.mongod.index(inventory_hostname) == 0
- name: Create replicaset rs1 with options and member tags
community.mongodb.mongodb_replicaset:
login_host: localhost
login_port: 3001
login_database: admin
replica_set: rs1
members:
- host: "localhost:3001"
priority: 1
tags:
dc: "east"
usage: "production"
- host: "localhost:3002"
priority: 1
tags:
dc: "east"
usage: "production"
- host: "localhost:3003"
priority: 0
hidden: true
slaveDelay: 3600
tags:
dc: "west"
usage: "reporting"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **mongodb\_replicaset** string | success | The name of the replicaset that has been created. |
### Authors
* Rhys Campbell (@rhysmeister)
| programming_docs |
ansible community.mongodb.mongodb_shard_zone – Manage Shard Zones. community.mongodb.mongodb\_shard\_zone – Manage Shard Zones.
============================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_shard_zone`.
New in version 1.3.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Shard Zones.
* Add and remove shard zones.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **mongos\_process** string | **Default:**"mongos" | Provide a custom name for the mongos process. Most users can ignore this setting. |
| **name** string / required | | The name of the zone. |
| **namespace** string | | The namespace the zone is assigned to Should be given in the form database.collection. |
| **ranges** list / elements=list | | The ranges assigned to the Zone. |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
| **state** string | **Choices:*** **present** ←
* absent
| The state of the zone. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+. This can be installed using pip or the OS package manager. @see <http://api.mongodb.org/python/current/installation.html>
Examples
--------
```
- name: Add a shard zone for NYC
community.mongodb.mongodb_shard_zone:
name: "NYC"
namespace: "records.users"
ranges:
- [{ zipcode: "10001" }, { zipcode: "10281" }]
- [{ zipcode: "11201" }, { zipcode: "11240" }]
state: "present"
- name: Remove all zone ranges
community.mongodb.mongodb_shard_zone:
name: "NYC"
namespace: "records.users"
state: "absent"
- name: Remove a specific zone range
community.mongodb.mongodb_shard_zone:
name: "NYC"
namespace: "records.users"
ranges:
- [{ zipcode: "11201" }, { zipcode: "11240" }]
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 | success | True when a change has happened |
| **failed** boolean | failed | If something went wrong |
| **msg** string | failure | A short description of what happened. |
### Authors
* Rhys Campbell (@rhysmeister)
ansible community.mongodb.mongodb_shard – Add or remove shards from a MongoDB Cluster community.mongodb.mongodb\_shard – Add or remove shards from a MongoDB Cluster
==============================================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_shard`.
New in version 1.0.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Add or remove shards from a MongoDB Cluster.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **mongos\_process** string | **Default:**"mongos" | Provide a custom name for the mongos process you are connecting to. Most users can ignore this setting. |
| **shard** string / required | | The shard connection string. Should be supplied in the form <replicaset>/host:port as detailed in <https://docs.mongodb.com/manual/tutorial/add-shards-to-shard-cluster/>. For example rs0/example1.mongodb.com:27017. |
| **sharded\_databases** raw | | Enable sharding on the listed database. Can be supplied as a string or a list of strings. Sharding cannot be disabled on a database. |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
| **state** string | **Choices:*** absent
* **present** ←
| Whether the shard should be present or absent from the Cluster. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+.
Examples
--------
```
- name: Add a replicaset shard named rs1 with a member running on port 27018 on mongodb0.example.net
community.mongodb.mongodb_shard:
login_user: admin
login_password: admin
shard: "rs1/mongodb0.example.net:27018"
state: present
- name: Add a standalone mongod shard running on port 27018 of mongodb0.example.net
community.mongodb.mongodb_shard:
login_user: admin
login_password: admin
shard: "mongodb0.example.net:27018"
state: present
- name: To remove a shard called 'rs1'
community.mongodb.mongodb_shard:
login_user: admin
login_password: admin
shard: rs1
state: absent
# Single node shard running on localhost
- name: Ensure shard rs0 exists
community.mongodb.mongodb_shard:
login_user: admin
login_password: secret
shard: "rs0/localhost:3001"
state: present
# Single node shard running on localhost
- name: Ensure shard rs1 exists
community.mongodb.mongodb_shard:
login_user: admin
login_password: secret
shard: "rs1/localhost:3002"
state: present
# Enable sharding on a few databases when creating the shard
- name: To remove a shard called 'rs1'
community.mongodb.mongodb_shard:
login_user: admin
login_password: admin
shard: rs1
sharded_databases:
- db1
- db2
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 |
| --- | --- | --- |
| **mongodb\_shard** string | success | The name of the shard to create. |
| **sharded\_enabled** list / elements=string | success when sharding is enabled | Databases that have had sharding enabled during module execution. |
### Authors
* Rhys Campbell (@rhysmeister)
ansible community.mongodb.mongodb_status – Validates the status of the replicaset. community.mongodb.mongodb\_status – Validates the status of the replicaset.
===========================================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_status`.
New in version 1.0.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Validates the status of the replicaset.
* The module expects all replicaset nodes to be PRIMARY, SECONDARY or ARBITER.
* Will wait until a timeout for the replicaset state to converge if required.
* Can also be used to lookup the current PRIMARY member (see examples).
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **interval** integer | **Default:**30 | The number of seconds to wait between polling executions. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **poll** integer | **Default:**1 | The maximum number of times to query for the replicaset status before the set converges or we fail. |
| **replica\_set** string | **Default:**"rs0" | Replicaset name. |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
| **validate** string | **Choices:*** **default** ←
* votes
* minimal
| The type of validate to perform on the replicaset. default, Suitable for most purposes. Validate that there are an odd number of servers and one is PRIMARY and the remainder are in a SECONDARY or ARBITER state. votes, Check the number of votes is odd and one is a PRIMARY and the remainder are in a SECONDARY or ARBITER state. Authentication is required here to get the replicaset configuration. minimal, Just checks that one server is in a PRIMARY state with the remainder being SECONDARY or ARBITER. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+. This can be installed using pip or the OS package manager. @see <http://api.mongodb.org/python/current/installation.html>
Examples
--------
```
- name: Check replicaset is healthy, fail if not after first attempt
community.mongodb.mongodb_status:
replica_set: rs0
when: ansible_hostname == "mongodb1"
- name: Wait for the replicaset rs0 to converge, check 5 times, 10 second interval between checks
community.mongodb.mongodb_status:
replica_set: rs0
poll: 5
interval: 10
when: ansible_hostname == "mongodb1"
# Get the replicaset status and then lookup the primary's hostname and save to a variable
- name: Ensure replicaset is stable before beginning
community.mongodb.mongodb_status:
login_user: "{{ admin_user }}"
login_password: "{{ admin_user_password }}"
poll: 3
interval: 10
register: rs
- name: Lookup PRIMARY replicaset member
set_fact:
primary: "{{ item.key.split('.')[0] }}"
loop: "{{ lookup('dict', rs.replicaset) }}"
when: "'PRIMARY' in item.value"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **failed** boolean | always | If the module has failed or not. |
| **iterations** integer | always | Number of times the module has queried the replicaset status. |
| **msg** string | always | Status message. |
| **replicaset** dictionary | always | The last queried status of all the members of the replicaset if obtainable. |
### Authors
* Rhys Campbell (@rhysmeister)
ansible community.mongodb.mongodb community.mongodb.mongodb
=========================
The documentation for the lookup plugin, community.mongodb.mongodb, was malformed.
The errors were:
* ```
1 validation error for PluginDocSchema
doc -> __root__
Cannot specify dict_keys(['lookup']) if `name` has been specified. (type=value_error)
```
File a bug with the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) in order to have it corrected.
ansible community.mongodb.mongodb_stepdown – Step down the MongoDB node from a PRIMARY state. community.mongodb.mongodb\_stepdown – Step down the MongoDB node from a PRIMARY state.
======================================================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_stepdown`.
New in version 1.0.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Step down the MongoDB node from the PRIMARY state if it has that status. Returns OK immediately if the member is already in the SECONDARY or ARBITER states. Will wait until a timeout for the member state to reach SECONDARY or PRIMARY, if the member state is currently STARTUP, RECOVERING, STARTUP2 or ROLLBACK, before taking any needed action.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **force** boolean | **Choices:*** **no** ←
* yes
| Optional. A boolean that determines whether the primary steps down if no electable and up-to-date secondary exists within the wait period. |
| **interval** integer | **Default:**30 | The number of seconds to wait between poll executions. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **poll** integer | **Default:**1 | The maximum number of times query for the member status. |
| **secondary\_catch\_up** integer | **Default:**10 | The secondaryCatchUpPeriodSecs parameter for the stepDown command. The number of seconds that mongod will wait for an electable secondary to catch up to the primary. |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
| **stepdown\_seconds** integer | **Default:**60 | The number of seconds to step down the primary, during which time the stepdown member is ineligible for becoming primary. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+. This can be installed using pip or the OS package manager. @see <http://api.mongodb.org/python/current/installation.html>
Examples
--------
```
- name: Step down the current MongoDB member
community.mongodb.mongodb_stepdown:
login_user: admin
login_password: secret
- name: Step down the current MongoDB member, poll a maximum of 5 times if member state is recovering
community.mongodb.mongodb_stepdown:
login_user: admin
login_password: secret
poll: 5
interval: 10
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **failed** boolean | always | If the module had failed or not. |
| **iteration** integer | always | Number of times the module has queried the replicaset status. |
| **msg** string | always | Status message. |
### Authors
* Rhys Campbell (@rhysmeister)
| programming_docs |
ansible community.mongodb.mongodb_oplog – Resizes the MongoDB oplog. community.mongodb.mongodb\_oplog – Resizes the MongoDB oplog.
=============================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_oplog`.
New in version 1.0.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Resizes the MongoDB oplog.
* This module should only be used with MongoDB 3.6 and above.
* Old MongoDB versions should use an alternative method.
* Consult <https://docs.mongodb.com/manual/tutorial/change-oplog-size> for further info.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **compact** boolean | **Choices:*** **no** ←
* yes
| Runs compact against the oplog.rs collection in the local database to reclaim disk space. Performs no actions against PRIMARY members. The MongoDB user must have the compact role on the local database for this feature to work. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **oplog\_size\_mb** integer / required | | New size of the oplog in MB. |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
| **ver** string | **Default:**"3.6" | Version of MongoDB this module is supported from. You probably don't want to modifiy this. Included here for internal testing. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+. This can be installed using pip or the OS package manager. @see <http://api.mongodb.org/python/current/installation.html>
Examples
--------
```
- name: Resize oplog to 16 gigabytes, or 16000 megabytes
community.mongodb.mongodb_oplog:
oplog_size_mb: 16000
- name: Resize oplog to 8 gigabytes and compact secondaries to reclaim space
community.mongodb.mongodb_oplog:
oplog_size_mb: 8000
compact: 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 |
| --- | --- | --- |
| **changed** boolean | success | Whether the member oplog was modified. |
| **compacted** boolean | success | Whether the member oplog was compacted. |
| **failed** boolean | failed | If something went wrong |
| **msg** string | success | A short description of what happened. |
### Authors
* Rhys Campbell (@rhysmeister)
ansible community.mongodb.mongodb_balancer – Manages the MongoDB Sharded Cluster Balancer. community.mongodb.mongodb\_balancer – Manages the MongoDB Sharded Cluster Balancer.
===================================================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_balancer`.
New in version 1.0.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages the MongoDB Sharded Cluster Balancer.
* Start or stop the balancer.
* Adjust the cluster chunksize.
* Enable or disable autosplit.
* Add or remove a balancer window.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **autosplit** boolean | **Choices:*** no
* yes
| Disable or enable the autosplit flag in the config.settings collection. |
| **chunksize** integer | | Control the size of chunks in the sharded cluster. Value should be given in MB. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **mongos\_process** string | **Default:**"mongos" | Provide a custom name for the mongos process. Most users can ignore this setting. |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
| **state** string | **Choices:*** **started** ←
* stopped
| Manage the Balancer for the Cluster |
| **window** raw | | Schedule the balancer window. Provide the following dictionary keys start, stop, state The state key should be "present" or "absent". The start and stop keys are ignored when state is "absent". start and stop should be strings in "HH:MM" format indicating the time bounds of the window. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+. This can be installed using pip or the OS package manager. @see <http://api.mongodb.org/python/current/installation.html>
Examples
--------
```
- name: Start the balancer
community.mongodb.mongodb_balancer:
state: started
- name: Stop the balancer and disable autosplit
community.mongodb.mongodb_balancer:
state: stopped
autosplit: false
- name: Enable autosplit
community.mongodb.mongodb_balancer:
autosplit: true
- name: Change the default chunksize to 128MB
community.mongodb.mongodb_balancer:
chunksize: 128
- name: Add or update a balancing window
community.mongodb.mongodb_balancer:
window:
start: "23:00"
stop: "06:00"
state: "present"
- name: Remove a balancing window
community.mongodb.mongodb_balancer:
window:
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 | success | Whether the balancer state or autosplit changed. |
| **failed** boolean | failed | If something went wrong |
| **msg** string | failure | A short description of what happened. |
| **new\_autosplit** string | When autosplit is changed. | The new state of autosplit. |
| **new\_balancer\_state** string | When balancer state is changed | The new state of the balancer. |
| **new\_chunksize** integer | When chunksize is changed. | The new value for chunksize. |
| **old\_autosplit** string | When autosplit is changed. | The previous state of autosplit. |
| **old\_balancer\_state** string | When balancer state is changed | The previous state of the balancer |
| **old\_chunksize** integer | When chunksize is changed. | The previous value for chunksize. |
### Authors
* Rhys Campbell (@rhysmeister)
ansible community.mongodb.mongodb_index – Creates or drops indexes on MongoDB collections. community.mongodb.mongodb\_index – Creates or drops indexes on MongoDB collections.
===================================================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_index`.
New in version 1.0.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates or drops indexes on MongoDB collections.
* Supports multiple index options, i.e. unique, sparse and partial.
* Validates existence of indexes by name only.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **indexes** list / elements=raw / required | | List of indexes to create or drop |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **replica\_set** string | | Replica set to connect to (automatically connects to primary for writes). |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+.
Examples
--------
```
- name: Create a single index on a collection
community.mongodb.mongodb_index:
login_user: admin
login_password: secret
indexes:
- database: mydb
collection: test
keys:
- username: 1
last_login: -1
options:
name: myindex
state: present
- name: Drop an index on a collection
community.mongodb.mongodb_index:
login_user: admin
login_password: secret
indexes:
- database: mydb
collection: test
options:
name: myindex
state: absent
- name: Create multiple indexes
community.mongodb.mongodb_index:
login_user: admin
login_password: secret
indexes:
- database: mydb
collection: test
keys:
- username: 1
last_login: -1
options:
name: myindex
state: present
- database: mydb
collection: test
keys:
- email: 1
last_login: -1
options:
name: myindex2
state: present
- name: Add a unique index
community.mongodb.mongodb_index:
login_port: 27017
login_user: admin
login_password: secret
login_database: "admin"
indexes:
- database: "test"
collection: "rhys"
keys:
username: 1
options:
name: myuniqueindex
unique: true
state: present
- name: Add a ttl index
community.mongodb.mongodb_index:
login_port: 27017
login_user: admin
login_password: secret
login_database: "admin"
indexes:
- database: "test"
collection: "rhys"
keys:
created: 1
options:
name: myttlindex
expireAfterSeconds: 3600
state: present
- name: Add a sparse index
community.mongodb.mongodb_index:
login_port: 27017
login_user: admin
login_password: secret
login_database: "admin"
indexes:
- database: "test"
collection: "rhys"
keys:
last_login: -1
options:
name: mysparseindex
sparse: true
state: present
- name: Add a partial index
community.mongodb.mongodb_index:
login_port: 27017
login_user: admin
login_password: secret
login_database: "admin"
indexes:
- database: "test"
collection: "rhys"
keys:
last_login: -1
options:
name: mypartialindex
partialFilterExpression:
rating:
$gt: 5
state: present
- name: Add a index in the background (background option is deprecated from 4.2+)
community.mongodb.mongodb_index:
login_port: 27017
login_user: admin
login_password: secret
login_database: "admin"
indexes:
- database: "test"
collection: "rhys"
options:
name: idxbackground
keys:
username: -1
backgroud: true
state: present
- name: Check creating 5 index all with multiple options specified
community.mongodb.mongodb_index:
login_port: 27017
login_user: admin
login_password: secret
login_database: "admin"
indexes:
- database: "test"
collection: "indextest"
options:
name: "idx_unq_username"
unique: true
keys:
username: -1
state: present
- database: "test"
collection: "indextest"
options:
name: "idx_last_login"
sparse: true
keys:
last_login: -1
state: present
- database: "test"
collection: "indextest"
options:
name: "myindex"
keys:
first_name: 1
last_name: -1
city: 1
state: present
- database: "test"
collection: partialtest
options:
name: "idx_partialtest"
partialFilterExpression:
rating:
$gt: 5
keys:
rating: -1
title: 1
state: present
- database: "test"
collection: "wideindex"
options:
name: "mywideindex"
keys:
email: -1
username: 1
first_name: 1
last_name: 1
dob: -1
city: 1
last_login: -1
review_count: 1
rating_count: 1
last_post: -1
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 |
| --- | --- | --- |
| **changed** boolean | When the module has changed something. | Indicates the module has changed something. |
| **failed** boolean | When the module has encountered an error. | Indicates the module has failed. |
| **indexes\_created** list / elements=string | always | List of indexes created. **Sample:** ['myindex', 'myindex2'] |
| **indexes\_dropped** list / elements=string | always | List of indexes dropped. **Sample:** ['myindex', 'myindex2'] |
### Authors
* Rhys Campbell (@rhysmeister)
ansible community.mongodb.mongodb_schema – Manages MongoDB Document Schema Validators. community.mongodb.mongodb\_schema – Manages MongoDB Document Schema Validators.
===============================================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_schema`.
New in version 1.3.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages MongoDB Document Schema Validators.
* Create, update and remove Validators on a collection.
* Supports the entire range of jsonSchema keywords.
* See [jsonSchema Available Keywords](<https://docs.mongodb.com/manual/reference/operator/query/jsonSchema/#available-keywords>) for details.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **action** string | **Choices:*** **error** ←
* warn
| The validation action for MongoDB to perform when handling invalid documents. |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **collection** string / required | | The collection to work with. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **db** string / required | | The database to work with. |
| **debug** boolean | **Choices:*** **no** ←
* yes
| Enable additional debugging output. |
| **level** string | **Choices:*** **strict** ←
* moderate
| The validation level MongoDB should apply when updating existing documents. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **properties** dictionary | | Individual property specification. |
| **required** list / elements=string | | List of fields that are required. |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
| **state** string | **Choices:*** **present** ←
* absent
| The state of the validator. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+.
Examples
--------
```
- name: Require that an email address field is in every document
community.mongodb.mongodb_schema:
db: "rhys"
collection: "contacts"
required:
- "email"
- name: More advanced example using properties
community.mongodb.mongodb_schema:
db: "rhys"
collection: "contacts"
state: "absent"
- name: Test with debuging option - Without check mode
community.mongodb.mongodb_schema:
<<: *mongo_parameters
db: "rhys"
collection: "contacts"
required:
- "email"
- "first_name"
- "last_name"
properties:
status:
bsonType: "string"
enum: ["ACTIVE", "DISABLED"]
description: "can only be ACTIVE or DISABLED"
year:
bsonType: "int"
minimum: 2021
maximum: 3020
exclusiveMaximum: false
description: "must be an integer from 2021 to 3020"
options:
bsonType: "array"
maxItems: 10
minItems: 5
uniqueItems: yes
email:
maxLength: 150
minLength: 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 |
| --- | --- | --- |
| **changed** boolean | on success | If the module caused a change. |
| **module\_config** dictionary | when debug is true | The validator document as indicated by the module invocation. |
| **msg** string | always | Status message. |
| **validator** dictionary | when debug is true | The validator document as read from the instance. |
### Authors
* Rhys Campbell (@rhysmeister)
| programming_docs |
ansible community.mongodb.mongodb_monitoring – Manages the free monitoring feature. community.mongodb.mongodb\_monitoring – Manages the free monitoring feature.
============================================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_monitoring`.
New in version 1.3.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages the free monitoring feature.
* Optionally return the monitoring url.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **return\_url** boolean | **Choices:*** **no** ←
* yes
| When true return the monitoring url if available. |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
| **state** string | **Choices:*** **started** ←
* stopped
| Manage the free monitoring feature. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+. This can be installed using pip or the OS package manager. @see <http://api.mongodb.org/python/current/installation.html>
Examples
--------
```
- name: Enable monitoring
community.mongodb.mongodb_monitoring:
state: "started"
- name: Disable monitoring
community.mongodb.mongodb_monitoring:
state: "stopped"
- name: Enable monitoring and return the monitoring url
community.mongodb_monitoring:
state: "started"
return_url: "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 |
| --- | --- | --- |
| **changed** boolean | success | Whether the monitoring status changed. |
| **failed** boolean | failed | If something went wrong |
| **msg** string | success | A short description of what happened. |
| **url** string | When requested and available. | The MongoDB instance Monitoring url. |
### Authors
* Rhys rhyscampbell (rhysmeister)
ansible community.mongodb.mongodb_maintenance – Enables or disables maintenance mode for a secondary member. community.mongodb.mongodb\_maintenance – Enables or disables maintenance mode for a secondary member.
=====================================================================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_maintenance`.
New in version 1.0.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Enables or disables maintenance mode for a secondary member.
* Wrapper around the replSetMaintenance command.
* Performs no actions against a PRIMARY member.
* When enabled SECONDARY members will not service reads.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **maintenance** boolean | **Choices:*** **no** ←
* yes
| Enable or disable maintenance mode. |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+. This can be installed using pip or the OS package manager. @see <http://api.mongodb.org/python/current/installation.html>
Examples
--------
```
- name: Enable maintenance mode
community.mongodb.mongodb_maintenance:
maintenance: true
- name: Disable maintenance mode
community.mongodb.mongodb_maintenance:
maintenance: false
```
Return Values
-------------
Common return 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 | success | Whether the member was placed into maintenance mode or not. |
| **failed** boolean | failed | If something went wrong |
| **msg** string | success | A short description of what happened. |
### Authors
* Rhys Campbell (@rhysmeister)
ansible community.mongodb.mongodb_shard_tag – Manage Shard Tags. community.mongodb.mongodb\_shard\_tag – Manage Shard Tags.
==========================================================
Note
This plugin is part of the [community.mongodb collection](https://galaxy.ansible.com/community/mongodb) (version 1.3.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 community.mongodb`.
To use it in a playbook, specify: `community.mongodb.mongodb_shard_tag`.
New in version 1.3.0: of community.mongodb
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Shard Tags..
* Add and remove shard tags.
Requirements
------------
The below requirements are needed on the host that executes this module.
* pymongo
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_mechanism** string | **Choices:*** SCRAM-SHA-256
* SCRAM-SHA-1
* MONGODB-X509
* GSSAPI
* PLAIN
| Authentication type. |
| **connection\_options** list / elements=raw | | Additional connection options. Supply as a list of dicts or strings containing key value pairs seperated with '='. |
| **login\_database** string | **Default:**"admin" | The database where login credentials are stored. |
| **login\_host** string | **Default:**"localhost" | The host running MongoDB instance to login to. |
| **login\_password** string | | The password used to authenticate with. Required when *login\_user* is specified. |
| **login\_port** integer | **Default:**27017 | The MongoDB server port to login to. |
| **login\_user** string | | The MongoDB user to login with. Required when *login\_password* is specified. |
| **mongos\_process** string | **Default:**"mongos" | Provide a custom name for the mongos process. Most users can ignore this setting. |
| **name** string / required | | The name of the tag. |
| **shard** string | | The name of the shard to assign or remove the tag from. |
| **ssl** boolean | **Choices:*** **no** ←
* yes
| Whether to use an SSL connection when connecting to the database. |
| **ssl\_ca\_certs** string | | The ssl\_ca\_certs option takes a path to a CA file. |
| **ssl\_cert\_reqs** string | **Choices:*** CERT\_NONE
* CERT\_OPTIONAL
* **CERT\_REQUIRED** ←
| Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided. |
| **ssl\_certfile** string | | Present a client certificate using the ssl\_certfile option. |
| **ssl\_crlfile** string | | The ssl\_crlfile option takes a path to a CRL file. |
| **ssl\_keyfile** string | | Private key for the client certificate. |
| **ssl\_pem\_passphrase** string | | Passphrase to decrypt encrypted private keys. |
| **state** string | **Choices:*** **present** ←
* absent
| The state of the zone. |
Notes
-----
Note
* Requires the pymongo Python package on the remote host, version 2.4.2+. This can be installed using pip or the OS package manager. @see <http://api.mongodb.org/python/current/installation.html>
Examples
--------
```
- name: Add the NYC tag to a shard called rs0
community.mongodb.mongodb_shard_tag:
name: "NYC"
shard "rs0"
state: "present"
- name: Remove the NYC tag from rs0
community.mongodb.mongodb_shard_tag:
name: "NYC"
shard "rs0"
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 | success | True when a change has happened |
| **failed** boolean | failed | If something went wrong |
| **msg** string | failure | A short description of what happened. |
### Authors
* Rhys Campbell (@rhysmeister)
ansible Community.Kubevirt Community.Kubevirt
==================
Collection version 1.0.0
Plugin Index
------------
These are the plugins in the community.kubevirt collection
### Inventory Plugins
* [kubevirt](kubevirt_inventory#ansible-collections-community-kubevirt-kubevirt-inventory) – KubeVirt inventory source
### Modules
* [kubevirt\_cdi\_upload](kubevirt_cdi_upload_module#ansible-collections-community-kubevirt-kubevirt-cdi-upload-module) – Upload local VM images to CDI Upload Proxy.
* [kubevirt\_preset](kubevirt_preset_module#ansible-collections-community-kubevirt-kubevirt-preset-module) – Manage KubeVirt virtual machine presets
* [kubevirt\_pvc](kubevirt_pvc_module#ansible-collections-community-kubevirt-kubevirt-pvc-module) – Manage PVCs on Kubernetes
* [kubevirt\_rs](kubevirt_rs_module#ansible-collections-community-kubevirt-kubevirt-rs-module) – Manage KubeVirt virtual machine replica sets
* [kubevirt\_template](kubevirt_template_module#ansible-collections-community-kubevirt-kubevirt-template-module) – Manage KubeVirt templates
* [kubevirt\_vm](kubevirt_vm_module#ansible-collections-community-kubevirt-kubevirt-vm-module) – Manage KubeVirt virtual machine
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible community.kubevirt.kubevirt_vm – Manage KubeVirt virtual machine community.kubevirt.kubevirt\_vm – Manage KubeVirt virtual machine
=================================================================
Note
This plugin is part of the [community.kubevirt collection](https://galaxy.ansible.com/community/kubevirt) (version 1.0.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 community.kubevirt`.
To use it in a playbook, specify: `community.kubevirt.kubevirt_vm`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Use Openshift Python SDK to manage the state of KubeVirt virtual machines.
Requirements
------------
The below requirements are needed on the host that executes this module.
* openshift >= 0.8.2
* python >= 2.7
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **affinity** dictionary | | Describes node affinity scheduling rules for the vm. |
| | **hard** dictionary | | If the affinity requirements specified by this field are not met at scheduling time, the vm will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during vm execution (e.g. due to a vm label update), the system may or may not try to eventually evict the vm from its node. When there are multiple elements, the lists of nodes corresponding to each `term` are intersected, i.e. all terms must be satisfied. |
| | **soft** dictionary | | The scheduler will prefer to schedule vms to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding `weight` to the sum if the node has vms which matches the corresponding `term`; the nodes with the highest sum are the most preferred. |
| **anti\_affinity** dictionary | | Describes vm anti-affinity scheduling rules e.g. avoid putting this vm in the same node, zone, etc. as some other vms. |
| | **hard** dictionary | | If the anti-affinity requirements specified by this field are not met at scheduling time, the vm will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during vm execution (e.g. due to a vm label update), the system may or may not try to eventually evict the vm from its node. When there are multiple elements, the lists of nodes corresponding to each `term` are intersected, i.e. all terms must be satisfied. |
| | **soft** dictionary | | The scheduler will prefer to schedule vms to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding `weight` to the sum if the node has vms which matches the corresponding `term`; the nodes with the highest sum are the most preferred. |
| **api\_key** string | | Token used to authenticate with the API. Can also be specified via K8S\_AUTH\_API\_KEY environment variable. |
| **bootloader** string | | Specify the bootloader of the virtual machine. All virtual machines use BIOS by default for booting. |
| **ca\_cert** path | | Path to a CA certificate used to authenticate with the API. The full certificate chain must be provided to avoid certificate validation errors. Can also be specified via K8S\_AUTH\_SSL\_CA\_CERT environment variable.
aliases: ssl\_ca\_cert |
| **client\_cert** path | | Path to a certificate used to authenticate with the API. Can also be specified via K8S\_AUTH\_CERT\_FILE environment variable.
aliases: cert\_file |
| **client\_key** path | | Path to a key file used to authenticate with the API. Can also be specified via K8S\_AUTH\_KEY\_FILE environment variable.
aliases: key\_file |
| **cloud\_init\_nocloud** dictionary | | Represents a cloud-init NoCloud user-data source. The NoCloud data will be added as a disk to the virtual machine. A proper cloud-init installation is required inside the guest. More information <https://kubevirt.io/api-reference/master/definitions.html#_v1_cloudinitnocloudsource>
|
| **context** string | | The name of a context found in the config file. Can also be specified via K8S\_AUTH\_CONTEXT environment variable. |
| **cpu\_cores** integer | | Number of CPU cores. |
| **cpu\_features** list / elements=string | | List of dictionary to fine-tune features provided by the selected CPU model.
*Note*: Policy attribute can either be omitted or contain one of the following policies: force, require, optional, disable, forbid.
*Note*: In case a policy is omitted for a feature, it will default to require. More information about policies: <https://libvirt.org/formatdomain.html#elementsCPU>
|
| **cpu\_limit** integer | | Is converted to its millicore value and multiplied by 100. The resulting value is the total amount of CPU time that a container can use every 100ms. A virtual machine cannot use more than its share of CPU time during this interval. |
| **cpu\_model** string | | CPU model. You can check list of available models here: <https://github.com/libvirt/libvirt/blob/master/src/cpu_map/index.xml>.
*Note:* User can define default CPU model via as *default-cpu-model* in *kubevirt-config* *ConfigMap*, if not set *host-model* is used.
*Note:* Be sure that node CPU model where you run a VM, has the same or higher CPU family.
*Note:* If CPU model wasn't defined, the VM will have CPU model closest to one that used on the node where the VM is running. |
| **cpu\_shares** integer | | Specify CPU shares. |
| **datavolumes** list / elements=string | | DataVolumes are a way to automate importing virtual machine disks onto pvcs during the virtual machine's launch flow. Without using a DataVolume, users have to prepare a pvc with a disk image before assigning it to a VM or VMI manifest. With a DataVolume, both the pvc creation and import is automated on behalf of the user. |
| **disks** list / elements=string | | List of dictionaries which specify disks of the virtual machine. A disk can be made accessible via four different types: *disk*, *lun*, *cdrom*, *floppy*. All possible configuration options are available in <https://kubevirt.io/api-reference/master/definitions.html#_v1_disk>
Each disk must have specified a *volume* that declares which volume type of the disk All possible configuration options of volume are available in <https://kubevirt.io/api-reference/master/definitions.html#_v1_volume>. |
| **ephemeral** boolean | **Choices:*** **no** ←
* yes
| If (true) ephemeral virtual machine will be created. When destroyed it won't be accessible again. Works only with `state` *present* and *absent*. |
| **force** boolean | **Choices:*** **no** ←
* yes
| If set to `no`, and *state* is `present`, an existing object will be replaced. |
| **headless** string | | Specify if the virtual machine should have attached a minimal Video and Graphics device configuration. By default a minimal Video and Graphics device configuration will be applied to the VirtualMachineInstance. The video device is vga compatible and comes with a memory size of 16 MB. |
| **host** string | | Provide a URL for accessing the API. Can also be specified via K8S\_AUTH\_HOST environment variable. |
| **hostname** string | | Specifies the hostname of the virtual machine. The hostname will be set either by dhcp, cloud-init if configured or virtual machine name will be used. |
| **hugepage\_size** string | | Specify huge page size. |
| **interfaces** list / elements=string | | An interface defines a virtual network interface of a virtual machine (also called a frontend). All possible configuration options interfaces are available in <https://kubevirt.io/api-reference/master/definitions.html#_v1_interface>
Each interface must have specified a *network* that declares which logical or physical device it is connected to (also called as backend). All possible configuration options of network are available in <https://kubevirt.io/api-reference/master/definitions.html#_v1_network>. |
| **kubeconfig** path | | Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the openshift client will attempt to load the default configuration file from *~/.kube/config.json*. Can also be specified via K8S\_AUTH\_KUBECONFIG environment variable. |
| **labels** dictionary | | Labels are key/value pairs that are attached to virtual machines. Labels are intended to be used to specify identifying attributes of virtual machines that are meaningful and relevant to users, but do not directly imply semantics to the core system. Labels can be used to organize and to select subsets of virtual machines. Labels can be attached to virtual machines at creation time and subsequently added and modified at any time. More on labels that are used for internal implementation <https://kubevirt.io/user-guide/#/misc/annotations_and_labels>
|
| **machine\_type** string | | QEMU machine type is the actual chipset of the virtual machine. |
| **memory** string | | The amount of memory to be requested by virtual machine. For example 1024Mi. |
| **memory\_limit** string | | The maximum memory to be used by virtual machine. For example 1024Mi. |
| **merge\_type** list / elements=string | **Choices:*** json
* merge
* strategic-merge
| Whether to override the default patch merge approach with a specific type. If more than one merge type is given, the merge types will be tried in order. Defaults to `['strategic-merge', 'merge']`, which is ideal for using the same parameters on resource kinds that combine Custom Resources and built-in resources, as Custom Resource Definitions typically aren't updatable by the usual strategic merge. See <https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment>
|
| **name** string / required | | Name of the virtual machine. |
| **namespace** string / required | | Namespace where the virtual machine exists. |
| **node\_affinity** dictionary | | Describes vm affinity scheduling rules e.g. co-locate this vm in the same node, zone, etc. as some other vms |
| | **hard** dictionary | | If the affinity requirements specified by this field are not met at scheduling time, the vm will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during vm execution (e.g. due to an update), the system may or may not try to eventually evict the vm from its node. |
| | **soft** dictionary | | The scheduler will prefer to schedule vms to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding `weight` to the sum if the node matches the corresponding match\_expressions; the nodes with the highest sum are the most preferred. |
| **password** string | | Provide a password for authenticating with the API. Can also be specified via K8S\_AUTH\_PASSWORD environment variable. Please read the description of the `username` option for a discussion of when this option is applicable. |
| **persist\_config** boolean | **Choices:*** no
* yes
| Whether or not to save the kube config refresh tokens. Can also be specified via K8S\_AUTH\_PERSIST\_CONFIG environment variable. When the k8s context is using a user credentials with refresh tokens (like oidc or gke/gcloud auth), the token is refreshed by the k8s python client library but not saved by default. So the old refresh token can expire and the next auth might fail. Setting this flag to true will tell the k8s python client to save the new refresh token to the kube config file. Default to false. Please note that the current version of the k8s python client library does not support setting this flag to True yet. The fix for this k8s python library is here: https://github.com/kubernetes-client/python-base/pull/169 |
| **proxy** string | | The URL of an HTTP proxy to use for the connection. Can also be specified via K8S\_AUTH\_PROXY environment variable. Please note that this module does not pick up typical proxy settings from the environment (e.g. HTTP\_PROXY). |
| **resource\_definition** dictionary | | A partial YAML definition of the object being created/updated. Here you can define Kubernetes resource parameters not covered by this module's parameters. NOTE: *resource\_definition* has lower priority than module parameters. If you try to define e.g. *metadata.namespace* here, that value will be ignored and *namespace* used instead.
aliases: definition, inline |
| **smbios\_uuid** string | | In order to provide a consistent view on the virtualized hardware for the guest OS, the SMBIOS UUID can be set. |
| **state** string | **Choices:*** **present** ←
* absent
* running
* stopped
| Set the virtual machine to either *present*, *absent*, *running* or *stopped*.
*present* - Create or update a virtual machine. (And run it if it's ephemeral.)
*absent* - Remove a virtual machine.
*running* - Create or update a virtual machine and run it.
*stopped* - Stop a virtual machine. (This deletes ephemeral VMs.) |
| **subdomain** string | | If specified, the fully qualified virtual machine hostname will be hostname.subdomain.namespace.svc.cluster\_domain. If not specified, the virtual machine will not have a domain name at all. The DNS entry will resolve to the virtual machine, no matter if the virtual machine itself can pick up a hostname. |
| **tablets** list / elements=string | | Specify tablets to be used as input devices |
| **template** string | | Name of Template to be used in creation of a virtual machine. |
| **template\_parameters** dictionary | | New values of parameters from Template. |
| **username** string | | Provide a username for authenticating with the API. Can also be specified via K8S\_AUTH\_USERNAME environment variable. Please note that this only works with clusters configured to use HTTP Basic Auth. If your cluster has a different form of authentication (e.g. OAuth2 in OpenShift), this option will not work as expected and you should look into the `k8s_auth` module, as that might do what you need. |
| **validate\_certs** boolean | **Choices:*** no
* yes
| Whether or not to verify the API server's SSL certificates. Can also be specified via K8S\_AUTH\_VERIFY\_SSL environment variable.
aliases: verify\_ssl |
| **wait** boolean | **Choices:*** no
* **yes** ←
|
*True* if the module should wait for the resource to get into desired state. |
| **wait\_sleep** string | **Default:**5 | Number of seconds to sleep between checks. |
| **wait\_timeout** integer | **Default:**120 | The amount of time in seconds the module should wait for the resource to get into desired state. |
Notes
-----
Note
* The OpenShift Python client wraps the K8s Python client, providing full access to all of the APIS and models available on both platforms. For API version details and additional information visit <https://github.com/openshift/openshift-restclient-python>
* To avoid SSL certificate validation errors when `validate_certs` is *True*, the full certificate chain for the API server must be provided via `ca_cert` or in the kubeconfig file.
* In order to use this module you have to install Openshift Python SDK. To ensure it’s installed with correct version you can create the following task: *pip: name=openshift>=0.8.2*
Examples
--------
```
- name: Start virtual machine 'myvm'
community.kubevirt.kubevirt_vm:
state: running
name: myvm
namespace: vms
- name: Create virtual machine 'myvm' and start it
community.kubevirt.kubevirt_vm:
state: running
name: myvm
namespace: vms
memory: 64Mi
cpu_cores: 1
bootloader: efi
smbios_uuid: 5d307ca9-b3ef-428c-8861-06e72d69f223
cpu_model: Conroe
headless: true
hugepage_size: 2Mi
tablets:
- bus: virtio
name: tablet1
cpu_limit: 3
cpu_shares: 2
disks:
- name: containerdisk
volume:
containerDisk:
image: kubevirt/cirros-container-disk-demo:latest
path: /custom-disk/cirros.img
disk:
bus: virtio
- name: Create virtual machine 'myvm' with multus network interface
community.kubevirt.kubevirt_vm:
name: myvm
namespace: vms
memory: 512M
interfaces:
- name: default
bridge: {}
network:
pod: {}
- name: mynet
bridge: {}
network:
multus:
networkName: mynetconf
- name: Combine inline definition with Ansible parameters
community.kubevirt.kubevirt_vm:
# Kubernetes specification:
definition:
metadata:
labels:
app: galaxy
service: web
origin: vmware
# Ansible parameters:
state: running
name: myvm
namespace: vms
memory: 64M
disks:
- name: containerdisk
volume:
containerDisk:
image: kubevirt/cirros-container-disk-demo:latest
path: /custom-disk/cirros.img
disk:
bus: virtio
- name: Start ephemeral virtual machine 'myvm' and wait to be running
community.kubevirt.kubevirt_vm:
ephemeral: true
state: running
wait: true
wait_timeout: 180
name: myvm
namespace: vms
memory: 64M
labels:
kubevirt.io/vm: myvm
disks:
- name: containerdisk
volume:
containerDisk:
image: kubevirt/cirros-container-disk-demo:latest
path: /custom-disk/cirros.img
disk:
bus: virtio
- name: Start fedora vm with cloud init
community.kubevirt.kubevirt_vm:
state: running
wait: true
name: myvm
namespace: vms
memory: 1024M
cloud_init_nocloud:
userData: |-
#cloud-config
password: fedora
chpasswd: { expire: False }
disks:
- name: containerdisk
volume:
containerDisk:
image: kubevirt/fedora-cloud-container-disk-demo:latest
path: /disk/fedora.qcow2
disk:
bus: virtio
node_affinity:
soft:
- weight: 1
term:
match_expressions:
- key: security
operator: In
values:
- S2
- name: Create virtual machine with datavolume and specify node affinity
community.kubevirt.kubevirt_vm:
name: myvm
namespace: default
memory: 1024Mi
datavolumes:
- name: mydv
source:
http:
url: https://url/disk.qcow2
pvc:
accessModes:
- ReadWriteOnce
storage: 5Gi
node_affinity:
hard:
- term:
match_expressions:
- key: security
operator: In
values:
- S1
- name: Remove virtual machine 'myvm'
community.kubevirt.kubevirt_vm:
state: absent
name: myvm
namespace: vms
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **kubevirt\_vm** complex | success | The virtual machine dictionary specification returned by the API. This dictionary contains all values returned by the KubeVirt API all options are described here <https://kubevirt.io/api-reference/master/definitions.html#_v1_virtualmachine>
|
### Authors
* KubeVirt Team (@kubevirt)
| programming_docs |
ansible community.kubevirt.kubevirt_rs – Manage KubeVirt virtual machine replica sets community.kubevirt.kubevirt\_rs – Manage KubeVirt virtual machine replica sets
==============================================================================
Note
This plugin is part of the [community.kubevirt collection](https://galaxy.ansible.com/community/kubevirt) (version 1.0.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 community.kubevirt`.
To use it in a playbook, specify: `community.kubevirt.kubevirt_rs`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Use Openshift Python SDK to manage the state of KubeVirt virtual machine replica sets.
Requirements
------------
The below requirements are needed on the host that executes this module.
* openshift >= 0.8.2
* python >= 2.7
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **affinity** dictionary | | Describes node affinity scheduling rules for the vm. |
| | **hard** dictionary | | If the affinity requirements specified by this field are not met at scheduling time, the vm will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during vm execution (e.g. due to a vm label update), the system may or may not try to eventually evict the vm from its node. When there are multiple elements, the lists of nodes corresponding to each `term` are intersected, i.e. all terms must be satisfied. |
| | **soft** dictionary | | The scheduler will prefer to schedule vms to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding `weight` to the sum if the node has vms which matches the corresponding `term`; the nodes with the highest sum are the most preferred. |
| **anti\_affinity** dictionary | | Describes vm anti-affinity scheduling rules e.g. avoid putting this vm in the same node, zone, etc. as some other vms. |
| | **hard** dictionary | | If the anti-affinity requirements specified by this field are not met at scheduling time, the vm will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during vm execution (e.g. due to a vm label update), the system may or may not try to eventually evict the vm from its node. When there are multiple elements, the lists of nodes corresponding to each `term` are intersected, i.e. all terms must be satisfied. |
| | **soft** dictionary | | The scheduler will prefer to schedule vms to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding `weight` to the sum if the node has vms which matches the corresponding `term`; the nodes with the highest sum are the most preferred. |
| **api\_key** string | | Token used to authenticate with the API. Can also be specified via K8S\_AUTH\_API\_KEY environment variable. |
| **bootloader** string | | Specify the bootloader of the virtual machine. All virtual machines use BIOS by default for booting. |
| **ca\_cert** path | | Path to a CA certificate used to authenticate with the API. The full certificate chain must be provided to avoid certificate validation errors. Can also be specified via K8S\_AUTH\_SSL\_CA\_CERT environment variable.
aliases: ssl\_ca\_cert |
| **client\_cert** path | | Path to a certificate used to authenticate with the API. Can also be specified via K8S\_AUTH\_CERT\_FILE environment variable.
aliases: cert\_file |
| **client\_key** path | | Path to a key file used to authenticate with the API. Can also be specified via K8S\_AUTH\_KEY\_FILE environment variable.
aliases: key\_file |
| **cloud\_init\_nocloud** dictionary | | Represents a cloud-init NoCloud user-data source. The NoCloud data will be added as a disk to the virtual machine. A proper cloud-init installation is required inside the guest. More information <https://kubevirt.io/api-reference/master/definitions.html#_v1_cloudinitnocloudsource>
|
| **context** string | | The name of a context found in the config file. Can also be specified via K8S\_AUTH\_CONTEXT environment variable. |
| **cpu\_cores** integer | | Number of CPU cores. |
| **cpu\_features** list / elements=string | | List of dictionary to fine-tune features provided by the selected CPU model.
*Note*: Policy attribute can either be omitted or contain one of the following policies: force, require, optional, disable, forbid.
*Note*: In case a policy is omitted for a feature, it will default to require. More information about policies: <https://libvirt.org/formatdomain.html#elementsCPU>
|
| **cpu\_limit** integer | | Is converted to its millicore value and multiplied by 100. The resulting value is the total amount of CPU time that a container can use every 100ms. A virtual machine cannot use more than its share of CPU time during this interval. |
| **cpu\_model** string | | CPU model. You can check list of available models here: <https://github.com/libvirt/libvirt/blob/master/src/cpu_map/index.xml>.
*Note:* User can define default CPU model via as *default-cpu-model* in *kubevirt-config* *ConfigMap*, if not set *host-model* is used.
*Note:* Be sure that node CPU model where you run a VM, has the same or higher CPU family.
*Note:* If CPU model wasn't defined, the VM will have CPU model closest to one that used on the node where the VM is running. |
| **cpu\_shares** integer | | Specify CPU shares. |
| **disks** list / elements=string | | List of dictionaries which specify disks of the virtual machine. A disk can be made accessible via four different types: *disk*, *lun*, *cdrom*, *floppy*. All possible configuration options are available in <https://kubevirt.io/api-reference/master/definitions.html#_v1_disk>
Each disk must have specified a *volume* that declares which volume type of the disk All possible configuration options of volume are available in <https://kubevirt.io/api-reference/master/definitions.html#_v1_volume>. |
| **force** boolean | **Choices:*** **no** ←
* yes
| If set to `no`, and *state* is `present`, an existing object will be replaced. |
| **headless** string | | Specify if the virtual machine should have attached a minimal Video and Graphics device configuration. By default a minimal Video and Graphics device configuration will be applied to the VirtualMachineInstance. The video device is vga compatible and comes with a memory size of 16 MB. |
| **host** string | | Provide a URL for accessing the API. Can also be specified via K8S\_AUTH\_HOST environment variable. |
| **hostname** string | | Specifies the hostname of the virtual machine. The hostname will be set either by dhcp, cloud-init if configured or virtual machine name will be used. |
| **hugepage\_size** string | | Specify huge page size. |
| **interfaces** list / elements=string | | An interface defines a virtual network interface of a virtual machine (also called a frontend). All possible configuration options interfaces are available in <https://kubevirt.io/api-reference/master/definitions.html#_v1_interface>
Each interface must have specified a *network* that declares which logical or physical device it is connected to (also called as backend). All possible configuration options of network are available in <https://kubevirt.io/api-reference/master/definitions.html#_v1_network>. |
| **kubeconfig** path | | Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the openshift client will attempt to load the default configuration file from *~/.kube/config.json*. Can also be specified via K8S\_AUTH\_KUBECONFIG environment variable. |
| **labels** dictionary | | Labels are key/value pairs that are attached to virtual machines. Labels are intended to be used to specify identifying attributes of virtual machines that are meaningful and relevant to users, but do not directly imply semantics to the core system. Labels can be used to organize and to select subsets of virtual machines. Labels can be attached to virtual machines at creation time and subsequently added and modified at any time. More on labels that are used for internal implementation <https://kubevirt.io/user-guide/#/misc/annotations_and_labels>
|
| **machine\_type** string | | QEMU machine type is the actual chipset of the virtual machine. |
| **memory** string | | The amount of memory to be requested by virtual machine. For example 1024Mi. |
| **memory\_limit** string | | The maximum memory to be used by virtual machine. For example 1024Mi. |
| **merge\_type** list / elements=string | **Choices:*** json
* merge
* strategic-merge
| Whether to override the default patch merge approach with a specific type. If more than one merge type is given, the merge types will be tried in order. Defaults to `['strategic-merge', 'merge']`, which is ideal for using the same parameters on resource kinds that combine Custom Resources and built-in resources, as Custom Resource Definitions typically aren't updatable by the usual strategic merge. See <https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment>
|
| **name** string / required | | Name of the virtual machine replica set. |
| **namespace** string / required | | Namespace where the virtual machine replica set exists. |
| **node\_affinity** dictionary | | Describes vm affinity scheduling rules e.g. co-locate this vm in the same node, zone, etc. as some other vms |
| | **hard** dictionary | | If the affinity requirements specified by this field are not met at scheduling time, the vm will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during vm execution (e.g. due to an update), the system may or may not try to eventually evict the vm from its node. |
| | **soft** dictionary | | The scheduler will prefer to schedule vms to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding `weight` to the sum if the node matches the corresponding match\_expressions; the nodes with the highest sum are the most preferred. |
| **password** string | | Provide a password for authenticating with the API. Can also be specified via K8S\_AUTH\_PASSWORD environment variable. Please read the description of the `username` option for a discussion of when this option is applicable. |
| **persist\_config** boolean | **Choices:*** no
* yes
| Whether or not to save the kube config refresh tokens. Can also be specified via K8S\_AUTH\_PERSIST\_CONFIG environment variable. When the k8s context is using a user credentials with refresh tokens (like oidc or gke/gcloud auth), the token is refreshed by the k8s python client library but not saved by default. So the old refresh token can expire and the next auth might fail. Setting this flag to true will tell the k8s python client to save the new refresh token to the kube config file. Default to false. Please note that the current version of the k8s python client library does not support setting this flag to True yet. The fix for this k8s python library is here: https://github.com/kubernetes-client/python-base/pull/169 |
| **proxy** string | | The URL of an HTTP proxy to use for the connection. Can also be specified via K8S\_AUTH\_PROXY environment variable. Please note that this module does not pick up typical proxy settings from the environment (e.g. HTTP\_PROXY). |
| **replicas** integer | | Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Replicas defaults to 1 if newly created replica set. |
| **resource\_definition** dictionary | | A partial YAML definition of the object being created/updated. Here you can define Kubernetes resource parameters not covered by this module's parameters. NOTE: *resource\_definition* has lower priority than module parameters. If you try to define e.g. *metadata.namespace* here, that value will be ignored and *namespace* used instead.
aliases: definition, inline |
| **selector** dictionary / required | | Selector is a label query over a set of virtual machine. |
| **smbios\_uuid** string | | In order to provide a consistent view on the virtualized hardware for the guest OS, the SMBIOS UUID can be set. |
| **state** string | **Choices:*** **present** ←
* absent
| Create or delete virtual machine replica sets. |
| **subdomain** string | | If specified, the fully qualified virtual machine hostname will be hostname.subdomain.namespace.svc.cluster\_domain. If not specified, the virtual machine will not have a domain name at all. The DNS entry will resolve to the virtual machine, no matter if the virtual machine itself can pick up a hostname. |
| **tablets** list / elements=string | | Specify tablets to be used as input devices |
| **username** string | | Provide a username for authenticating with the API. Can also be specified via K8S\_AUTH\_USERNAME environment variable. Please note that this only works with clusters configured to use HTTP Basic Auth. If your cluster has a different form of authentication (e.g. OAuth2 in OpenShift), this option will not work as expected and you should look into the `k8s_auth` module, as that might do what you need. |
| **validate\_certs** boolean | **Choices:*** no
* yes
| Whether or not to verify the API server's SSL certificates. Can also be specified via K8S\_AUTH\_VERIFY\_SSL environment variable.
aliases: verify\_ssl |
| **wait** boolean | **Choices:*** no
* **yes** ←
|
*True* if the module should wait for the resource to get into desired state. |
| **wait\_sleep** string | **Default:**5 | Number of seconds to sleep between checks. |
| **wait\_timeout** integer | **Default:**120 | The amount of time in seconds the module should wait for the resource to get into desired state. |
Notes
-----
Note
* The OpenShift Python client wraps the K8s Python client, providing full access to all of the APIS and models available on both platforms. For API version details and additional information visit <https://github.com/openshift/openshift-restclient-python>
* To avoid SSL certificate validation errors when `validate_certs` is *True*, the full certificate chain for the API server must be provided via `ca_cert` or in the kubeconfig file.
* In order to use this module you have to install Openshift Python SDK. To ensure it’s installed with correct version you can create the following task: *pip: name=openshift>=0.8.2*
Examples
--------
```
- name: Create virtual machine replica set 'myvmir'
community.kubevirt.kubevirt_rs:
state: present
name: myvmir
namespace: vms
wait: true
replicas: 3
memory: 64M
labels:
myvmi: myvmi
selector:
matchLabels:
myvmi: myvmi
disks:
- name: containerdisk
volume:
containerDisk:
image: kubevirt/cirros-container-disk-demo:latest
path: /custom-disk/cirros.img
disk:
bus: virtio
- name: Remove virtual machine replica set 'myvmir'
community.kubevirt.kubevirt_rs:
state: absent
name: myvmir
namespace: vms
wait: 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 |
| --- | --- | --- |
| **kubevirt\_rs** complex | success | The virtual machine virtual machine replica set managed by the user. This dictionary contains all values returned by the KubeVirt API all options are described here <https://kubevirt.io/api-reference/master/definitions.html#_v1_virtualmachineinstance>
|
### Authors
* KubeVirt Team (@kubevirt)
ansible community.kubevirt.kubevirt – KubeVirt inventory source community.kubevirt.kubevirt – KubeVirt inventory source
=======================================================
Note
This plugin is part of the [community.kubevirt collection](https://galaxy.ansible.com/community/kubevirt) (version 1.0.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 community.kubevirt`.
To use it in a playbook, specify: `community.kubevirt.kubevirt`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Fetch running VirtualMachines for one or more namespaces.
* Groups by namespace, namespace\_vms and labels.
* Uses kubevirt.(yml|yaml) YAML configuration file to set parameter values.
Requirements
------------
The below requirements are needed on the local controller node that executes this inventory.
* openshift >= 0.6
* PyYAML >= 3.11
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **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. |
| **connections** list / elements=string | | | Optional list of cluster connection settings. If no connections are provided, the default *~/.kube/config* and active context will be used, and objects will be returned for all namespaces the active user is authorized to access. |
| | **annotation\_variable** string | **Default:**"ansible" | | Specify the name of the annotation which provides data, which should be used as inventory host variables. Note, that the value in ansible annotations should be json. |
| | **api\_key** string | | | Token used to authenticate with the API. Can also be specified via K8S\_AUTH\_API\_KEY environment variable. |
| | **api\_version** string | | | Specify the KubeVirt API version. |
| | **cert\_file** string | | | Path to a certificate used to authenticate with the API. Can also be specified via K8S\_AUTH\_CERT\_FILE environment variable. |
| | **context** string | | | The name of a context found in the config file. Can also be specified via K8S\_AUTH\_CONTEXT environment variable. |
| | **host** string | | | Provide a URL for accessing the API. Can also be specified via K8S\_AUTH\_HOST environment variable. |
| | **key\_file** string | | | Path to a key file used to authenticate with the API. Can also be specified via K8S\_AUTH\_HOST environment variable. |
| | **kubeconfig** string | | | Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the OpenShift client will attempt to load the default configuration file from *~/.kube/config.json*. Can also be specified via K8S\_AUTH\_KUBECONFIG environment variable. |
| | **name** string | | | Optional name to assign to the cluster. If not provided, a name is constructed from the server and port. |
| | **namespaces** list / elements=string | | | List of namespaces. If not specified, will fetch all virtual machines for all namespaces user is authorized to access. |
| | **network\_name** string | | | In case of multiple network attached to virtual machine, define which interface should be returned as primary IP address.
aliases: interface\_name |
| | **password** string | | | Provide a password for authenticating with the API. Can also be specified via K8S\_AUTH\_PASSWORD environment variable. |
| | **ssl\_ca\_cert** string | | | Path to a CA certificate used to authenticate with the API. Can also be specified via K8S\_AUTH\_SSL\_CA\_CERT environment variable. |
| | **username** string | | | Provide a username for authenticating with the API. Can also be specified via K8S\_AUTH\_USERNAME environment variable. |
| | **verify\_ssl** boolean | **Choices:*** no
* yes
| | Whether or not to verify the API server's SSL certificates. Can also be specified via K8S\_AUTH\_VERIFY\_SSL environment variable. |
| **groups** dictionary | **Default:**{} | | Add hosts to group based on Jinja2 conditionals. |
| **host\_format** string | **Default:**"{namespace}-{name}-{uid}" | | Specify the format of the host in the inventory group. |
| **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:*** kubevirt
* community.general.kubevirt
* community.kubevirt.kubevirt
| | token that ensures this is a source file for the 'kubevirt' 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. |
| **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
--------
```
# File must be named kubevirt.yaml or kubevirt.yml
# Authenticate with token, and return all virtual machines for all namespaces
plugin: community.kubevirt.kubevirt
connections:
- host: https://kubevirt.io
token: xxxxxxxxxxxxxxxx
ssl_verify: false
# Use default config (~/.kube/config) file and active context, and return vms with interfaces
# connected to network myovsnetwork and from namespace vms
plugin: community.kubevirt.kubevirt
connections:
- namespaces:
- vms
network_name: myovsnetwork
```
### Authors
* KubeVirt Team (@kubevirt)
| programming_docs |
ansible community.kubevirt.kubevirt_pvc – Manage PVCs on Kubernetes community.kubevirt.kubevirt\_pvc – Manage PVCs on Kubernetes
============================================================
Note
This plugin is part of the [community.kubevirt collection](https://galaxy.ansible.com/community/kubevirt) (version 1.0.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 community.kubevirt`.
To use it in a playbook, specify: `community.kubevirt.kubevirt_pvc`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Use Openshift Python SDK to manage PVCs on Kubernetes
* Support Containerized Data Importer out of the box
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* openshift >= 0.8.2
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_modes** list / elements=string | | Contains the desired access modes the volume should have. More info: <https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes>
|
| **annotations** dictionary | | Annotations attached to this object. <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/> |
| **api\_key** string | | Token used to authenticate with the API. Can also be specified via K8S\_AUTH\_API\_KEY environment variable. |
| **ca\_cert** path | | Path to a CA certificate used to authenticate with the API. The full certificate chain must be provided to avoid certificate validation errors. Can also be specified via K8S\_AUTH\_SSL\_CA\_CERT environment variable.
aliases: ssl\_ca\_cert |
| **cdi\_source** dictionary | | If data is to be copied onto the PVC using the Containerized Data Importer you can specify the source of the data (along with any additional configuration) as well as it's format. Valid source types are: blank, http, s3, registry, pvc and upload. The last one requires using the [community.kubevirt.kubevirt\_cdi\_upload](kubevirt_cdi_upload_module) module to actually perform an upload. Source data format is specified using the optional *content\_type*. Valid options are `kubevirt` (default; raw image) and `archive` (tar.gz). This uses the DataVolume source syntax: <https://github.com/kubevirt/containerized-data-importer/blob/master/doc/datavolumes.md#https3registry-source>
|
| **client\_cert** path | | Path to a certificate used to authenticate with the API. Can also be specified via K8S\_AUTH\_CERT\_FILE environment variable.
aliases: cert\_file |
| **client\_key** path | | Path to a key file used to authenticate with the API. Can also be specified via K8S\_AUTH\_KEY\_FILE environment variable.
aliases: key\_file |
| **context** string | | The name of a context found in the config file. Can also be specified via K8S\_AUTH\_CONTEXT environment variable. |
| **force** boolean | **Choices:*** **no** ←
* yes
| If set to `True`, and *state* is `present`, an existing object will be replaced. |
| **host** string | | Provide a URL for accessing the API. Can also be specified via K8S\_AUTH\_HOST environment variable. |
| **kubeconfig** path | | Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the openshift client will attempt to load the default configuration file from *~/.kube/config.json*. Can also be specified via K8S\_AUTH\_KUBECONFIG environment variable. |
| **labels** dictionary | | Labels attached to this object. <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/> |
| **merge\_type** list / elements=string | **Choices:*** json
* merge
* strategic-merge
| Whether to override the default patch merge approach with a specific type. This defaults to `['strategic-merge', 'merge']`, which is ideal for using the same parameters on resource kinds that combine Custom Resources and built-in resources. See <https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment>
If more than one merge\_type is given, the merge\_types will be tried in order |
| **name** string / required | | Use to specify a PVC object name. |
| **namespace** string / required | | Use to specify a PVC object namespace. |
| **password** string | | Provide a password for authenticating with the API. Can also be specified via K8S\_AUTH\_PASSWORD environment variable. Please read the description of the `username` option for a discussion of when this option is applicable. |
| **persist\_config** boolean | **Choices:*** no
* yes
| Whether or not to save the kube config refresh tokens. Can also be specified via K8S\_AUTH\_PERSIST\_CONFIG environment variable. When the k8s context is using a user credentials with refresh tokens (like oidc or gke/gcloud auth), the token is refreshed by the k8s python client library but not saved by default. So the old refresh token can expire and the next auth might fail. Setting this flag to true will tell the k8s python client to save the new refresh token to the kube config file. Default to false. Please note that the current version of the k8s python client library does not support setting this flag to True yet. The fix for this k8s python library is here: https://github.com/kubernetes-client/python-base/pull/169 |
| **proxy** string | | The URL of an HTTP proxy to use for the connection. Can also be specified via K8S\_AUTH\_PROXY environment variable. Please note that this module does not pick up typical proxy settings from the environment (e.g. HTTP\_PROXY). |
| **resource\_definition** dictionary | | A partial YAML definition of the PVC object being created/updated. Here you can define Kubernetes PVC Resource parameters not covered by this module's parameters. NOTE: *resource\_definition* has lower priority than module parameters. If you try to define e.g. *metadata.namespace* here, that value will be ignored and *namespace* used instead.
aliases: definition, inline |
| **selector** dictionary | | A label query over volumes to consider for binding. <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/> |
| **size** string | | How much storage to allocate to the PVC.
aliases: storage |
| **state** string | **Choices:*** **present** ←
* absent
| Determines if an object should be created, patched, or deleted. When set to `present`, an object will be created, if it does not already exist. If set to `absent`, an existing object will be deleted. If set to `present`, an existing object will be patched, if its attributes differ from those specified using module options and *resource\_definition*. |
| **storage\_class\_name** string | | Name of the StorageClass required by the claim. More info: <https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1>
|
| **username** string | | Provide a username for authenticating with the API. Can also be specified via K8S\_AUTH\_USERNAME environment variable. Please note that this only works with clusters configured to use HTTP Basic Auth. If your cluster has a different form of authentication (e.g. OAuth2 in OpenShift), this option will not work as expected and you should look into the `k8s_auth` module, as that might do what you need. |
| **validate\_certs** boolean | **Choices:*** no
* yes
| Whether or not to verify the API server's SSL certificates. Can also be specified via K8S\_AUTH\_VERIFY\_SSL environment variable.
aliases: verify\_ssl |
| **volume\_mode** string | | This defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. This is an alpha feature of kubernetes and may change in the future. |
| **volume\_name** string | | This is the binding reference to the PersistentVolume backing this claim. |
| **wait** boolean | **Choices:*** **no** ←
* yes
| If set, this module will wait for the PVC to become bound and CDI (if enabled) to finish its operation before returning. Used only if *state* set to `present`. Unless used in conjunction with *cdi\_source*, this might result in a timeout, as clusters may be configured to not bind PVCs until first usage. |
| **wait\_timeout** integer | **Default:**300 | Specifies how much time in seconds to wait for PVC creation to complete if *wait* option is enabled. Default value is reasonably high due to an expectation that CDI might take a while to finish its operation. |
Notes
-----
Note
* The OpenShift Python client wraps the K8s Python client, providing full access to all of the APIS and models available on both platforms. For API version details and additional information visit <https://github.com/openshift/openshift-restclient-python>
* To avoid SSL certificate validation errors when `validate_certs` is *True*, the full certificate chain for the API server must be provided via `ca_cert` or in the kubeconfig file.
Examples
--------
```
- name: Create a PVC and import data from an external source
community.kubevirt.kubevirt_pvc:
name: pvc1
namespace: default
size: 100Mi
access_modes:
- ReadWriteOnce
cdi_source:
http:
url: https://www.source.example/path/of/data/vm.img
# If the URL points to a tar.gz containing the disk image, uncomment the line below:
#content_type: archive
- name: Create a PVC as a clone from a different PVC
community.kubevirt.kubevirt_pvc:
name: pvc2
namespace: default
size: 100Mi
access_modes:
- ReadWriteOnce
cdi_source:
pvc:
namespace: source-ns
name: source-pvc
- name: Create a PVC ready for data upload
community.kubevirt.kubevirt_pvc:
name: pvc3
namespace: default
size: 100Mi
access_modes:
- ReadWriteOnce
cdi_source:
upload: yes
# You need the kubevirt_cdi_upload module to actually upload something
- name: Create a PVC with a blank raw image
community.kubevirt.kubevirt_pvc:
name: pvc4
namespace: default
size: 100Mi
access_modes:
- ReadWriteOnce
cdi_source:
blank: yes
- name: Create a PVC and fill it with data from a container
community.kubevirt.kubevirt_pvc:
name: pvc5
namespace: default
size: 100Mi
access_modes:
- ReadWriteOnce
cdi_source:
registry:
url: "docker://kubevirt/fedora-cloud-registry-disk-demo"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **result** complex | success | The created, patched, or otherwise present object. Will be empty in the case of a deletion. |
| | **api\_version** string | success | The versioned schema of this representation of an object. |
| | **duration** integer | when `wait` is true | elapsed time of task in seconds **Sample:** 48 |
| | **items** list / elements=string | when resource\_definition or src contains list of objects | Returned only when multiple yaml documents are passed to src or resource\_definition |
| | **kind** string | success | Represents the REST resource this object represents. |
| | **metadata** complex | success | Standard object metadata. Includes name, namespace, annotations, labels, etc. |
| | **spec** complex | success | Specific attributes of the object. Will vary based on the *api\_version* and *kind*. |
| | **status** complex | success | Current status details for the object. |
### Authors
* KubeVirt Team (@kubevirt)
ansible community.kubevirt.kubevirt_template – Manage KubeVirt templates community.kubevirt.kubevirt\_template – Manage KubeVirt templates
=================================================================
Note
This plugin is part of the [community.kubevirt collection](https://galaxy.ansible.com/community/kubevirt) (version 1.0.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 community.kubevirt`.
To use it in a playbook, specify: `community.kubevirt.kubevirt_template`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Use Openshift Python SDK to manage the state of KubeVirt templates.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* openshift >= 0.8.2
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_key** string | | Token used to authenticate with the API. Can also be specified via K8S\_AUTH\_API\_KEY environment variable. |
| **ca\_cert** path | | Path to a CA certificate used to authenticate with the API. The full certificate chain must be provided to avoid certificate validation errors. Can also be specified via K8S\_AUTH\_SSL\_CA\_CERT environment variable.
aliases: ssl\_ca\_cert |
| **client\_cert** path | | Path to a certificate used to authenticate with the API. Can also be specified via K8S\_AUTH\_CERT\_FILE environment variable.
aliases: cert\_file |
| **client\_key** path | | Path to a key file used to authenticate with the API. Can also be specified via K8S\_AUTH\_KEY\_FILE environment variable.
aliases: key\_file |
| **context** string | | The name of a context found in the config file. Can also be specified via K8S\_AUTH\_CONTEXT environment variable. |
| **default\_disk** dictionary | | The goal of default disk is to define what kind of disk is supported by the OS mainly in terms of bus (ide, scsi, sata, virtio, ...) The `default_disk` parameter define configuration overlay for disks that will be applied on top of disks during virtual machine creation to define global compatibility and/or performance defaults defined here. This is parameter can be used only when kubevirt addon is installed on your openshift cluster. |
| **default\_network** dictionary | | The goal of default network is similar to *default\_volume* and should be used as a template that specifies performance and connection parameters (L2 bridge for example) The `default_network` parameter define configuration overlay for networks that will be applied on top of networks during virtual machine creation to define global compatibility and/or performance defaults defined here. This is parameter can be used only when kubevirt addon is installed on your openshift cluster. |
| **default\_nic** dictionary | | The goal of default network is similar to *default\_disk* and should be used as a template to ensure OS compatibility and performance. The `default_nic` parameter define configuration overlay for nic that will be applied on top of nics during virtual machine creation to define global compatibility and/or performance defaults defined here. This is parameter can be used only when kubevirt addon is installed on your openshift cluster. |
| **default\_volume** dictionary | | The goal of default volume is to be able to configure mostly performance parameters like caches if those are exposed by the underlying volume implementation. The `default_volume` parameter define configuration overlay for volumes that will be applied on top of volumes during virtual machine creation to define global compatibility and/or performance defaults defined here. This is parameter can be used only when kubevirt addon is installed on your openshift cluster. |
| **description** string | | A description of the template. Include enough detail that the user will understand what is being deployed... and any caveats they need to know before deploying. It should also provide links to additional information, such as a README file." |
| **display\_name** string | | A brief, user-friendly name, which can be employed by user interfaces. |
| **documentation\_url** string | | A URL referencing further documentation for the template. |
| **editable** list / elements=string | | Extension for hinting at which elements should be considered editable. List of jsonpath selectors. The jsonpath root is the objects: element of the template. This is parameter can be used only when kubevirt addon is installed on your openshift cluster. |
| **force** boolean | **Choices:*** **no** ←
* yes
| If set to `yes`, and *state* is `present`, an existing object will be replaced. |
| **host** string | | Provide a URL for accessing the API. Can also be specified via K8S\_AUTH\_HOST environment variable. |
| **icon\_class** string | | An icon to be displayed with your template in the web console. Choose from our existing logo icons when possible. You can also use icons from FontAwesome. Alternatively, provide icons through CSS customizations that can be added to an OpenShift Container Platform cluster that uses your template. You must specify an icon class that exists, or it will prevent falling back to the generic icon. |
| **kubeconfig** path | | Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the openshift client will attempt to load the default configuration file from *~/.kube/config.json*. Can also be specified via K8S\_AUTH\_KUBECONFIG environment variable. |
| **long\_description** string | | Additional template description. This may be displayed by the service catalog, for example. |
| **merge\_type** list / elements=string | **Choices:*** json
* merge
* strategic-merge
| Whether to override the default patch merge approach with a specific type. By default, the strategic merge will typically be used. |
| **name** string / required | | Name of the Template object. |
| **namespace** string / required | | Namespace where the Template object exists. |
| **objects** list / elements=string | | List of any valid API objects, such as a *DeploymentConfig*, *Service*, etc. The object will be created exactly as defined here, with any parameter values substituted in prior to creation. The definition of these objects can reference parameters defined earlier. As part of the list user can pass also *VirtualMachine* kind. When passing *VirtualMachine* user must use Ansible structure of the parameters not the Kubernetes API structure. For more information please take a look at [community.kubevirt.kubevirt\_vm](kubevirt_vm_module) module and at EXAMPLES section, where you can see example. |
| **parameters** list / elements=string | | Parameters allow a value to be supplied by the user or generated when the template is instantiated. Then, that value is substituted wherever the parameter is referenced. References can be defined in any field in the objects list field. This is useful for generating random passwords or allowing the user to supply a host name or other user-specific value that is required to customize the template. More information can be found at: <https://docs.openshift.com/container-platform/3.6/dev_guide/templates.html#writing-parameters>
|
| **password** string | | Provide a password for authenticating with the API. Can also be specified via K8S\_AUTH\_PASSWORD environment variable. Please read the description of the `username` option for a discussion of when this option is applicable. |
| **persist\_config** boolean | **Choices:*** no
* yes
| Whether or not to save the kube config refresh tokens. Can also be specified via K8S\_AUTH\_PERSIST\_CONFIG environment variable. When the k8s context is using a user credentials with refresh tokens (like oidc or gke/gcloud auth), the token is refreshed by the k8s python client library but not saved by default. So the old refresh token can expire and the next auth might fail. Setting this flag to true will tell the k8s python client to save the new refresh token to the kube config file. Default to false. Please note that the current version of the k8s python client library does not support setting this flag to True yet. The fix for this k8s python library is here: https://github.com/kubernetes-client/python-base/pull/169 |
| **provider\_display\_name** string | | The name of the person or organization providing the template. |
| **proxy** string | | The URL of an HTTP proxy to use for the connection. Can also be specified via K8S\_AUTH\_PROXY environment variable. Please note that this module does not pick up typical proxy settings from the environment (e.g. HTTP\_PROXY). |
| **state** string | **Choices:*** absent
* **present** ←
| Determines if an object should be created, patched, or deleted. When set to `present`, an object will be created, if it does not already exist. If set to `absent`, an existing object will be deleted. If set to `present`, an existing object will be patched, if its attributes differ from those specified using *resource\_definition* or *src*. |
| **support\_url** string | | A URL where support can be obtained for the template. |
| **username** string | | Provide a username for authenticating with the API. Can also be specified via K8S\_AUTH\_USERNAME environment variable. Please note that this only works with clusters configured to use HTTP Basic Auth. If your cluster has a different form of authentication (e.g. OAuth2 in OpenShift), this option will not work as expected and you should look into the `k8s_auth` module, as that might do what you need. |
| **validate\_certs** boolean | **Choices:*** no
* yes
| Whether or not to verify the API server's SSL certificates. Can also be specified via K8S\_AUTH\_VERIFY\_SSL environment variable.
aliases: verify\_ssl |
| **version** string | | Template structure version. This is parameter can be used only when kubevirt addon is installed on your openshift cluster. |
Notes
-----
Note
* The OpenShift Python client wraps the K8s Python client, providing full access to all of the APIS and models available on both platforms. For API version details and additional information visit <https://github.com/openshift/openshift-restclient-python>
* To avoid SSL certificate validation errors when `validate_certs` is *True*, the full certificate chain for the API server must be provided via `ca_cert` or in the kubeconfig file.
Examples
--------
```
- name: Create template 'mytemplate'
community.kubevirt.kubevirt_template:
state: present
name: myvmtemplate
namespace: templates
display_name: Generic cirros template
description: Basic cirros template
long_description: Verbose description of cirros template
provider_display_name: Just Be Cool, Inc.
documentation_url: http://theverycoolcompany.com
support_url: http://support.theverycoolcompany.com
icon_class: icon-linux
default_disk:
disk:
bus: virtio
default_nic:
model: virtio
default_network:
resource:
resourceName: bridge.network.kubevirt.io/cnvmgmt
default_volume:
containerDisk:
image: kubevirt/cirros-container-disk-demo:latest
objects:
- name: ${NAME}
kind: VirtualMachine
memory: ${MEMORY_SIZE}
state: present
namespace: vms
parameters:
- name: NAME
description: VM name
generate: expression
from: 'vm-[A-Za-z0-9]{8}'
- name: MEMORY_SIZE
description: Memory size
value: 1Gi
- name: Remove template 'myvmtemplate'
community.kubevirt.kubevirt_template:
state: absent
name: myvmtemplate
namespace: templates
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **kubevirt\_template** complex | success | The template dictionary specification returned by the API. |
### Authors
* KubeVirt Team (@kubevirt)
| programming_docs |
ansible community.kubevirt.kubevirt_cdi_upload – Upload local VM images to CDI Upload Proxy. community.kubevirt.kubevirt\_cdi\_upload – Upload local VM images to CDI Upload Proxy.
======================================================================================
Note
This plugin is part of the [community.kubevirt collection](https://galaxy.ansible.com/community/kubevirt) (version 1.0.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 community.kubevirt`.
To use it in a playbook, specify: `community.kubevirt.kubevirt_cdi_upload`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Use Openshift Python SDK to create UploadTokenRequest objects.
* Transfer contents of local files to the CDI Upload Proxy.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.7
* openshift >= 0.8.2
* requests >= 2.0.0
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_key** string | | Token used to authenticate with the API. Can also be specified via K8S\_AUTH\_API\_KEY environment variable. |
| **ca\_cert** path | | Path to a CA certificate used to authenticate with the API. The full certificate chain must be provided to avoid certificate validation errors. Can also be specified via K8S\_AUTH\_SSL\_CA\_CERT environment variable.
aliases: ssl\_ca\_cert |
| **client\_cert** path | | Path to a certificate used to authenticate with the API. Can also be specified via K8S\_AUTH\_CERT\_FILE environment variable.
aliases: cert\_file |
| **client\_key** path | | Path to a key file used to authenticate with the API. Can also be specified via K8S\_AUTH\_KEY\_FILE environment variable.
aliases: key\_file |
| **context** string | | The name of a context found in the config file. Can also be specified via K8S\_AUTH\_CONTEXT environment variable. |
| **host** string | | Provide a URL for accessing the API. Can also be specified via K8S\_AUTH\_HOST environment variable. |
| **kubeconfig** path | | Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the openshift client will attempt to load the default configuration file from *~/.kube/config.json*. Can also be specified via K8S\_AUTH\_KUBECONFIG environment variable. |
| **merge\_type** list / elements=string | **Choices:*** json
* merge
* strategic-merge
| Whether to override the default patch merge approach with a specific type. By default, the strategic merge will typically be used. |
| **password** string | | Provide a password for authenticating with the API. Can also be specified via K8S\_AUTH\_PASSWORD environment variable. Please read the description of the `username` option for a discussion of when this option is applicable. |
| **path** string | | Path of local image file to transfer. |
| **persist\_config** boolean | **Choices:*** no
* yes
| Whether or not to save the kube config refresh tokens. Can also be specified via K8S\_AUTH\_PERSIST\_CONFIG environment variable. When the k8s context is using a user credentials with refresh tokens (like oidc or gke/gcloud auth), the token is refreshed by the k8s python client library but not saved by default. So the old refresh token can expire and the next auth might fail. Setting this flag to true will tell the k8s python client to save the new refresh token to the kube config file. Default to false. Please note that the current version of the k8s python client library does not support setting this flag to True yet. The fix for this k8s python library is here: https://github.com/kubernetes-client/python-base/pull/169 |
| **proxy** string | | The URL of an HTTP proxy to use for the connection. Can also be specified via K8S\_AUTH\_PROXY environment variable. Please note that this module does not pick up typical proxy settings from the environment (e.g. HTTP\_PROXY). |
| **pvc\_name** string / required | | Use to specify the name of the target PersistentVolumeClaim. |
| **pvc\_namespace** string / required | | Use to specify the namespace of the target PersistentVolumeClaim. |
| **upload\_host** string | | URL containing the host and port on which the CDI Upload Proxy is available. More info: <https://github.com/kubevirt/containerized-data-importer/blob/master/doc/upload.md#expose-cdi-uploadproxy-service>
|
| **upload\_host\_validate\_certs** boolean | **Choices:*** no
* **yes** ←
| Whether or not to verify the CDI Upload Proxy's SSL certificates against your system's CA trust store.
aliases: upload\_host\_verify\_ssl |
| **username** string | | Provide a username for authenticating with the API. Can also be specified via K8S\_AUTH\_USERNAME environment variable. Please note that this only works with clusters configured to use HTTP Basic Auth. If your cluster has a different form of authentication (e.g. OAuth2 in OpenShift), this option will not work as expected and you should look into the `k8s_auth` module, as that might do what you need. |
| **validate\_certs** boolean | **Choices:*** no
* yes
| Whether or not to verify the API server's SSL certificates. Can also be specified via K8S\_AUTH\_VERIFY\_SSL environment variable.
aliases: verify\_ssl |
Notes
-----
Note
* The OpenShift Python client wraps the K8s Python client, providing full access to all of the APIS and models available on both platforms. For API version details and additional information visit <https://github.com/openshift/openshift-restclient-python>
* To avoid SSL certificate validation errors when `validate_certs` is *True*, the full certificate chain for the API server must be provided via `ca_cert` or in the kubeconfig file.
Examples
--------
```
- name: Upload local image to pvc-vm1
community.kubevirt.kubevirt_cdi_upload:
pvc_namespace: default
pvc_name: pvc-vm1
upload_host: https://localhost:8443
upload_host_validate_certs: false
path: /tmp/cirros-0.4.0-x86_64-disk.img
```
### Authors
* KubeVirt Team (@kubevirt)
ansible community.kubevirt.kubevirt_preset – Manage KubeVirt virtual machine presets community.kubevirt.kubevirt\_preset – Manage KubeVirt virtual machine presets
=============================================================================
Note
This plugin is part of the [community.kubevirt collection](https://galaxy.ansible.com/community/kubevirt) (version 1.0.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 community.kubevirt`.
To use it in a playbook, specify: `community.kubevirt.kubevirt_preset`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Use Openshift Python SDK to manage the state of KubeVirt virtual machine presets.
Requirements
------------
The below requirements are needed on the host that executes this module.
* openshift >= 0.8.2
* python >= 2.7
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **affinity** dictionary | | Describes node affinity scheduling rules for the vm. |
| | **hard** dictionary | | If the affinity requirements specified by this field are not met at scheduling time, the vm will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during vm execution (e.g. due to a vm label update), the system may or may not try to eventually evict the vm from its node. When there are multiple elements, the lists of nodes corresponding to each `term` are intersected, i.e. all terms must be satisfied. |
| | **soft** dictionary | | The scheduler will prefer to schedule vms to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding `weight` to the sum if the node has vms which matches the corresponding `term`; the nodes with the highest sum are the most preferred. |
| **anti\_affinity** dictionary | | Describes vm anti-affinity scheduling rules e.g. avoid putting this vm in the same node, zone, etc. as some other vms. |
| | **hard** dictionary | | If the anti-affinity requirements specified by this field are not met at scheduling time, the vm will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during vm execution (e.g. due to a vm label update), the system may or may not try to eventually evict the vm from its node. When there are multiple elements, the lists of nodes corresponding to each `term` are intersected, i.e. all terms must be satisfied. |
| | **soft** dictionary | | The scheduler will prefer to schedule vms to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding `weight` to the sum if the node has vms which matches the corresponding `term`; the nodes with the highest sum are the most preferred. |
| **api\_key** string | | Token used to authenticate with the API. Can also be specified via K8S\_AUTH\_API\_KEY environment variable. |
| **bootloader** string | | Specify the bootloader of the virtual machine. All virtual machines use BIOS by default for booting. |
| **ca\_cert** path | | Path to a CA certificate used to authenticate with the API. The full certificate chain must be provided to avoid certificate validation errors. Can also be specified via K8S\_AUTH\_SSL\_CA\_CERT environment variable.
aliases: ssl\_ca\_cert |
| **client\_cert** path | | Path to a certificate used to authenticate with the API. Can also be specified via K8S\_AUTH\_CERT\_FILE environment variable.
aliases: cert\_file |
| **client\_key** path | | Path to a key file used to authenticate with the API. Can also be specified via K8S\_AUTH\_KEY\_FILE environment variable.
aliases: key\_file |
| **cloud\_init\_nocloud** dictionary | | Represents a cloud-init NoCloud user-data source. The NoCloud data will be added as a disk to the virtual machine. A proper cloud-init installation is required inside the guest. More information <https://kubevirt.io/api-reference/master/definitions.html#_v1_cloudinitnocloudsource>
|
| **context** string | | The name of a context found in the config file. Can also be specified via K8S\_AUTH\_CONTEXT environment variable. |
| **cpu\_cores** integer | | Number of CPU cores. |
| **cpu\_features** list / elements=string | | List of dictionary to fine-tune features provided by the selected CPU model.
*Note*: Policy attribute can either be omitted or contain one of the following policies: force, require, optional, disable, forbid.
*Note*: In case a policy is omitted for a feature, it will default to require. More information about policies: <https://libvirt.org/formatdomain.html#elementsCPU>
|
| **cpu\_limit** integer | | Is converted to its millicore value and multiplied by 100. The resulting value is the total amount of CPU time that a container can use every 100ms. A virtual machine cannot use more than its share of CPU time during this interval. |
| **cpu\_model** string | | CPU model. You can check list of available models here: <https://github.com/libvirt/libvirt/blob/master/src/cpu_map/index.xml>.
*Note:* User can define default CPU model via as *default-cpu-model* in *kubevirt-config* *ConfigMap*, if not set *host-model* is used.
*Note:* Be sure that node CPU model where you run a VM, has the same or higher CPU family.
*Note:* If CPU model wasn't defined, the VM will have CPU model closest to one that used on the node where the VM is running. |
| **cpu\_shares** integer | | Specify CPU shares. |
| **disks** list / elements=string | | List of dictionaries which specify disks of the virtual machine. A disk can be made accessible via four different types: *disk*, *lun*, *cdrom*, *floppy*. All possible configuration options are available in <https://kubevirt.io/api-reference/master/definitions.html#_v1_disk>
Each disk must have specified a *volume* that declares which volume type of the disk All possible configuration options of volume are available in <https://kubevirt.io/api-reference/master/definitions.html#_v1_volume>. |
| **force** boolean | **Choices:*** **no** ←
* yes
| If set to `no`, and *state* is `present`, an existing object will be replaced. |
| **headless** string | | Specify if the virtual machine should have attached a minimal Video and Graphics device configuration. By default a minimal Video and Graphics device configuration will be applied to the VirtualMachineInstance. The video device is vga compatible and comes with a memory size of 16 MB. |
| **host** string | | Provide a URL for accessing the API. Can also be specified via K8S\_AUTH\_HOST environment variable. |
| **hostname** string | | Specifies the hostname of the virtual machine. The hostname will be set either by dhcp, cloud-init if configured or virtual machine name will be used. |
| **hugepage\_size** string | | Specify huge page size. |
| **interfaces** list / elements=string | | An interface defines a virtual network interface of a virtual machine (also called a frontend). All possible configuration options interfaces are available in <https://kubevirt.io/api-reference/master/definitions.html#_v1_interface>
Each interface must have specified a *network* that declares which logical or physical device it is connected to (also called as backend). All possible configuration options of network are available in <https://kubevirt.io/api-reference/master/definitions.html#_v1_network>. |
| **kubeconfig** path | | Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the openshift client will attempt to load the default configuration file from *~/.kube/config.json*. Can also be specified via K8S\_AUTH\_KUBECONFIG environment variable. |
| **labels** dictionary | | Labels are key/value pairs that are attached to virtual machines. Labels are intended to be used to specify identifying attributes of virtual machines that are meaningful and relevant to users, but do not directly imply semantics to the core system. Labels can be used to organize and to select subsets of virtual machines. Labels can be attached to virtual machines at creation time and subsequently added and modified at any time. More on labels that are used for internal implementation <https://kubevirt.io/user-guide/#/misc/annotations_and_labels>
|
| **machine\_type** string | | QEMU machine type is the actual chipset of the virtual machine. |
| **memory** string | | The amount of memory to be requested by virtual machine. For example 1024Mi. |
| **memory\_limit** string | | The maximum memory to be used by virtual machine. For example 1024Mi. |
| **merge\_type** list / elements=string | **Choices:*** json
* merge
* strategic-merge
| Whether to override the default patch merge approach with a specific type. If more than one merge type is given, the merge types will be tried in order. Defaults to `['strategic-merge', 'merge']`, which is ideal for using the same parameters on resource kinds that combine Custom Resources and built-in resources, as Custom Resource Definitions typically aren't updatable by the usual strategic merge. See <https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment>
|
| **name** string / required | | Name of the virtual machine preset. |
| **namespace** string / required | | Namespace where the virtual machine preset exists. |
| **node\_affinity** dictionary | | Describes vm affinity scheduling rules e.g. co-locate this vm in the same node, zone, etc. as some other vms |
| | **hard** dictionary | | If the affinity requirements specified by this field are not met at scheduling time, the vm will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during vm execution (e.g. due to an update), the system may or may not try to eventually evict the vm from its node. |
| | **soft** dictionary | | The scheduler will prefer to schedule vms to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding `weight` to the sum if the node matches the corresponding match\_expressions; the nodes with the highest sum are the most preferred. |
| **password** string | | Provide a password for authenticating with the API. Can also be specified via K8S\_AUTH\_PASSWORD environment variable. Please read the description of the `username` option for a discussion of when this option is applicable. |
| **persist\_config** boolean | **Choices:*** no
* yes
| Whether or not to save the kube config refresh tokens. Can also be specified via K8S\_AUTH\_PERSIST\_CONFIG environment variable. When the k8s context is using a user credentials with refresh tokens (like oidc or gke/gcloud auth), the token is refreshed by the k8s python client library but not saved by default. So the old refresh token can expire and the next auth might fail. Setting this flag to true will tell the k8s python client to save the new refresh token to the kube config file. Default to false. Please note that the current version of the k8s python client library does not support setting this flag to True yet. The fix for this k8s python library is here: https://github.com/kubernetes-client/python-base/pull/169 |
| **proxy** string | | The URL of an HTTP proxy to use for the connection. Can also be specified via K8S\_AUTH\_PROXY environment variable. Please note that this module does not pick up typical proxy settings from the environment (e.g. HTTP\_PROXY). |
| **resource\_definition** dictionary | | A partial YAML definition of the object being created/updated. Here you can define Kubernetes resource parameters not covered by this module's parameters. NOTE: *resource\_definition* has lower priority than module parameters. If you try to define e.g. *metadata.namespace* here, that value will be ignored and *namespace* used instead.
aliases: definition, inline |
| **selector** dictionary | | Selector is a label query over a set of virtual machine preset. |
| **smbios\_uuid** string | | In order to provide a consistent view on the virtualized hardware for the guest OS, the SMBIOS UUID can be set. |
| **state** string | **Choices:*** **present** ←
* absent
| Create or delete virtual machine presets. |
| **subdomain** string | | If specified, the fully qualified virtual machine hostname will be hostname.subdomain.namespace.svc.cluster\_domain. If not specified, the virtual machine will not have a domain name at all. The DNS entry will resolve to the virtual machine, no matter if the virtual machine itself can pick up a hostname. |
| **tablets** list / elements=string | | Specify tablets to be used as input devices |
| **username** string | | Provide a username for authenticating with the API. Can also be specified via K8S\_AUTH\_USERNAME environment variable. Please note that this only works with clusters configured to use HTTP Basic Auth. If your cluster has a different form of authentication (e.g. OAuth2 in OpenShift), this option will not work as expected and you should look into the `k8s_auth` module, as that might do what you need. |
| **validate\_certs** boolean | **Choices:*** no
* yes
| Whether or not to verify the API server's SSL certificates. Can also be specified via K8S\_AUTH\_VERIFY\_SSL environment variable.
aliases: verify\_ssl |
| **wait** boolean | **Choices:*** no
* **yes** ←
|
*True* if the module should wait for the resource to get into desired state. |
| **wait\_sleep** string | **Default:**5 | Number of seconds to sleep between checks. |
| **wait\_timeout** integer | **Default:**120 | The amount of time in seconds the module should wait for the resource to get into desired state. |
Notes
-----
Note
* The OpenShift Python client wraps the K8s Python client, providing full access to all of the APIS and models available on both platforms. For API version details and additional information visit <https://github.com/openshift/openshift-restclient-python>
* To avoid SSL certificate validation errors when `validate_certs` is *True*, the full certificate chain for the API server must be provided via `ca_cert` or in the kubeconfig file.
* In order to use this module you have to install Openshift Python SDK. To ensure it’s installed with correct version you can create the following task: *pip: name=openshift>=0.8.2*
Examples
--------
```
- name: Create virtual machine preset 'vmi-preset-small'
community.kubevirt.kubevirt_preset:
state: present
name: vmi-preset-small
namespace: vms
memory: 64M
selector:
matchLabels:
kubevirt.io/vmPreset: vmi-preset-small
- name: Remove virtual machine preset 'vmi-preset-small'
community.kubevirt.kubevirt_preset:
state: absent
name: vmi-preset-small
namespace: vms
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **kubevirt\_preset** complex | success | The virtual machine preset managed by the user. This dictionary contains all values returned by the KubeVirt API all options are described here <https://kubevirt.io/api-reference/master/definitions.html#_v1_virtualmachineinstancepreset>
|
### Authors
* KubeVirt Team (@kubevirt)
| programming_docs |
ansible community.mysql.mysql_query – Run MySQL queries community.mysql.mysql\_query – Run MySQL queries
================================================
Note
This plugin is part of the [community.mysql collection](https://galaxy.ansible.com/community/mysql) (version 2.3.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 community.mysql`.
To use it in a playbook, specify: `community.mysql.mysql_query`.
New in version 0.1.0: of community.mysql
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Runs arbitrary MySQL queries.
* Pay attention, the module does not support check mode! All queries will be executed in autocommit mode.
* To run SQL queries from a file, use [community.mysql.mysql\_db](mysql_db_module#ansible-collections-community-mysql-mysql-db-module) module.
Requirements
------------
The below requirements are needed on the host that executes this module.
* PyMySQL (Python 2.7 and Python 3.X), or
* MySQLdb (Python 2.x)
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **ca\_cert** path | | The path to a Certificate Authority (CA) certificate. This option, if used, must specify the same certificate as used by the server.
aliases: ssl\_ca |
| **check\_hostname** boolean added in 1.1.0 of community.mysql | **Choices:*** no
* yes
| Whether to validate the server host name when an SSL connection is required. Corresponds to MySQL CLIs `--ssl` switch. Setting this to `false` disables hostname verification. Use with caution. Requires pymysql >= 0.7.11. This option has no effect on MySQLdb. |
| **client\_cert** path | | The path to a client public key certificate.
aliases: ssl\_cert |
| **client\_key** path | | The path to the client private key.
aliases: ssl\_key |
| **config\_file** path | **Default:**"~/.my.cnf" | Specify a config file from which user and password are to be read. |
| **connect\_timeout** integer | **Default:**30 | The connection timeout when connecting to the MySQL server. |
| **login\_db** string | | Name of database to connect to and run queries against. |
| **login\_host** string | **Default:**"localhost" | Host running the database. In some cases for local connections the *login\_unix\_socket=/path/to/mysqld/socket*, that is usually `/var/run/mysqld/mysqld.sock`, needs to be used instead of *login\_host=localhost*. |
| **login\_password** string | | The password used to authenticate with. |
| **login\_port** integer | **Default:**3306 | Port of the MySQL server. Requires *login\_host* be defined as other than localhost if login\_port is used. |
| **login\_unix\_socket** string | | The path to a Unix domain socket for local connections. |
| **login\_user** string | | The username used to authenticate with. |
| **named\_args** dictionary | | Dictionary of key-value arguments to pass to the query. Mutually exclusive with *positional\_args*. |
| **positional\_args** list / elements=string | | List of values to be passed as positional arguments to the query. Mutually exclusive with *named\_args*. |
| **query** raw / required | | SQL query to run. Multiple queries can be passed using YAML list syntax. Must be a string or YAML list containing strings. |
| **single\_transaction** boolean | **Choices:*** **no** ←
* yes
| Where passed queries run in a single transaction (`yes`) or commit them one-by-one (`no`). |
Notes
-----
Note
* Requires the PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) package installed on the remote host. The Python package may be installed with apt-get install python-pymysql (Ubuntu; see [ansible.builtin.apt](../../ansible/builtin/apt_module#ansible-collections-ansible-builtin-apt-module)) or yum install python2-PyMySQL (RHEL/CentOS/Fedora; see [ansible.builtin.yum](../../ansible/builtin/yum_module#ansible-collections-ansible-builtin-yum-module)). You can also use dnf install python2-PyMySQL for newer versions of Fedora; see [ansible.builtin.dnf](../../ansible/builtin/dnf_module#ansible-collections-ansible-builtin-dnf-module).
* Be sure you have PyMySQL or MySQLdb library installed on the target machine for the Python interpreter Ansible uses, for example, if it is Python 3, you must install the library for Python 3. You can also change the interpreter. For more information, see [https://docs.ansible.com/ansible/latest/reference\_appendices/interpreter\_discovery.html](../../../reference_appendices/interpreter_discovery).
* Both `login_password` and `login_user` are required when you are passing credentials. If none are present, the module will attempt to read the credentials from `~/.my.cnf`, and finally fall back to using the MySQL default login of ‘root’ with no password.
* If there are problems with local connections, using *login\_unix\_socket=/path/to/mysqld/socket* instead of *login\_host=localhost* might help. As an example, the default MariaDB installation of version 10.4 and later uses the unix\_socket authentication plugin by default that without using *login\_unix\_socket=/var/run/mysqld/mysqld.sock* (the default path) causes the error `Host '127.0.0.1' is not allowed to connect to this MariaDB server`.
* Alternatively, you can use the mysqlclient library instead of MySQL-python (MySQLdb) which supports both Python 2.X and Python >=3.5. See <https://pypi.org/project/mysqlclient/> how to install it.
See Also
--------
See also
[community.mysql.mysql\_db](mysql_db_module#ansible-collections-community-mysql-mysql-db-module)
The official documentation on the **community.mysql.mysql\_db** module.
Examples
--------
```
- name: Simple select query to acme db
community.mysql.mysql_query:
login_db: acme
query: SELECT * FROM orders
- name: Select query to db acme with positional arguments
community.mysql.mysql_query:
login_db: acme
query: SELECT * FROM acme WHERE id = %s AND story = %s
positional_args:
- 1
- test
- name: Select query to test_db with named_args
community.mysql.mysql_query:
login_db: test_db
query: SELECT * FROM test WHERE id = %(id_val)s AND story = %(story_val)s
named_args:
id_val: 1
story_val: test
- name: Run several insert queries against db test_db in single transaction
community.mysql.mysql_query:
login_db: test_db
query:
- INSERT INTO articles (id, story) VALUES (2, 'my_long_story')
- INSERT INTO prices (id, price) VALUES (123, '100.00')
single_transaction: 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 |
| --- | --- | --- |
| **executed\_queries** list / elements=string | always | List of executed queries. **Sample:** ['SELECT \* FROM bar', 'UPDATE bar SET id = 1 WHERE id = 2'] |
| **query\_result** list / elements=string | changed | List of lists (sublist for each query) containing dictionaries in column:value form representing returned rows. **Sample:** [[{'Column': 'Value1'}, {'Column': 'Value2'}], [{'ID': 1}, {'ID': 2}]] |
| **rowcount** list / elements=string | changed | Number of affected rows for each subquery. **Sample:** [5, 1] |
### Authors
* Andrew Klychkov (@Andersson007)
ansible Community.Mysql Community.Mysql
===============
Collection version 2.3.1
Plugin Index
------------
These are the plugins in the community.mysql collection
### Modules
* [mysql\_db](mysql_db_module#ansible-collections-community-mysql-mysql-db-module) – Add or remove MySQL databases from a remote host
* [mysql\_info](mysql_info_module#ansible-collections-community-mysql-mysql-info-module) – Gather information about MySQL servers
* [mysql\_query](mysql_query_module#ansible-collections-community-mysql-mysql-query-module) – Run MySQL queries
* [mysql\_replication](mysql_replication_module#ansible-collections-community-mysql-mysql-replication-module) – Manage MySQL replication
* [mysql\_role](mysql_role_module#ansible-collections-community-mysql-mysql-role-module) – Adds, removes, or updates a MySQL role
* [mysql\_user](mysql_user_module#ansible-collections-community-mysql-mysql-user-module) – Adds or removes a user from a MySQL database
* [mysql\_variables](mysql_variables_module#ansible-collections-community-mysql-mysql-variables-module) – Manage MySQL global variables
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible community.mysql.mysql_user – Adds or removes a user from a MySQL database community.mysql.mysql\_user – Adds or removes a user from a MySQL database
==========================================================================
Note
This plugin is part of the [community.mysql collection](https://galaxy.ansible.com/community/mysql) (version 2.3.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 community.mysql`.
To use it in a playbook, specify: `community.mysql.mysql_user`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
Synopsis
--------
* Adds or removes a user from a MySQL database.
Requirements
------------
The below requirements are needed on the host that executes this module.
* PyMySQL (Python 2.7 and Python 3.X), or
* MySQLdb (Python 2.x)
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **append\_privs** boolean | **Choices:*** **no** ←
* yes
| Append the privileges defined by priv to the existing ones for this user instead of overwriting existing ones. |
| **ca\_cert** path | | The path to a Certificate Authority (CA) certificate. This option, if used, must specify the same certificate as used by the server.
aliases: ssl\_ca |
| **check\_hostname** boolean added in 1.1.0 of community.mysql | **Choices:*** no
* yes
| Whether to validate the server host name when an SSL connection is required. Corresponds to MySQL CLIs `--ssl` switch. Setting this to `false` disables hostname verification. Use with caution. Requires pymysql >= 0.7.11. This option has no effect on MySQLdb. |
| **check\_implicit\_admin** boolean | **Choices:*** **no** ←
* yes
| Check if mysql allows login as root/nopassword before trying supplied credentials. If success, passed *login\_user*/*login\_password* will be ignored. |
| **client\_cert** path | | The path to a client public key certificate.
aliases: ssl\_cert |
| **client\_key** path | | The path to the client private key.
aliases: ssl\_key |
| **config\_file** path | **Default:**"~/.my.cnf" | Specify a config file from which user and password are to be read. |
| **connect\_timeout** integer | **Default:**30 | The connection timeout when connecting to the MySQL server. |
| **encrypted** boolean | **Choices:*** **no** ←
* yes
| Indicate that the 'password' field is a `mysql\_native\_password` hash. |
| **host** string | **Default:**"localhost" | The 'host' part of the MySQL username. |
| **host\_all** boolean | **Choices:*** **no** ←
* yes
| Override the host option, making ansible apply changes to all hostnames for a given user. This option cannot be used when creating users. |
| **login\_host** string | **Default:**"localhost" | Host running the database. In some cases for local connections the *login\_unix\_socket=/path/to/mysqld/socket*, that is usually `/var/run/mysqld/mysqld.sock`, needs to be used instead of *login\_host=localhost*. |
| **login\_password** string | | The password used to authenticate with. |
| **login\_port** integer | **Default:**3306 | Port of the MySQL server. Requires *login\_host* be defined as other than localhost if login\_port is used. |
| **login\_unix\_socket** string | | The path to a Unix domain socket for local connections. |
| **login\_user** string | | The username used to authenticate with. |
| **name** string / required | | Name of the user (role) to add or remove. |
| **password** string | | Set the user's password. |
| **plugin** string added in 0.1.0 of community.mysql | | User's plugin to authenticate (``CREATE USER user IDENTIFIED WITH plugin``). |
| **plugin\_auth\_string** string added in 0.1.0 of community.mysql | | User's plugin auth\_string (``CREATE USER user IDENTIFIED WITH plugin BY plugin\_auth\_string``). |
| **plugin\_hash\_string** string added in 0.1.0 of community.mysql | | User's plugin hash string (``CREATE USER user IDENTIFIED WITH plugin AS plugin\_hash\_string``). |
| **priv** raw | | MySQL privileges string in the format: `db.table:priv1,priv2`. Multiple privileges can be specified by separating each one using a forward slash: `db.table:priv/db.table:priv`. The format is based on MySQL `GRANT` statement. Database and table names can be quoted, MySQL-style. If column privileges are used, the `priv1,priv2` part must be exactly as returned by a `SHOW GRANT` statement. If not followed, the module will always report changes. It includes grouping columns by permission (`SELECT(col1,col2`) instead of `SELECT(col1`,SELECT(col2))). Can be passed as a dictionary (see the examples). Supports GRANTs for procedures and functions (see the examples). |
| **resource\_limits** dictionary added in 0.1.0 of community.mysql | | Limit the user for certain server resources. Provided since MySQL 5.6 / MariaDB 10.2. Available options are `MAX_QUERIES_PER_HOUR: num`, `MAX_UPDATES_PER_HOUR: num`, `MAX_CONNECTIONS_PER_HOUR: num`, `MAX_USER_CONNECTIONS: num`. Used when *state=present*, ignored otherwise. |
| **sql\_log\_bin** boolean | **Choices:*** no
* **yes** ←
| Whether binary logging should be enabled or disabled for the connection. |
| **state** string | **Choices:*** absent
* **present** ←
| Whether the user should exist. When `absent`, removes the user. |
| **tls\_requires** dictionary added in 1.0.0 of community.mysql | | Set requirement for secure transport as a dictionary of requirements (see the examples). Valid requirements are SSL, X509, SUBJECT, ISSUER, CIPHER. SUBJECT, ISSUER and CIPHER are complementary, and mutually exclusive with SSL and X509.
<https://mariadb.com/kb/en/securing-connections-for-client-and-server/#requiring-tls>. |
| **update\_password** string | **Choices:*** **always** ←
* on\_create
|
`always` will update passwords if they differ.
`on_create` will only set the password for newly created users. |
Notes
-----
Note
* MySQL server installs with default *login\_user* of `root` and no password. To secure this user as part of an idempotent playbook, you must create at least two tasks: 1) change the root user’s password, without providing any *login\_user*/*login\_password* details, 2) drop a `~/.my.cnf` file containing the new root credentials. Subsequent runs of the playbook will then succeed by reading the new credentials from the file.
* Currently, there is only support for the `mysql_native_password` encrypted password hash module.
* Supports (check\_mode).
* Requires the PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) package installed on the remote host. The Python package may be installed with apt-get install python-pymysql (Ubuntu; see [ansible.builtin.apt](../../ansible/builtin/apt_module#ansible-collections-ansible-builtin-apt-module)) or yum install python2-PyMySQL (RHEL/CentOS/Fedora; see [ansible.builtin.yum](../../ansible/builtin/yum_module#ansible-collections-ansible-builtin-yum-module)). You can also use dnf install python2-PyMySQL for newer versions of Fedora; see [ansible.builtin.dnf](../../ansible/builtin/dnf_module#ansible-collections-ansible-builtin-dnf-module).
* Be sure you have PyMySQL or MySQLdb library installed on the target machine for the Python interpreter Ansible uses, for example, if it is Python 3, you must install the library for Python 3. You can also change the interpreter. For more information, see [https://docs.ansible.com/ansible/latest/reference\_appendices/interpreter\_discovery.html](../../../reference_appendices/interpreter_discovery).
* Both `login_password` and `login_user` are required when you are passing credentials. If none are present, the module will attempt to read the credentials from `~/.my.cnf`, and finally fall back to using the MySQL default login of ‘root’ with no password.
* If there are problems with local connections, using *login\_unix\_socket=/path/to/mysqld/socket* instead of *login\_host=localhost* might help. As an example, the default MariaDB installation of version 10.4 and later uses the unix\_socket authentication plugin by default that without using *login\_unix\_socket=/var/run/mysqld/mysqld.sock* (the default path) causes the error `Host '127.0.0.1' is not allowed to connect to this MariaDB server`.
* Alternatively, you can use the mysqlclient library instead of MySQL-python (MySQLdb) which supports both Python 2.X and Python >=3.5. See <https://pypi.org/project/mysqlclient/> how to install it.
See Also
--------
See also
[community.mysql.mysql\_info](mysql_info_module#ansible-collections-community-mysql-mysql-info-module)
The official documentation on the **community.mysql.mysql\_info** module.
[MySQL access control and account management reference](https://dev.mysql.com/doc/refman/8.0/en/access-control.html)
Complete reference of the MySQL access control and account management documentation.
[MySQL provided privileges reference](https://dev.mysql.com/doc/refman/8.0/en/privileges-provided.html)
Complete reference of the MySQL provided privileges documentation.
Examples
--------
```
- name: Removes anonymous user account for localhost
community.mysql.mysql_user:
name: ''
host: localhost
state: absent
- name: Removes all anonymous user accounts
community.mysql.mysql_user:
name: ''
host_all: yes
state: absent
- name: Create database user with name 'bob' and password '12345' with all database privileges
community.mysql.mysql_user:
name: bob
password: 12345
priv: '*.*:ALL'
state: present
- name: Create database user using hashed password with all database privileges
community.mysql.mysql_user:
name: bob
password: '*EE0D72C1085C46C5278932678FBE2C6A782821B4'
encrypted: yes
priv: '*.*:ALL'
state: present
- name: Create database user with password and all database privileges and 'WITH GRANT OPTION'
community.mysql.mysql_user:
name: bob
password: 12345
priv: '*.*:ALL,GRANT'
state: present
- name: Create user with password, all database privileges and 'WITH GRANT OPTION' in db1 and db2
community.mysql.mysql_user:
state: present
name: bob
password: 12345dd
priv:
'db1.*': 'ALL,GRANT'
'db2.*': 'ALL,GRANT'
# Use 'PROCEDURE' instead of 'FUNCTION' to apply GRANTs for a MySQL procedure instead.
- name: Grant a user the right to execute a function
community.mysql.mysql_user:
name: readonly
password: 12345
priv:
FUNCTION my_db.my_function: EXECUTE
state: present
# Note that REQUIRESSL is a special privilege that should only apply to *.* by itself.
# Setting this privilege in this manner is deprecated.
# Use 'tls_requires' instead.
- name: Modify user to require SSL connections
community.mysql.mysql_user:
name: bob
append_privs: yes
priv: '*.*:REQUIRESSL'
state: present
- name: Modify user to require TLS connection with a valid client certificate
community.mysql.mysql_user:
name: bob
tls_requires:
x509:
state: present
- name: Modify user to require TLS connection with a specific client certificate and cipher
community.mysql.mysql_user:
name: bob
tls_requires:
subject: '/CN=alice/O=MyDom, Inc./C=US/ST=Oregon/L=Portland'
cipher: 'ECDHE-ECDSA-AES256-SHA384'
- name: Modify user to no longer require SSL
community.mysql.mysql_user:
name: bob
tls_requires:
- name: Ensure no user named 'sally'@'localhost' exists, also passing in the auth credentials
community.mysql.mysql_user:
login_user: root
login_password: 123456
name: sally
state: absent
# check_implicit_admin example
- name: >
Ensure no user named 'sally'@'localhost' exists, also passing in the auth credentials.
If mysql allows root/nopassword login, try it without the credentials first.
If it's not allowed, pass the credentials
community.mysql.mysql_user:
check_implicit_admin: yes
login_user: root
login_password: 123456
name: sally
state: absent
- name: Ensure no user named 'sally' exists at all
community.mysql.mysql_user:
name: sally
host_all: yes
state: absent
- name: Specify grants composed of more than one word
community.mysql.mysql_user:
name: replication
password: 12345
priv: "*.*:REPLICATION CLIENT"
state: present
- name: Revoke all privileges for user 'bob' and password '12345'
community.mysql.mysql_user:
name: bob
password: 12345
priv: "*.*:USAGE"
state: present
# Example privileges string format
# mydb.*:INSERT,UPDATE/anotherdb.*:SELECT/yetanotherdb.*:ALL
- name: Example using login_unix_socket to connect to server
community.mysql.mysql_user:
name: root
password: abc123
login_unix_socket: /var/run/mysqld/mysqld.sock
- name: Example of skipping binary logging while adding user 'bob'
community.mysql.mysql_user:
name: bob
password: 12345
priv: "*.*:USAGE"
state: present
sql_log_bin: no
- name: Create user 'bob' authenticated with plugin 'AWSAuthenticationPlugin'
community.mysql.mysql_user:
name: bob
plugin: AWSAuthenticationPlugin
plugin_hash_string: RDS
priv: '*.*:ALL'
state: present
- name: Limit bob's resources to 10 queries per hour and 5 connections per hour
community.mysql.mysql_user:
name: bob
resource_limits:
MAX_QUERIES_PER_HOUR: 10
MAX_CONNECTIONS_PER_HOUR: 5
# Example .my.cnf file for setting the root password
# [client]
# user=root
# password=n<_665{vS43y
```
### Authors
* Jonathan Mainguy (@Jmainguy)
* Benjamin Malynovytch (@bmalynovytch)
* Lukasz Tomaszkiewicz (@tomaszkiewicz)
| programming_docs |
ansible community.mysql.mysql_role – Adds, removes, or updates a MySQL role community.mysql.mysql\_role – Adds, removes, or updates a MySQL role
====================================================================
Note
This plugin is part of the [community.mysql collection](https://galaxy.ansible.com/community/mysql) (version 2.3.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 community.mysql`.
To use it in a playbook, specify: `community.mysql.mysql_role`.
New in version 2.2.0: of community.mysql
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
Synopsis
--------
* Adds, removes, or updates a MySQL role.
* Roles are supported since MySQL 8.0.0 and MariaDB 10.0.5.
Requirements
------------
The below requirements are needed on the host that executes this module.
* PyMySQL (Python 2.7 and Python 3.X), or
* MySQLdb (Python 2.x)
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **admin** string | | Supported by **MariaDB**. Name of the admin user of the role (the *login\_user*, by default). |
| **append\_members** boolean | **Choices:*** **no** ←
* yes
| Add members defined by the *members* option to the existing ones for this role instead of overwriting them. Mutually exclusive with the *detach\_members* and *admin* option. |
| **append\_privs** boolean | **Choices:*** **no** ←
* yes
| Append the privileges defined by the *priv* option to the existing ones for this role instead of overwriting them. |
| **ca\_cert** path | | The path to a Certificate Authority (CA) certificate. This option, if used, must specify the same certificate as used by the server.
aliases: ssl\_ca |
| **check\_hostname** boolean added in 1.1.0 of community.mysql | **Choices:*** no
* yes
| Whether to validate the server host name when an SSL connection is required. Corresponds to MySQL CLIs `--ssl` switch. Setting this to `false` disables hostname verification. Use with caution. Requires pymysql >= 0.7.11. This option has no effect on MySQLdb. |
| **check\_implicit\_admin** boolean | **Choices:*** **no** ←
* yes
| Check if mysql allows login as root/nopassword before trying supplied credentials. If success, passed *login\_user*/*login\_password* will be ignored. |
| **client\_cert** path | | The path to a client public key certificate.
aliases: ssl\_cert |
| **client\_key** path | | The path to the client private key.
aliases: ssl\_key |
| **config\_file** path | **Default:**"~/.my.cnf" | Specify a config file from which user and password are to be read. |
| **connect\_timeout** integer | **Default:**30 | The connection timeout when connecting to the MySQL server. |
| **detach\_members** boolean | **Choices:*** **no** ←
* yes
| Detaches members defined by the *members* option from the role instead of overwriting all the current members. Mutually exclusive with the *append\_members* and *admin* option. |
| **login\_host** string | **Default:**"localhost" | Host running the database. In some cases for local connections the *login\_unix\_socket=/path/to/mysqld/socket*, that is usually `/var/run/mysqld/mysqld.sock`, needs to be used instead of *login\_host=localhost*. |
| **login\_password** string | | The password used to authenticate with. |
| **login\_port** integer | **Default:**3306 | Port of the MySQL server. Requires *login\_host* be defined as other than localhost if login\_port is used. |
| **login\_unix\_socket** string | | The path to a Unix domain socket for local connections. |
| **login\_user** string | | The username used to authenticate with. |
| **members** list / elements=string | | List of members of the role. For users, use the format `username@hostname`. Always specify the hostname part explicitly. For roles, use the format `rolename`. Mutually exclusive with *admin*. |
| **name** string / required | | Name of the role to add or remove. |
| **priv** raw | | MySQL privileges string in the format: `db.table:priv1,priv2`. You can specify multiple privileges by separating each one using a forward slash: `db.table:priv/db.table:priv`. The format is based on MySQL `GRANT` statement. Database and table names can be quoted, MySQL-style. If column privileges are used, the `priv1,priv2` part must be exactly as returned by a `SHOW GRANT` statement. If not followed, the module will always report changes. It includes grouping columns by permission (`SELECT(col1,col2`) instead of `SELECT(col1`,SELECT(col2))). Can be passed as a dictionary (see the examples). Supports GRANTs for procedures and functions (see the examples for the [community.mysql.mysql\_user](mysql_user_module) module). |
| **set\_default\_role\_all** boolean | **Choices:*** no
* **yes** ←
| Is not supported by MariaDB and is silently ignored when working with MariaDB. If `yes`, runs **SET DEFAULT ROLE ALL TO** each of the *members* when changed. If you want to avoid this behavior, set this option to `no` explicitly. |
| **state** string | **Choices:*** absent
* **present** ←
| If `present` and the role does not exist, creates the role. If `present` and the role exists, does nothing or updates its attributes. If `absent`, removes the role. |
Notes
-----
Note
* Pay attention that the module runs `SET DEFAULT ROLE ALL TO` all the *members* passed by default when the state has changed. If you want to avoid this behavior, set *set\_default\_role\_all* to `no`.
* Supports `check_mode`.
* Requires the PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) package installed on the remote host. The Python package may be installed with apt-get install python-pymysql (Ubuntu; see [ansible.builtin.apt](../../ansible/builtin/apt_module#ansible-collections-ansible-builtin-apt-module)) or yum install python2-PyMySQL (RHEL/CentOS/Fedora; see [ansible.builtin.yum](../../ansible/builtin/yum_module#ansible-collections-ansible-builtin-yum-module)). You can also use dnf install python2-PyMySQL for newer versions of Fedora; see [ansible.builtin.dnf](../../ansible/builtin/dnf_module#ansible-collections-ansible-builtin-dnf-module).
* Be sure you have PyMySQL or MySQLdb library installed on the target machine for the Python interpreter Ansible uses, for example, if it is Python 3, you must install the library for Python 3. You can also change the interpreter. For more information, see [https://docs.ansible.com/ansible/latest/reference\_appendices/interpreter\_discovery.html](../../../reference_appendices/interpreter_discovery).
* Both `login_password` and `login_user` are required when you are passing credentials. If none are present, the module will attempt to read the credentials from `~/.my.cnf`, and finally fall back to using the MySQL default login of ‘root’ with no password.
* If there are problems with local connections, using *login\_unix\_socket=/path/to/mysqld/socket* instead of *login\_host=localhost* might help. As an example, the default MariaDB installation of version 10.4 and later uses the unix\_socket authentication plugin by default that without using *login\_unix\_socket=/var/run/mysqld/mysqld.sock* (the default path) causes the error `Host '127.0.0.1' is not allowed to connect to this MariaDB server`.
* Alternatively, you can use the mysqlclient library instead of MySQL-python (MySQLdb) which supports both Python 2.X and Python >=3.5. See <https://pypi.org/project/mysqlclient/> how to install it.
See Also
--------
See also
[community.mysql.mysql\_user](mysql_user_module#ansible-collections-community-mysql-mysql-user-module)
The official documentation on the **community.mysql.mysql\_user** module.
[MySQL role reference](https://dev.mysql.com/doc/refman/8.0/en/create-role.html)
Complete reference of the MySQL role documentation.
Examples
--------
```
# Example of a .my.cnf file content for setting a root password
# [client]
# user=root
# password=n<_665{vS43y
#
# Example of a privileges dictionary passed through the priv option
# priv:
# 'mydb.*': 'INSERT,UPDATE'
# 'anotherdb.*': 'SELECT'
# 'yetanotherdb.*': 'ALL'
#
# You can also use the string format like in the community.mysql.mysql_user module, for example
# mydb.*:INSERT,UPDATE/anotherdb.*:SELECT/yetanotherdb.*:ALL
#
# For more examples on how to specify privileges, refer to the community.mysql.mysql_user module
# Create a role developers with all database privileges
# and add alice and bob as members.
# The statement 'SET DEFAULT ROLE ALL' to them will be run.
- name: Create role developers, add members
community.mysql.mysql_role:
name: developers
state: present
priv: '*.*:ALL'
members:
- 'alice@%'
- 'bob@%'
- name: Same as above but do not run SET DEFAULT ROLE ALL TO each member
community.mysql.mysql_role:
name: developers
state: present
priv: '*.*:ALL'
members:
- 'alice@%'
- 'bob@%'
set_default_role_all: no
# Assuming that the role developers exists,
# add john to the current members
- name: Add members to an existing role
community.mysql.mysql_role:
name: developers
state: present
append_members: yes
members:
- 'joe@localhost'
# Create role readers with the SELECT privilege
# on all tables in the fiction database
- name: Create role developers, add members
community.mysql.mysql_role:
name: readers
state: present
priv: 'fiction.*:SELECT'
# Assuming that the role readers exists,
# add the UPDATE privilege to the role on all tables in the fiction database
- name: Create role developers, add members
community.mysql.mysql_role:
name: readers
state: present
priv: 'fiction.*:UPDATE'
append_privs: yes
- name: Create role with the 'SELECT' and 'UPDATE' privileges in db1 and db2
community.mysql.mysql_role:
state: present
name: foo
priv:
'db1.*': 'SELECT,UPDATE'
'db2.*': 'SELECT,UPDATE'
- name: Remove joe from readers
community.mysql.mysql_role:
state: present
name: readers
members:
- 'joe@localhost'
detach_members: yes
- name: Remove the role readers if exists
community.mysql.mysql_role:
state: absent
name: readers
- name: Example of using login_unix_socket to connect to the server
community.mysql.mysql_role:
name: readers
state: present
login_unix_socket: /var/run/mysqld/mysqld.sock
# Pay attention that the admin cannot be changed later
# and will be ignored if a role currently exists.
# To change members, you need to run a separate task using the admin
# of the role as the login_user.
- name: On MariaDB, create the role readers with alice as its admin
community.mysql.mysql_role:
state: present
name: readers
admin: 'alice@%'
- name: Create the role business, add the role marketing to members
community.mysql.mysql_role:
state: present
name: business
members:
- marketing
```
### Authors
* Andrew Klychkov (@Andersson007)
ansible community.mysql.mysql_info – Gather information about MySQL servers community.mysql.mysql\_info – Gather information about MySQL servers
====================================================================
Note
This plugin is part of the [community.mysql collection](https://galaxy.ansible.com/community/mysql) (version 2.3.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 community.mysql`.
To use it in a playbook, specify: `community.mysql.mysql_info`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gathers information about MySQL servers.
Requirements
------------
The below requirements are needed on the host that executes this module.
* PyMySQL (Python 2.7 and Python 3.X), or
* MySQLdb (Python 2.x)
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **ca\_cert** path | | The path to a Certificate Authority (CA) certificate. This option, if used, must specify the same certificate as used by the server.
aliases: ssl\_ca |
| **check\_hostname** boolean added in 1.1.0 of community.mysql | **Choices:*** no
* yes
| Whether to validate the server host name when an SSL connection is required. Corresponds to MySQL CLIs `--ssl` switch. Setting this to `false` disables hostname verification. Use with caution. Requires pymysql >= 0.7.11. This option has no effect on MySQLdb. |
| **client\_cert** path | | The path to a client public key certificate.
aliases: ssl\_cert |
| **client\_key** path | | The path to the client private key.
aliases: ssl\_key |
| **config\_file** path | **Default:**"~/.my.cnf" | Specify a config file from which user and password are to be read. |
| **connect\_timeout** integer | **Default:**30 | The connection timeout when connecting to the MySQL server. |
| **exclude\_fields** list / elements=string added in 0.1.0 of community.mysql | | List of fields which are not needed to collect. Supports elements: `db_size`. Unsupported elements will be ignored. |
| **filter** list / elements=string | | Limit the collected information by comma separated string or YAML list. Allowable values are `version`, `databases`, `settings`, `global_status`, `users`, `engines`, `master_status`, `slave_status`, `slave_hosts`. By default, collects all subsets. You can use '!' before value (for example, `!settings`) to exclude it from the information. If you pass including and excluding values to the filter, for example, *filter=!settings,version*, the excluding values, `!settings` in this case, will be ignored. |
| **login\_db** string | | Database name to connect to. It makes sense if *login\_user* is allowed to connect to a specific database only. |
| **login\_host** string | **Default:**"localhost" | Host running the database. In some cases for local connections the *login\_unix\_socket=/path/to/mysqld/socket*, that is usually `/var/run/mysqld/mysqld.sock`, needs to be used instead of *login\_host=localhost*. |
| **login\_password** string | | The password used to authenticate with. |
| **login\_port** integer | **Default:**3306 | Port of the MySQL server. Requires *login\_host* be defined as other than localhost if login\_port is used. |
| **login\_unix\_socket** string | | The path to a Unix domain socket for local connections. |
| **login\_user** string | | The username used to authenticate with. |
| **return\_empty\_dbs** boolean | **Choices:*** **no** ←
* yes
| Includes names of empty databases to returned dictionary. |
Notes
-----
Note
* Calculating the size of a database might be slow, depending on the number and size of tables in it. To avoid this, use *exclude\_fields=db\_size*.
* Supports `check_mode`.
* Requires the PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) package installed on the remote host. The Python package may be installed with apt-get install python-pymysql (Ubuntu; see [ansible.builtin.apt](../../ansible/builtin/apt_module#ansible-collections-ansible-builtin-apt-module)) or yum install python2-PyMySQL (RHEL/CentOS/Fedora; see [ansible.builtin.yum](../../ansible/builtin/yum_module#ansible-collections-ansible-builtin-yum-module)). You can also use dnf install python2-PyMySQL for newer versions of Fedora; see [ansible.builtin.dnf](../../ansible/builtin/dnf_module#ansible-collections-ansible-builtin-dnf-module).
* Be sure you have PyMySQL or MySQLdb library installed on the target machine for the Python interpreter Ansible uses, for example, if it is Python 3, you must install the library for Python 3. You can also change the interpreter. For more information, see [https://docs.ansible.com/ansible/latest/reference\_appendices/interpreter\_discovery.html](../../../reference_appendices/interpreter_discovery).
* Both `login_password` and `login_user` are required when you are passing credentials. If none are present, the module will attempt to read the credentials from `~/.my.cnf`, and finally fall back to using the MySQL default login of ‘root’ with no password.
* If there are problems with local connections, using *login\_unix\_socket=/path/to/mysqld/socket* instead of *login\_host=localhost* might help. As an example, the default MariaDB installation of version 10.4 and later uses the unix\_socket authentication plugin by default that without using *login\_unix\_socket=/var/run/mysqld/mysqld.sock* (the default path) causes the error `Host '127.0.0.1' is not allowed to connect to this MariaDB server`.
* Alternatively, you can use the mysqlclient library instead of MySQL-python (MySQLdb) which supports both Python 2.X and Python >=3.5. See <https://pypi.org/project/mysqlclient/> how to install it.
See Also
--------
See also
[community.mysql.mysql\_variables](mysql_variables_module#ansible-collections-community-mysql-mysql-variables-module)
The official documentation on the **community.mysql.mysql\_variables** module.
[community.mysql.mysql\_db](mysql_db_module#ansible-collections-community-mysql-mysql-db-module)
The official documentation on the **community.mysql.mysql\_db** module.
[community.mysql.mysql\_user](mysql_user_module#ansible-collections-community-mysql-mysql-user-module)
The official documentation on the **community.mysql.mysql\_user** module.
[community.mysql.mysql\_replication](mysql_replication_module#ansible-collections-community-mysql-mysql-replication-module)
The official documentation on the **community.mysql.mysql\_replication** module.
Examples
--------
```
# Display info from mysql-hosts group (using creds from ~/.my.cnf to connect):
# ansible mysql-hosts -m mysql_info
# Display only databases and users info:
# ansible mysql-hosts -m mysql_info -a 'filter=databases,users'
# Display only slave status:
# ansible standby -m mysql_info -a 'filter=slave_status'
# Display all info from databases group except settings:
# ansible databases -m mysql_info -a 'filter=!settings'
- name: Collect all possible information using passwordless root access
community.mysql.mysql_info:
login_user: root
- name: Get MySQL version with non-default credentials
community.mysql.mysql_info:
login_user: mysuperuser
login_password: mysuperpass
filter: version
- name: Collect all info except settings and users by root
community.mysql.mysql_info:
login_user: root
login_password: rootpass
filter: "!settings,!users"
- name: Collect info about databases and version using ~/.my.cnf as a credential file
become: yes
community.mysql.mysql_info:
filter:
- databases
- version
- name: Collect info about databases and version using ~alice/.my.cnf as a credential file
become: yes
community.mysql.mysql_info:
config_file: /home/alice/.my.cnf
filter:
- databases
- version
- name: Collect info about databases including empty and excluding their sizes
become: yes
community.mysql.mysql_info:
config_file: /home/alice/.my.cnf
filter:
- databases
exclude_fields: db_size
return_empty_dbs: 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 |
| --- | --- | --- |
| **databases** dictionary | if not excluded by filter | Information about databases. **Sample:** [{'information\_schema': {'size': 73728}, 'mysql': {'size': 656594}}] |
| | **size** dictionary | if not excluded by filter | Database size in bytes. **Sample:** {'size': 656594} |
| **engines** dictionary | if not excluded by filter | Information about the server's storage engines. **Sample:** [{'CSV': {'Comment': 'CSV storage engine', 'Savepoints': 'NO', 'Support': 'YES', 'Transactions': 'NO', 'XA': 'NO'}}] |
| **global\_status** dictionary | if not excluded by filter | Global status information. **Sample:** [{'Innodb\_buffer\_pool\_read\_requests': 123, 'Innodb\_buffer\_pool\_reads': 32}] |
| **master\_status** dictionary | if master | Master status information. **Sample:** [{'Binlog\_Do\_DB': '', 'Binlog\_Ignore\_DB': 'mysql', 'File': 'mysql-bin.000001', 'Position': 769}] |
| **settings** dictionary | if not excluded by filter | Global settings (variables) information. **Sample:** [{'innodb\_open\_files': 300, 'innodb\_page\_size"': 16384}] |
| **slave\_hosts** dictionary | if master | Slave status information. **Sample:** [{'2': {'Host': '', 'Master\_id': 1, 'Port': 3306}}] |
| **slave\_status** dictionary | if standby | Slave status information. **Sample:** [{'192.168.1.101': {'3306': {'replication\_user': {'Connect\_Retry': 60, 'Exec\_Master\_Log\_Pos': 769, 'Last\_Errno': 0}}}}] |
| **users** dictionary | if not excluded by filter | Users information. **Sample:** [{'localhost': {'root': {'Alter\_priv': 'Y', 'Alter\_routine\_priv': 'Y'}}}] |
| **version** dictionary | if not excluded by filter | Database server version. **Sample:** {'version': {'full': '5.5.60-MariaDB', 'major': 5, 'minor': 5, 'release': 60, 'suffix': 'MariaDB'}} |
| | **full** string | if not excluded by filter | Full server version. **Sample:** 5.5.60-MariaDB |
| | **major** integer | if not excluded by filter | Major server version. **Sample:** 5 |
| | **minor** integer | if not excluded by filter | Minor server version. **Sample:** 5 |
| | **release** integer | if not excluded by filter | Release server version. **Sample:** 60 |
| | **suffix** string | if not excluded by filter | Server suffix, for example MySQL, MariaDB, other or none. **Sample:** MariaDB |
### Authors
* Andrew Klychkov (@Andersson007)
* Sebastian Gumprich (@rndmh3ro)
| programming_docs |
ansible community.mysql.mysql_db – Add or remove MySQL databases from a remote host community.mysql.mysql\_db – Add or remove MySQL databases from a remote host
============================================================================
Note
This plugin is part of the [community.mysql collection](https://galaxy.ansible.com/community/mysql) (version 2.3.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 community.mysql`.
To use it in a playbook, specify: `community.mysql.mysql_db`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Add or remove MySQL databases from a remote host.
Requirements
------------
The below requirements are needed on the host that executes this module.
* MySQLdb (Python 2.x)
* PyMySQL (Python 2.7 and Python 3.X), or
* mysql (command line binary)
* mysqldump (command line binary)
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **ca\_cert** path | | The path to a Certificate Authority (CA) certificate. This option, if used, must specify the same certificate as used by the server.
aliases: ssl\_ca |
| **check\_hostname** boolean added in 1.1.0 of community.mysql | **Choices:*** no
* yes
| Whether to validate the server host name when an SSL connection is required. Corresponds to MySQL CLIs `--ssl` switch. Setting this to `false` disables hostname verification. Use with caution. Requires pymysql >= 0.7.11. This option has no effect on MySQLdb. |
| **check\_implicit\_admin** boolean added in 0.1.0 of community.mysql | **Choices:*** **no** ←
* yes
| Check if mysql allows login as root/nopassword before trying supplied credentials. If success, passed *login\_user*/*login\_password* will be ignored. |
| **client\_cert** path | | The path to a client public key certificate.
aliases: ssl\_cert |
| **client\_key** path | | The path to the client private key.
aliases: ssl\_key |
| **collation** string | **Default:**"" | Collation mode (sorting). This only applies to new table/databases and does not update existing ones, this is a limitation of MySQL. |
| **config\_file** path | **Default:**"~/.my.cnf" | Specify a config file from which user and password are to be read. |
| **config\_overrides\_defaults** boolean added in 0.1.0 of community.mysql | **Choices:*** **no** ←
* yes
| If `yes`, connection parameters from *config\_file* will override the default values of *login\_host* and *login\_port* parameters. Used when *stat* is `present` or `absent`, ignored otherwise. It needs Python 3.5+ as the default interpreter on a target host. |
| **connect\_timeout** integer | **Default:**30 | The connection timeout when connecting to the MySQL server. |
| **dump\_extra\_args** string added in 0.1.0 of community.mysql | | Provide additional arguments for mysqldump. Used when *state=dump* only, ignored otherwise. |
| **encoding** string | **Default:**"" | Encoding mode to use, examples include `utf8` or `latin1_swedish_ci`, at creation of database, dump or importation of sql script. |
| **force** boolean added in 0.1.0 of community.mysql | **Choices:*** **no** ←
* yes
| Continue dump or import even if we get an SQL error. Used only when *state* is `dump` or `import`. |
| **hex\_blob** boolean added in 0.1.0 of community.mysql | **Choices:*** **no** ←
* yes
| Dump binary columns using hexadecimal notation. |
| **ignore\_tables** list / elements=string | **Default:**[] | A list of table names that will be ignored in the dump of the form database\_name.table\_name. |
| **login\_host** string | **Default:**"localhost" | Host running the database. In some cases for local connections the *login\_unix\_socket=/path/to/mysqld/socket*, that is usually `/var/run/mysqld/mysqld.sock`, needs to be used instead of *login\_host=localhost*. |
| **login\_password** string | | The password used to authenticate with. |
| **login\_port** integer | **Default:**3306 | Port of the MySQL server. Requires *login\_host* be defined as other than localhost if login\_port is used. |
| **login\_unix\_socket** string | | The path to a Unix domain socket for local connections. |
| **login\_user** string | | The username used to authenticate with. |
| **master\_data** integer added in 0.1.0 of community.mysql | **Choices:*** 0
* 1
* 2
**Default:**0 | Option to dump a master replication server to produce a dump file that can be used to set up another server as a slave of the master.
`0` to not include master data.
`1` to generate a 'CHANGE MASTER TO' statement required on the slave to start the replication process.
`2` to generate a commented 'CHANGE MASTER TO'. Can be used when *state=dump*. |
| **name** list / elements=string / required | | Name of the database to add or remove.
*name=all* may only be provided if *state* is `dump` or `import`. List of databases is provided with *state=dump*, *state=present* and *state=absent*. If *name=all* it works like --all-databases option for mysqldump (Added in 2.0).
aliases: db |
| **quick** boolean | **Choices:*** no
* **yes** ←
| Option used for dumping large tables. |
| **restrict\_config\_file** boolean added in 0.1.0 of community.mysql | **Choices:*** **no** ←
* yes
| Read only passed *config\_file*. When *state* is `dump` or `import`, by default the module passes *config\_file* parameter using `--defaults-extra-file` command-line argument to `mysql/mysqldump` utilities under the hood that read named option file in addition to usual option files. If this behavior is undesirable, use `yes` to read only named option file. |
| **single\_transaction** boolean | **Choices:*** **no** ←
* yes
| Execute the dump in a single transaction. |
| **skip\_lock\_tables** boolean added in 0.1.0 of community.mysql | **Choices:*** **no** ←
* yes
| Skip locking tables for read. Used when *state=dump*, ignored otherwise. |
| **state** string | **Choices:*** absent
* dump
* import
* **present** ←
| The database state. |
| **target** path | | Location, on the remote host, of the dump file to read from or write to. Uncompressed SQL files (`.sql`) as well as bzip2 (`.bz2`), gzip (`.gz`) and xz (Added in 2.0) compressed files are supported. |
| **unsafe\_login\_password** boolean added in 0.1.0 of community.mysql | **Choices:*** **no** ←
* yes
| If `no`, the module will safely use a shell-escaped version of the *login\_password* value. It makes sense to use `yes` only if there are special symbols in the value and errors `Access denied` occur. Used only when *state* is `import` or `dump` and *login\_password* is passed, ignored otherwise. |
| **use\_shell** boolean added in 0.1.0 of community.mysql | **Choices:*** **no** ←
* yes
| Used to prevent `Broken pipe` errors when the imported *target* file is compressed. If `yes`, the module will internally execute commands via a shell. Used when *state=import*, ignored otherwise. |
Notes
-----
Note
* Supports `check_mode`.
* Requires the mysql and mysqldump binaries on the remote host.
* This module is **not idempotent** when *state* is `import`, and will import the dump file each time if run more than once.
* Requires the PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) package installed on the remote host. The Python package may be installed with apt-get install python-pymysql (Ubuntu; see [ansible.builtin.apt](../../ansible/builtin/apt_module#ansible-collections-ansible-builtin-apt-module)) or yum install python2-PyMySQL (RHEL/CentOS/Fedora; see [ansible.builtin.yum](../../ansible/builtin/yum_module#ansible-collections-ansible-builtin-yum-module)). You can also use dnf install python2-PyMySQL for newer versions of Fedora; see [ansible.builtin.dnf](../../ansible/builtin/dnf_module#ansible-collections-ansible-builtin-dnf-module).
* Be sure you have PyMySQL or MySQLdb library installed on the target machine for the Python interpreter Ansible uses, for example, if it is Python 3, you must install the library for Python 3. You can also change the interpreter. For more information, see [https://docs.ansible.com/ansible/latest/reference\_appendices/interpreter\_discovery.html](../../../reference_appendices/interpreter_discovery).
* Both `login_password` and `login_user` are required when you are passing credentials. If none are present, the module will attempt to read the credentials from `~/.my.cnf`, and finally fall back to using the MySQL default login of ‘root’ with no password.
* If there are problems with local connections, using *login\_unix\_socket=/path/to/mysqld/socket* instead of *login\_host=localhost* might help. As an example, the default MariaDB installation of version 10.4 and later uses the unix\_socket authentication plugin by default that without using *login\_unix\_socket=/var/run/mysqld/mysqld.sock* (the default path) causes the error `Host '127.0.0.1' is not allowed to connect to this MariaDB server`.
* Alternatively, you can use the mysqlclient library instead of MySQL-python (MySQLdb) which supports both Python 2.X and Python >=3.5. See <https://pypi.org/project/mysqlclient/> how to install it.
See Also
--------
See also
[community.mysql.mysql\_info](mysql_info_module#ansible-collections-community-mysql-mysql-info-module)
The official documentation on the **community.mysql.mysql\_info** module.
[community.mysql.mysql\_variables](mysql_variables_module#ansible-collections-community-mysql-mysql-variables-module)
The official documentation on the **community.mysql.mysql\_variables** module.
[community.mysql.mysql\_user](mysql_user_module#ansible-collections-community-mysql-mysql-user-module)
The official documentation on the **community.mysql.mysql\_user** module.
[community.mysql.mysql\_replication](mysql_replication_module#ansible-collections-community-mysql-mysql-replication-module)
The official documentation on the **community.mysql.mysql\_replication** module.
[MySQL command-line client reference](https://dev.mysql.com/doc/refman/8.0/en/mysql.html)
Complete reference of the MySQL command-line client documentation.
[mysqldump reference](https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html)
Complete reference of the `mysqldump` client utility documentation.
[CREATE DATABASE reference](https://dev.mysql.com/doc/refman/8.0/en/create-database.html)
Complete reference of the CREATE DATABASE command documentation.
[DROP DATABASE reference](https://dev.mysql.com/doc/refman/8.0/en/drop-database.html)
Complete reference of the DROP DATABASE command documentation.
Examples
--------
```
- name: Create a new database with name 'bobdata'
community.mysql.mysql_db:
name: bobdata
state: present
- name: Create new databases with names 'foo' and 'bar'
community.mysql.mysql_db:
name:
- foo
- bar
state: present
# Copy database dump file to remote host and restore it to database 'my_db'
- name: Copy database dump file
copy:
src: dump.sql.bz2
dest: /tmp
- name: Restore database
community.mysql.mysql_db:
name: my_db
state: import
target: /tmp/dump.sql.bz2
- name: Restore database ignoring errors
community.mysql.mysql_db:
name: my_db
state: import
target: /tmp/dump.sql.bz2
force: yes
- name: Dump multiple databases
community.mysql.mysql_db:
state: dump
name: db_1,db_2
target: /tmp/dump.sql
- name: Dump multiple databases
community.mysql.mysql_db:
state: dump
name:
- db_1
- db_2
target: /tmp/dump.sql
- name: Dump all databases to hostname.sql
community.mysql.mysql_db:
state: dump
name: all
target: /tmp/dump.sql
- name: Dump all databases to hostname.sql including master data
community.mysql.mysql_db:
state: dump
name: all
target: /tmp/dump.sql
master_data: 1
# Import of sql script with encoding option
- name: >
Import dump.sql with specific latin1 encoding,
similar to mysql -u <username> --default-character-set=latin1 -p <password> < dump.sql
community.mysql.mysql_db:
state: import
name: all
encoding: latin1
target: /tmp/dump.sql
# Dump of database with encoding option
- name: >
Dump of Databse with specific latin1 encoding,
similar to mysqldump -u <username> --default-character-set=latin1 -p <password> <database>
community.mysql.mysql_db:
state: dump
name: db_1
encoding: latin1
target: /tmp/dump.sql
- name: Delete database with name 'bobdata'
community.mysql.mysql_db:
name: bobdata
state: absent
- name: Make sure there is neither a database with name 'foo', nor one with name 'bar'
community.mysql.mysql_db:
name:
- foo
- bar
state: absent
# Dump database with argument not directly supported by this module
# using dump_extra_args parameter
- name: Dump databases without including triggers
community.mysql.mysql_db:
state: dump
name: foo
target: /tmp/dump.sql
dump_extra_args: --skip-triggers
- name: Try to create database as root/nopassword first. If not allowed, pass the credentials
community.mysql.mysql_db:
check_implicit_admin: yes
login_user: bob
login_password: 123456
name: bobdata
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 |
| --- | --- | --- |
| **db** string | always | Database names in string format delimited by white space. **Sample:** foo bar |
| **db\_list** list / elements=string | always | List of database names. **Sample:** ['foo', 'bar'] |
| **executed\_commands** list / elements=string added in 0.1.0 of community.mysql | if executed | List of commands which tried to run. **Sample:** ['CREATE DATABASE acme'] |
### Authors
* Ansible Core Team
ansible community.mysql.mysql_variables – Manage MySQL global variables community.mysql.mysql\_variables – Manage MySQL global variables
================================================================
Note
This plugin is part of the [community.mysql collection](https://galaxy.ansible.com/community/mysql) (version 2.3.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 community.mysql`.
To use it in a playbook, specify: `community.mysql.mysql_variables`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Query / Set MySQL variables.
Requirements
------------
The below requirements are needed on the host that executes this module.
* PyMySQL (Python 2.7 and Python 3.X), or
* MySQLdb (Python 2.x)
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **ca\_cert** path | | The path to a Certificate Authority (CA) certificate. This option, if used, must specify the same certificate as used by the server.
aliases: ssl\_ca |
| **check\_hostname** boolean added in 1.1.0 of community.mysql | **Choices:*** no
* yes
| Whether to validate the server host name when an SSL connection is required. Corresponds to MySQL CLIs `--ssl` switch. Setting this to `false` disables hostname verification. Use with caution. Requires pymysql >= 0.7.11. This option has no effect on MySQLdb. |
| **client\_cert** path | | The path to a client public key certificate.
aliases: ssl\_cert |
| **client\_key** path | | The path to the client private key.
aliases: ssl\_key |
| **config\_file** path | **Default:**"~/.my.cnf" | Specify a config file from which user and password are to be read. |
| **connect\_timeout** integer | **Default:**30 | The connection timeout when connecting to the MySQL server. |
| **login\_host** string | **Default:**"localhost" | Host running the database. In some cases for local connections the *login\_unix\_socket=/path/to/mysqld/socket*, that is usually `/var/run/mysqld/mysqld.sock`, needs to be used instead of *login\_host=localhost*. |
| **login\_password** string | | The password used to authenticate with. |
| **login\_port** integer | **Default:**3306 | Port of the MySQL server. Requires *login\_host* be defined as other than localhost if login\_port is used. |
| **login\_unix\_socket** string | | The path to a Unix domain socket for local connections. |
| **login\_user** string | | The username used to authenticate with. |
| **mode** string added in 0.1.0 of community.mysql | **Choices:*** **global** ←
* persist
* persist\_only
|
`global` assigns `value` to a global system variable which will be changed at runtime but won't persist across server restarts.
`persist` assigns `value` to a global system variable and persists it to the mysqld-auto.cnf option file in the data directory (the variable will survive service restarts).
`persist_only` persists `value` to the mysqld-auto.cnf option file in the data directory but without setting the global variable runtime value (the value will be changed after the next service restart). Supported by MySQL 8.0 or later. For more information see <https://dev.mysql.com/doc/refman/8.0/en/set-variable.html>. |
| **value** string | | If set, then sets variable value to this. |
| **variable** string / required | | Variable name to operate. |
Notes
-----
Note
* Does not support `check_mode`.
* Requires the PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) package installed on the remote host. The Python package may be installed with apt-get install python-pymysql (Ubuntu; see [ansible.builtin.apt](../../ansible/builtin/apt_module#ansible-collections-ansible-builtin-apt-module)) or yum install python2-PyMySQL (RHEL/CentOS/Fedora; see [ansible.builtin.yum](../../ansible/builtin/yum_module#ansible-collections-ansible-builtin-yum-module)). You can also use dnf install python2-PyMySQL for newer versions of Fedora; see [ansible.builtin.dnf](../../ansible/builtin/dnf_module#ansible-collections-ansible-builtin-dnf-module).
* Be sure you have PyMySQL or MySQLdb library installed on the target machine for the Python interpreter Ansible uses, for example, if it is Python 3, you must install the library for Python 3. You can also change the interpreter. For more information, see [https://docs.ansible.com/ansible/latest/reference\_appendices/interpreter\_discovery.html](../../../reference_appendices/interpreter_discovery).
* Both `login_password` and `login_user` are required when you are passing credentials. If none are present, the module will attempt to read the credentials from `~/.my.cnf`, and finally fall back to using the MySQL default login of ‘root’ with no password.
* If there are problems with local connections, using *login\_unix\_socket=/path/to/mysqld/socket* instead of *login\_host=localhost* might help. As an example, the default MariaDB installation of version 10.4 and later uses the unix\_socket authentication plugin by default that without using *login\_unix\_socket=/var/run/mysqld/mysqld.sock* (the default path) causes the error `Host '127.0.0.1' is not allowed to connect to this MariaDB server`.
* Alternatively, you can use the mysqlclient library instead of MySQL-python (MySQLdb) which supports both Python 2.X and Python >=3.5. See <https://pypi.org/project/mysqlclient/> how to install it.
See Also
--------
See also
[community.mysql.mysql\_info](mysql_info_module#ansible-collections-community-mysql-mysql-info-module)
The official documentation on the **community.mysql.mysql\_info** module.
[MySQL SET command reference](https://dev.mysql.com/doc/refman/8.0/en/set-statement.html)
Complete reference of the MySQL SET command documentation.
Examples
--------
```
- name: Check for sync_binlog setting
community.mysql.mysql_variables:
variable: sync_binlog
- name: Set read_only variable to 1 persistently
community.mysql.mysql_variables:
variable: read_only
value: 1
mode: persist
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **queries** list / elements=string added in 0.1.0 of community.mysql | if executed | List of executed queries which modified DB's state. **Sample:** ['SET GLOBAL `read\_only` = 1'] |
### Authors
* Balazs Pocze (@banyek)
| programming_docs |
ansible community.mysql.mysql_replication – Manage MySQL replication community.mysql.mysql\_replication – Manage MySQL replication
=============================================================
Note
This plugin is part of the [community.mysql collection](https://galaxy.ansible.com/community/mysql) (version 2.3.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 community.mysql`.
To use it in a playbook, specify: `community.mysql.mysql_replication`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages MySQL server replication, replica, primary status, get and change primary host.
Requirements
------------
The below requirements are needed on the host that executes this module.
* PyMySQL (Python 2.7 and Python 3.X), or
* MySQLdb (Python 2.x)
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **ca\_cert** path | | The path to a Certificate Authority (CA) certificate. This option, if used, must specify the same certificate as used by the server.
aliases: ssl\_ca |
| **channel** string added in 0.1.0 of community.mysql | | Name of replication channel. Multi-source replication is supported from MySQL 5.7. Mutually exclusive with *connection\_name*. For more information see <https://dev.mysql.com/doc/refman/8.0/en/replication-multi-source.html>. |
| **check\_hostname** boolean added in 1.1.0 of community.mysql | **Choices:*** no
* yes
| Whether to validate the server host name when an SSL connection is required. Corresponds to MySQL CLIs `--ssl` switch. Setting this to `false` disables hostname verification. Use with caution. Requires pymysql >= 0.7.11. This option has no effect on MySQLdb. |
| **client\_cert** path | | The path to a client public key certificate.
aliases: ssl\_cert |
| **client\_key** path | | The path to the client private key.
aliases: ssl\_key |
| **config\_file** path | **Default:**"~/.my.cnf" | Specify a config file from which user and password are to be read. |
| **connect\_timeout** integer | **Default:**30 | The connection timeout when connecting to the MySQL server. |
| **connection\_name** string added in 0.1.0 of community.mysql | | Name of the primary connection. Supported from MariaDB 10.0.1. Mutually exclusive with *channel*. For more information see <https://mariadb.com/kb/en/library/multi-source-replication/>. |
| **fail\_on\_error** boolean added in 0.1.0 of community.mysql | **Choices:*** **no** ←
* yes
| Fails on error when calling mysql. |
| **login\_host** string | **Default:**"localhost" | Host running the database. In some cases for local connections the *login\_unix\_socket=/path/to/mysqld/socket*, that is usually `/var/run/mysqld/mysqld.sock`, needs to be used instead of *login\_host=localhost*. |
| **login\_password** string | | The password used to authenticate with. |
| **login\_port** integer | **Default:**3306 | Port of the MySQL server. Requires *login\_host* be defined as other than localhost if login\_port is used. |
| **login\_unix\_socket** string | | The path to a Unix domain socket for local connections. |
| **login\_user** string | | The username used to authenticate with. |
| **mode** string | **Choices:*** changeprimary
* changemaster
* getprimary
* getmaster
* **getreplica** ←
* getslave
* startreplica
* startslave
* stopreplica
* stopslave
* resetprimary
* resetmaster
* resetreplica
* resetslave
* resetreplicaall
* resetslaveall
| Module operating mode. Could be `changeprimary | changemaster` (CHANGE PRIMARY | MASTER TO), `getprimary | getmaster` (SHOW PRIMARY | MASTER STATUS), `getreplica | getslave` (SHOW REPLICA | SLAVE STATUS), `startreplica | startslave` (START REPLICA | SLAVE), `stopreplica | stopslave` (STOP REPLICA | SLAVE), `resetprimary | resetmaster` (RESET PRIMARY | MASTER) - supported since community.mysql 0.1.0, `resetreplica, resetslave` (RESET REPLICA | SLAVE), `resetreplicaall, resetslave` (RESET REPLICA | SLAVE ALL). |
| **primary\_auto\_position** boolean | **Choices:*** **no** ←
* yes
| Whether the host uses GTID based replication or not. Same as the `MASTER_AUTO_POSITION` mysql variable.
aliases: master\_auto\_position |
| **primary\_connect\_retry** integer | | Same as the `MASTER_CONNECT_RETRY` mysql variable.
aliases: master\_connect\_retry |
| **primary\_delay** integer added in 0.1.0 of community.mysql | | Time lag behind the primary's state (in seconds). Same as the `MASTER_DELAY` mysql variable. Available from MySQL 5.6. For more information see <https://dev.mysql.com/doc/refman/8.0/en/replication-delayed.html>.
aliases: master\_delay |
| **primary\_host** string | | Same as the `MASTER_HOST` mysql variable.
aliases: master\_host |
| **primary\_log\_file** string | | Same as the `MASTER_LOG_FILE` mysql variable.
aliases: master\_log\_file |
| **primary\_log\_pos** integer | | Same as the `MASTER_LOG_POS` mysql variable.
aliases: master\_log\_pos |
| **primary\_password** string | | Same as the `MASTER_PASSWORD` mysql variable.
aliases: master\_password |
| **primary\_port** integer | | Same as the `MASTER_PORT` mysql variable.
aliases: master\_port |
| **primary\_ssl** boolean | **Choices:*** **no** ←
* yes
| Same as the `MASTER_SSL` mysql variable. When setting it to `yes`, the connection attempt only succeeds if an encrypted connection can be established. For details, refer to [MySQL encrypted replication documentation](https://dev.mysql.com/doc/refman/8.0/en/replication-solutions-encrypted-connections.html).
aliases: master\_ssl |
| **primary\_ssl\_ca** string | | Same as the `MASTER_SSL_CA` mysql variable. For details, refer to [MySQL encrypted replication documentation](https://dev.mysql.com/doc/refman/8.0/en/replication-solutions-encrypted-connections.html).
aliases: master\_ssl\_ca |
| **primary\_ssl\_capath** string | | Same as the `MASTER_SSL_CAPATH` mysql variable. For details, refer to [MySQL encrypted replication documentation](https://dev.mysql.com/doc/refman/8.0/en/replication-solutions-encrypted-connections.html).
aliases: master\_ssl\_capath |
| **primary\_ssl\_cert** string | | Same as the `MASTER_SSL_CERT` mysql variable. For details, refer to [MySQL encrypted replication documentation](https://dev.mysql.com/doc/refman/8.0/en/replication-solutions-encrypted-connections.html).
aliases: master\_ssl\_cert |
| **primary\_ssl\_cipher** string | | Same as the `MASTER_SSL_CIPHER` mysql variable. Specifies a colon-separated list of one or more ciphers permitted by the replica for the replication connection. For details, refer to [MySQL encrypted replication documentation](https://dev.mysql.com/doc/refman/8.0/en/replication-solutions-encrypted-connections.html).
aliases: master\_ssl\_cipher |
| **primary\_ssl\_key** string | | Same as the `MASTER_SSL_KEY` mysql variable. For details, refer to [MySQL encrypted replication documentation](https://dev.mysql.com/doc/refman/8.0/en/replication-solutions-encrypted-connections.html).
aliases: master\_ssl\_key |
| **primary\_use\_gtid** string added in 0.1.0 of community.mysql | **Choices:*** current\_pos
* replica\_pos
* slave\_pos
* disabled
| Configures the replica to use the MariaDB Global Transaction ID.
`disabled` equals MASTER\_USE\_GTID=no command. To find information about available values see <https://mariadb.com/kb/en/library/change-master-to/#master_use_gtid>. Available since MariaDB 10.0.2.
`replica_pos` has been introduced in MariaDB 10.5.1 and it is an alias for `slave_pos`.
aliases: master\_use\_gtid |
| **primary\_user** string | | Same as the `MASTER_USER` mysql variable.
aliases: master\_user |
| **relay\_log\_file** string | | Same as mysql variable. |
| **relay\_log\_pos** integer | | Same as mysql variable. |
Notes
-----
Note
* If an empty value for the parameter of string type is needed, use an empty string.
* Requires the PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) package installed on the remote host. The Python package may be installed with apt-get install python-pymysql (Ubuntu; see [ansible.builtin.apt](../../ansible/builtin/apt_module#ansible-collections-ansible-builtin-apt-module)) or yum install python2-PyMySQL (RHEL/CentOS/Fedora; see [ansible.builtin.yum](../../ansible/builtin/yum_module#ansible-collections-ansible-builtin-yum-module)). You can also use dnf install python2-PyMySQL for newer versions of Fedora; see [ansible.builtin.dnf](../../ansible/builtin/dnf_module#ansible-collections-ansible-builtin-dnf-module).
* Be sure you have PyMySQL or MySQLdb library installed on the target machine for the Python interpreter Ansible uses, for example, if it is Python 3, you must install the library for Python 3. You can also change the interpreter. For more information, see [https://docs.ansible.com/ansible/latest/reference\_appendices/interpreter\_discovery.html](../../../reference_appendices/interpreter_discovery).
* Both `login_password` and `login_user` are required when you are passing credentials. If none are present, the module will attempt to read the credentials from `~/.my.cnf`, and finally fall back to using the MySQL default login of ‘root’ with no password.
* If there are problems with local connections, using *login\_unix\_socket=/path/to/mysqld/socket* instead of *login\_host=localhost* might help. As an example, the default MariaDB installation of version 10.4 and later uses the unix\_socket authentication plugin by default that without using *login\_unix\_socket=/var/run/mysqld/mysqld.sock* (the default path) causes the error `Host '127.0.0.1' is not allowed to connect to this MariaDB server`.
* Alternatively, you can use the mysqlclient library instead of MySQL-python (MySQLdb) which supports both Python 2.X and Python >=3.5. See <https://pypi.org/project/mysqlclient/> how to install it.
See Also
--------
See also
[community.mysql.mysql\_info](mysql_info_module#ansible-collections-community-mysql-mysql-info-module)
The official documentation on the **community.mysql.mysql\_info** module.
[MySQL replication reference](https://dev.mysql.com/doc/refman/8.0/en/replication.html)
Complete reference of the MySQL replication documentation.
[MySQL encrypted replication reference.](https://dev.mysql.com/doc/refman/8.0/en/replication-solutions-encrypted-connections.html)
Setting up MySQL replication to use encrypted connection.
[MariaDB replication reference](https://mariadb.com/kb/en/library/setting-up-replication/)
Complete reference of the MariaDB replication documentation.
Examples
--------
```
- name: Stop mysql replica thread
community.mysql.mysql_replication:
mode: stopreplica
- name: Get primary binlog file name and binlog position
community.mysql.mysql_replication:
mode: getprimary
- name: Change primary to primary server 192.0.2.1 and use binary log 'mysql-bin.000009' with position 4578
community.mysql.mysql_replication:
mode: changeprimary
primary_host: 192.0.2.1
primary_log_file: mysql-bin.000009
primary_log_pos: 4578
- name: Check replica status using port 3308
community.mysql.mysql_replication:
mode: getreplica
login_host: ansible.example.com
login_port: 3308
- name: On MariaDB change primary to use GTID current_pos
community.mysql.mysql_replication:
mode: changeprimary
primary_use_gtid: current_pos
- name: Change primary to use replication delay 3600 seconds
community.mysql.mysql_replication:
mode: changeprimary
primary_host: 192.0.2.1
primary_delay: 3600
- name: Start MariaDB replica with connection name primary-1
community.mysql.mysql_replication:
mode: startreplica
connection_name: primary-1
- name: Stop replication in channel primary-1
community.mysql.mysql_replication:
mode: stopreplica
channel: primary-1
- name: >
Run RESET MASTER command which will delete all existing binary log files
and reset the binary log index file on the primary
community.mysql.mysql_replication:
mode: resetprimary
- name: Run start replica and fail the task on errors
community.mysql.mysql_replication:
mode: startreplica
connection_name: primary-1
fail_on_error: yes
- name: Change primary and fail on error (like when replica thread is running)
community.mysql.mysql_replication:
mode: changeprimary
fail_on_error: 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 |
| --- | --- | --- |
| **queries** list / elements=string added in 0.1.0 of community.mysql | always | List of executed queries which modified DB's state. **Sample:** ["CHANGE MASTER TO MASTER\_HOST='primary2.example.com',MASTER\_PORT=3306"] |
### Authors
* Balazs Pocze (@banyek)
* Andrew Klychkov (@Andersson007)
ansible community.fortios.fmgr_fwpol_package – Manages FortiManager Firewall Policies Packages. community.fortios.fmgr\_fwpol\_package – Manages FortiManager Firewall Policies Packages.
=========================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_fwpol_package`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages FortiManager Firewall Policies Packages. Policy Packages contain one or more Firewall Policies/Rules and are distritbuted via FortiManager to Fortigates.
* This module controls the creation/edit/delete/assign of these packages.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **central\_nat** string | **Choices:*** enable
* **disable** ←
| Central NAT setting. |
| **fwpolicy6\_implicit\_log** string | **Choices:*** enable
* **disable** ←
| Implicit Log setting for all IPv6 policies in package. |
| **fwpolicy\_implicit\_log** string | **Choices:*** enable
* **disable** ←
| Implicit Log setting for all IPv4 policies in package. |
| **inspection\_mode** string | **Choices:*** **flow** ←
* proxy
| Inspection mode setting for the policies flow or proxy. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
| Sets one of three modes for managing the object. |
| **name** string / required | | Name of the FortiManager package or folder. |
| **ngfw\_mode** string | **Choices:*** **profile-based** ←
* policy-based
| NGFW mode setting for the policies flow or proxy. |
| **object\_type** string / required | **Choices:*** pkg
* folder
* install
| Are we managing packages or folders, or installing packages? |
| **package\_folder** string | | Name of the folder you want to put the package into. |
| **parent\_folder** string | | The parent folder name you want to add this object under. |
| **scope\_members** string | | The devices or scope that you want to assign this policy package to. |
| **scope\_members\_vdom** string | **Default:**"root" | The members VDOM you want to assign the package to. |
| **ssl\_ssh\_profile** string | | if policy-based ngfw-mode, refer to firewall ssl-ssh-profile. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: CREATE BASIC POLICY PACKAGE
community.fortios.fmgr_fwpol_package:
adom: "ansible"
mode: "add"
name: "testPackage"
object_type: "pkg"
- name: ADD PACKAGE WITH TARGETS
community.fortios.fmgr_fwpol_package:
mode: "add"
adom: "ansible"
name: "ansibleTestPackage1"
object_type: "pkg"
inspection_mode: "flow"
ngfw_mode: "profile-based"
scope_members: "seattle-fgt02, seattle-fgt03"
- name: ADD FOLDER
community.fortios.fmgr_fwpol_package:
mode: "add"
adom: "ansible"
name: "ansibleTestFolder1"
object_type: "folder"
- name: ADD PACKAGE INTO PARENT FOLDER
community.fortios.fmgr_fwpol_package:
mode: "set"
adom: "ansible"
name: "ansibleTestPackage2"
object_type: "pkg"
parent_folder: "ansibleTestFolder1"
- name: ADD FOLDER INTO PARENT FOLDER
community.fortios.fmgr_fwpol_package:
mode: "set"
adom: "ansible"
name: "ansibleTestFolder2"
object_type: "folder"
parent_folder: "ansibleTestFolder1"
- name: INSTALL PACKAGE
community.fortios.fmgr_fwpol_package:
mode: "set"
adom: "ansible"
name: "ansibleTestPackage1"
object_type: "install"
scope_members: "seattle-fgt03, seattle-fgt02"
- name: REMOVE PACKAGE
community.fortios.fmgr_fwpol_package:
mode: "delete"
adom: "ansible"
name: "ansibleTestPackage1"
object_type: "pkg"
- name: REMOVE NESTED PACKAGE
community.fortios.fmgr_fwpol_package:
mode: "delete"
adom: "ansible"
name: "ansibleTestPackage2"
object_type: "pkg"
parent_folder: "ansibleTestFolder1"
- name: REMOVE NESTED FOLDER
community.fortios.fmgr_fwpol_package:
mode: "delete"
adom: "ansible"
name: "ansibleTestFolder2"
object_type: "folder"
parent_folder: "ansibleTestFolder1"
- name: REMOVE FOLDER
community.fortios.fmgr_fwpol_package:
mode: "delete"
adom: "ansible"
name: "ansibleTestFolder1"
object_type: "folder"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible community.fortios.fmgr_device – Add or remove device from FortiManager. community.fortios.fmgr\_device – Add or remove device from FortiManager.
========================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_device`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Add or remove a device or list of devices from FortiManager Device Manager using JSON RPC API.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string / required | **Default:**"root" | The ADOM the configuration should belong to. |
| **blind\_add** string | **Choices:*** enable
* **disable** ←
| When adding a device, module will check if it exists, and skip if it does. If enabled, this option will stop the module from checking if it already exists, and blindly add the device. |
| **device\_ip** string | | The IP of the device being added to FortiManager. Supports both IPv4 and IPv6. |
| **device\_password** string | | The password of the device being added to FortiManager. |
| **device\_serial** string | | The serial number of the device being added to FortiManager. |
| **device\_unique\_name** string | | The desired "friendly" name of the device being added to FortiManager. |
| **device\_username** string | | The username of the device being added to FortiManager. |
| **mode** string | **Choices:*** **add** ←
* delete
| The desired mode of the specified object. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: DISCOVER AND ADD DEVICE FGT1
community.fortios.fmgr_device:
adom: "root"
device_username: "admin"
device_password: "admin"
device_ip: "10.10.24.201"
device_unique_name: "FGT1"
device_serial: "FGVM000000117994"
mode: "add"
blind_add: "enable"
- name: DISCOVER AND ADD DEVICE FGT2
community.fortios.fmgr_device:
adom: "root"
device_username: "admin"
device_password: "admin"
device_ip: "10.10.24.202"
device_unique_name: "FGT2"
device_serial: "FGVM000000117992"
mode: "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 |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
| programming_docs |
ansible community.fortios.fmgr_secprof_voip – VOIP security profiles in FMG community.fortios.fmgr\_secprof\_voip – VOIP security profiles in FMG
=====================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_secprof_voip`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage VOIP security profiles in FortiManager via API
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **comment** string | | Comment. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **name** string | | Profile name. |
| **sccp** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **sccp\_block\_mcast** string | **Choices:*** disable
* enable
| Enable/disable block multicast RTP connections. choice | disable | Disable status. choice | enable | Enable status. |
| **sccp\_log\_call\_summary** string | **Choices:*** disable
* enable
| Enable/disable log summary of SCCP calls. choice | disable | Disable status. choice | enable | Enable status. |
| **sccp\_log\_violations** string | **Choices:*** disable
* enable
| Enable/disable logging of SCCP violations. choice | disable | Disable status. choice | enable | Enable status. |
| **sccp\_max\_calls** string | | Maximum calls per minute per SCCP client (max 65535). |
| **sccp\_status** string | **Choices:*** disable
* enable
| Enable/disable SCCP. choice | disable | Disable status. choice | enable | Enable status. |
| **sccp\_verify\_header** string | **Choices:*** disable
* enable
| Enable/disable verify SCCP header content. choice | disable | Disable status. choice | enable | Enable status. |
| **sip** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **sip\_ack\_rate** string | | ACK request rate limit (per second, per policy). |
| **sip\_block\_ack** string | **Choices:*** disable
* enable
| Enable/disable block ACK requests. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_bye** string | **Choices:*** disable
* enable
| Enable/disable block BYE requests. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_cancel** string | **Choices:*** disable
* enable
| Enable/disable block CANCEL requests. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_geo\_red\_options** string | **Choices:*** disable
* enable
| Enable/disable block OPTIONS requests, but OPTIONS requests still notify for redundancy. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_info** string | **Choices:*** disable
* enable
| Enable/disable block INFO requests. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_invite** string | **Choices:*** disable
* enable
| Enable/disable block INVITE requests. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_long\_lines** string | **Choices:*** disable
* enable
| Enable/disable block requests with headers exceeding max-line-length. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_message** string | **Choices:*** disable
* enable
| Enable/disable block MESSAGE requests. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_notify** string | **Choices:*** disable
* enable
| Enable/disable block NOTIFY requests. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_options** string | **Choices:*** disable
* enable
| Enable/disable block OPTIONS requests and no OPTIONS as notifying message for redundancy either. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_prack** string | **Choices:*** disable
* enable
| Enable/disable block prack requests. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_publish** string | **Choices:*** disable
* enable
| Enable/disable block PUBLISH requests. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_refer** string | **Choices:*** disable
* enable
| Enable/disable block REFER requests. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_register** string | **Choices:*** disable
* enable
| Enable/disable block REGISTER requests. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_subscribe** string | **Choices:*** disable
* enable
| Enable/disable block SUBSCRIBE requests. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_unknown** string | **Choices:*** disable
* enable
| Block unrecognized SIP requests (enabled by default). choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_block\_update** string | **Choices:*** disable
* enable
| Enable/disable block UPDATE requests. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_bye\_rate** string | | BYE request rate limit (per second, per policy). |
| **sip\_call\_keepalive** string | | Continue tracking calls with no RTP for this many minutes. |
| **sip\_cancel\_rate** string | | CANCEL request rate limit (per second, per policy). |
| **sip\_contact\_fixup** string | **Choices:*** disable
* enable
| Fixup contact anyway even if contact's IP|port doesn't match session's IP|port. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_hnt\_restrict\_source\_ip** string | **Choices:*** disable
* enable
| Enable/disable restrict RTP source IP to be the same as SIP source IP when HNT is enabled. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_hosted\_nat\_traversal** string | **Choices:*** disable
* enable
| Hosted NAT Traversal (HNT). choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_info\_rate** string | | INFO request rate limit (per second, per policy). |
| **sip\_invite\_rate** string | | INVITE request rate limit (per second, per policy). |
| **sip\_ips\_rtp** string | **Choices:*** disable
* enable
| Enable/disable allow IPS on RTP. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_log\_call\_summary** string | **Choices:*** disable
* enable
| Enable/disable logging of SIP call summary. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_log\_violations** string | **Choices:*** disable
* enable
| Enable/disable logging of SIP violations. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_malformed\_header\_allow** string | **Choices:*** pass
* discard
* respond
| Action for malformed Allow header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_call\_id** string | **Choices:*** pass
* discard
* respond
| Action for malformed Call-ID header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_contact** string | **Choices:*** pass
* discard
* respond
| Action for malformed Contact header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_content\_length** string | **Choices:*** pass
* discard
* respond
| Action for malformed Content-Length header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_content\_type** string | **Choices:*** pass
* discard
* respond
| Action for malformed Content-Type header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_cseq** string | **Choices:*** pass
* discard
* respond
| Action for malformed CSeq header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_expires** string | **Choices:*** pass
* discard
* respond
| Action for malformed Expires header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_from** string | **Choices:*** pass
* discard
* respond
| Action for malformed From header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_max\_forwards** string | **Choices:*** pass
* discard
* respond
| Action for malformed Max-Forwards header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_p\_asserted\_identity** string | **Choices:*** pass
* discard
* respond
| Action for malformed P-Asserted-Identity header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_rack** string | **Choices:*** pass
* discard
* respond
| Action for malformed RAck header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_record\_route** string | **Choices:*** pass
* discard
* respond
| Action for malformed Record-Route header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_route** string | **Choices:*** pass
* discard
* respond
| Action for malformed Route header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_rseq** string | **Choices:*** pass
* discard
* respond
| Action for malformed RSeq header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_sdp\_a** string | **Choices:*** pass
* discard
* respond
| Action for malformed SDP a line. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_sdp\_b** string | **Choices:*** pass
* discard
* respond
| Action for malformed SDP b line. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_sdp\_c** string | **Choices:*** pass
* discard
* respond
| Action for malformed SDP c line. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_sdp\_i** string | **Choices:*** pass
* discard
* respond
| Action for malformed SDP i line. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_sdp\_k** string | **Choices:*** pass
* discard
* respond
| Action for malformed SDP k line. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_sdp\_m** string | **Choices:*** pass
* discard
* respond
| Action for malformed SDP m line. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_sdp\_o** string | **Choices:*** pass
* discard
* respond
| Action for malformed SDP o line. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_sdp\_r** string | **Choices:*** pass
* discard
* respond
| Action for malformed SDP r line. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_sdp\_s** string | **Choices:*** pass
* discard
* respond
| Action for malformed SDP s line. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_sdp\_t** string | **Choices:*** pass
* discard
* respond
| Action for malformed SDP t line. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_sdp\_v** string | **Choices:*** pass
* discard
* respond
| Action for malformed SDP v line. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_sdp\_z** string | **Choices:*** pass
* discard
* respond
| Action for malformed SDP z line. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_to** string | **Choices:*** pass
* discard
* respond
| Action for malformed To header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_header\_via** string | **Choices:*** pass
* discard
* respond
| Action for malformed VIA header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_malformed\_request\_line** string | **Choices:*** pass
* discard
* respond
| Action for malformed request line. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_max\_body\_length** string | | Maximum SIP message body length (0 meaning no limit). |
| **sip\_max\_dialogs** string | | Maximum number of concurrent calls/dialogs (per policy). |
| **sip\_max\_idle\_dialogs** string | | Maximum number established but idle dialogs to retain (per policy). |
| **sip\_max\_line\_length** string | | Maximum SIP header line length (78-4096). |
| **sip\_message\_rate** string | | MESSAGE request rate limit (per second, per policy). |
| **sip\_nat\_trace** string | **Choices:*** disable
* enable
| Enable/disable preservation of original IP in SDP i line. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_no\_sdp\_fixup** string | **Choices:*** disable
* enable
| Enable/disable no SDP fix-up. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_notify\_rate** string | | NOTIFY request rate limit (per second, per policy). |
| **sip\_open\_contact\_pinhole** string | **Choices:*** disable
* enable
| Enable/disable open pinhole for non-REGISTER Contact port. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_open\_record\_route\_pinhole** string | **Choices:*** disable
* enable
| Enable/disable open pinhole for Record-Route port. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_open\_register\_pinhole** string | **Choices:*** disable
* enable
| Enable/disable open pinhole for REGISTER Contact port. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_open\_via\_pinhole** string | **Choices:*** disable
* enable
| Enable/disable open pinhole for Via port. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_options\_rate** string | | OPTIONS request rate limit (per second, per policy). |
| **sip\_prack\_rate** string | | PRACK request rate limit (per second, per policy). |
| **sip\_preserve\_override** string | **Choices:*** disable
* enable
| Override i line to preserve original IPS (default| append). choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_provisional\_invite\_expiry\_time** string | | Expiry time for provisional INVITE (10 - 3600 sec). |
| **sip\_publish\_rate** string | | PUBLISH request rate limit (per second, per policy). |
| **sip\_refer\_rate** string | | REFER request rate limit (per second, per policy). |
| **sip\_register\_contact\_trace** string | **Choices:*** disable
* enable
| Enable/disable trace original IP/port within the contact header of REGISTER requests. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_register\_rate** string | | REGISTER request rate limit (per second, per policy). |
| **sip\_rfc2543\_branch** string | **Choices:*** disable
* enable
| Enable/disable support via branch compliant with RFC 2543. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_rtp** string | **Choices:*** disable
* enable
| Enable/disable create pinholes for RTP traffic to traverse firewall. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_ssl\_algorithm** string | **Choices:*** high
* medium
* low
| Relative strength of encryption algorithms accepted in negotiation. choice | high | High encryption. Allow only AES and ChaCha. choice | medium | Medium encryption. Allow AES, ChaCha, 3DES, and RC4. choice | low | Low encryption. Allow AES, ChaCha, 3DES, RC4, and DES. |
| **sip\_ssl\_auth\_client** string | | Require a client certificate and authenticate it with the peer/peergrp. |
| **sip\_ssl\_auth\_server** string | | Authenticate the server's certificate with the peer/peergrp. |
| **sip\_ssl\_client\_certificate** string | | Name of Certificate to offer to server if requested. |
| **sip\_ssl\_client\_renegotiation** string | **Choices:*** allow
* deny
* secure
| Allow/block client renegotiation by server. choice | allow | Allow a SSL client to renegotiate. choice | deny | Abort any SSL connection that attempts to renegotiate. choice | secure | Reject any SSL connection that does not offer a RFC 5746 Secure Renegotiation Indication. |
| **sip\_ssl\_max\_version** string | **Choices:*** ssl-3.0
* tls-1.0
* tls-1.1
* tls-1.2
| Highest SSL/TLS version to negotiate. choice | ssl-3.0 | SSL 3.0. choice | tls-1.0 | TLS 1.0. choice | tls-1.1 | TLS 1.1. choice | tls-1.2 | TLS 1.2. |
| **sip\_ssl\_min\_version** string | **Choices:*** ssl-3.0
* tls-1.0
* tls-1.1
* tls-1.2
| Lowest SSL/TLS version to negotiate. choice | ssl-3.0 | SSL 3.0. choice | tls-1.0 | TLS 1.0. choice | tls-1.1 | TLS 1.1. choice | tls-1.2 | TLS 1.2. |
| **sip\_ssl\_mode** string | **Choices:*** off
* full
| SSL/TLS mode for encryption & decryption of traffic. choice | off | No SSL. choice | full | Client to FortiGate and FortiGate to Server SSL. |
| **sip\_ssl\_pfs** string | **Choices:*** require
* deny
* allow
| SSL Perfect Forward Secrecy. choice | require | PFS mandatory. choice | deny | PFS rejected. choice | allow | PFS allowed. |
| **sip\_ssl\_send\_empty\_frags** string | **Choices:*** disable
* enable
| Send empty fragments to avoid attack on CBC IV (SSL 3.0 & TLS 1.0 only). choice | disable | Do not send empty fragments. choice | enable | Send empty fragments. |
| **sip\_ssl\_server\_certificate** string | | Name of Certificate return to the client in every SSL connection. |
| **sip\_status** string | **Choices:*** disable
* enable
| Enable/disable SIP. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_strict\_register** string | **Choices:*** disable
* enable
| Enable/disable only allow the registrar to connect. choice | disable | Disable status. choice | enable | Enable status. |
| **sip\_subscribe\_rate** string | | SUBSCRIBE request rate limit (per second, per policy). |
| **sip\_unknown\_header** string | **Choices:*** pass
* discard
* respond
| Action for unknown SIP header. choice | pass | Bypass malformed messages. choice | discard | Discard malformed messages. choice | respond | Respond with error code. |
| **sip\_update\_rate** string | | UPDATE request rate limit (per second, per policy). |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: DELETE Profile
community.fortios.fmgr_secprof_voip:
name: "Ansible_VOIP_Profile"
mode: "delete"
- name: Create FMGR_VOIP_PROFILE
community.fortios.fmgr_secprof_voip:
mode: "set"
adom: "root"
name: "Ansible_VOIP_Profile"
comment: "Created by Ansible"
sccp: {block-mcast: "enable", log-call-summary: "enable", log-violations: "enable", status: "enable"}
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
| programming_docs |
ansible community.fortios.fmgr_secprof_wanopt – WAN optimization community.fortios.fmgr\_secprof\_wanopt – WAN optimization
==========================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_secprof_wanopt`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage WanOpt security profiles in FortiManager via API
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **auth\_group** string | | Optionally add an authentication group to restrict access to the WAN Optimization tunnel to peers in the authentication group. |
| **cifs** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **cifs\_byte\_caching** string | **Choices:*** disable
* enable
| Enable/disable byte-caching for HTTP. Byte caching reduces the amount of traffic by caching file data sent across the WAN and in future serving if from the cache. |
| **cifs\_log\_traffic** string | **Choices:*** disable
* enable
| Enable/disable logging. |
| **cifs\_port** string | | Single port number or port number range for CIFS. Only packets with a destination port number that matches this port number or range are accepted by this profile. |
| **cifs\_prefer\_chunking** string | **Choices:*** dynamic
* fix
| Select dynamic or fixed-size data chunking for HTTP WAN Optimization. |
| **cifs\_secure\_tunnel** string | **Choices:*** disable
* enable
| Enable/disable securing the WAN Opt tunnel using SSL. Secure and non-secure tunnels use the same TCP port (7810). |
| **cifs\_status** string | **Choices:*** disable
* enable
| Enable/disable HTTP WAN Optimization. |
| **cifs\_tunnel\_sharing** string | **Choices:*** private
* shared
* express-shared
| Tunnel sharing mode for aggressive/non-aggressive and/or interactive/non-interactive protocols. |
| **comments** string | | Comment. |
| **ftp** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **ftp\_byte\_caching** string | **Choices:*** disable
* enable
| Enable/disable byte-caching for HTTP. Byte caching reduces the amount of traffic by caching file data sent across the WAN and in future serving if from the cache. |
| **ftp\_log\_traffic** string | **Choices:*** disable
* enable
| Enable/disable logging. |
| **ftp\_port** string | | Single port number or port number range for FTP. Only packets with a destination port number that matches this port number or range are accepted by this profile. |
| **ftp\_prefer\_chunking** string | **Choices:*** dynamic
* fix
| Select dynamic or fixed-size data chunking for HTTP WAN Optimization. |
| **ftp\_secure\_tunnel** string | **Choices:*** disable
* enable
| Enable/disable securing the WAN Opt tunnel using SSL. Secure and non-secure tunnels use the same TCP port (7810). |
| **ftp\_status** string | **Choices:*** disable
* enable
| Enable/disable HTTP WAN Optimization. |
| **ftp\_tunnel\_sharing** string | **Choices:*** private
* shared
* express-shared
| Tunnel sharing mode for aggressive/non-aggressive and/or interactive/non-interactive protocols. |
| **http** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **http\_byte\_caching** string | **Choices:*** disable
* enable
| Enable/disable byte-caching for HTTP. Byte caching reduces the amount of traffic by caching file data sent across the WAN and in future serving if from the cache. |
| **http\_log\_traffic** string | **Choices:*** disable
* enable
| Enable/disable logging. |
| **http\_port** string | | Single port number or port number range for HTTP. Only packets with a destination port number that matches this port number or range are accepted by this profile. |
| **http\_prefer\_chunking** string | **Choices:*** dynamic
* fix
| Select dynamic or fixed-size data chunking for HTTP WAN Optimization. |
| **http\_secure\_tunnel** string | **Choices:*** disable
* enable
| Enable/disable securing the WAN Opt tunnel using SSL. Secure and non-secure tunnels use the same TCP port (7810). |
| **http\_ssl** string | **Choices:*** disable
* enable
| Enable/disable SSL/TLS offloading (hardware acceleration) for HTTPS traffic in this tunnel. |
| **http\_ssl\_port** string | | Port on which to expect HTTPS traffic for SSL/TLS offloading. |
| **http\_status** string | **Choices:*** disable
* enable
| Enable/disable HTTP WAN Optimization. |
| **http\_tunnel\_non\_http** string | **Choices:*** disable
* enable
| Configure how to process non-HTTP traffic when a profile configured for HTTP traffic accepts a non-HTTP session. Can occur if an application sends non-HTTP traffic using an HTTP destination port. |
| **http\_tunnel\_sharing** string | **Choices:*** private
* shared
* express-shared
| Tunnel sharing mode for aggressive/non-aggressive and/or interactive/non-interactive protocols. |
| **http\_unknown\_http\_version** string | **Choices:*** best-effort
* reject
* tunnel
| How to handle HTTP sessions that do not comply with HTTP 0.9, 1.0, or 1.1. |
| **mapi** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **mapi\_byte\_caching** string | **Choices:*** disable
* enable
| Enable/disable byte-caching for HTTP. Byte caching reduces the amount of traffic by caching file data sent across the WAN and in future serving if from the cache. |
| **mapi\_log\_traffic** string | **Choices:*** disable
* enable
| Enable/disable logging. |
| **mapi\_port** string | | Single port number or port number range for MAPI. Only packets with a destination port number that matches this port number or range are accepted by this profile. |
| **mapi\_secure\_tunnel** string | **Choices:*** disable
* enable
| Enable/disable securing the WAN Opt tunnel using SSL. Secure and non-secure tunnels use the same TCP port (7810). |
| **mapi\_status** string | **Choices:*** disable
* enable
| Enable/disable HTTP WAN Optimization. |
| **mapi\_tunnel\_sharing** string | **Choices:*** private
* shared
* express-shared
| Tunnel sharing mode for aggressive/non-aggressive and/or interactive/non-interactive protocols. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **name** string | | Profile name. |
| **tcp** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **tcp\_byte\_caching** string | **Choices:*** disable
* enable
| Enable/disable byte-caching for HTTP. Byte caching reduces the amount of traffic by caching file data sent across the WAN and in future serving if from the cache. |
| **tcp\_byte\_caching\_opt** string | **Choices:*** mem-only
* mem-disk
| Select whether TCP byte-caching uses system memory only or both memory and disk space. |
| **tcp\_log\_traffic** string | **Choices:*** disable
* enable
| Enable/disable logging. |
| **tcp\_port** string | | Single port number or port number range for TCP. Only packets with a destination port number that matches this port number or range are accepted by this profile. |
| **tcp\_secure\_tunnel** string | **Choices:*** disable
* enable
| Enable/disable securing the WAN Opt tunnel using SSL. Secure and non-secure tunnels use the same TCP port (7810). |
| **tcp\_ssl** string | **Choices:*** disable
* enable
| Enable/disable SSL/TLS offloading. |
| **tcp\_ssl\_port** string | | Port on which to expect HTTPS traffic for SSL/TLS offloading. |
| **tcp\_status** string | **Choices:*** disable
* enable
| Enable/disable HTTP WAN Optimization. |
| **tcp\_tunnel\_sharing** string | **Choices:*** private
* shared
* express-shared
| Tunnel sharing mode for aggressive/non-aggressive and/or interactive/non-interactive protocols. |
| **transparent** string | **Choices:*** disable
* enable
| Enable/disable transparent mode. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: DELETE Profile
community.fortios.fmgr_secprof_wanopt:
name: "Ansible_WanOpt_Profile"
mode: "delete"
- name: Create FMGR_WANOPT_PROFILE
community.fortios.fmgr_secprof_wanopt:
mode: "set"
adom: "root"
transparent: "enable"
name: "Ansible_WanOpt_Profile"
comments: "Created by Ansible"
cifs: {byte-caching: "enable",
log-traffic: "enable",
port: 80,
prefer-chunking: "dynamic",
status: "enable",
tunnel-sharing: "private"}
ftp: {byte-caching: "enable",
log-traffic: "enable",
port: 80,
prefer-chunking: "dynamic",
secure-tunnel: "disable",
status: "enable",
tunnel-sharing: "private"}
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible community.fortios.faz_device – Add or remove device community.fortios.faz\_device – Add or remove device
====================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.faz_device`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Add or remove a device or list of devices to FortiAnalyzer Device Manager. ADOM Capable.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string / required | **Default:**"root" | The ADOM the configuration should belong to. |
| **device\_ip** string | | The IP of the device being added to FortiAnalyzer. |
| **device\_password** string | | The password of the device being added to FortiAnalyzer. |
| **device\_serial** string | | The serial number of the device being added to FortiAnalyzer. |
| **device\_unique\_name** string | | The desired "friendly" name of the device being added to FortiAnalyzer. |
| **device\_username** string | | The username of the device being added to FortiAnalyzer. |
| **faz\_quota** string | | Specifies the quota for the device in FAZ |
| **mgmt\_mode** string / required | **Choices:*** unreg
* fmg
* faz
* fmgfaz
| Management Mode of the device you are adding. |
| **mode** string | **Choices:*** **add** ←
* delete
* promote
| Add or delete devices. Or promote unregistered devices that are in the FortiAnalyzer "waiting pool" |
| **os\_minor\_vers** string / required | | Minor OS rev of the device. |
| **os\_type** string / required | **Choices:*** unknown
* fos
* fsw
* foc
* fml
* faz
* fwb
* fch
* fct
* log
* fmg
* fsa
* fdd
* fac
| The os type of the device being added (default 0). |
| **os\_ver** string / required | **Choices:*** unknown
* 0.0
* 1.0
* 2.0
* 3.0
* 4.0
* 5.0
* 6.0
| Major OS rev of the device |
| **platform\_str** string | | Required for determine the platform for VM platforms. ie FortiGate-VM64 |
Examples
--------
```
- name: DISCOVER AND ADD DEVICE A PHYSICAL FORTIGATE
community.fortios.faz_device:
adom: "root"
device_username: "admin"
device_password: "admin"
device_ip: "10.10.24.201"
device_unique_name: "FGT1"
device_serial: "FGVM000000117994"
state: "present"
mgmt_mode: "faz"
os_type: "fos"
os_ver: "5.0"
minor_rev: 6
- name: DISCOVER AND ADD DEVICE A VIRTUAL FORTIGATE
community.fortios.faz_device:
adom: "root"
device_username: "admin"
device_password: "admin"
device_ip: "10.10.24.202"
device_unique_name: "FGT2"
mgmt_mode: "faz"
os_type: "fos"
os_ver: "5.0"
minor_rev: 6
state: "present"
platform_str: "FortiGate-VM64"
- name: DELETE DEVICE FGT01
community.fortios.faz_device:
adom: "root"
device_unique_name: "ansible-fgt01"
mode: "delete"
- name: DELETE DEVICE FGT02
community.fortios.faz_device:
adom: "root"
device_unique_name: "ansible-fgt02"
mode: "delete"
- name: PROMOTE FGT01 IN FAZ BY IP
community.fortios.faz_device:
adom: "root"
device_password: "fortinet"
device_ip: "10.7.220.151"
device_username: "ansible"
mgmt_mode: "faz"
mode: "promote"
- name: PROMOTE FGT02 IN FAZ
community.fortios.faz_device:
adom: "root"
device_password: "fortinet"
device_unique_name: "ansible-fgt02"
device_username: "ansible"
mgmt_mode: "faz"
mode: "promote"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
ansible community.fortios.fmgr_fwobj_ippool – Allows the editing of IP Pool Objects within FortiManager. community.fortios.fmgr\_fwobj\_ippool – Allows the editing of IP Pool Objects within FortiManager.
==================================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_fwobj_ippool`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows users to add/edit/delete IP Pool Objects.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **arp\_intf** string | | Select an interface from available options that will reply to ARP requests. (If blank, any is selected). |
| **arp\_reply** string | **Choices:*** disable
* enable
| Enable/disable replying to ARP requests when an IP Pool is added to a policy (default = enable). choice | disable | Disable ARP reply. choice | enable | Enable ARP reply. |
| **associated\_interface** string | | Associated interface name. |
| **block\_size** string | | Number of addresses in a block (64 to 4096, default = 128). |
| **comments** string | | Comment. |
| **dynamic\_mapping** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameter.ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **dynamic\_mapping\_arp\_intf** string | | Dynamic Mapping clone of original suffixed parameter. |
| **dynamic\_mapping\_arp\_reply** string | **Choices:*** disable
* enable
| Dynamic Mapping clone of original suffixed parameter. |
| **dynamic\_mapping\_associated\_interface** string | | Dynamic Mapping clone of original suffixed parameter. |
| **dynamic\_mapping\_block\_size** string | | Dynamic Mapping clone of original suffixed parameter. |
| **dynamic\_mapping\_comments** string | | Dynamic Mapping clone of original suffixed parameter. |
| **dynamic\_mapping\_endip** string | | Dynamic Mapping clone of original suffixed parameter. |
| **dynamic\_mapping\_num\_blocks\_per\_user** string | | Dynamic Mapping clone of original suffixed parameter. |
| **dynamic\_mapping\_pba\_timeout** string | | Dynamic Mapping clone of original suffixed parameter. |
| **dynamic\_mapping\_permit\_any\_host** string | **Choices:*** disable
* enable
| Dynamic Mapping clone of original suffixed parameter. |
| **dynamic\_mapping\_source\_endip** string | | Dynamic Mapping clone of original suffixed parameter. |
| **dynamic\_mapping\_source\_startip** string | | Dynamic Mapping clone of original suffixed parameter. |
| **dynamic\_mapping\_startip** string | | Dynamic Mapping clone of original suffixed parameter. |
| **dynamic\_mapping\_type** string | **Choices:*** overload
* one-to-one
* fixed-port-range
* port-block-allocation
| Dynamic Mapping clone of original suffixed parameter. |
| **endip** string | | Final IPv4 address (inclusive) in the range for the address pool (format xxx.xxx.xxx.xxx, Default| 0.0.0.0). |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **name** string | | IP pool name. |
| **num\_blocks\_per\_user** string | | Number of addresses blocks that can be used by a user (1 to 128, default = 8). |
| **pba\_timeout** string | | Port block allocation timeout (seconds). |
| **permit\_any\_host** string | **Choices:*** disable
* enable
| Enable/disable full cone NAT. choice | disable | Disable full cone NAT. choice | enable | Enable full cone NAT. |
| **source\_endip** string | | Final IPv4 address (inclusive) in the range of the source addresses to be translated (format xxx.xxx.xxx.xxx, Default| 0.0.0.0). |
| **source\_startip** string | | First IPv4 address (inclusive) in the range of the source addresses to be translated (format xxx.xxx.xxx.xxx, Default| 0.0.0.0). |
| **startip** string | | First IPv4 address (inclusive) in the range for the address pool (format xxx.xxx.xxx.xxx, Default| 0.0.0.0). |
| **type** string | **Choices:*** overload
* one-to-one
* fixed-port-range
* port-block-allocation
| IP pool type (overload, one-to-one, fixed port range, or port block allocation). choice | overload | IP addresses in the IP pool can be shared by clients. choice | one-to-one | One to one mapping. choice | fixed-port-range | Fixed port range. choice | port-block-allocation | Port block allocation. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: ADD FMGR_FIREWALL_IPPOOL Overload
community.fortios.fmgr_fwobj_ippool:
mode: "add"
adom: "ansible"
name: "Ansible_pool4_overload"
comments: "Created by ansible"
type: "overload"
# OPTIONS FOR ALL MODES
startip: "10.10.10.10"
endip: "10.10.10.100"
arp_reply: "enable"
- name: ADD FMGR_FIREWALL_IPPOOL one-to-one
community.fortios.fmgr_fwobj_ippool:
mode: "add"
adom: "ansible"
name: "Ansible_pool4_121"
comments: "Created by ansible"
type: "one-to-one"
# OPTIONS FOR ALL MODES
startip: "10.10.20.10"
endip: "10.10.20.100"
arp_reply: "enable"
- name: ADD FMGR_FIREWALL_IPPOOL FIXED PORT RANGE
community.fortios.fmgr_fwobj_ippool:
mode: "add"
adom: "ansible"
name: "Ansible_pool4_fixed_port"
comments: "Created by ansible"
type: "fixed-port-range"
# OPTIONS FOR ALL MODES
startip: "10.10.40.10"
endip: "10.10.40.100"
arp_reply: "enable"
# FIXED PORT RANGE OPTIONS
source_startip: "192.168.20.1"
source_endip: "192.168.20.20"
- name: ADD FMGR_FIREWALL_IPPOOL PORT BLOCK ALLOCATION
community.fortios.fmgr_fwobj_ippool:
mode: "add"
adom: "ansible"
name: "Ansible_pool4_port_block_allocation"
comments: "Created by ansible"
type: "port-block-allocation"
# OPTIONS FOR ALL MODES
startip: "10.10.30.10"
endip: "10.10.30.100"
arp_reply: "enable"
# PORT BLOCK ALLOCATION OPTIONS
block_size: "128"
num_blocks_per_user: "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 |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
| programming_docs |
ansible community.fortios.fmgr_device_config – Edit device configurations community.fortios.fmgr\_device\_config – Edit device configurations
===================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_device_config`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Edit device configurations from FortiManager Device Manager using JSON RPC API.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **device\_hostname** string | | The device's new hostname. |
| **device\_unique\_name** string / required | | The unique device's name that you are editing. A.K.A. Friendly name of the device in FortiManager. |
| **install\_config** string | **Default:**"disable" | Tells FMGR to attempt to install the config after making it. |
| **interface** string | | The interface/port number you are editing. |
| **interface\_allow\_access** string | | Specify what protocols are allowed on the interface, comma-separated list (see examples). |
| **interface\_ip** string | | The IP and subnet of the interface/port you are editing. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: CHANGE HOSTNAME
community.fortios.fmgr_device_config:
device_hostname: "ChangedbyAnsible"
device_unique_name: "FGT1"
- name: EDIT INTERFACE INFORMATION
community.fortios.fmgr_device_config:
adom: "root"
device_unique_name: "FGT2"
interface: "port3"
interface_ip: "10.1.1.1/24"
interface_allow_access: "ping, telnet, https"
- name: INSTALL CONFIG
community.fortios.fmgr_device_config:
adom: "root"
device_unique_name: "FGT1"
install_config: "enable"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible Community.Fortios Community.Fortios
=================
Collection version 1.0.0
Plugin Index
------------
These are the plugins in the community.fortios collection
### Httpapi Plugins
* [fortianalyzer](fortianalyzer_httpapi#ansible-collections-community-fortios-fortianalyzer-httpapi) – HttpApi Plugin for Fortinet FortiAnalyzer Appliance or VM.
* [fortimanager](fortimanager_httpapi#ansible-collections-community-fortios-fortimanager-httpapi) – HttpApi Plugin for Fortinet FortiManager Appliance or VM.
### Modules
* [faz\_device](faz_device_module#ansible-collections-community-fortios-faz-device-module) – Add or remove device
* [fmgr\_device](fmgr_device_module#ansible-collections-community-fortios-fmgr-device-module) – Add or remove device from FortiManager.
* [fmgr\_device\_config](fmgr_device_config_module#ansible-collections-community-fortios-fmgr-device-config-module) – Edit device configurations
* [fmgr\_device\_group](fmgr_device_group_module#ansible-collections-community-fortios-fmgr-device-group-module) – Alter FortiManager device groups.
* [fmgr\_device\_provision\_template](fmgr_device_provision_template_module#ansible-collections-community-fortios-fmgr-device-provision-template-module) – Manages Device Provisioning Templates in FortiManager.
* [fmgr\_fwobj\_address](fmgr_fwobj_address_module#ansible-collections-community-fortios-fmgr-fwobj-address-module) – Allows the management of firewall objects in FortiManager
* [fmgr\_fwobj\_ippool](fmgr_fwobj_ippool_module#ansible-collections-community-fortios-fmgr-fwobj-ippool-module) – Allows the editing of IP Pool Objects within FortiManager.
* [fmgr\_fwobj\_ippool6](fmgr_fwobj_ippool6_module#ansible-collections-community-fortios-fmgr-fwobj-ippool6-module) – Allows the editing of IP Pool Objects within FortiManager.
* [fmgr\_fwobj\_service](fmgr_fwobj_service_module#ansible-collections-community-fortios-fmgr-fwobj-service-module) – Manages FortiManager Firewall Service Objects.
* [fmgr\_fwobj\_vip](fmgr_fwobj_vip_module#ansible-collections-community-fortios-fmgr-fwobj-vip-module) – Manages Virtual IPs objects in FortiManager
* [fmgr\_fwpol\_ipv4](fmgr_fwpol_ipv4_module#ansible-collections-community-fortios-fmgr-fwpol-ipv4-module) – Allows the add/delete of Firewall Policies on Packages in FortiManager.
* [fmgr\_fwpol\_package](fmgr_fwpol_package_module#ansible-collections-community-fortios-fmgr-fwpol-package-module) – Manages FortiManager Firewall Policies Packages.
* [fmgr\_ha](fmgr_ha_module#ansible-collections-community-fortios-fmgr-ha-module) – Manages the High-Availability State of FortiManager Clusters and Nodes.
* [fmgr\_provisioning](fmgr_provisioning_module#ansible-collections-community-fortios-fmgr-provisioning-module) – Provision devices via FortiMananger
* [fmgr\_query](fmgr_query_module#ansible-collections-community-fortios-fmgr-query-module) – Query FortiManager data objects for use in Ansible workflows.
* [fmgr\_script](fmgr_script_module#ansible-collections-community-fortios-fmgr-script-module) – Add/Edit/Delete and execute scripts
* [fmgr\_secprof\_appctrl](fmgr_secprof_appctrl_module#ansible-collections-community-fortios-fmgr-secprof-appctrl-module) – Manage application control security profiles
* [fmgr\_secprof\_av](fmgr_secprof_av_module#ansible-collections-community-fortios-fmgr-secprof-av-module) – Manage security profile
* [fmgr\_secprof\_dns](fmgr_secprof_dns_module#ansible-collections-community-fortios-fmgr-secprof-dns-module) – Manage DNS security profiles in FortiManager
* [fmgr\_secprof\_ips](fmgr_secprof_ips_module#ansible-collections-community-fortios-fmgr-secprof-ips-module) – Managing IPS security profiles in FortiManager
* [fmgr\_secprof\_profile\_group](fmgr_secprof_profile_group_module#ansible-collections-community-fortios-fmgr-secprof-profile-group-module) – Manage security profiles within FortiManager
* [fmgr\_secprof\_proxy](fmgr_secprof_proxy_module#ansible-collections-community-fortios-fmgr-secprof-proxy-module) – Manage proxy security profiles in FortiManager
* [fmgr\_secprof\_spam](fmgr_secprof_spam_module#ansible-collections-community-fortios-fmgr-secprof-spam-module) – spam filter profile for FMG
* [fmgr\_secprof\_ssl\_ssh](fmgr_secprof_ssl_ssh_module#ansible-collections-community-fortios-fmgr-secprof-ssl-ssh-module) – Manage SSL and SSH security profiles in FortiManager
* [fmgr\_secprof\_voip](fmgr_secprof_voip_module#ansible-collections-community-fortios-fmgr-secprof-voip-module) – VOIP security profiles in FMG
* [fmgr\_secprof\_waf](fmgr_secprof_waf_module#ansible-collections-community-fortios-fmgr-secprof-waf-module) – FortiManager web application firewall security profile
* [fmgr\_secprof\_wanopt](fmgr_secprof_wanopt_module#ansible-collections-community-fortios-fmgr-secprof-wanopt-module) – WAN optimization
* [fmgr\_secprof\_web](fmgr_secprof_web_module#ansible-collections-community-fortios-fmgr-secprof-web-module) – Manage web filter security profiles in FortiManager
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible community.fortios.fmgr_device_group – Alter FortiManager device groups. community.fortios.fmgr\_device\_group – Alter FortiManager device groups.
=========================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_device_group`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Add or edit device groups and assign devices to device groups FortiManager Device Manager using JSON RPC API.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **grp\_desc** string | | The description of the device group. |
| **grp\_members** string | | A comma separated list of device names or device groups to be added as members to the device group. If Group Members are defined, and mode="delete", only group members will be removed. If you want to delete a group itself, you must omit this parameter from the task in playbook. |
| **grp\_name** string | | The name of the device group. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **vdom** string | **Default:**"root" | The VDOM of the Fortigate you want to add, must match the device in FMGR. Usually root. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: CREATE DEVICE GROUP
community.fortios.fmgr_device_group:
grp_name: "TestGroup"
grp_desc: "CreatedbyAnsible"
adom: "ansible"
mode: "add"
- name: CREATE DEVICE GROUP 2
community.fortios.fmgr_device_group:
grp_name: "AnsibleGroup"
grp_desc: "CreatedbyAnsible"
adom: "ansible"
mode: "add"
- name: ADD DEVICES TO DEVICE GROUP
community.fortios.fmgr_device_group:
mode: "add"
grp_name: "TestGroup"
grp_members: "FGT1,FGT2"
adom: "ansible"
vdom: "root"
- name: REMOVE DEVICES TO DEVICE GROUP
community.fortios.fmgr_device_group:
mode: "delete"
grp_name: "TestGroup"
grp_members: "FGT1,FGT2"
adom: "ansible"
- name: DELETE DEVICE GROUP
community.fortios.fmgr_device_group:
grp_name: "AnsibleGroup"
grp_desc: "CreatedbyAnsible"
mode: "delete"
adom: "ansible"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible community.fortios.fmgr_secprof_web – Manage web filter security profiles in FortiManager community.fortios.fmgr\_secprof\_web – Manage web filter security profiles in FortiManager
==========================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_secprof_web`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage web filter security profiles in FortiManager through playbooks using the FMG API
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **comment** string | | Optional comments. |
| **extended\_log** string | **Choices:*** disable
* enable
| Enable/disable extended logging for web filtering. choice | disable | Disable setting. choice | enable | Enable setting. |
| **ftgd\_wf** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **ftgd\_wf\_exempt\_quota** string | | Do not stop quota for these categories. |
| **ftgd\_wf\_filters\_action** string | **Choices:*** block
* monitor
* warning
* authenticate
| Action to take for matches. choice | block | Block access. choice | monitor | Allow access while logging the action. choice | warning | Allow access after warning the user. choice | authenticate | Authenticate user before allowing access. |
| **ftgd\_wf\_filters\_auth\_usr\_grp** string | | Groups with permission to authenticate. |
| **ftgd\_wf\_filters\_category** string | | Categories and groups the filter examines. |
| **ftgd\_wf\_filters\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **ftgd\_wf\_filters\_override\_replacemsg** string | | Override replacement message. |
| **ftgd\_wf\_filters\_warn\_duration** string | | Duration of warnings. |
| **ftgd\_wf\_filters\_warning\_duration\_type** string | **Choices:*** session
* timeout
| Re-display warning after closing browser or after a timeout. choice | session | After session ends. choice | timeout | After timeout occurs. |
| **ftgd\_wf\_filters\_warning\_prompt** string | **Choices:*** per-domain
* per-category
| Warning prompts in each category or each domain. choice | per-domain | Per-domain warnings. choice | per-category | Per-category warnings. |
| **ftgd\_wf\_max\_quota\_timeout** string | | Maximum FortiGuard quota used by single page view in seconds (excludes streams). |
| **ftgd\_wf\_options** string | **Choices:*** error-allow
* rate-server-ip
* connect-request-bypass
* ftgd-disable
| Options for FortiGuard Web Filter. FLAG Based Options. Specify multiple in list form. flag | error-allow | Allow web pages with a rating error to pass through. flag | rate-server-ip | Rate the server IP in addition to the domain name. flag | connect-request-bypass | Bypass connection which has CONNECT request. flag | ftgd-disable | Disable FortiGuard scanning. |
| **ftgd\_wf\_ovrd** string | | Allow web filter profile overrides. |
| **ftgd\_wf\_quota\_category** string | | FortiGuard categories to apply quota to (category action must be set to monitor). |
| **ftgd\_wf\_quota\_duration** string | | Duration of quota. |
| **ftgd\_wf\_quota\_override\_replacemsg** string | | Override replacement message. |
| **ftgd\_wf\_quota\_type** string | **Choices:*** time
* traffic
| Quota type. choice | time | Use a time-based quota. choice | traffic | Use a traffic-based quota. |
| **ftgd\_wf\_quota\_unit** string | **Choices:*** B
* KB
* MB
* GB
| Traffic quota unit of measurement. choice | B | Quota in bytes. choice | KB | Quota in kilobytes. choice | MB | Quota in megabytes. choice | GB | Quota in gigabytes. |
| **ftgd\_wf\_quota\_value** string | | Traffic quota value. |
| **ftgd\_wf\_rate\_crl\_urls** string | **Choices:*** disable
* enable
| Enable/disable rating CRL by URL. choice | disable | Disable rating CRL by URL. choice | enable | Enable rating CRL by URL. |
| **ftgd\_wf\_rate\_css\_urls** string | **Choices:*** disable
* enable
| Enable/disable rating CSS by URL. choice | disable | Disable rating CSS by URL. choice | enable | Enable rating CSS by URL. |
| **ftgd\_wf\_rate\_image\_urls** string | **Choices:*** disable
* enable
| Enable/disable rating images by URL. choice | disable | Disable rating images by URL (blocked images are replaced with blanks). choice | enable | Enable rating images by URL (blocked images are replaced with blanks). |
| **ftgd\_wf\_rate\_javascript\_urls** string | **Choices:*** disable
* enable
| Enable/disable rating JavaScript by URL. choice | disable | Disable rating JavaScript by URL. choice | enable | Enable rating JavaScript by URL. |
| **https\_replacemsg** string | **Choices:*** disable
* enable
| Enable replacement messages for HTTPS. choice | disable | Disable setting. choice | enable | Enable setting. |
| **inspection\_mode** string | **Choices:*** proxy
* flow-based
| Web filtering inspection mode. choice | proxy | Proxy. choice | flow-based | Flow based. |
| **log\_all\_url** string | **Choices:*** disable
* enable
| Enable/disable logging all URLs visited. choice | disable | Disable setting. choice | enable | Enable setting. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **name** string | | Profile name. |
| **options** string | **Choices:*** block-invalid-url
* jscript
* js
* vbs
* unknown
* wf-referer
* intrinsic
* wf-cookie
* per-user-bwl
* activexfilter
* cookiefilter
* javafilter
| FLAG Based Options. Specify multiple in list form. flag | block-invalid-url | Block sessions contained an invalid domain name. flag | jscript | Javascript block. flag | js | JS block. flag | vbs | VB script block. flag | unknown | Unknown script block. flag | wf-referer | Referring block. flag | intrinsic | Intrinsic script block. flag | wf-cookie | Cookie block. flag | per-user-bwl | Per-user black/white list filter flag | activexfilter | ActiveX filter. flag | cookiefilter | Cookie filter. flag | javafilter | Java applet filter. |
| **override** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **override\_ovrd\_cookie** string | **Choices:*** deny
* allow
| Allow/deny browser-based (cookie) overrides. choice | deny | Deny browser-based (cookie) override. choice | allow | Allow browser-based (cookie) override. |
| **override\_ovrd\_dur** string | | Override duration. |
| **override\_ovrd\_dur\_mode** string | **Choices:*** constant
* ask
| Override duration mode. choice | constant | Constant mode. choice | ask | Prompt for duration when initiating an override. |
| **override\_ovrd\_scope** string | **Choices:*** user
* user-group
* ip
* ask
* browser
| Override scope. choice | user | Override for the user. choice | user-group | Override for the user's group. choice | ip | Override for the initiating IP. choice | ask | Prompt for scope when initiating an override. choice | browser | Create browser-based (cookie) override. |
| **override\_ovrd\_user\_group** string | | User groups with permission to use the override. |
| **override\_profile** string | | Web filter profile with permission to create overrides. |
| **override\_profile\_attribute** string | **Choices:*** User-Name
* NAS-IP-Address
* Framed-IP-Address
* Framed-IP-Netmask
* Filter-Id
* Login-IP-Host
* Reply-Message
* Callback-Number
* Callback-Id
* Framed-Route
* Framed-IPX-Network
* Class
* Called-Station-Id
* Calling-Station-Id
* NAS-Identifier
* Proxy-State
* Login-LAT-Service
* Login-LAT-Node
* Login-LAT-Group
* Framed-AppleTalk-Zone
* Acct-Session-Id
* Acct-Multi-Session-Id
| Profile attribute to retrieve from the RADIUS server. choice | User-Name | Use this attribute. choice | NAS-IP-Address | Use this attribute. choice | Framed-IP-Address | Use this attribute. choice | Framed-IP-Netmask | Use this attribute. choice | Filter-Id | Use this attribute. choice | Login-IP-Host | Use this attribute. choice | Reply-Message | Use this attribute. choice | Callback-Number | Use this attribute. choice | Callback-Id | Use this attribute. choice | Framed-Route | Use this attribute. choice | Framed-IPX-Network | Use this attribute. choice | Class | Use this attribute. choice | Called-Station-Id | Use this attribute. choice | Calling-Station-Id | Use this attribute. choice | NAS-Identifier | Use this attribute. choice | Proxy-State | Use this attribute. choice | Login-LAT-Service | Use this attribute. choice | Login-LAT-Node | Use this attribute. choice | Login-LAT-Group | Use this attribute. choice | Framed-AppleTalk-Zone | Use this attribute. choice | Acct-Session-Id | Use this attribute. choice | Acct-Multi-Session-Id | Use this attribute. |
| **override\_profile\_type** string | **Choices:*** list
* radius
| Override profile type. choice | list | Profile chosen from list. choice | radius | Profile determined by RADIUS server. |
| **ovrd\_perm** string | **Choices:*** bannedword-override
* urlfilter-override
* fortiguard-wf-override
* contenttype-check-override
| FLAG Based Options. Specify multiple in list form. flag | bannedword-override | Banned word override. flag | urlfilter-override | URL filter override. flag | fortiguard-wf-override | FortiGuard Web Filter override. flag | contenttype-check-override | Content-type header override. |
| **post\_action** string | **Choices:*** normal
* block
| Action taken for HTTP POST traffic. choice | normal | Normal, POST requests are allowed. choice | block | POST requests are blocked. |
| **replacemsg\_group** string | | Replacement message group. |
| **url\_extraction** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **url\_extraction\_redirect\_header** string | | HTTP header name to use for client redirect on blocked requests |
| **url\_extraction\_redirect\_no\_content** string | **Choices:*** disable
* enable
| Enable / Disable empty message-body entity in HTTP response choice | disable | Disable setting. choice | enable | Enable setting. |
| **url\_extraction\_redirect\_url** string | | HTTP header value to use for client redirect on blocked requests |
| **url\_extraction\_server\_fqdn** string | | URL extraction server FQDN (fully qualified domain name) |
| **url\_extraction\_status** string | **Choices:*** disable
* enable
| Enable URL Extraction choice | disable | Disable setting. choice | enable | Enable setting. |
| **web** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **web\_blacklist** string | **Choices:*** disable
* enable
| Enable/disable automatic addition of URLs detected by FortiSandbox to blacklist. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_bword\_table** string | | Banned word table ID. |
| **web\_bword\_threshold** string | | Banned word score threshold. |
| **web\_content\_header\_list** string | | Content header list. |
| **web\_content\_log** string | **Choices:*** disable
* enable
| Enable/disable logging logging blocked web content. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_extended\_all\_action\_log** string | **Choices:*** disable
* enable
| Enable/disable extended any filter action logging for web filtering. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_filter\_activex\_log** string | **Choices:*** disable
* enable
| Enable/disable logging ActiveX. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_filter\_applet\_log** string | **Choices:*** disable
* enable
| Enable/disable logging Java applets. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_filter\_command\_block\_log** string | **Choices:*** disable
* enable
| Enable/disable logging blocked commands. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_filter\_cookie\_log** string | **Choices:*** disable
* enable
| Enable/disable logging cookie filtering. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_filter\_cookie\_removal\_log** string | **Choices:*** disable
* enable
| Enable/disable logging blocked cookies. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_filter\_js\_log** string | **Choices:*** disable
* enable
| Enable/disable logging Java scripts. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_filter\_jscript\_log** string | **Choices:*** disable
* enable
| Enable/disable logging JScripts. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_filter\_referer\_log** string | **Choices:*** disable
* enable
| Enable/disable logging referrers. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_filter\_unknown\_log** string | **Choices:*** disable
* enable
| Enable/disable logging unknown scripts. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_filter\_vbs\_log** string | **Choices:*** disable
* enable
| Enable/disable logging VBS scripts. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_ftgd\_err\_log** string | **Choices:*** disable
* enable
| Enable/disable logging rating errors. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_ftgd\_quota\_usage** string | **Choices:*** disable
* enable
| Enable/disable logging daily quota usage. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_invalid\_domain\_log** string | **Choices:*** disable
* enable
| Enable/disable logging invalid domain names. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_keyword\_match** string | | Search keywords to log when match is found. |
| **web\_log\_search** string | **Choices:*** disable
* enable
| Enable/disable logging all search phrases. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_safe\_search** string | **Choices:*** url
* header
| Safe search type. FLAG Based Options. Specify multiple in list form. flag | url | Insert safe search string into URL. flag | header | Insert safe search header. |
| **web\_url\_log** string | **Choices:*** disable
* enable
| Enable/disable logging URL filtering. choice | disable | Disable setting. choice | enable | Enable setting. |
| **web\_urlfilter\_table** string | | URL filter table ID. |
| **web\_whitelist** string | **Choices:*** exempt-av
* exempt-webcontent
* exempt-activex-java-cookie
* exempt-dlp
* exempt-rangeblock
* extended-log-others
| FortiGuard whitelist settings. FLAG Based Options. Specify multiple in list form. flag | exempt-av | Exempt antivirus. flag | exempt-webcontent | Exempt web content. flag | exempt-activex-java-cookie | Exempt ActiveX-JAVA-Cookie. flag | exempt-dlp | Exempt DLP. flag | exempt-rangeblock | Exempt RangeBlock. flag | extended-log-others | Support extended log. |
| **web\_youtube\_restrict** string | **Choices:*** strict
* none
* moderate
| YouTube EDU filter level. choice | strict | Strict access for YouTube. choice | none | Full access for YouTube. choice | moderate | Moderate access for YouTube. |
| **wisp** string | **Choices:*** disable
* enable
| Enable/disable web proxy WISP. choice | disable | Disable web proxy WISP. choice | enable | Enable web proxy WISP. |
| **wisp\_algorithm** string | **Choices:*** auto-learning
* primary-secondary
* round-robin
| WISP server selection algorithm. choice | auto-learning | Select the lightest loading healthy server. choice | primary-secondary | Select the first healthy server in order. choice | round-robin | Select the next healthy server. |
| **wisp\_servers** string | | WISP servers. |
| **youtube\_channel\_filter** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **youtube\_channel\_filter\_channel\_id** string | | YouTube channel ID to be filtered. |
| **youtube\_channel\_filter\_comment** string | | Comment. |
| **youtube\_channel\_status** string | **Choices:*** disable
* blacklist
* whitelist
| YouTube channel filter status. choice | disable | Disable YouTube channel filter. choice | blacklist | Block matches. choice | whitelist | Allow matches. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: DELETE Profile
community.fortios.fmgr_secprof_web:
name: "Ansible_Web_Filter_Profile"
mode: "delete"
- name: CREATE Profile
community.fortios.fmgr_secprof_web:
name: "Ansible_Web_Filter_Profile"
comment: "Created by Ansible Module TEST"
mode: "set"
extended_log: "enable"
inspection_mode: "proxy"
log_all_url: "enable"
options: "js"
ovrd_perm: "bannedword-override"
post_action: "block"
web_content_log: "enable"
web_extended_all_action_log: "enable"
web_filter_activex_log: "enable"
web_filter_applet_log: "enable"
web_filter_command_block_log: "enable"
web_filter_cookie_log: "enable"
web_filter_cookie_removal_log: "enable"
web_filter_js_log: "enable"
web_filter_jscript_log: "enable"
web_filter_referer_log: "enable"
web_filter_unknown_log: "enable"
web_filter_vbs_log: "enable"
web_ftgd_err_log: "enable"
web_ftgd_quota_usage: "enable"
web_invalid_domain_log: "enable"
web_url_log: "enable"
wisp: "enable"
wisp_algorithm: "auto-learning"
youtube_channel_status: "blacklist"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
| programming_docs |
ansible community.fortios.fmgr_fwobj_ippool6 – Allows the editing of IP Pool Objects within FortiManager. community.fortios.fmgr\_fwobj\_ippool6 – Allows the editing of IP Pool Objects within FortiManager.
===================================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_fwobj_ippool6`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows users to add/edit/delete IPv6 Pool Objects.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **comments** string | | Comment. |
| **dynamic\_mapping** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **dynamic\_mapping\_comments** string | | Dynamic Mapping clone of original suffixed parameter. |
| **dynamic\_mapping\_endip** string | | Dynamic Mapping clone of original suffixed parameter. |
| **dynamic\_mapping\_startip** string | | Dynamic Mapping clone of original suffixed parameter. |
| **endip** string | | Final IPv6 address (inclusive) in the range for the address pool. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **name** string | | IPv6 IP pool name. |
| **startip** string | | First IPv6 address (inclusive) in the range for the address pool. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: ADD FMGR_FIREWALL_IPPOOL6
fmgr_firewall_ippool6:
mode: "add"
adom: "ansible"
startip:
name: "IPv6 IPPool"
endip:
comments: "Created by Ansible"
- name: DELETE FMGR_FIREWALL_IPPOOL6
fmgr_firewall_ippool6:
mode: "delete"
adom: "ansible"
name: "IPv6 IPPool"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible community.fortios.fmgr_secprof_ips – Managing IPS security profiles in FortiManager community.fortios.fmgr\_secprof\_ips – Managing IPS security profiles in FortiManager
=====================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_secprof_ips`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Managing IPS security profiles in FortiManager
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **block\_malicious\_url** string | **Choices:*** disable
* enable
| Enable/disable malicious URL blocking. |
| **comment** string | | Comment. |
| **entries** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **entries\_action** string | **Choices:*** pass
* block
* reset
* default
| Action taken with traffic in which signatures are detected. |
| **entries\_application** string | | Applications to be protected. set application ? lists available applications. all includes all applications. other includes all unlisted applications. |
| **entries\_exempt\_ip\_dst\_ip** string | | Destination IP address and netmask. |
| **entries\_exempt\_ip\_src\_ip** string | | Source IP address and netmask. |
| **entries\_location** string | | Protect client or server traffic. |
| **entries\_log** string | **Choices:*** disable
* enable
| Enable/disable logging of signatures included in filter. |
| **entries\_log\_attack\_context** string | **Choices:*** disable
* enable
| Enable/disable logging of attack context| URL buffer, header buffer, body buffer, packet buffer. |
| **entries\_log\_packet** string | **Choices:*** disable
* enable
| Enable/disable packet logging. Enable to save the packet that triggers the filter. You can download the packets in pcap format for diagnostic use. |
| **entries\_os** string | | Operating systems to be protected. all includes all operating systems. other includes all unlisted operating systems. |
| **entries\_protocol** string | | Protocols to be examined. set protocol ? lists available protocols. all includes all protocols. other includes all unlisted protocols. |
| **entries\_quarantine** string | **Choices:*** none
* attacker
| Quarantine method. |
| **entries\_quarantine\_expiry** string | | Duration of quarantine. |
| **entries\_quarantine\_log** string | **Choices:*** disable
* enable
| Enable/disable quarantine logging. |
| **entries\_rate\_count** string | | Count of the rate. |
| **entries\_rate\_duration** string | | Duration (sec) of the rate. |
| **entries\_rate\_mode** string | **Choices:*** periodical
* continuous
| Rate limit mode. |
| **entries\_rate\_track** string | **Choices:*** none
* src-ip
* dest-ip
* dhcp-client-mac
* dns-domain
| Track the packet protocol field. |
| **entries\_rule** string | | Identifies the predefined or custom IPS signatures to add to the sensor. |
| **entries\_severity** string | | Relative severity of the signature, from info to critical. Log messages generated by the signature include the severity. |
| **entries\_status** string | **Choices:*** disable
* enable
* default
| Status of the signatures included in filter. default enables the filter and only use filters with default status of enable. Filters with default status of disable will not be used. |
| **extended\_log** string | **Choices:*** disable
* enable
| Enable/disable extended logging. |
| **filter** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **filter\_action** string | **Choices:*** pass
* block
* default
* reset
| Action of selected rules. |
| **filter\_application** string | | Vulnerable application filter. |
| **filter\_location** string | | Vulnerability location filter. |
| **filter\_log** string | **Choices:*** disable
* enable
| Enable/disable logging of selected rules. |
| **filter\_log\_packet** string | **Choices:*** disable
* enable
| Enable/disable packet logging of selected rules. |
| **filter\_name** string | | Filter name. |
| **filter\_os** string | | Vulnerable OS filter. |
| **filter\_protocol** string | | Vulnerable protocol filter. |
| **filter\_quarantine** string | **Choices:*** none
* attacker
| Quarantine IP or interface. |
| **filter\_quarantine\_expiry** string | | Duration of quarantine in minute. |
| **filter\_quarantine\_log** string | **Choices:*** disable
* enable
| Enable/disable logging of selected quarantine. |
| **filter\_severity** string | | Vulnerability severity filter. |
| **filter\_status** string | **Choices:*** disable
* enable
* default
| Selected rules status. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **name** string | | Sensor name. |
| **override** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **override\_action** string | **Choices:*** pass
* block
* reset
| Action of override rule. |
| **override\_exempt\_ip\_dst\_ip** string | | Destination IP address and netmask. |
| **override\_exempt\_ip\_src\_ip** string | | Source IP address and netmask. |
| **override\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. |
| **override\_log\_packet** string | **Choices:*** disable
* enable
| Enable/disable packet logging. |
| **override\_quarantine** string | **Choices:*** none
* attacker
| Quarantine IP or interface. |
| **override\_quarantine\_expiry** string | | Duration of quarantine in minute. |
| **override\_quarantine\_log** string | **Choices:*** disable
* enable
| Enable/disable logging of selected quarantine. |
| **override\_rule\_id** string | | Override rule ID. |
| **override\_status** string | **Choices:*** disable
* enable
| Enable/disable status of override rule. |
| **replacemsg\_group** string | | Replacement message group. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: DELETE Profile
community.fortios.fmgr_secprof_ips:
name: "Ansible_IPS_Profile"
comment: "Created by Ansible Module TEST"
mode: "delete"
- name: CREATE Profile
community.fortios.fmgr_secprof_ips:
name: "Ansible_IPS_Profile"
comment: "Created by Ansible Module TEST"
mode: "set"
block_malicious_url: "enable"
entries: [{severity: "high", action: "block", log-packet: "enable"}, {severity: "medium", action: "pass"}]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible community.fortios.fmgr_secprof_dns – Manage DNS security profiles in FortiManager community.fortios.fmgr\_secprof\_dns – Manage DNS security profiles in FortiManager
===================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_secprof_dns`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage DNS security profiles in FortiManager
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **block\_action** string | **Choices:*** block
* redirect
| Action to take for blocked domains. choice | block | Return NXDOMAIN for blocked domains. choice | redirect | Redirect blocked domains to SDNS portal. |
| **block\_botnet** string | **Choices:*** disable
* enable
| Enable/disable blocking botnet C&C; DNS lookups. choice | disable | Disable blocking botnet C&C; DNS lookups. choice | enable | Enable blocking botnet C&C; DNS lookups. |
| **comment** string | | Comment for the security profile to show in the FortiManager GUI. |
| **domain\_filter\_domain\_filter\_table** string | | DNS domain filter table ID. |
| **external\_ip\_blocklist** string | | One or more external IP block lists. |
| **ftgd\_dns\_filters\_action** string | **Choices:*** monitor
* block
| Action to take for DNS requests matching the category. choice | monitor | Allow DNS requests matching the category and log the result. choice | block | Block DNS requests matching the category. |
| **ftgd\_dns\_filters\_category** string | | Category number. |
| **ftgd\_dns\_filters\_log** string | **Choices:*** disable
* enable
| Enable/disable DNS filter logging for this DNS profile. choice | disable | Disable DNS filter logging. choice | enable | Enable DNS filter logging. |
| **ftgd\_dns\_options** string | **Choices:*** error-allow
* ftgd-disable
| FortiGuard DNS filter options. FLAG Based Options. Specify multiple in list form. flag | error-allow | Allow all domains when FortiGuard DNS servers fail. flag | ftgd-disable | Disable FortiGuard DNS domain rating. |
| **log\_all\_domain** string | **Choices:*** disable
* enable
| Enable/disable logging of all domains visited (detailed DNS logging). choice | disable | Disable logging of all domains visited. choice | enable | Enable logging of all domains visited. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values. |
| **name** string | | Profile name. |
| **redirect\_portal** string | | IP address of the SDNS redirect portal. |
| **safe\_search** string | **Choices:*** disable
* enable
| Enable/disable Google, Bing, and YouTube safe search. choice | disable | Disable Google, Bing, and YouTube safe search. choice | enable | Enable Google, Bing, and YouTube safe search. |
| **sdns\_domain\_log** string | **Choices:*** disable
* enable
| Enable/disable domain filtering and botnet domain logging. choice | disable | Disable domain filtering and botnet domain logging. choice | enable | Enable domain filtering and botnet domain logging. |
| **sdns\_ftgd\_err\_log** string | **Choices:*** disable
* enable
| Enable/disable FortiGuard SDNS rating error logging. choice | disable | Disable FortiGuard SDNS rating error logging. choice | enable | Enable FortiGuard SDNS rating error logging. |
| **youtube\_restrict** string | **Choices:*** strict
* moderate
| Set safe search for YouTube restriction level. choice | strict | Enable strict safe seach for YouTube. choice | moderate | Enable moderate safe search for YouTube. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: DELETE Profile
community.fortios.fmgr_secprof_dns:
name: "Ansible_DNS_Profile"
comment: "Created by Ansible Module TEST"
mode: "delete"
- name: CREATE Profile
community.fortios.fmgr_secprof_dns:
name: "Ansible_DNS_Profile"
comment: "Created by Ansible Module TEST"
mode: "set"
block_action: "block"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible community.fortios.fmgr_secprof_proxy – Manage proxy security profiles in FortiManager community.fortios.fmgr\_secprof\_proxy – Manage proxy security profiles in FortiManager
=======================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_secprof_proxy`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage proxy security profiles for FortiGates via FortiManager using the FMG API with playbooks
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **header\_client\_ip** string | **Choices:*** pass
* add
* remove
| Actions to take on the HTTP client-IP header in forwarded requests| forwards (pass), adds, or removes the HTTP header. choice | pass | Forward the same HTTP header. choice | add | Add the HTTP header. choice | remove | Remove the HTTP header. |
| **header\_front\_end\_https** string | **Choices:*** pass
* add
* remove
| Action to take on the HTTP front-end-HTTPS header in forwarded requests| forwards (pass), adds, or removes the HTTP header. choice | pass | Forward the same HTTP header. choice | add | Add the HTTP header. choice | remove | Remove the HTTP header. |
| **header\_via\_request** string | **Choices:*** pass
* add
* remove
| Action to take on the HTTP via header in forwarded requests| forwards (pass), adds, or removes the HTTP header . choice | pass | Forward the same HTTP header. choice | add | Add the HTTP header. choice | remove | Remove the HTTP header. |
| **header\_via\_response** string | **Choices:*** pass
* add
* remove
| Action to take on the HTTP via header in forwarded responses| forwards (pass), adds, or removes the HTTP heade r. choice | pass | Forward the same HTTP header. choice | add | Add the HTTP header. choice | remove | Remove the HTTP header. |
| **header\_x\_authenticated\_groups** string | **Choices:*** pass
* add
* remove
| Action to take on the HTTP x-authenticated-groups header in forwarded requests| forwards (pass), adds, or remo ves the HTTP header. choice | pass | Forward the same HTTP header. choice | add | Add the HTTP header. choice | remove | Remove the HTTP header. |
| **header\_x\_authenticated\_user** string | **Choices:*** pass
* add
* remove
| Action to take on the HTTP x-authenticated-user header in forwarded requests| forwards (pass), adds, or remove s the HTTP header. choice | pass | Forward the same HTTP header. choice | add | Add the HTTP header. choice | remove | Remove the HTTP header. |
| **header\_x\_forwarded\_for** string | **Choices:*** pass
* add
* remove
| Action to take on the HTTP x-forwarded-for header in forwarded requests| forwards (pass), adds, or removes the HTTP header. choice | pass | Forward the same HTTP header. choice | add | Add the HTTP header. choice | remove | Remove the HTTP header. |
| **headers** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **headers\_action** string | **Choices:*** add-to-request
* add-to-response
* remove-from-request
* remove-from-response
| Action when HTTP the header forwarded. choice | add-to-request | Add the HTTP header to request. choice | add-to-response | Add the HTTP header to response. choice | remove-from-request | Remove the HTTP header from request. choice | remove-from-response | Remove the HTTP header from response. |
| **headers\_content** string | | HTTP header's content. |
| **headers\_name** string | | HTTP forwarded header name. |
| **log\_header\_change** string | **Choices:*** disable
* enable
| Enable/disable logging HTTP header changes. choice | disable | Disable Enable/disable logging HTTP header changes. choice | enable | Enable Enable/disable logging HTTP header changes. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **name** string | | Profile name. |
| **strip\_encoding** string | **Choices:*** disable
* enable
| Enable/disable stripping unsupported encoding from the request header. choice | disable | Disable stripping of unsupported encoding from the request header. choice | enable | Enable stripping of unsupported encoding from the request header. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: DELETE Profile
community.fortios.fmgr_secprof_proxy:
name: "Ansible_Web_Proxy_Profile"
mode: "delete"
- name: CREATE Profile
community.fortios.fmgr_secprof_proxy:
name: "Ansible_Web_Proxy_Profile"
mode: "set"
header_client_ip: "pass"
header_front_end_https: "add"
header_via_request: "remove"
header_via_response: "pass"
header_x_authenticated_groups: "add"
header_x_authenticated_user: "remove"
strip_encoding: "enable"
log_header_change: "enable"
header_x_forwarded_for: "pass"
headers_action: "add-to-request"
headers_content: "test"
headers_name: "test_header"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
| programming_docs |
ansible community.fortios.fmgr_ha – Manages the High-Availability State of FortiManager Clusters and Nodes. community.fortios.fmgr\_ha – Manages the High-Availability State of FortiManager Clusters and Nodes.
====================================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_ha`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Change HA state or settings of FortiManager nodes (Standalone/Master/Slave).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **fmgr\_ha\_cluster\_id** string | **Default:**1 | Sets the ID number of the HA cluster. Defaults to 1. |
| **fmgr\_ha\_cluster\_pw** string | | Sets the password for the HA cluster. Only required once. System remembers between HA mode switches. |
| **fmgr\_ha\_file\_quota** string | **Default:**4096 | Sets the File quota in MB (2048-20480). |
| **fmgr\_ha\_hb\_interval** string | **Default:**5 | Sets the heartbeat interval (1-255). |
| **fmgr\_ha\_hb\_threshold** string | **Default:**3 | Sets heartbeat lost threshold (1-255). |
| **fmgr\_ha\_mode** string | **Choices:*** standalone
* master
* slave
| Sets the role of the FortiManager host for HA. |
| **fmgr\_ha\_peer\_ipv4** string | | Sets the IPv4 address of a HA peer. |
| **fmgr\_ha\_peer\_ipv6** string | | Sets the IPv6 address of a HA peer. |
| **fmgr\_ha\_peer\_sn** string | | Sets the HA Peer Serial Number. |
| **fmgr\_ha\_peer\_status** string | **Choices:*** enable
* disable
| Sets the peer status to enable or disable. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: SET FORTIMANAGER HA NODE TO MASTER
community.fortios.fmgr_ha:
fmgr_ha_mode: "master"
fmgr_ha_cluster_pw: "fortinet"
fmgr_ha_cluster_id: "1"
- name: SET FORTIMANAGER HA NODE TO SLAVE
community.fortios.fmgr_ha:
fmgr_ha_mode: "slave"
fmgr_ha_cluster_pw: "fortinet"
fmgr_ha_cluster_id: "1"
- name: SET FORTIMANAGER HA NODE TO STANDALONE
community.fortios.fmgr_ha:
fmgr_ha_mode: "standalone"
- name: ADD FORTIMANAGER HA PEER
community.fortios.fmgr_ha:
fmgr_ha_peer_ipv4: "192.168.1.254"
fmgr_ha_peer_sn: "FMG-VM1234567890"
fmgr_ha_peer_status: "enable"
- name: CREATE CLUSTER ON MASTER
community.fortios.fmgr_ha:
fmgr_ha_mode: "master"
fmgr_ha_cluster_pw: "fortinet"
fmgr_ha_cluster_id: "1"
fmgr_ha_hb_threshold: "10"
fmgr_ha_hb_interval: "15"
fmgr_ha_file_quota: "2048"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible community.fortios.fmgr_fwpol_ipv4 – Allows the add/delete of Firewall Policies on Packages in FortiManager. community.fortios.fmgr\_fwpol\_ipv4 – Allows the add/delete of Firewall Policies on Packages in FortiManager.
=============================================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_fwpol_ipv4`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows the add/delete of Firewall Policies on Packages in FortiManager.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **action** string | **Choices:*** deny
* accept
* ipsec
| Policy action (allow/deny/ipsec). choice | deny | Blocks sessions that match the firewall policy. choice | accept | Allows session that match the firewall policy. choice | ipsec | Firewall policy becomes a policy-based IPsec VPN policy. |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **app\_category** string | | Application category ID list. |
| **app\_group** string | | Application group names. |
| **application** string | | Application ID list. |
| **application\_list** string | | Name of an existing Application list. |
| **auth\_cert** string | | HTTPS server certificate for policy authentication. |
| **auth\_path** string | **Choices:*** disable
* enable
| Enable/disable authentication-based routing. choice | disable | Disable authentication-based routing. choice | enable | Enable authentication-based routing. |
| **auth\_redirect\_addr** string | | HTTP-to-HTTPS redirect address for firewall authentication. |
| **auto\_asic\_offload** string | **Choices:*** disable
* enable
| Enable/disable offloading security profile processing to CP processors. choice | disable | Disable ASIC offloading. choice | enable | Enable auto ASIC offloading. |
| **av\_profile** string | | Name of an existing Antivirus profile. |
| **block\_notification** string | **Choices:*** disable
* enable
| Enable/disable block notification. choice | disable | Disable setting. choice | enable | Enable setting. |
| **captive\_portal\_exempt** string | **Choices:*** disable
* enable
| Enable to exempt some users from the captive portal. choice | disable | Disable exemption of captive portal. choice | enable | Enable exemption of captive portal. |
| **capture\_packet** string | **Choices:*** disable
* enable
| Enable/disable capture packets. choice | disable | Disable capture packets. choice | enable | Enable capture packets. |
| **comments** string | | Comment. |
| **custom\_log\_fields** string | | Custom fields to append to log messages for this policy. |
| **delay\_tcp\_npu\_session** string | **Choices:*** disable
* enable
| Enable TCP NPU session delay to guarantee packet order of 3-way handshake. choice | disable | Disable TCP NPU session delay in order to guarantee packet order of 3-way handshake. choice | enable | Enable TCP NPU session delay in order to guarantee packet order of 3-way handshake. |
| **devices** string | | Names of devices or device groups that can be matched by the policy. |
| **diffserv\_forward** string | **Choices:*** disable
* enable
| Enable to change packet's DiffServ values to the specified diffservcode-forward value. choice | disable | Disable WAN optimization. choice | enable | Enable WAN optimization. |
| **diffserv\_reverse** string | **Choices:*** disable
* enable
| Enable to change packet's reverse (reply) DiffServ values to the specified diffservcode-rev value. choice | disable | Disable setting. choice | enable | Enable setting. |
| **diffservcode\_forward** string | | Change packet's DiffServ to this value. |
| **diffservcode\_rev** string | | Change packet's reverse (reply) DiffServ to this value. |
| **disclaimer** string | **Choices:*** disable
* enable
| Enable/disable user authentication disclaimer. choice | disable | Disable user authentication disclaimer. choice | enable | Enable user authentication disclaimer. |
| **dlp\_sensor** string | | Name of an existing DLP sensor. |
| **dnsfilter\_profile** string | | Name of an existing DNS filter profile. |
| **dscp\_match** string | **Choices:*** disable
* enable
| Enable DSCP check. choice | disable | Disable DSCP check. choice | enable | Enable DSCP check. |
| **dscp\_negate** string | **Choices:*** disable
* enable
| Enable negated DSCP match. choice | disable | Disable DSCP negate. choice | enable | Enable DSCP negate. |
| **dscp\_value** string | | DSCP value. |
| **dsri** string | **Choices:*** disable
* enable
| Enable DSRI to ignore HTTP server responses. choice | disable | Disable DSRI. choice | enable | Enable DSRI. |
| **dstaddr** string | | Destination address and address group names. |
| **dstaddr\_negate** string | **Choices:*** disable
* enable
| When enabled dstaddr specifies what the destination address must NOT be. choice | disable | Disable destination address negate. choice | enable | Enable destination address negate. |
| **dstintf** string | | Outgoing (egress) interface. |
| **fail\_on\_missing\_dependency** string | **Choices:*** enable
* **disable** ←
| Normal behavior is to "skip" tasks that fail dependency checks, so other tasks can run. If set to "enabled" if a failed dependency check happeens, Ansible will exit as with failure instead of skip. |
| **firewall\_session\_dirty** string | **Choices:*** check-all
* check-new
| How to handle sessions if the configuration of this firewall policy changes. choice | check-all | Flush all current sessions accepted by this policy. choice | check-new | Continue to allow sessions already accepted by this policy. |
| **fixedport** string | **Choices:*** disable
* enable
| Enable to prevent source NAT from changing a session's source port. choice | disable | Disable setting. choice | enable | Enable setting. |
| **fsso** string | **Choices:*** disable
* enable
| Enable/disable Fortinet Single Sign-On. choice | disable | Disable setting. choice | enable | Enable setting. |
| **fsso\_agent\_for\_ntlm** string | | FSSO agent to use for NTLM authentication. |
| **global\_label** string | | Label for the policy that appears when the GUI is in Global View mode. |
| **groups** string | | Names of user groups that can authenticate with this policy. |
| **gtp\_profile** string | | GTP profile. |
| **icap\_profile** string | | Name of an existing ICAP profile. |
| **identity\_based\_route** string | | Name of identity-based routing rule. |
| **inbound** string | **Choices:*** disable
* enable
| Policy-based IPsec VPN | only traffic from the remote network can initiate a VPN. choice | disable | Disable setting. choice | enable | Enable setting. |
| **internet\_service** string | **Choices:*** disable
* enable
| Enable/disable use of Internet Services for this policy. If enabled, dstaddr and service are not used. choice | disable | Disable use of Internet Services in policy. choice | enable | Enable use of Internet Services in policy. |
| **internet\_service\_custom** string | | Custom Internet Service name. |
| **internet\_service\_id** string | | Internet Service ID. |
| **internet\_service\_negate** string | **Choices:*** disable
* enable
| When enabled internet-service specifies what the service must NOT be. choice | disable | Disable negated Internet Service match. choice | enable | Enable negated Internet Service match. |
| **internet\_service\_src** string | **Choices:*** disable
* enable
| Enable/disable use of Internet Services in source for this policy. If enabled, source address is not used. choice | disable | Disable use of Internet Services source in policy. choice | enable | Enable use of Internet Services source in policy. |
| **internet\_service\_src\_custom** string | | Custom Internet Service source name. |
| **internet\_service\_src\_id** string | | Internet Service source ID. |
| **internet\_service\_src\_negate** string | **Choices:*** disable
* enable
| When enabled internet-service-src specifies what the service must NOT be. choice | disable | Disable negated Internet Service source match. choice | enable | Enable negated Internet Service source match. |
| **ippool** string | **Choices:*** disable
* enable
| Enable to use IP Pools for source NAT. choice | disable | Disable setting. choice | enable | Enable setting. |
| **ips\_sensor** string | | Name of an existing IPS sensor. |
| **label** string | | Label for the policy that appears when the GUI is in Section View mode. |
| **learning\_mode** string | **Choices:*** disable
* enable
| Enable to allow everything, but log all of the meaningful data for security information gathering. choice | disable | Disable learning mode in firewall policy. choice | enable | Enable learning mode in firewall policy. |
| **logtraffic** string | **Choices:*** disable
* all
* utm
| Enable or disable logging. Log all sessions or security profile sessions. choice | disable | Disable all logging for this policy. choice | all | Log all sessions accepted or denied by this policy. choice | utm | Log traffic that has a security profile applied to it. |
| **logtraffic\_start** string | **Choices:*** disable
* enable
| Record logs when a session starts and ends. choice | disable | Disable setting. choice | enable | Enable setting. |
| **match\_vip** string | **Choices:*** disable
* enable
| Enable to match packets that have had their destination addresses changed by a VIP. choice | disable | Do not match DNATed packet. choice | enable | Match DNATed packet. |
| **mms\_profile** string | | Name of an existing MMS profile. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **name** string | | Policy name. |
| **nat** string | **Choices:*** disable
* enable
| Enable/disable source NAT. choice | disable | Disable setting. choice | enable | Enable setting. |
| **natinbound** string | **Choices:*** disable
* enable
| Policy-based IPsec VPN | apply destination NAT to inbound traffic. choice | disable | Disable setting. choice | enable | Enable setting. |
| **natip** string | | Policy-based IPsec VPN | source NAT IP address for outgoing traffic. |
| **natoutbound** string | **Choices:*** disable
* enable
| Policy-based IPsec VPN | apply source NAT to outbound traffic. choice | disable | Disable setting. choice | enable | Enable setting. |
| **np\_acceleration** string | **Choices:*** disable
* enable
| Enable/disable UTM Network Processor acceleration. choice | disable | Disable UTM Network Processor acceleration. choice | enable | Enable UTM Network Processor acceleration. |
| **ntlm** string | **Choices:*** disable
* enable
| Enable/disable NTLM authentication. choice | disable | Disable setting. choice | enable | Enable setting. |
| **ntlm\_enabled\_browsers** string | | HTTP-User-Agent value of supported browsers. |
| **ntlm\_guest** string | **Choices:*** disable
* enable
| Enable/disable NTLM guest user access. choice | disable | Disable setting. choice | enable | Enable setting. |
| **outbound** string | **Choices:*** disable
* enable
| Policy-based IPsec VPN | only traffic from the internal network can initiate a VPN. choice | disable | Disable setting. choice | enable | Enable setting. |
| **package\_name** string | **Default:**"default" | The policy package you want to modify |
| **per\_ip\_shaper** string | | Per-IP traffic shaper. |
| **permit\_any\_host** string | **Choices:*** disable
* enable
| Accept UDP packets from any host. choice | disable | Disable setting. choice | enable | Enable setting. |
| **permit\_stun\_host** string | **Choices:*** disable
* enable
| Accept UDP packets from any Session Traversal Utilities for NAT (STUN) host. choice | disable | Disable setting. choice | enable | Enable setting. |
| **policyid** string | | Policy ID. |
| **poolname** string | | IP Pool names. |
| **profile\_group** string | | Name of profile group. |
| **profile\_protocol\_options** string | | Name of an existing Protocol options profile. |
| **profile\_type** string | **Choices:*** single
* group
| Determine whether the firewall policy allows security profile groups or single profiles only. choice | single | Do not allow security profile groups. choice | group | Allow security profile groups. |
| **radius\_mac\_auth\_bypass** string | **Choices:*** disable
* enable
| Enable MAC authentication bypass. The bypassed MAC address must be received from RADIUS server. choice | disable | Disable MAC authentication bypass. choice | enable | Enable MAC authentication bypass. |
| **redirect\_url** string | | URL users are directed to after seeing and accepting the disclaimer or authenticating. |
| **replacemsg\_override\_group** string | | Override the default replacement message group for this policy. |
| **rsso** string | **Choices:*** disable
* enable
| Enable/disable RADIUS single sign-on (RSSO). choice | disable | Disable setting. choice | enable | Enable setting. |
| **rtp\_addr** string | | Address names if this is an RTP NAT policy. |
| **rtp\_nat** string | **Choices:*** disable
* enable
| Enable Real Time Protocol (RTP) NAT. choice | disable | Disable setting. choice | enable | Enable setting. |
| **scan\_botnet\_connections** string | **Choices:*** disable
* block
* monitor
| Block or monitor connections to Botnet servers or disable Botnet scanning. choice | disable | Do not scan connections to botnet servers. choice | block | Block connections to botnet servers. choice | monitor | Log connections to botnet servers. |
| **schedule** string | | Schedule name. |
| **schedule\_timeout** string | **Choices:*** disable
* enable
| Enable to force current sessions to end when the schedule object times out. choice | disable | Disable schedule timeout. choice | enable | Enable schedule timeout. |
| **send\_deny\_packet** string | **Choices:*** disable
* enable
| Enable to send a reply when a session is denied or blocked by a firewall policy. choice | disable | Disable deny-packet sending. choice | enable | Enable deny-packet sending. |
| **service** string | | Service and service group names. |
| **service\_negate** string | **Choices:*** disable
* enable
| When enabled service specifies what the service must NOT be. choice | disable | Disable negated service match. choice | enable | Enable negated service match. |
| **session\_ttl** string | | TTL in seconds for sessions accepted by this policy (0 means use the system default session TTL). |
| **spamfilter\_profile** string | | Name of an existing Spam filter profile. |
| **srcaddr** string | | Source address and address group names. |
| **srcaddr\_negate** string | **Choices:*** disable
* enable
| When enabled srcaddr specifies what the source address must NOT be. choice | disable | Disable source address negate. choice | enable | Enable source address negate. |
| **srcintf** string | | Incoming (ingress) interface. |
| **ssh\_filter\_profile** string | | Name of an existing SSH filter profile. |
| **ssl\_mirror** string | **Choices:*** disable
* enable
| Enable to copy decrypted SSL traffic to a FortiGate interface (called SSL mirroring). choice | disable | Disable SSL mirror. choice | enable | Enable SSL mirror. |
| **ssl\_mirror\_intf** string | | SSL mirror interface name. |
| **ssl\_ssh\_profile** string | | Name of an existing SSL SSH profile. |
| **status** string | **Choices:*** disable
* enable
| Enable or disable this policy. choice | disable | Disable setting. choice | enable | Enable setting. |
| **tcp\_mss\_receiver** string | | Receiver TCP maximum segment size (MSS). |
| **tcp\_mss\_sender** string | | Sender TCP maximum segment size (MSS). |
| **tcp\_session\_without\_syn** string | **Choices:*** all
* data-only
* disable
| Enable/disable creation of TCP session without SYN flag. choice | all | Enable TCP session without SYN. choice | data-only | Enable TCP session data only. choice | disable | Disable TCP session without SYN. |
| **timeout\_send\_rst** string | **Choices:*** disable
* enable
| Enable/disable sending RST packets when TCP sessions expire. choice | disable | Disable sending of RST packet upon TCP session expiration. choice | enable | Enable sending of RST packet upon TCP session expiration. |
| **traffic\_shaper** string | | Traffic shaper. |
| **traffic\_shaper\_reverse** string | | Reverse traffic shaper. |
| **url\_category** string | | URL category ID list. |
| **users** string | | Names of individual users that can authenticate with this policy. |
| **utm\_status** string | **Choices:*** disable
* enable
| Enable to add one or more security profiles (AV, IPS, etc.) to the firewall policy. choice | disable | Disable setting. choice | enable | Enable setting. |
| **vlan\_cos\_fwd** string | | VLAN forward direction user priority | 255 passthrough, 0 lowest, 7 highest. |
| **vlan\_cos\_rev** string | | VLAN reverse direction user priority | 255 passthrough, 0 lowest, 7 highest.. |
| **vlan\_filter** string | | Set VLAN filters. |
| **voip\_profile** string | | Name of an existing VoIP profile. |
| **vpn\_dst\_node** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. |
| **vpn\_dst\_node\_host** string | | VPN Destination Node Host. |
| **vpn\_dst\_node\_seq** string | | VPN Destination Node Seq. |
| **vpn\_dst\_node\_subnet** string | | VPN Destination Node Seq. |
| **vpn\_src\_node** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. |
| **vpn\_src\_node\_host** string | | VPN Source Node Host. |
| **vpn\_src\_node\_seq** string | | VPN Source Node Seq. |
| **vpn\_src\_node\_subnet** string | | VPN Source Node. |
| **vpntunnel** string | | Policy-based IPsec VPN | name of the IPsec VPN Phase 1. |
| **waf\_profile** string | | Name of an existing Web application firewall profile. |
| **wanopt** string | **Choices:*** disable
* enable
| Enable/disable WAN optimization. choice | disable | Disable setting. choice | enable | Enable setting. |
| **wanopt\_detection** string | **Choices:*** active
* passive
* off
| WAN optimization auto-detection mode. choice | active | Active WAN optimization peer auto-detection. choice | passive | Passive WAN optimization peer auto-detection. choice | off | Turn off WAN optimization peer auto-detection. |
| **wanopt\_passive\_opt** string | **Choices:*** default
* transparent
* non-transparent
| WAN optimization passive mode options. This option decides what IP address will be used to connect server. choice | default | Allow client side WAN opt peer to decide. choice | transparent | Use address of client to connect to server. choice | non-transparent | Use local FortiGate address to connect to server. |
| **wanopt\_peer** string | | WAN optimization peer. |
| **wanopt\_profile** string | | WAN optimization profile. |
| **wccp** string | **Choices:*** disable
* enable
| Enable/disable forwarding traffic matching this policy to a configured WCCP server. choice | disable | Disable WCCP setting. choice | enable | Enable WCCP setting. |
| **webcache** string | **Choices:*** disable
* enable
| Enable/disable web cache. choice | disable | Disable setting. choice | enable | Enable setting. |
| **webcache\_https** string | **Choices:*** disable
* enable
| Enable/disable web cache for HTTPS. choice | disable | Disable web cache for HTTPS. choice | enable | Enable web cache for HTTPS. |
| **webfilter\_profile** string | | Name of an existing Web filter profile. |
| **wsso** string | **Choices:*** disable
* enable
| Enable/disable WiFi Single Sign On (WSSO). choice | disable | Disable setting. choice | enable | Enable setting. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: ADD VERY BASIC IPV4 POLICY WITH NO NAT (WIDE OPEN)
community.fortios.fmgr_fwpol_ipv4:
mode: "set"
adom: "ansible"
package_name: "default"
name: "Basic_IPv4_Policy"
comments: "Created by Ansible"
action: "accept"
dstaddr: "all"
srcaddr: "all"
dstintf: "any"
srcintf: "any"
logtraffic: "utm"
service: "ALL"
schedule: "always"
- name: ADD VERY BASIC IPV4 POLICY WITH NAT AND MULTIPLE ENTRIES
community.fortios.fmgr_fwpol_ipv4:
mode: "set"
adom: "ansible"
package_name: "default"
name: "Basic_IPv4_Policy_2"
comments: "Created by Ansible"
action: "accept"
dstaddr: "google-play"
srcaddr: "all"
dstintf: "any"
srcintf: "any"
logtraffic: "utm"
service: "HTTP, HTTPS"
schedule: "always"
nat: "enable"
users: "karen, kevin"
- name: ADD VERY BASIC IPV4 POLICY WITH NAT AND MULTIPLE ENTRIES AND SEC PROFILES
community.fortios.fmgr_fwpol_ipv4:
mode: "set"
adom: "ansible"
package_name: "default"
name: "Basic_IPv4_Policy_3"
comments: "Created by Ansible"
action: "accept"
dstaddr: "google-play, autoupdate.opera.com"
srcaddr: "corp_internal"
dstintf: "zone_wan1, zone_wan2"
srcintf: "zone_int1"
logtraffic: "utm"
service: "HTTP, HTTPS"
schedule: "always"
nat: "enable"
users: "karen, kevin"
av_profile: "sniffer-profile"
ips_sensor: "default"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
| programming_docs |
ansible community.fortios.fmgr_secprof_spam – spam filter profile for FMG community.fortios.fmgr\_secprof\_spam – spam filter profile for FMG
===================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_secprof_spam`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage spam filter security profiles within FortiManager via API
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **comment** string | | Comment. |
| **external** string | **Choices:*** disable
* enable
| Enable/disable external Email inspection. |
| **flow\_based** string | **Choices:*** disable
* enable
| Enable/disable flow-based spam filtering. |
| **gmail** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **gmail\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. |
| **imap** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **imap\_action** string | **Choices:*** pass
* tag
| Action for spam email. |
| **imap\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. |
| **imap\_tag\_msg** string | | Subject text or header added to spam email. |
| **imap\_tag\_type** string | **Choices:*** subject
* header
* spaminfo
| Tag subject or header for spam email. FLAG Based Options. Specify multiple in list form. |
| **mapi** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **mapi\_action** string | **Choices:*** pass
* discard
| Action for spam email. |
| **mapi\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **msn\_hotmail** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **msn\_hotmail\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. |
| **name** string | | Profile name. |
| **options** string | **Choices:*** bannedword
* spamfsip
* spamfssubmit
* spamfschksum
* spamfsurl
* spamhelodns
* spamraddrdns
* spamrbl
* spamhdrcheck
* spamfsphish
* spambwl
| None FLAG Based Options. Specify multiple in list form. |
| **pop3** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **pop3\_action** string | **Choices:*** pass
* tag
| Action for spam email. |
| **pop3\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. |
| **pop3\_tag\_msg** string | | Subject text or header added to spam email. |
| **pop3\_tag\_type** string | **Choices:*** subject
* header
* spaminfo
| Tag subject or header for spam email. FLAG Based Options. Specify multiple in list form. |
| **replacemsg\_group** string | | Replacement message group. |
| **smtp** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **smtp\_action** string | **Choices:*** pass
* tag
* discard
| Action for spam email. |
| **smtp\_hdrip** string | **Choices:*** disable
* enable
| Enable/disable SMTP email header IP checks for spamfsip, spamrbl and spambwl filters. |
| **smtp\_local\_override** string | **Choices:*** disable
* enable
| Enable/disable local filter to override SMTP remote check result. |
| **smtp\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. |
| **smtp\_tag\_msg** string | | Subject text or header added to spam email. |
| **smtp\_tag\_type** string | **Choices:*** subject
* header
* spaminfo
| Tag subject or header for spam email. FLAG Based Options. Specify multiple in list form. |
| **spam\_bwl\_table** string | | Anti-spam black/white list table ID. |
| **spam\_bword\_table** string | | Anti-spam banned word table ID. |
| **spam\_bword\_threshold** string | | Spam banned word threshold. |
| **spam\_filtering** string | **Choices:*** disable
* enable
| Enable/disable spam filtering. |
| **spam\_iptrust\_table** string | | Anti-spam IP trust table ID. |
| **spam\_log** string | **Choices:*** disable
* enable
| Enable/disable spam logging for email filtering. |
| **spam\_log\_fortiguard\_response** string | **Choices:*** disable
* enable
| Enable/disable logging FortiGuard spam response. |
| **spam\_mheader\_table** string | | Anti-spam MIME header table ID. |
| **spam\_rbl\_table** string | | Anti-spam DNSBL table ID. |
| **yahoo\_mail** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **yahoo\_mail\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: DELETE Profile
community.fortios.fmgr_secprof_spam:
name: "Ansible_Spam_Filter_Profile"
mode: "delete"
- name: Create FMGR_SPAMFILTER_PROFILE
community.fortios.fmgr_secprof_spam:
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
mode: "set"
adom: "root"
spam_log_fortiguard_response: "enable"
spam_iptrust_table:
spam_filtering: "enable"
spam_bword_threshold: 10
options: ["bannedword", "spamfsip", "spamfsurl", "spamrbl", "spamfsphish", "spambwl"]
name: "Ansible_Spam_Filter_Profile"
flow_based: "enable"
external: "enable"
comment: "Created by Ansible"
gmail_log: "enable"
spam_log: "enable"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible community.fortios.fmgr_query – Query FortiManager data objects for use in Ansible workflows. community.fortios.fmgr\_query – Query FortiManager data objects for use in Ansible workflows.
=============================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_query`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Provides information on data objects within FortiManager so that playbooks can perform conditionals.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **custom\_dict** string | | ADVANCED USERS ONLY! REQUIRES KNOWLEDGE OF FMGR JSON API! DICTIONARY JSON FORMAT ONLY -- Custom dictionary/datagram to send to the endpoint. |
| **custom\_endpoint** string | | ADVANCED USERS ONLY! REQUIRES KNOWLEDGE OF FMGR JSON API! The HTTP Endpoint on FortiManager you wish to GET from. |
| **device\_ip** string | | The IP of the device you want to query. |
| **device\_serial** string | | The serial number of the device you want to query. |
| **device\_unique\_name** string | | The desired "friendly" name of the device you want to query. |
| **nodes** string | | A LIST of firewalls in the cluster you want to verify i.e. ["firewall\_A","firewall\_B"]. |
| **object** string / required | **Choices:*** device
* cluster\_nodes
* task
* custom
| The data object we wish to query (device, package, rule, etc). Will expand choices as improves. |
| **task\_id** string | | The ID of the task you wish to query status on. If left blank and object = 'task' a list of tasks are returned. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: QUERY FORTIGATE DEVICE BY IP
community.fortios.fmgr_query:
object: "device"
adom: "ansible"
device_ip: "10.7.220.41"
- name: QUERY FORTIGATE DEVICE BY SERIAL
community.fortios.fmgr_query:
adom: "ansible"
object: "device"
device_serial: "FGVM000000117992"
- name: QUERY FORTIGATE DEVICE BY FRIENDLY NAME
community.fortios.fmgr_query:
adom: "ansible"
object: "device"
device_unique_name: "ansible-fgt01"
- name: VERIFY CLUSTER MEMBERS AND STATUS
community.fortios.fmgr_query:
adom: "ansible"
object: "cluster_nodes"
device_unique_name: "fgt-cluster01"
nodes: ["ansible-fgt01", "ansible-fgt02", "ansible-fgt03"]
- name: GET STATUS OF TASK ID
community.fortios.fmgr_query:
adom: "ansible"
object: "task"
task_id: "3"
- name: USE CUSTOM TYPE TO QUERY AVAILABLE SCRIPTS
community.fortios.fmgr_query:
adom: "ansible"
object: "custom"
custom_endpoint: "/dvmdb/adom/ansible/script"
custom_dict: { "type": "cli" }
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
ansible community.fortios.fmgr_provisioning – Provision devices via FortiMananger community.fortios.fmgr\_provisioning – Provision devices via FortiMananger
==========================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_provisioning`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Add model devices on the FortiManager using jsonrpc API and have them pre-configured, so when central management is configured, the configuration is pushed down to the registering devices
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string / required | | The administrative domain (admon) the configuration belongs to |
| **description** string | | Description of the device to be provisioned. |
| **group** string | | The name of the device group the provisioned device can belong to. |
| **host** string / required | | The FortiManager's Address. |
| **minor\_release** string | | The minor release number such as 6.X.1, as X being the minor release. |
| **name** string / required | | The name of the device to be provisioned. |
| **os\_type** string / required | | The Fortinet OS type to be pushed to the device, such as 'FOS' for FortiOS. |
| **os\_version** string / required | | The Fortinet OS version to be used for the device, such as 5.0 or 6.0. |
| **password** string | | The password associated with the username account. |
| **patch\_release** string | | The patch release number such as 6.0.X, as X being the patch release. |
| **platform** string / required | | The platform of the device, such as model number or VM. |
| **policy\_package** string / required | | The name of the policy package to be assigned to the device. |
| **serial** string / required | | The serial number of the device that will be provisioned. |
| **username** string / required | | The username to log into the FortiManager |
| **vdom** string | | The virtual domain (vdom) the configuration belongs to |
Examples
--------
```
- name: Create FGT1 Model Device
community.fortios.fmgr_provisioning:
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
adom: "root"
vdom: "root"
policy_package: "default"
name: "FGT1"
group: "Ansible"
serial: "FGVM000000117994"
platform: "FortiGate-VM64"
description: "Provisioned by Ansible"
os_version: '6.0'
minor_release: 0
patch_release: 0
os_type: 'fos'
- name: Create FGT2 Model Device
community.fortios.fmgr_provisioning:
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
adom: "root"
vdom: "root"
policy_package: "test_pp"
name: "FGT2"
group: "Ansible"
serial: "FGVM000000117992"
platform: "FortiGate-VM64"
description: "Provisioned by Ansible"
os_version: '5.0'
minor_release: 6
patch_release: 0
os_type: 'fos'
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Andrew Welsh (@Ghilli3)
ansible community.fortios.fmgr_secprof_waf – FortiManager web application firewall security profile community.fortios.fmgr\_secprof\_waf – FortiManager web application firewall security profile
=============================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_secprof_waf`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage web application firewall security profiles for FGTs via FMG
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **address\_list** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **address\_list\_blocked\_address** string | | Blocked address. |
| **address\_list\_blocked\_log** string | **Choices:*** disable
* enable
| Enable/disable logging on blocked addresses. choice | disable | Disable setting. choice | enable | Enable setting. |
| **address\_list\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **address\_list\_status** string | **Choices:*** disable
* enable
| Status. choice | disable | Disable setting. choice | enable | Enable setting. |
| **address\_list\_trusted\_address** string | | Trusted address. |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **comment** string | | Comment. |
| **constraint** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **constraint\_content\_length\_action** string | **Choices:*** allow
* block
| Action. choice | allow | Allow. choice | block | Block. |
| **constraint\_content\_length\_length** string | | Length of HTTP content in bytes (0 to 2147483647). |
| **constraint\_content\_length\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_content\_length\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **constraint\_content\_length\_status** string | **Choices:*** disable
* enable
| Enable/disable the constraint. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_exception\_address** string | | Host address. |
| **constraint\_exception\_content\_length** string | **Choices:*** disable
* enable
| HTTP content length in request. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_exception\_header\_length** string | **Choices:*** disable
* enable
| HTTP header length in request. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_exception\_hostname** string | **Choices:*** disable
* enable
| Enable/disable hostname check. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_exception\_line\_length** string | **Choices:*** disable
* enable
| HTTP line length in request. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_exception\_malformed** string | **Choices:*** disable
* enable
| Enable/disable malformed HTTP request check. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_exception\_max\_cookie** string | **Choices:*** disable
* enable
| Maximum number of cookies in HTTP request. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_exception\_max\_header\_line** string | **Choices:*** disable
* enable
| Maximum number of HTTP header line. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_exception\_max\_range\_segment** string | **Choices:*** disable
* enable
| Maximum number of range segments in HTTP range line. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_exception\_max\_url\_param** string | **Choices:*** disable
* enable
| Maximum number of parameters in URL. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_exception\_method** string | **Choices:*** disable
* enable
| Enable/disable HTTP method check. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_exception\_param\_length** string | **Choices:*** disable
* enable
| Maximum length of parameter in URL, HTTP POST request or HTTP body. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_exception\_pattern** string | | URL pattern. |
| **constraint\_exception\_regex** string | **Choices:*** disable
* enable
| Enable/disable regular expression based pattern match. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_exception\_url\_param\_length** string | **Choices:*** disable
* enable
| Maximum length of parameter in URL. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_exception\_version** string | **Choices:*** disable
* enable
| Enable/disable HTTP version check. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_header\_length\_action** string | **Choices:*** allow
* block
| Action. choice | allow | Allow. choice | block | Block. |
| **constraint\_header\_length\_length** string | | Length of HTTP header in bytes (0 to 2147483647). |
| **constraint\_header\_length\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_header\_length\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **constraint\_header\_length\_status** string | **Choices:*** disable
* enable
| Enable/disable the constraint. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_hostname\_action** string | **Choices:*** allow
* block
| Action for a hostname constraint. choice | allow | Allow. choice | block | Block. |
| **constraint\_hostname\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_hostname\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **constraint\_hostname\_status** string | **Choices:*** disable
* enable
| Enable/disable the constraint. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_line\_length\_action** string | **Choices:*** allow
* block
| Action. choice | allow | Allow. choice | block | Block. |
| **constraint\_line\_length\_length** string | | Length of HTTP line in bytes (0 to 2147483647). |
| **constraint\_line\_length\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_line\_length\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **constraint\_line\_length\_status** string | **Choices:*** disable
* enable
| Enable/disable the constraint. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_malformed\_action** string | **Choices:*** allow
* block
| Action. choice | allow | Allow. choice | block | Block. |
| **constraint\_malformed\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_malformed\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **constraint\_malformed\_status** string | **Choices:*** disable
* enable
| Enable/disable the constraint. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_max\_cookie\_action** string | **Choices:*** allow
* block
| Action. choice | allow | Allow. choice | block | Block. |
| **constraint\_max\_cookie\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_max\_cookie\_max\_cookie** string | | Maximum number of cookies in HTTP request (0 to 2147483647). |
| **constraint\_max\_cookie\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **constraint\_max\_cookie\_status** string | **Choices:*** disable
* enable
| Enable/disable the constraint. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_max\_header\_line\_action** string | **Choices:*** allow
* block
| Action. choice | allow | Allow. choice | block | Block. |
| **constraint\_max\_header\_line\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_max\_header\_line\_max\_header\_line** string | | Maximum number HTTP header lines (0 to 2147483647). |
| **constraint\_max\_header\_line\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **constraint\_max\_header\_line\_status** string | **Choices:*** disable
* enable
| Enable/disable the constraint. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_max\_range\_segment\_action** string | **Choices:*** allow
* block
| Action. choice | allow | Allow. choice | block | Block. |
| **constraint\_max\_range\_segment\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_max\_range\_segment\_max\_range\_segment** string | | Maximum number of range segments in HTTP range line (0 to 2147483647). |
| **constraint\_max\_range\_segment\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **constraint\_max\_range\_segment\_status** string | **Choices:*** disable
* enable
| Enable/disable the constraint. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_max\_url\_param\_action** string | **Choices:*** allow
* block
| Action. choice | allow | Allow. choice | block | Block. |
| **constraint\_max\_url\_param\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_max\_url\_param\_max\_url\_param** string | | Maximum number of parameters in URL (0 to 2147483647). |
| **constraint\_max\_url\_param\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **constraint\_max\_url\_param\_status** string | **Choices:*** disable
* enable
| Enable/disable the constraint. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_method\_action** string | **Choices:*** allow
* block
| Action. choice | allow | Allow. choice | block | Block. |
| **constraint\_method\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_method\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **constraint\_method\_status** string | **Choices:*** disable
* enable
| Enable/disable the constraint. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_param\_length\_action** string | **Choices:*** allow
* block
| Action. choice | allow | Allow. choice | block | Block. |
| **constraint\_param\_length\_length** string | | Maximum length of parameter in URL, HTTP POST request or HTTP body in bytes (0 to 2147483647). |
| **constraint\_param\_length\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_param\_length\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **constraint\_param\_length\_status** string | **Choices:*** disable
* enable
| Enable/disable the constraint. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_url\_param\_length\_action** string | **Choices:*** allow
* block
| Action. choice | allow | Allow. choice | block | Block. |
| **constraint\_url\_param\_length\_length** string | | Maximum length of URL parameter in bytes (0 to 2147483647). |
| **constraint\_url\_param\_length\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_url\_param\_length\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **constraint\_url\_param\_length\_status** string | **Choices:*** disable
* enable
| Enable/disable the constraint. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_version\_action** string | **Choices:*** allow
* block
| Action. choice | allow | Allow. choice | block | Block. |
| **constraint\_version\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **constraint\_version\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **constraint\_version\_status** string | **Choices:*** disable
* enable
| Enable/disable the constraint. choice | disable | Disable setting. choice | enable | Enable setting. |
| **extended\_log** string | **Choices:*** disable
* enable
| Enable/disable extended logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **external** string | **Choices:*** disable
* enable
| Disable/Enable external HTTP Inspection. choice | disable | Disable external inspection. choice | enable | Enable external inspection. |
| **method** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **method\_default\_allowed\_methods** string | **Choices:*** delete
* get
* head
* options
* post
* put
* trace
* others
* connect
| Methods. FLAG Based Options. Specify multiple in list form. flag | delete | HTTP DELETE method. flag | get | HTTP GET method. flag | head | HTTP HEAD method. flag | options | HTTP OPTIONS method. flag | post | HTTP POST method. flag | put | HTTP PUT method. flag | trace | HTTP TRACE method. flag | others | Other HTTP methods. flag | connect | HTTP CONNECT method. |
| **method\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **method\_method\_policy\_address** string | | Host address. |
| **method\_method\_policy\_allowed\_methods** string | **Choices:*** delete
* get
* head
* options
* post
* put
* trace
* others
* connect
| Allowed Methods. FLAG Based Options. Specify multiple in list form. flag | delete | HTTP DELETE method. flag | get | HTTP GET method. flag | head | HTTP HEAD method. flag | options | HTTP OPTIONS method. flag | post | HTTP POST method. flag | put | HTTP PUT method. flag | trace | HTTP TRACE method. flag | others | Other HTTP methods. flag | connect | HTTP CONNECT method. |
| **method\_method\_policy\_pattern** string | | URL pattern. |
| **method\_method\_policy\_regex** string | **Choices:*** disable
* enable
| Enable/disable regular expression based pattern match. choice | disable | Disable setting. choice | enable | Enable setting. |
| **method\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | low severity choice | medium | medium severity choice | high | High severity |
| **method\_status** string | **Choices:*** disable
* enable
| Status. choice | disable | Disable setting. choice | enable | Enable setting. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **name** string | | WAF Profile name. |
| **signature** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **signature\_credit\_card\_detection\_threshold** string | | The minimum number of Credit cards to detect violation. |
| **signature\_custom\_signature\_action** string | **Choices:*** allow
* block
* erase
| Action. choice | allow | Allow. choice | block | Block. choice | erase | Erase credit card numbers. |
| **signature\_custom\_signature\_case\_sensitivity** string | **Choices:*** disable
* enable
| Case sensitivity in pattern. choice | disable | Case insensitive in pattern. choice | enable | Case sensitive in pattern. |
| **signature\_custom\_signature\_direction** string | **Choices:*** request
* response
| Traffic direction. choice | request | Match HTTP request. choice | response | Match HTTP response. |
| **signature\_custom\_signature\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **signature\_custom\_signature\_name** string | | Signature name. |
| **signature\_custom\_signature\_pattern** string | | Match pattern. |
| **signature\_custom\_signature\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **signature\_custom\_signature\_status** string | **Choices:*** disable
* enable
| Status. choice | disable | Disable setting. choice | enable | Enable setting. |
| **signature\_custom\_signature\_target** string | **Choices:*** arg
* arg-name
* req-body
* req-cookie
* req-cookie-name
* req-filename
* req-header
* req-header-name
* req-raw-uri
* req-uri
* resp-body
* resp-hdr
* resp-status
| Match HTTP target. FLAG Based Options. Specify multiple in list form. flag | arg | HTTP arguments. flag | arg-name | Names of HTTP arguments. flag | req-body | HTTP request body. flag | req-cookie | HTTP request cookies. flag | req-cookie-name | HTTP request cookie names. flag | req-filename | HTTP request file name. flag | req-header | HTTP request headers. flag | req-header-name | HTTP request header names. flag | req-raw-uri | Raw URI of HTTP request. flag | req-uri | URI of HTTP request. flag | resp-body | HTTP response body. flag | resp-hdr | HTTP response headers. flag | resp-status | HTTP response status. |
| **signature\_disabled\_signature** string | | Disabled signatures |
| **signature\_disabled\_sub\_class** string | | Disabled signature subclasses. |
| **signature\_main\_class\_action** string | **Choices:*** allow
* block
* erase
| Action. choice | allow | Allow. choice | block | Block. choice | erase | Erase credit card numbers. |
| **signature\_main\_class\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **signature\_main\_class\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
| **signature\_main\_class\_status** string | **Choices:*** disable
* enable
| Status. choice | disable | Disable setting. choice | enable | Enable setting. |
| **url\_access** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **url\_access\_access\_pattern\_negate** string | **Choices:*** disable
* enable
| Enable/disable match negation. choice | disable | Disable setting. choice | enable | Enable setting. |
| **url\_access\_access\_pattern\_pattern** string | | URL pattern. |
| **url\_access\_access\_pattern\_regex** string | **Choices:*** disable
* enable
| Enable/disable regular expression based pattern match. choice | disable | Disable setting. choice | enable | Enable setting. |
| **url\_access\_access\_pattern\_srcaddr** string | | Source address. |
| **url\_access\_action** string | **Choices:*** bypass
* permit
* block
| Action. choice | bypass | Allow the HTTP request, also bypass further WAF scanning. choice | permit | Allow the HTTP request, and continue further WAF scanning. choice | block | Block HTTP request. |
| **url\_access\_address** string | | Host address. |
| **url\_access\_log** string | **Choices:*** disable
* enable
| Enable/disable logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **url\_access\_severity** string | **Choices:*** low
* medium
* high
| Severity. choice | low | Low severity. choice | medium | Medium severity. choice | high | High severity. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: DELETE Profile
community.fortios.fmgr_secprof_waf:
name: "Ansible_WAF_Profile"
comment: "Created by Ansible Module TEST"
mode: "delete"
- name: CREATE Profile
community.fortios.fmgr_secprof_waf:
name: "Ansible_WAF_Profile"
comment: "Created by Ansible Module TEST"
mode: "set"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
| programming_docs |
ansible community.fortios.fmgr_script – Add/Edit/Delete and execute scripts community.fortios.fmgr\_script – Add/Edit/Delete and execute scripts
====================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_script`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create/edit/delete scripts and execute the scripts on the FortiManager using jsonrpc API
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string / required | | The administrative domain (admon) the configuration belongs to |
| **mode** string | **Choices:*** **add** ←
* delete
* execute
* set
| The desired mode of the specified object. Execute will run the script. |
| **script\_content** string | | The script content that will be executed. |
| **script\_description** string | | The description of the script. |
| **script\_name** string / required | | The name of the script. |
| **script\_package** string | | (datasource) Policy package object to run the script against |
| **script\_scope** string | | (datasource) The devices that the script will run on, can have both device member and device group member. |
| **script\_target** string | | The target of the script to be run. |
| **script\_type** string | | The type of script (CLI or TCL). |
| **vdom** string | | The virtual domain (vdom) the configuration belongs to |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: CREATE SCRIPT
community.fortios.fmgr_script:
adom: "root"
script_name: "TestScript"
script_type: "cli"
script_target: "remote_device"
script_description: "Create by Ansible"
script_content: "get system status"
- name: EXECUTE SCRIPT
community.fortios.fmgr_script:
adom: "root"
script_name: "TestScript"
mode: "execute"
script_scope: "FGT1,FGT2"
- name: DELETE SCRIPT
community.fortios.fmgr_script:
adom: "root"
script_name: "TestScript"
mode: "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 |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Andrew Welsh (@Ghilli3)
ansible community.fortios.fmgr_device_provision_template – Manages Device Provisioning Templates in FortiManager. community.fortios.fmgr\_device\_provision\_template – Manages Device Provisioning Templates in FortiManager.
============================================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_device_provision_template`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows the editing and assignment of device provisioning templates in FortiManager.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **admin\_enable\_fortiguard** string | **Choices:*** none
* direct
* this-fmg
| Enables FortiGuard security updates to their default settings. |
| **admin\_fortianalyzer\_target** string | | Configures faz target. |
| **admin\_fortiguard\_target** string | | Configures fortiguard target. admin\_enable\_fortiguard must be set to "direct". |
| **admin\_gui\_theme** string | **Choices:*** green
* red
* blue
* melongene
* mariner
| Changes the admin gui theme. |
| **admin\_http\_port** string | | Non-SSL admin gui port number. |
| **admin\_https\_port** string | | SSL admin gui port number. |
| **admin\_https\_redirect** string | **Choices:*** enable
* disable
| Enables or disables https redirect from http. |
| **admin\_language** string | **Choices:*** english
* simch
* japanese
* korean
* spanish
* trach
* french
* portuguese
| Sets the admin gui language. |
| **admin\_switch\_controller** string | **Choices:*** enable
* disable
| Enables or disables the switch controller. |
| **admin\_timeout** string | | Admin timeout in minutes. |
| **adom** string / required | | The ADOM the configuration should belong to. |
| **delete\_provisioning\_template** string | | If specified, all other options are ignored. The specified provisioning template will be deleted. |
| **device\_unique\_name** string / required | | The unique device's name that you are editing. |
| **dns\_primary\_ipv4** string | | primary ipv4 dns forwarder. |
| **dns\_secondary\_ipv4** string | | secondary ipv4 dns forwarder. |
| **dns\_suffix** string | | Sets the local dns domain suffix. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values. |
| **ntp\_auth** string | **Choices:*** enable
* disable
| Enables or disables ntp authentication. |
| **ntp\_auth\_pwd** string | | Sets the ntp auth password. |
| **ntp\_server** string | | Only used with custom ntp\_type -- specifies IP of server to sync to -- comma separated ip addresses for multiples. |
| **ntp\_status** string | **Choices:*** enable
* disable
| Enables or disables ntp. |
| **ntp\_sync\_interval** string | | Sets the interval in minutes for ntp sync. |
| **ntp\_type** string | **Choices:*** fortiguard
* custom
| Enables fortiguard servers or custom servers are the ntp source. |
| **ntp\_v3** string | **Choices:*** enable
* disable
| Enables or disables ntpv3 (default is ntpv4). |
| **provision\_targets** string / required | | The friendly names of devices in FortiManager to assign the provisioning template to. CSV separated list. |
| **provisioning\_template** string / required | | The provisioning template you want to apply (default = default). |
| **smtp\_conn\_sec** string | **Choices:*** none
* starttls
* smtps
| defines the ssl level for smtp. |
| **smtp\_password** string | | SMTP password. |
| **smtp\_port** string | | SMTP port number. |
| **smtp\_replyto** string | | SMTP reply to address. |
| **smtp\_server** string | | SMTP server ipv4 address. |
| **smtp\_source\_ipv4** string | | SMTP source ip address. |
| **smtp\_username** string | | SMTP auth username. |
| **smtp\_validate\_cert** string | **Choices:*** enable
* disable
| Enables or disables valid certificate checking for smtp. |
| **snmp\_status** string | **Choices:*** enable
* disable
| Enables or disables SNMP globally. |
| **snmp\_v2c\_id** string | | Primary key for the snmp community. this must be unique! |
| **snmp\_v2c\_name** string | | Specifies the v2c community name. |
| **snmp\_v2c\_query\_hosts\_ipv4** string | | - IPv4 addresses or subnets that are allowed to query SNMP v2c, comma separated ("10.7.220.59 255.255.255.0, 10.7.220.0 255.255.255.0"). |
| **snmp\_v2c\_query\_port** string | | Sets the snmp v2c community query port. |
| **snmp\_v2c\_query\_status** string | **Choices:*** enable
* disable
| Enables or disables the v2c community specified for queries. |
| **snmp\_v2c\_status** string | **Choices:*** enable
* disable
| Enables or disables the v2c community specified. |
| **snmp\_v2c\_trap\_hosts\_ipv4** string | | - IPv4 addresses of the hosts that should get SNMP v2c traps, comma separated, must include mask ("10.7.220.59 255.255.255.255, 10.7.220.60 255.255.255.255"). |
| **snmp\_v2c\_trap\_port** string | | Sets the snmp v2c community trap port. |
| **snmp\_v2c\_trap\_src\_ipv4** string | | Source ip the traps should come from IPv4. |
| **snmp\_v2c\_trap\_status** string | **Choices:*** enable
* disable
| Enables or disables the v2c community specified for traps. |
| **snmpv3\_auth\_proto** string | **Choices:*** md5
* sha
| SNMPv3 auth protocol. |
| **snmpv3\_auth\_pwd** string | | SNMPv3 auth pwd \_\_ currently not encrypted! ensure this file is locked down permissions wise! |
| **snmpv3\_name** string | | SNMPv3 user name. |
| **snmpv3\_notify\_hosts** string | | List of ipv4 hosts to send snmpv3 traps to. Comma separated IPv4 list. |
| **snmpv3\_priv\_proto** string | **Choices:*** aes
* des
* aes256
* aes256cisco
| SNMPv3 priv protocol. |
| **snmpv3\_priv\_pwd** string | | SNMPv3 priv pwd currently not encrypted! ensure this file is locked down permissions wise! |
| **snmpv3\_queries** string | **Choices:*** enable
* disable
| Allow snmpv3\_queries. |
| **snmpv3\_query\_port** string | | SNMPv3 query port. |
| **snmpv3\_security\_level** string | **Choices:*** no-auth-no-priv
* auth-no-priv
* auth-priv
| SNMPv3 security level. |
| **snmpv3\_source\_ip** string | | SNMPv3 source ipv4 address for traps. |
| **snmpv3\_status** string | **Choices:*** enable
* disable
| SNMPv3 user is enabled or disabled. |
| **snmpv3\_trap\_rport** string | | SNMPv3 trap remote port. |
| **snmpv3\_trap\_status** string | **Choices:*** enable
* disable
| SNMPv3 traps is enabled or disabled. |
| **syslog\_certificate** string | | Certificate used to communicate with Syslog server if encryption on. |
| **syslog\_enc\_algorithm** string | **Choices:*** high
* low
* **disable** ←
* high-medium
| Enable/disable reliable syslogging with TLS encryption. choice | high | SSL communication with high encryption algorithms. choice | low | SSL communication with low encryption algorithms. choice | disable | Disable SSL communication. choice | high-medium | SSL communication with high and medium encryption algorithms. |
| **syslog\_facility** string | **Choices:*** kernel
* user
* mail
* daemon
* auth
* **syslog** ←
* lpr
* news
* uucp
* cron
* authpriv
* ftp
* ntp
* audit
* alert
* clock
* local0
* local1
* local2
* local3
* local4
* local5
* local6
* local7
| Remote syslog facility. choice | kernel | Kernel messages. choice | user | Random user-level messages. choice | mail | Mail system. choice | daemon | System daemons. choice | auth | Security/authorization messages. choice | syslog | Messages generated internally by syslog. choice | lpr | Line printer subsystem. choice | news | Network news subsystem. choice | uucp | Network news subsystem. choice | cron | Clock daemon. choice | authpriv | Security/authorization messages (private). choice | ftp | FTP daemon. choice | ntp | NTP daemon. choice | audit | Log audit. choice | alert | Log alert. choice | clock | Clock daemon. choice | local0 | Reserved for local use. choice | local1 | Reserved for local use. choice | local2 | Reserved for local use. choice | local3 | Reserved for local use. choice | local4 | Reserved for local use. choice | local5 | Reserved for local use. choice | local6 | Reserved for local use. choice | local7 | Reserved for local use. |
| **syslog\_filter** string | **Choices:*** emergency
* alert
* critical
* error
* warning
* notification
* information
* debug
| Sets the logging level for syslog. |
| **syslog\_mode** string | **Choices:*** **udp** ←
* legacy-reliable
* reliable
| Remote syslog logging over UDP/Reliable TCP. choice | udp | Enable syslogging over UDP. choice | legacy-reliable | Enable legacy reliable syslogging by RFC3195 (Reliable Delivery for Syslog). choice | reliable | Enable reliable syslogging by RFC6587 (Transmission of Syslog Messages over TCP). |
| **syslog\_port** string | | Syslog port that will be set. |
| **syslog\_server** string | | Server the syslogs will be sent to. |
| **syslog\_status** string | **Choices:*** enable
* disable
| Enables or disables syslogs. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: SET SNMP SYSTEM INFO
community.fortios.fmgr_device_provision_template:
provisioning_template: "default"
snmp_status: "enable"
mode: "set"
- name: SET SNMP SYSTEM INFO ANSIBLE ADOM
community.fortios.fmgr_device_provision_template:
provisioning_template: "default"
snmp_status: "enable"
mode: "set"
adom: "ansible"
- name: SET SNMP SYSTEM INFO different template (SNMPv2)
community.fortios.fmgr_device_provision_template:
provisioning_template: "ansibleTest"
snmp_status: "enable"
mode: "set"
adom: "ansible"
snmp_v2c_query_port: "162"
snmp_v2c_trap_port: "161"
snmp_v2c_status: "enable"
snmp_v2c_trap_status: "enable"
snmp_v2c_query_status: "enable"
snmp_v2c_name: "ansibleV2c"
snmp_v2c_id: "1"
snmp_v2c_trap_src_ipv4: "10.7.220.41"
snmp_v2c_trap_hosts_ipv4: "10.7.220.59 255.255.255.255, 10.7.220.60 255.255.255.255"
snmp_v2c_query_hosts_ipv4: "10.7.220.59 255.255.255.255, 10.7.220.0 255.255.255.0"
- name: SET SNMP SYSTEM INFO different template (SNMPv3)
community.fortios.fmgr_device_provision_template:
provisioning_template: "ansibleTest"
snmp_status: "enable"
mode: "set"
adom: "ansible"
snmpv3_auth_proto: "sha"
snmpv3_auth_pwd: "fortinet"
snmpv3_name: "ansibleSNMPv3"
snmpv3_notify_hosts: "10.7.220.59,10.7.220.60"
snmpv3_priv_proto: "aes256"
snmpv3_priv_pwd: "fortinet"
snmpv3_queries: "enable"
snmpv3_query_port: "161"
snmpv3_security_level: "auth_priv"
snmpv3_source_ip: "0.0.0.0"
snmpv3_status: "enable"
snmpv3_trap_rport: "162"
snmpv3_trap_status: "enable"
- name: SET SYSLOG INFO
community.fortios.fmgr_device_provision_template:
provisioning_template: "ansibleTest"
mode: "set"
adom: "ansible"
syslog_server: "10.7.220.59"
syslog_port: "514"
syslog_mode: "disable"
syslog_status: "enable"
syslog_filter: "information"
- name: SET NTP TO FORTIGUARD
community.fortios.fmgr_device_provision_template:
provisioning_template: "ansibleTest"
mode: "set"
adom: "ansible"
ntp_status: "enable"
ntp_sync_interval: "60"
type: "fortiguard"
- name: SET NTP TO CUSTOM SERVER
community.fortios.fmgr_device_provision_template:
provisioning_template: "ansibleTest"
mode: "set"
adom: "ansible"
ntp_status: "enable"
ntp_sync_interval: "60"
ntp_type: "custom"
ntp_server: "10.7.220.32,10.7.220.1"
ntp_auth: "enable"
ntp_auth_pwd: "fortinet"
ntp_v3: "disable"
- name: SET ADMIN GLOBAL SETTINGS
community.fortios.fmgr_device_provision_template:
provisioning_template: "ansibleTest"
mode: "set"
adom: "ansible"
admin_https_redirect: "enable"
admin_https_port: "4433"
admin_http_port: "8080"
admin_timeout: "30"
admin_language: "english"
admin_switch_controller: "enable"
admin_gui_theme: "blue"
admin_enable_fortiguard: "direct"
admin_fortiguard_target: "10.7.220.128"
admin_fortianalyzer_target: "10.7.220.61"
- name: SET CUSTOM SMTP SERVER
community.fortios.fmgr_device_provision_template:
provisioning_template: "ansibleTest"
mode: "set"
adom: "ansible"
smtp_username: "ansible"
smtp_password: "fortinet"
smtp_port: "25"
smtp_replyto: "[email protected]"
smtp_conn_sec: "starttls"
smtp_server: "10.7.220.32"
smtp_source_ipv4: "0.0.0.0"
smtp_validate_cert: "disable"
- name: SET DNS SERVERS
community.fortios.fmgr_device_provision_template:
provisioning_template: "ansibleTest"
mode: "set"
adom: "ansible"
dns_suffix: "ansible.local"
dns_primary_ipv4: "8.8.8.8"
dns_secondary_ipv4: "4.4.4.4"
- name: SET PROVISIONING TEMPLATE DEVICE TARGETS IN FORTIMANAGER
community.fortios.fmgr_device_provision_template:
provisioning_template: "ansibleTest"
mode: "set"
adom: "ansible"
provision_targets: "FGT1, FGT2"
- name: DELETE ENTIRE PROVISIONING TEMPLATE
community.fortios.fmgr_device_provision_template:
delete_provisioning_template: "ansibleTest"
mode: "delete"
adom: "ansible"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible community.fortios.fortianalyzer – HttpApi Plugin for Fortinet FortiAnalyzer Appliance or VM. community.fortios.fortianalyzer – HttpApi Plugin for Fortinet FortiAnalyzer Appliance or VM.
============================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fortianalyzer`.
Synopsis
--------
* This HttpApi plugin provides methods to connect to Fortinet FortiAnalyzer Appliance or VM via JSON RPC API.
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible community.fortios.fmgr_fwobj_service – Manages FortiManager Firewall Service Objects. community.fortios.fmgr\_fwobj\_service – Manages FortiManager Firewall Service Objects.
=======================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_fwobj_service`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages FortiManager Firewall Service Objects.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | -The ADOM the configuration should belong to. |
| **app\_category** string | | Application category ID. |
| **app\_service\_type** string | | Application service type. |
| **application** string | | Application ID. |
| **category** string | | Service category. |
| **check\_reset\_range** string | | Enable disable RST check. |
| **color** string | **Default:**22 | GUI icon color. |
| **comment** string | | Comment. |
| **custom\_type** string | **Choices:*** tcp\_udp\_sctp
* icmp
* icmp6
* ip
* http
* ftp
* connect
* socks\_tcp
* socks\_udp
* **all** ←
| Tells module what kind of custom service to be added. |
| **explicit\_proxy** string | **Choices:*** enable
* **disable** ←
| Enable/disable explicit web proxy service. |
| **fqdn** string | **Default:**"" | Fully qualified domain name. |
| **group\_member** string | | Comma-Seperated list of members' names. |
| **group\_name** string | | Name of the Service Group. |
| **icmp\_code** string | | ICMP code. |
| **icmp\_type** string | | ICMP type. |
| **iprange** string | **Default:**"0.0.0.0" | Start IP-End IP. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
| Sets one of three modes for managing the object. |
| **name** string | | Custom service name. |
| **object\_type** string | **Choices:*** custom
* group
* category
| Tells module if we are adding a custom service, category, or group. |
| **protocol** string | | Protocol type. |
| **protocol\_number** string | | IP protocol number. |
| **sctp\_portrange** string | | Multiple SCTP port ranges. Comma separated list of destination ports to add (i.e. '443,80'). Syntax is <destPort:sourcePort> If no sourcePort is defined, it assumes all of them. Ranges can be defined with a hyphen - Examples -- '443' (destPort 443 only) '443:1000-2000' (destPort 443 from source ports 1000-2000). String multiple together in same quotes, comma separated. ('443:1000-2000, 80:1000-2000'). |
| **session\_ttl** string | **Default:**0 | Session TTL (300 - 604800, 0 = default). |
| **tcp\_halfclose\_timer** string | **Default:**0 | TCP half close timeout (1 - 86400 sec, 0 = default). |
| **tcp\_halfopen\_timer** string | **Default:**0 | TCP half close timeout (1 - 86400 sec, 0 = default). |
| **tcp\_portrange** string | | Comma separated list of destination ports to add (i.e. '443,80'). Syntax is <destPort:sourcePort> If no sourcePort is defined, it assumes all of them. Ranges can be defined with a hyphen - Examples -- '443' (destPort 443 only) '443:1000-2000' (destPort 443 from source ports 1000-2000). String multiple together in same quotes, comma separated. ('443:1000-2000, 80:1000-2000'). |
| **tcp\_timewait\_timer** string | **Default:**0 | TCP half close timeout (1 - 300 sec, 0 = default). |
| **udp\_idle\_timer** string | **Default:**0 | TCP half close timeout (0 - 86400 sec, 0 = default). |
| **udp\_portrange** string | | Comma separated list of destination ports to add (i.e. '443,80'). Syntax is <destPort:sourcePort> If no sourcePort is defined, it assumes all of them. Ranges can be defined with a hyphen - Examples -- '443' (destPort 443 only) '443:1000-2000' (destPort 443 from source ports 1000-2000). String multiple together in same quotes, comma separated. ('443:1000-2000, 80:1000-2000'). |
| **visibility** string | **Choices:*** **enable** ←
* disable
| Enable/disable service visibility. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: ADD A CUSTOM SERVICE FOR TCP/UDP/SCP
community.fortios.fmgr_fwobj_service:
adom: "ansible"
name: "ansible_custom_service"
object_type: "custom"
custom_type: "tcp_udp_sctp"
tcp_portrange: "443"
udp_portrange: "51"
sctp_portrange: "100"
- name: ADD A CUSTOM SERVICE FOR TCP/UDP/SCP WITH SOURCE RANGES AND MULTIPLES
community.fortios.fmgr_fwobj_service:
adom: "ansible"
name: "ansible_custom_serviceWithSource"
object_type: "custom"
custom_type: "tcp_udp_sctp"
tcp_portrange: "443:2000-1000,80-82:10000-20000"
udp_portrange: "51:100-200,162:200-400"
sctp_portrange: "100:2000-2500"
- name: ADD A CUSTOM SERVICE FOR ICMP
community.fortios.fmgr_fwobj_service:
adom: "ansible"
name: "ansible_custom_icmp"
object_type: "custom"
custom_type: "icmp"
icmp_type: "8"
icmp_code: "3"
- name: ADD A CUSTOM SERVICE FOR ICMP6
community.fortios.fmgr_fwobj_service:
adom: "ansible"
name: "ansible_custom_icmp6"
object_type: "custom"
custom_type: "icmp6"
icmp_type: "5"
icmp_code: "1"
- name: ADD A CUSTOM SERVICE FOR IP - GRE
community.fortios.fmgr_fwobj_service:
adom: "ansible"
name: "ansible_custom_icmp6"
object_type: "custom"
custom_type: "ip"
protocol_number: "47"
- name: ADD A CUSTOM PROXY FOR ALL WITH SOURCE RANGES AND MULTIPLES
community.fortios.fmgr_fwobj_service:
adom: "ansible"
name: "ansible_custom_proxy_all"
object_type: "custom"
custom_type: "all"
explicit_proxy: "enable"
tcp_portrange: "443:2000-1000,80-82:10000-20000"
iprange: "www.ansible.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 |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
| programming_docs |
ansible community.fortios.fortimanager – HttpApi Plugin for Fortinet FortiManager Appliance or VM. community.fortios.fortimanager – HttpApi Plugin for Fortinet FortiManager Appliance or VM.
==========================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fortimanager`.
Synopsis
--------
* This HttpApi plugin provides methods to connect to Fortinet FortiManager Appliance or VM via JSON RPC API.
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible community.fortios.fmgr_secprof_av – Manage security profile community.fortios.fmgr\_secprof\_av – Manage security profile
=============================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_secprof_av`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage security profile groups for FortiManager objects
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **analytics\_bl\_filetype** string | | Only submit files matching this DLP file-pattern to FortiSandbox. |
| **analytics\_db** string | **Choices:*** disable
* enable
| Enable/disable using the FortiSandbox signature database to supplement the AV signature databases. |
| **analytics\_max\_upload** string | | Maximum size of files that can be uploaded to FortiSandbox (1 - 395 MBytes, default = 10). |
| **analytics\_wl\_filetype** string | | Do not submit files matching this DLP file-pattern to FortiSandbox. |
| **av\_block\_log** string | **Choices:*** disable
* enable
| Enable/disable logging for AntiVirus file blocking. |
| **av\_virus\_log** string | **Choices:*** disable
* enable
| Enable/disable AntiVirus logging. |
| **comment** string | | Comment. |
| **content\_disarm** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **content\_disarm\_cover\_page** string | **Choices:*** disable
* enable
| Enable/disable inserting a cover page into the disarmed document. |
| **content\_disarm\_detect\_only** string | **Choices:*** disable
* enable
| Enable/disable only detect disarmable files, do not alter content. |
| **content\_disarm\_office\_embed** string | **Choices:*** disable
* enable
| Enable/disable stripping of embedded objects in Microsoft Office documents. |
| **content\_disarm\_office\_hylink** string | **Choices:*** disable
* enable
| Enable/disable stripping of hyperlinks in Microsoft Office documents. |
| **content\_disarm\_office\_linked** string | **Choices:*** disable
* enable
| Enable/disable stripping of linked objects in Microsoft Office documents. |
| **content\_disarm\_office\_macro** string | **Choices:*** disable
* enable
| Enable/disable stripping of macros in Microsoft Office documents. |
| **content\_disarm\_original\_file\_destination** string | **Choices:*** fortisandbox
* quarantine
* discard
| Destination to send original file if active content is removed. |
| **content\_disarm\_pdf\_act\_form** string | **Choices:*** disable
* enable
| Enable/disable stripping of actions that submit data to other targets in PDF documents. |
| **content\_disarm\_pdf\_act\_gotor** string | **Choices:*** disable
* enable
| Enable/disable stripping of links to other PDFs in PDF documents. |
| **content\_disarm\_pdf\_act\_java** string | **Choices:*** disable
* enable
| Enable/disable stripping of actions that execute JavaScript code in PDF documents. |
| **content\_disarm\_pdf\_act\_launch** string | **Choices:*** disable
* enable
| Enable/disable stripping of links to external applications in PDF documents. |
| **content\_disarm\_pdf\_act\_movie** string | **Choices:*** disable
* enable
| Enable/disable stripping of embedded movies in PDF documents. |
| **content\_disarm\_pdf\_act\_sound** string | **Choices:*** disable
* enable
| Enable/disable stripping of embedded sound files in PDF documents. |
| **content\_disarm\_pdf\_embedfile** string | **Choices:*** disable
* enable
| Enable/disable stripping of embedded files in PDF documents. |
| **content\_disarm\_pdf\_hyperlink** string | **Choices:*** disable
* enable
| Enable/disable stripping of hyperlinks from PDF documents. |
| **content\_disarm\_pdf\_javacode** string | **Choices:*** disable
* enable
| Enable/disable stripping of JavaScript code in PDF documents. |
| **extended\_log** string | **Choices:*** disable
* enable
| Enable/disable extended logging for antivirus. |
| **ftgd\_analytics** string | **Choices:*** disable
* suspicious
* everything
| Settings to control which files are uploaded to FortiSandbox. |
| **ftp** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **ftp\_archive\_block** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to block. FLAG Based Options. Specify multiple in list form. |
| **ftp\_archive\_log** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to log. FLAG Based Options. Specify multiple in list form. |
| **ftp\_emulator** string | **Choices:*** disable
* enable
| Enable/disable the virus emulator. |
| **ftp\_options** string | **Choices:*** scan
* quarantine
* avmonitor
| Enable/disable FTP AntiVirus scanning, monitoring, and quarantine. FLAG Based Options. Specify multiple in list form. |
| **ftp\_outbreak\_prevention** string | **Choices:*** disabled
* files
* full-archive
| Enable FortiGuard Virus Outbreak Prevention service. |
| **http** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **http\_archive\_block** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to block. FLAG Based Options. Specify multiple in list form. |
| **http\_archive\_log** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to log. FLAG Based Options. Specify multiple in list form. |
| **http\_content\_disarm** string | **Choices:*** disable
* enable
| Enable Content Disarm and Reconstruction for this protocol. |
| **http\_emulator** string | **Choices:*** disable
* enable
| Enable/disable the virus emulator. |
| **http\_options** string | **Choices:*** scan
* quarantine
* avmonitor
| Enable/disable HTTP AntiVirus scanning, monitoring, and quarantine. FLAG Based Options. Specify multiple in list form. |
| **http\_outbreak\_prevention** string | **Choices:*** disabled
* files
* full-archive
| Enable FortiGuard Virus Outbreak Prevention service. |
| **imap** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **imap\_archive\_block** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to block. FLAG Based Options. Specify multiple in list form. |
| **imap\_archive\_log** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to log. FLAG Based Options. Specify multiple in list form. |
| **imap\_content\_disarm** string | **Choices:*** disable
* enable
| Enable Content Disarm and Reconstruction for this protocol. |
| **imap\_emulator** string | **Choices:*** disable
* enable
| Enable/disable the virus emulator. |
| **imap\_executables** string | **Choices:*** default
* virus
| Treat Windows executable files as viruses for the purpose of blocking or monitoring. |
| **imap\_options** string | **Choices:*** scan
* quarantine
* avmonitor
| Enable/disable IMAP AntiVirus scanning, monitoring, and quarantine. FLAG Based Options. Specify multiple in list form. |
| **imap\_outbreak\_prevention** string | **Choices:*** disabled
* files
* full-archive
| Enable FortiGuard Virus Outbreak Prevention service. |
| **inspection\_mode** string | **Choices:*** proxy
* flow-based
| Inspection mode. |
| **mapi** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **mapi\_archive\_block** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to block. FLAG Based Options. Specify multiple in list form. |
| **mapi\_archive\_log** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to log. FLAG Based Options. Specify multiple in list form. |
| **mapi\_emulator** string | **Choices:*** disable
* enable
| Enable/disable the virus emulator. |
| **mapi\_executables** string | **Choices:*** default
* virus
| Treat Windows executable files as viruses for the purpose of blocking or monitoring. |
| **mapi\_options** string | **Choices:*** scan
* quarantine
* avmonitor
| Enable/disable MAPI AntiVirus scanning, monitoring, and quarantine. FLAG Based Options. Specify multiple in list form. |
| **mapi\_outbreak\_prevention** string | **Choices:*** disabled
* files
* full-archive
| Enable FortiGuard Virus Outbreak Prevention service. |
| **mobile\_malware\_db** string | **Choices:*** disable
* enable
| Enable/disable using the mobile malware signature database. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **nac\_quar** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **nac\_quar\_expiry** string | | Duration of quarantine. |
| **nac\_quar\_infected** string | **Choices:*** none
* quar-src-ip
| Enable/Disable quarantining infected hosts to the banned user list. |
| **nac\_quar\_log** string | **Choices:*** disable
* enable
| Enable/disable AntiVirus quarantine logging. |
| **name** string | | Profile name. |
| **nntp** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **nntp\_archive\_block** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to block. FLAG Based Options. Specify multiple in list form. |
| **nntp\_archive\_log** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to log. FLAG Based Options. Specify multiple in list form. |
| **nntp\_emulator** string | **Choices:*** disable
* enable
| Enable/disable the virus emulator. |
| **nntp\_options** string | **Choices:*** scan
* quarantine
* avmonitor
| Enable/disable NNTP AntiVirus scanning, monitoring, and quarantine. FLAG Based Options. Specify multiple in list form. |
| **nntp\_outbreak\_prevention** string | **Choices:*** disabled
* files
* full-archive
| Enable FortiGuard Virus Outbreak Prevention service. |
| **pop3** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **pop3\_archive\_block** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to block. FLAG Based Options. Specify multiple in list form. |
| **pop3\_archive\_log** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to log. FLAG Based Options. Specify multiple in list form. |
| **pop3\_content\_disarm** string | **Choices:*** disable
* enable
| Enable Content Disarm and Reconstruction for this protocol. |
| **pop3\_emulator** string | **Choices:*** disable
* enable
| Enable/disable the virus emulator. |
| **pop3\_executables** string | **Choices:*** default
* virus
| Treat Windows executable files as viruses for the purpose of blocking or monitoring. |
| **pop3\_options** string | **Choices:*** scan
* quarantine
* avmonitor
| Enable/disable POP3 AntiVirus scanning, monitoring, and quarantine. FLAG Based Options. Specify multiple in list form. |
| **pop3\_outbreak\_prevention** string | **Choices:*** disabled
* files
* full-archive
| Enable FortiGuard Virus Outbreak Prevention service. |
| **replacemsg\_group** string | | Replacement message group customized for this profile. |
| **scan\_mode** string | **Choices:*** quick
* full
| Choose between full scan mode and quick scan mode. |
| **smb** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **smb\_archive\_block** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to block. FLAG Based Options. Specify multiple in list form. |
| **smb\_archive\_log** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to log. FLAG Based Options. Specify multiple in list form. |
| **smb\_emulator** string | **Choices:*** disable
* enable
| Enable/disable the virus emulator. |
| **smb\_options** string | **Choices:*** scan
* quarantine
* avmonitor
| Enable/disable SMB AntiVirus scanning, monitoring, and quarantine. FLAG Based Options. Specify multiple in list form. |
| **smb\_outbreak\_prevention** string | **Choices:*** disabled
* files
* full-archive
| Enable FortiGuard Virus Outbreak Prevention service. |
| **smtp** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **smtp\_archive\_block** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to block. FLAG Based Options. Specify multiple in list form. |
| **smtp\_archive\_log** string | **Choices:*** encrypted
* corrupted
* multipart
* nested
* mailbomb
* unhandled
* partiallycorrupted
* fileslimit
* timeout
| Select the archive types to log. FLAG Based Options. Specify multiple in list form. |
| **smtp\_content\_disarm** string | **Choices:*** disable
* enable
| Enable Content Disarm and Reconstruction for this protocol. |
| **smtp\_emulator** string | **Choices:*** disable
* enable
| Enable/disable the virus emulator. |
| **smtp\_executables** string | **Choices:*** default
* virus
| Treat Windows executable files as viruses for the purpose of blocking or monitoring. |
| **smtp\_options** string | **Choices:*** scan
* quarantine
* avmonitor
| Enable/disable SMTP AntiVirus scanning, monitoring, and quarantine. FLAG Based Options. Specify multiple in list form. |
| **smtp\_outbreak\_prevention** string | **Choices:*** disabled
* files
* full-archive
| Enable FortiGuard Virus Outbreak Prevention service. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: DELETE Profile
community.fortios.fmgr_secprof_av:
name: "Ansible_AV_Profile"
mode: "delete"
- name: CREATE Profile
community.fortios.fmgr_secprof_av:
name: "Ansible_AV_Profile"
comment: "Created by Ansible Module TEST"
mode: "set"
inspection_mode: "proxy"
ftgd_analytics: "everything"
av_block_log: "enable"
av_virus_log: "enable"
scan_mode: "full"
mobile_malware_db: "enable"
ftp_archive_block: "encrypted"
ftp_outbreak_prevention: "files"
ftp_archive_log: "timeout"
ftp_emulator: "disable"
ftp_options: "scan"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
| programming_docs |
ansible community.fortios.fmgr_secprof_ssl_ssh – Manage SSL and SSH security profiles in FortiManager community.fortios.fmgr\_secprof\_ssl\_ssh – Manage SSL and SSH security profiles in FortiManager
================================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_secprof_ssl_ssh`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage SSL and SSH security profiles in FortiManager via the FMG API
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **caname** string | | CA certificate used by SSL Inspection. |
| **comment** string | | Optional comments. |
| **ftps** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **ftps\_allow\_invalid\_server\_cert** string | **Choices:*** disable
* enable
| When enabled, allows SSL sessions whose server certificate validation failed. choice | disable | Disable setting. choice | enable | Enable setting. |
| **ftps\_client\_cert\_request** string | **Choices:*** bypass
* inspect
* block
| Action based on client certificate request failure. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **ftps\_ports** string | | Ports to use for scanning (1 - 65535, default = 443). |
| **ftps\_status** string | **Choices:*** disable
* deep-inspection
| Configure protocol inspection status. choice | disable | Disable. choice | deep-inspection | Full SSL inspection. |
| **ftps\_unsupported\_ssl** string | **Choices:*** bypass
* inspect
* block
| Action based on the SSL encryption used being unsupported. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **ftps\_untrusted\_cert** string | **Choices:*** allow
* block
* ignore
| Allow, ignore, or block the untrusted SSL session server certificate. choice | allow | Allow the untrusted server certificate. choice | block | Block the connection when an untrusted server certificate is detected. choice | ignore | Always take the server certificate as trusted. |
| **https** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **https\_allow\_invalid\_server\_cert** string | **Choices:*** disable
* enable
| When enabled, allows SSL sessions whose server certificate validation failed. choice | disable | Disable setting. choice | enable | Enable setting. |
| **https\_client\_cert\_request** string | **Choices:*** bypass
* inspect
* block
| Action based on client certificate request failure. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **https\_ports** string | | Ports to use for scanning (1 - 65535, default = 443). |
| **https\_status** string | **Choices:*** disable
* certificate-inspection
* deep-inspection
| Configure protocol inspection status. choice | disable | Disable. choice | certificate-inspection | Inspect SSL handshake only. choice | deep-inspection | Full SSL inspection. |
| **https\_unsupported\_ssl** string | **Choices:*** bypass
* inspect
* block
| Action based on the SSL encryption used being unsupported. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **https\_untrusted\_cert** string | **Choices:*** allow
* block
* ignore
| Allow, ignore, or block the untrusted SSL session server certificate. choice | allow | Allow the untrusted server certificate. choice | block | Block the connection when an untrusted server certificate is detected. choice | ignore | Always take the server certificate as trusted. |
| **imaps** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **imaps\_allow\_invalid\_server\_cert** string | **Choices:*** disable
* enable
| When enabled, allows SSL sessions whose server certificate validation failed. choice | disable | Disable setting. choice | enable | Enable setting. |
| **imaps\_client\_cert\_request** string | **Choices:*** bypass
* inspect
* block
| Action based on client certificate request failure. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **imaps\_ports** string | | Ports to use for scanning (1 - 65535, default = 443). |
| **imaps\_status** string | **Choices:*** disable
* deep-inspection
| Configure protocol inspection status. choice | disable | Disable. choice | deep-inspection | Full SSL inspection. |
| **imaps\_unsupported\_ssl** string | **Choices:*** bypass
* inspect
* block
| Action based on the SSL encryption used being unsupported. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **imaps\_untrusted\_cert** string | **Choices:*** allow
* block
* ignore
| Allow, ignore, or block the untrusted SSL session server certificate. choice | allow | Allow the untrusted server certificate. choice | block | Block the connection when an untrusted server certificate is detected. choice | ignore | Always take the server certificate as trusted. |
| **mapi\_over\_https** string | **Choices:*** disable
* enable
| Enable/disable inspection of MAPI over HTTPS. choice | disable | Disable inspection of MAPI over HTTPS. choice | enable | Enable inspection of MAPI over HTTPS. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **name** string | | Name. |
| **pop3s** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **pop3s\_allow\_invalid\_server\_cert** string | **Choices:*** disable
* enable
| When enabled, allows SSL sessions whose server certificate validation failed. choice | disable | Disable setting. choice | enable | Enable setting. |
| **pop3s\_client\_cert\_request** string | **Choices:*** bypass
* inspect
* block
| Action based on client certificate request failure. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **pop3s\_ports** string | | Ports to use for scanning (1 - 65535, default = 443). |
| **pop3s\_status** string | **Choices:*** disable
* deep-inspection
| Configure protocol inspection status. choice | disable | Disable. choice | deep-inspection | Full SSL inspection. |
| **pop3s\_unsupported\_ssl** string | **Choices:*** bypass
* inspect
* block
| Action based on the SSL encryption used being unsupported. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **pop3s\_untrusted\_cert** string | **Choices:*** allow
* block
* ignore
| Allow, ignore, or block the untrusted SSL session server certificate. choice | allow | Allow the untrusted server certificate. choice | block | Block the connection when an untrusted server certificate is detected. choice | ignore | Always take the server certificate as trusted. |
| **rpc\_over\_https** string | **Choices:*** disable
* enable
| Enable/disable inspection of RPC over HTTPS. choice | disable | Disable inspection of RPC over HTTPS. choice | enable | Enable inspection of RPC over HTTPS. |
| **server\_cert** string | | Certificate used by SSL Inspection to replace server certificate. |
| **server\_cert\_mode** string | **Choices:*** re-sign
* replace
| Re-sign or replace the server's certificate. choice | re-sign | Multiple clients connecting to multiple servers. choice | replace | Protect an SSL server. |
| **smtps** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **smtps\_allow\_invalid\_server\_cert** string | **Choices:*** disable
* enable
| When enabled, allows SSL sessions whose server certificate validation failed. choice | disable | Disable setting. choice | enable | Enable setting. |
| **smtps\_client\_cert\_request** string | **Choices:*** bypass
* inspect
* block
| Action based on client certificate request failure. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **smtps\_ports** string | | Ports to use for scanning (1 - 65535, default = 443). |
| **smtps\_status** string | **Choices:*** disable
* deep-inspection
| Configure protocol inspection status. choice | disable | Disable. choice | deep-inspection | Full SSL inspection. |
| **smtps\_unsupported\_ssl** string | **Choices:*** bypass
* inspect
* block
| Action based on the SSL encryption used being unsupported. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **smtps\_untrusted\_cert** string | **Choices:*** allow
* block
* ignore
| Allow, ignore, or block the untrusted SSL session server certificate. choice | allow | Allow the untrusted server certificate. choice | block | Block the connection when an untrusted server certificate is detected. choice | ignore | Always take the server certificate as trusted. |
| **ssh** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **ssh\_inspect\_all** string | **Choices:*** disable
* deep-inspection
| Level of SSL inspection. choice | disable | Disable. choice | deep-inspection | Full SSL inspection. |
| **ssh\_ports** string | | Ports to use for scanning (1 - 65535, default = 443). |
| **ssh\_ssh\_algorithm** string | **Choices:*** compatible
* high-encryption
| Relative strength of encryption algorithms accepted during negotiation. choice | compatible | Allow a broader set of encryption algorithms for best compatibility. choice | high-encryption | Allow only AES-CTR, AES-GCM ciphers and high encryption algorithms. |
| **ssh\_ssh\_policy\_check** string | **Choices:*** disable
* enable
| Enable/disable SSH policy check. choice | disable | Disable SSH policy check. choice | enable | Enable SSH policy check. |
| **ssh\_ssh\_tun\_policy\_check** string | **Choices:*** disable
* enable
| Enable/disable SSH tunnel policy check. choice | disable | Disable SSH tunnel policy check. choice | enable | Enable SSH tunnel policy check. |
| **ssh\_status** string | **Choices:*** disable
* deep-inspection
| Configure protocol inspection status. choice | disable | Disable. choice | deep-inspection | Full SSL inspection. |
| **ssh\_unsupported\_version** string | **Choices:*** block
* bypass
| Action based on SSH version being unsupported. choice | block | Block. choice | bypass | Bypass. |
| **ssl** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **ssl\_allow\_invalid\_server\_cert** string | **Choices:*** disable
* enable
| When enabled, allows SSL sessions whose server certificate validation failed. choice | disable | Disable setting. choice | enable | Enable setting. |
| **ssl\_anomalies\_log** string | **Choices:*** disable
* enable
| Enable/disable logging SSL anomalies. choice | disable | Disable logging SSL anomalies. choice | enable | Enable logging SSL anomalies. |
| **ssl\_client\_cert\_request** string | **Choices:*** bypass
* inspect
* block
| Action based on client certificate request failure. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **ssl\_exempt** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **ssl\_exempt\_address** string | | IPv4 address object. |
| **ssl\_exempt\_address6** string | | IPv6 address object. |
| **ssl\_exempt\_fortiguard\_category** string | | FortiGuard category ID. |
| **ssl\_exempt\_regex** string | | Exempt servers by regular expression. |
| **ssl\_exempt\_type** string | **Choices:*** fortiguard-category
* address
* address6
* wildcard-fqdn
* regex
| Type of address object (IPv4 or IPv6) or FortiGuard category. choice | fortiguard-category | FortiGuard category. choice | address | Firewall IPv4 address. choice | address6 | Firewall IPv6 address. choice | wildcard-fqdn | Fully Qualified Domain Name with wildcard characters. choice | regex | Regular expression FQDN. |
| **ssl\_exempt\_wildcard\_fqdn** string | | Exempt servers by wildcard FQDN. |
| **ssl\_exemptions\_log** string | **Choices:*** disable
* enable
| Enable/disable logging SSL exemptions. choice | disable | Disable logging SSL exemptions. choice | enable | Enable logging SSL exemptions. |
| **ssl\_inspect\_all** string | **Choices:*** disable
* certificate-inspection
* deep-inspection
| Level of SSL inspection. choice | disable | Disable. choice | certificate-inspection | Inspect SSL handshake only. choice | deep-inspection | Full SSL inspection. |
| **ssl\_server** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **ssl\_server\_ftps\_client\_cert\_request** string | **Choices:*** bypass
* inspect
* block
| Action based on client certificate request failure during the FTPS handshake. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **ssl\_server\_https\_client\_cert\_request** string | **Choices:*** bypass
* inspect
* block
| Action based on client certificate request failure during the HTTPS handshake. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **ssl\_server\_imaps\_client\_cert\_request** string | **Choices:*** bypass
* inspect
* block
| Action based on client certificate request failure during the IMAPS handshake. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **ssl\_server\_ip** string | | IPv4 address of the SSL server. |
| **ssl\_server\_pop3s\_client\_cert\_request** string | **Choices:*** bypass
* inspect
* block
| Action based on client certificate request failure during the POP3S handshake. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **ssl\_server\_smtps\_client\_cert\_request** string | **Choices:*** bypass
* inspect
* block
| Action based on client certificate request failure during the SMTPS handshake. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **ssl\_server\_ssl\_other\_client\_cert\_request** string | **Choices:*** bypass
* inspect
* block
| Action based on client certificate request failure during an SSL protocol handshake. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **ssl\_unsupported\_ssl** string | **Choices:*** bypass
* inspect
* block
| Action based on the SSL encryption used being unsupported. choice | bypass | Bypass. choice | inspect | Inspect. choice | block | Block. |
| **ssl\_untrusted\_cert** string | **Choices:*** allow
* block
* ignore
| Allow, ignore, or block the untrusted SSL session server certificate. choice | allow | Allow the untrusted server certificate. choice | block | Block the connection when an untrusted server certificate is detected. choice | ignore | Always take the server certificate as trusted. |
| **untrusted\_caname** string | | Untrusted CA certificate used by SSL Inspection. |
| **use\_ssl\_server** string | **Choices:*** disable
* enable
| Enable/disable the use of SSL server table for SSL offloading. choice | disable | Don't use SSL server configuration. choice | enable | Use SSL server configuration. |
| **whitelist** string | **Choices:*** disable
* enable
| Enable/disable exempting servers by FortiGuard whitelist. choice | disable | Disable setting. choice | enable | Enable setting. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: DELETE Profile
community.fortios.fmgr_secprof_ssl_ssh:
name: Ansible_SSL_SSH_Profile
mode: delete
- name: CREATE Profile
community.fortios.fmgr_secprof_ssl_ssh:
name: Ansible_SSL_SSH_Profile
comment: "Created by Ansible Module TEST"
mode: set
mapi_over_https: enable
rpc_over_https: enable
server_cert_mode: replace
ssl_anomalies_log: enable
ssl_exemptions_log: enable
use_ssl_server: enable
whitelist: enable
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
| programming_docs |
ansible community.fortios.fmgr_fwobj_address – Allows the management of firewall objects in FortiManager community.fortios.fmgr\_fwobj\_address – Allows the management of firewall objects in FortiManager
==================================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_fwobj_address`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for the management of IPv4, IPv6, and multicast address objects within FortiManager.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **allow\_routing** string | **Choices:*** enable
* **disable** ←
| Enable/disable use of this address in the static route configuration. |
| **associated\_interface** string | | Associated interface name. |
| **cache\_ttl** string | | Minimal TTL of individual IP addresses in FQDN cache. Only applies when type = wildcard-fqdn. |
| **color** string | **Default:**22 | Color of the object in FortiManager GUI. Takes integers 1-32 |
| **comment** string | | Comment for the object in FortiManager. |
| **country** string | | Country name. Required if type = geographic. |
| **end\_ip** string | | End IP. Only used when ipv4 = iprange. |
| **fqdn** string | | Fully qualified domain name. |
| **group\_members** string | | Address group member. If this is defined w/out group\_name, the operation will fail. |
| **group\_name** string | | Address group name. If this is defined in playbook task, all other options are ignored. |
| **ipv4** string | **Choices:*** ipmask
* iprange
* fqdn
* wildcard
* geography
* wildcard-fqdn
* group
| Type of IPv4 Object. Must not be specified with either multicast or IPv6 parameters. |
| **ipv4addr** string | | IP and network mask. If only defining one IP use this parameter. (i.e. 10.7.220.30/255.255.255.255) Can also define subnets (i.e. 10.7.220.0/255.255.255.0) Also accepts CIDR (i.e. 10.7.220.0/24) If Netmask is omitted after IP address, /32 is assumed. When multicast is set to Broadcast Subnet the ipv4addr parameter is used to specify the subnet. |
| **ipv6** string | **Choices:*** ip
* iprange
* group
| Puts module into IPv6 mode. Must not be specified with either ipv4 or multicast parameters. |
| **ipv6addr** string | | IPv6 address in full. (i.e. 2001:0db8:85a3:0000:0000:8a2e:0370:7334) |
| **mode** string | **Choices:*** **add** ←
* set
* delete
| Sets one of three modes for managing the object. |
| **multicast** string | **Choices:*** multicastrange
* broadcastmask
* ip6
| Manages Multicast Address Objects. Sets either a Multicast IP Range or a Broadcast Subnet. Must not be specified with either ipv4 or ipv6 parameters. When set to Broadcast Subnet the ipv4addr parameter is used to specify the subnet. Can create IPv4 Multicast Objects (multicastrange and broadcastmask options -- uses start/end-ip and ipv4addr). |
| **name** string | | Friendly Name Address object name in FortiManager. |
| **obj\_id** string | | Object ID for NSX. |
| **start\_ip** string | | Start IP. Only used when ipv4 = iprange. |
| **visibility** string | **Choices:*** **enable** ←
* disable
| Enable/disable address visibility. |
| **wildcard** string | | IP address and wildcard netmask. Required if ipv4 = wildcard. |
| **wildcard\_fqdn** string | | Wildcard FQDN. Required if ipv4 = wildcard-fqdn. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: ADD IPv4 IP ADDRESS OBJECT
community.fortios.fmgr_fwobj_address:
ipv4: "ipmask"
ipv4addr: "10.7.220.30/32"
name: "ansible_v4Obj"
comment: "Created by Ansible"
color: "6"
- name: ADD IPv4 IP ADDRESS OBJECT MORE OPTIONS
community.fortios.fmgr_fwobj_address:
ipv4: "ipmask"
ipv4addr: "10.7.220.34/32"
name: "ansible_v4Obj_MORE"
comment: "Created by Ansible"
color: "6"
allow_routing: "enable"
cache_ttl: "180"
associated_interface: "port1"
obj_id: "123"
- name: ADD IPv4 IP ADDRESS SUBNET OBJECT
community.fortios.fmgr_fwobj_address:
ipv4: "ipmask"
ipv4addr: "10.7.220.0/255.255.255.128"
name: "ansible_subnet"
comment: "Created by Ansible"
mode: "set"
- name: ADD IPv4 IP ADDRESS RANGE OBJECT
community.fortios.fmgr_fwobj_address:
ipv4: "iprange"
start_ip: "10.7.220.1"
end_ip: "10.7.220.125"
name: "ansible_range"
comment: "Created by Ansible"
- name: ADD IPv4 IP ADDRESS WILDCARD OBJECT
community.fortios.fmgr_fwobj_address:
ipv4: "wildcard"
wildcard: "10.7.220.30/255.255.255.255"
name: "ansible_wildcard"
comment: "Created by Ansible"
- name: ADD IPv4 IP ADDRESS WILDCARD FQDN OBJECT
community.fortios.fmgr_fwobj_address:
ipv4: "wildcard-fqdn"
wildcard_fqdn: "*.myds.com"
name: "Synology myds DDNS service"
comment: "Created by Ansible"
- name: ADD IPv4 IP ADDRESS FQDN OBJECT
community.fortios.fmgr_fwobj_address:
ipv4: "fqdn"
fqdn: "ansible.com"
name: "ansible_fqdn"
comment: "Created by Ansible"
- name: ADD IPv4 IP ADDRESS GEO OBJECT
community.fortios.fmgr_fwobj_address:
ipv4: "geography"
country: "usa"
name: "ansible_geo"
comment: "Created by Ansible"
- name: ADD IPv6 ADDRESS
community.fortios.fmgr_fwobj_address:
ipv6: "ip"
ipv6addr: "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
name: "ansible_v6Obj"
comment: "Created by Ansible"
- name: ADD IPv6 ADDRESS RANGE
community.fortios.fmgr_fwobj_address:
ipv6: "iprange"
start_ip: "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
end_ip: "2001:0db8:85a3:0000:0000:8a2e:0370:7446"
name: "ansible_v6range"
comment: "Created by Ansible"
- name: ADD IPv4 IP ADDRESS GROUP
community.fortios.fmgr_fwobj_address:
ipv4: "group"
group_name: "ansibleIPv4Group"
group_members: "ansible_fqdn, ansible_wildcard, ansible_range"
- name: ADD IPv6 IP ADDRESS GROUP
community.fortios.fmgr_fwobj_address:
ipv6: "group"
group_name: "ansibleIPv6Group"
group_members: "ansible_v6Obj, ansible_v6range"
- name: ADD MULTICAST RANGE
community.fortios.fmgr_fwobj_address:
multicast: "multicastrange"
start_ip: "224.0.0.251"
end_ip: "224.0.0.251"
name: "ansible_multicastrange"
comment: "Created by Ansible"
- name: ADD BROADCAST SUBNET
community.fortios.fmgr_fwobj_address:
multicast: "broadcastmask"
ipv4addr: "10.7.220.0/24"
name: "ansible_broadcastSubnet"
comment: "Created by Ansible"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible community.fortios.fmgr_fwobj_vip – Manages Virtual IPs objects in FortiManager community.fortios.fmgr\_fwobj\_vip – Manages Virtual IPs objects in FortiManager
================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_fwobj_vip`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages Virtual IP objects in FortiManager for IPv4
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **arp\_reply** string | **Choices:*** disable
* enable
| Enable to respond to ARP requests for this virtual IP address. Enabled by default. choice | disable | Disable ARP reply. choice | enable | Enable ARP reply. |
| **color** string | | Color of icon on the GUI. |
| **comment** string | | Comment. |
| **dns\_mapping\_ttl** string | | DNS mapping TTL (Set to zero to use TTL in DNS response, default = 0). |
| **dynamic\_mapping** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **dynamic\_mapping\_arp\_reply** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_color** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_comment** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_dns\_mapping\_ttl** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_extaddr** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_extintf** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_extip** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_extport** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_gratuitous\_arp\_interval** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_http\_cookie\_age** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_http\_cookie\_domain** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_http\_cookie\_domain\_from\_host** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_http\_cookie\_generation** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_http\_cookie\_path** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_http\_cookie\_share** string | **Choices:*** disable
* same-ip
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | same-ip | |
| **dynamic\_mapping\_http\_ip\_header** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_http\_ip\_header\_name** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_http\_multiplex** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_https\_cookie\_secure** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_ldb\_method** string | **Choices:*** static
* round-robin
* weighted
* least-session
* least-rtt
* first-alive
* http-host
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | static | choice | round-robin | choice | weighted | choice | least-session | choice | least-rtt | choice | first-alive | choice | http-host | |
| **dynamic\_mapping\_mapped\_addr** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_mappedip** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_mappedport** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_max\_embryonic\_connections** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_monitor** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_nat\_source\_vip** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_outlook\_web\_access** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_persistence** string | **Choices:*** none
* http-cookie
* ssl-session-id
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | none | choice | http-cookie | choice | ssl-session-id | |
| **dynamic\_mapping\_portforward** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_portmapping\_type** string | **Choices:*** 1-to-1
* m-to-n
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | 1-to-1 | choice | m-to-n | |
| **dynamic\_mapping\_protocol** string | **Choices:*** tcp
* udp
* sctp
* icmp
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | tcp | choice | udp | choice | sctp | choice | icmp | |
| **dynamic\_mapping\_realservers\_client\_ip** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_realservers\_healthcheck** string | **Choices:*** disable
* enable
* vip
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | choice | vip | |
| **dynamic\_mapping\_realservers\_holddown\_interval** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_realservers\_http\_host** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_realservers\_ip** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_realservers\_max\_connections** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_realservers\_monitor** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_realservers\_port** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_realservers\_seq** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_realservers\_status** string | **Choices:*** active
* standby
* disable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | active | choice | standby | choice | disable | |
| **dynamic\_mapping\_realservers\_weight** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_server\_type** string | **Choices:*** http
* https
* ssl
* tcp
* udp
* ip
* imaps
* pop3s
* smtps
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | http | choice | https | choice | ssl | choice | tcp | choice | udp | choice | ip | choice | imaps | choice | pop3s | choice | smtps | |
| **dynamic\_mapping\_service** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_src\_filter** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_srcintf\_filter** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_ssl\_algorithm** string | **Choices:*** high
* medium
* low
* custom
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | high | choice | medium | choice | low | choice | custom | |
| **dynamic\_mapping\_ssl\_certificate** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_ssl\_cipher\_suites\_cipher** string | **Choices:*** TLS-RSA-WITH-RC4-128-MD5
* TLS-RSA-WITH-RC4-128-SHA
* TLS-RSA-WITH-DES-CBC-SHA
* TLS-RSA-WITH-3DES-EDE-CBC-SHA
* TLS-RSA-WITH-AES-128-CBC-SHA
* TLS-RSA-WITH-AES-256-CBC-SHA
* TLS-RSA-WITH-AES-128-CBC-SHA256
* TLS-RSA-WITH-AES-256-CBC-SHA256
* TLS-RSA-WITH-CAMELLIA-128-CBC-SHA
* TLS-RSA-WITH-CAMELLIA-256-CBC-SHA
* TLS-RSA-WITH-CAMELLIA-128-CBC-SHA256
* TLS-RSA-WITH-CAMELLIA-256-CBC-SHA256
* TLS-RSA-WITH-SEED-CBC-SHA
* TLS-RSA-WITH-ARIA-128-CBC-SHA256
* TLS-RSA-WITH-ARIA-256-CBC-SHA384
* TLS-DHE-RSA-WITH-DES-CBC-SHA
* TLS-DHE-RSA-WITH-3DES-EDE-CBC-SHA
* TLS-DHE-RSA-WITH-AES-128-CBC-SHA
* TLS-DHE-RSA-WITH-AES-256-CBC-SHA
* TLS-DHE-RSA-WITH-AES-128-CBC-SHA256
* TLS-DHE-RSA-WITH-AES-256-CBC-SHA256
* TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA
* TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA
* TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA256
* TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA256
* TLS-DHE-RSA-WITH-SEED-CBC-SHA
* TLS-DHE-RSA-WITH-ARIA-128-CBC-SHA256
* TLS-DHE-RSA-WITH-ARIA-256-CBC-SHA384
* TLS-ECDHE-RSA-WITH-RC4-128-SHA
* TLS-ECDHE-RSA-WITH-3DES-EDE-CBC-SHA
* TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA
* TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA
* TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256
* TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256
* TLS-DHE-RSA-WITH-CHACHA20-POLY1305-SHA256
* TLS-DHE-RSA-WITH-AES-128-GCM-SHA256
* TLS-DHE-RSA-WITH-AES-256-GCM-SHA384
* TLS-DHE-DSS-WITH-AES-128-CBC-SHA
* TLS-DHE-DSS-WITH-AES-256-CBC-SHA
* TLS-DHE-DSS-WITH-AES-128-CBC-SHA256
* TLS-DHE-DSS-WITH-AES-128-GCM-SHA256
* TLS-DHE-DSS-WITH-AES-256-CBC-SHA256
* TLS-DHE-DSS-WITH-AES-256-GCM-SHA384
* TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256
* TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256
* TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384
* TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384
* TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA
* TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256
* TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
* TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384
* TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384
* TLS-RSA-WITH-AES-128-GCM-SHA256
* TLS-RSA-WITH-AES-256-GCM-SHA384
* TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA
* TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA
* TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA256
* TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA256
* TLS-DHE-DSS-WITH-SEED-CBC-SHA
* TLS-DHE-DSS-WITH-ARIA-128-CBC-SHA256
* TLS-DHE-DSS-WITH-ARIA-256-CBC-SHA384
* TLS-ECDHE-RSA-WITH-ARIA-128-CBC-SHA256
* TLS-ECDHE-RSA-WITH-ARIA-256-CBC-SHA384
* TLS-ECDHE-ECDSA-WITH-ARIA-128-CBC-SHA256
* TLS-ECDHE-ECDSA-WITH-ARIA-256-CBC-SHA384
* TLS-DHE-DSS-WITH-3DES-EDE-CBC-SHA
* TLS-DHE-DSS-WITH-DES-CBC-SHA
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | TLS-RSA-WITH-RC4-128-MD5 | choice | TLS-RSA-WITH-RC4-128-SHA | choice | TLS-RSA-WITH-DES-CBC-SHA | choice | TLS-RSA-WITH-3DES-EDE-CBC-SHA | choice | TLS-RSA-WITH-AES-128-CBC-SHA | choice | TLS-RSA-WITH-AES-256-CBC-SHA | choice | TLS-RSA-WITH-AES-128-CBC-SHA256 | choice | TLS-RSA-WITH-AES-256-CBC-SHA256 | choice | TLS-RSA-WITH-CAMELLIA-128-CBC-SHA | choice | TLS-RSA-WITH-CAMELLIA-256-CBC-SHA | choice | TLS-RSA-WITH-CAMELLIA-128-CBC-SHA256 | choice | TLS-RSA-WITH-CAMELLIA-256-CBC-SHA256 | choice | TLS-RSA-WITH-SEED-CBC-SHA | choice | TLS-RSA-WITH-ARIA-128-CBC-SHA256 | choice | TLS-RSA-WITH-ARIA-256-CBC-SHA384 | choice | TLS-DHE-RSA-WITH-DES-CBC-SHA | choice | TLS-DHE-RSA-WITH-3DES-EDE-CBC-SHA | choice | TLS-DHE-RSA-WITH-AES-128-CBC-SHA | choice | TLS-DHE-RSA-WITH-AES-256-CBC-SHA | choice | TLS-DHE-RSA-WITH-AES-128-CBC-SHA256 | choice | TLS-DHE-RSA-WITH-AES-256-CBC-SHA256 | choice | TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA | choice | TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA | choice | TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA256 | choice | TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA256 | choice | TLS-DHE-RSA-WITH-SEED-CBC-SHA | choice | TLS-DHE-RSA-WITH-ARIA-128-CBC-SHA256 | choice | TLS-DHE-RSA-WITH-ARIA-256-CBC-SHA384 | choice | TLS-ECDHE-RSA-WITH-RC4-128-SHA | choice | TLS-ECDHE-RSA-WITH-3DES-EDE-CBC-SHA | choice | TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA | choice | TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA | choice | TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 | choice | TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 | choice | TLS-DHE-RSA-WITH-CHACHA20-POLY1305-SHA256 | choice | TLS-DHE-RSA-WITH-AES-128-GCM-SHA256 | choice | TLS-DHE-RSA-WITH-AES-256-GCM-SHA384 | choice | TLS-DHE-DSS-WITH-AES-128-CBC-SHA | choice | TLS-DHE-DSS-WITH-AES-256-CBC-SHA | choice | TLS-DHE-DSS-WITH-AES-128-CBC-SHA256 | choice | TLS-DHE-DSS-WITH-AES-128-GCM-SHA256 | choice | TLS-DHE-DSS-WITH-AES-256-CBC-SHA256 | choice | TLS-DHE-DSS-WITH-AES-256-GCM-SHA384 | choice | TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256 | choice | TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 | choice | TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384 | choice | TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384 | choice | TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA | choice | TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 | choice | TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 | choice | TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 | choice | TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 | choice | TLS-RSA-WITH-AES-128-GCM-SHA256 | choice | TLS-RSA-WITH-AES-256-GCM-SHA384 | choice | TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA | choice | TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA | choice | TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA256 | choice | TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA256 | choice | TLS-DHE-DSS-WITH-SEED-CBC-SHA | choice | TLS-DHE-DSS-WITH-ARIA-128-CBC-SHA256 | choice | TLS-DHE-DSS-WITH-ARIA-256-CBC-SHA384 | choice | TLS-ECDHE-RSA-WITH-ARIA-128-CBC-SHA256 | choice | TLS-ECDHE-RSA-WITH-ARIA-256-CBC-SHA384 | choice | TLS-ECDHE-ECDSA-WITH-ARIA-128-CBC-SHA256 | choice | TLS-ECDHE-ECDSA-WITH-ARIA-256-CBC-SHA384 | choice | TLS-DHE-DSS-WITH-3DES-EDE-CBC-SHA | choice | TLS-DHE-DSS-WITH-DES-CBC-SHA | |
| **dynamic\_mapping\_ssl\_cipher\_suites\_versions** string | **Choices:*** ssl-3.0
* tls-1.0
* tls-1.1
* tls-1.2
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. FLAG Based Options. Specify multiple in list form. flag | ssl-3.0 | flag | tls-1.0 | flag | tls-1.1 | flag | tls-1.2 | |
| **dynamic\_mapping\_ssl\_client\_fallback** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_ssl\_client\_renegotiation** string | **Choices:*** deny
* allow
* secure
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | deny | choice | allow | choice | secure | |
| **dynamic\_mapping\_ssl\_client\_session\_state\_max** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_ssl\_client\_session\_state\_timeout** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_ssl\_client\_session\_state\_type** string | **Choices:*** disable
* time
* count
* both
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | time | choice | count | choice | both | |
| **dynamic\_mapping\_ssl\_dh\_bits** string | **Choices:*** 768
* 1024
* 1536
* 2048
* 3072
* 4096
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | 768 | choice | 1024 | choice | 1536 | choice | 2048 | choice | 3072 | choice | 4096 | |
| **dynamic\_mapping\_ssl\_hpkp** string | **Choices:*** disable
* enable
* report-only
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | choice | report-only | |
| **dynamic\_mapping\_ssl\_hpkp\_age** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_ssl\_hpkp\_backup** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_ssl\_hpkp\_include\_subdomains** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_ssl\_hpkp\_primary** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_ssl\_hpkp\_report\_uri** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_ssl\_hsts** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_ssl\_hsts\_age** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_ssl\_hsts\_include\_subdomains** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_ssl\_http\_location\_conversion** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_ssl\_http\_match\_host** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_ssl\_max\_version** string | **Choices:*** ssl-3.0
* tls-1.0
* tls-1.1
* tls-1.2
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | ssl-3.0 | choice | tls-1.0 | choice | tls-1.1 | choice | tls-1.2 | |
| **dynamic\_mapping\_ssl\_min\_version** string | **Choices:*** ssl-3.0
* tls-1.0
* tls-1.1
* tls-1.2
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | ssl-3.0 | choice | tls-1.0 | choice | tls-1.1 | choice | tls-1.2 | |
| **dynamic\_mapping\_ssl\_mode** string | **Choices:*** half
* full
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | half | choice | full | |
| **dynamic\_mapping\_ssl\_pfs** string | **Choices:*** require
* deny
* allow
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | require | choice | deny | choice | allow | |
| **dynamic\_mapping\_ssl\_send\_empty\_frags** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_ssl\_server\_algorithm** string | **Choices:*** high
* low
* medium
* custom
* client
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | high | choice | low | choice | medium | choice | custom | choice | client | |
| **dynamic\_mapping\_ssl\_server\_max\_version** string | **Choices:*** ssl-3.0
* tls-1.0
* tls-1.1
* tls-1.2
* client
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | ssl-3.0 | choice | tls-1.0 | choice | tls-1.1 | choice | tls-1.2 | choice | client | |
| **dynamic\_mapping\_ssl\_server\_min\_version** string | **Choices:*** ssl-3.0
* tls-1.0
* tls-1.1
* tls-1.2
* client
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | ssl-3.0 | choice | tls-1.0 | choice | tls-1.1 | choice | tls-1.2 | choice | client | |
| **dynamic\_mapping\_ssl\_server\_session\_state\_max** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_ssl\_server\_session\_state\_timeout** string | | Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. |
| **dynamic\_mapping\_ssl\_server\_session\_state\_type** string | **Choices:*** disable
* time
* count
* both
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | time | choice | count | choice | both | |
| **dynamic\_mapping\_type** string | **Choices:*** static-nat
* load-balance
* server-load-balance
* dns-translation
* fqdn
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | static-nat | choice | load-balance | choice | server-load-balance | choice | dns-translation | choice | fqdn | |
| **dynamic\_mapping\_weblogic\_server** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **dynamic\_mapping\_websphere\_server** string | **Choices:*** disable
* enable
| Dynamic Mapping Version of Suffixed Option Name. Sub-Table. Same Descriptions as Parent. choice | disable | choice | enable | |
| **extaddr** string | | External FQDN address name. |
| **extintf** string | | Interface connected to the source network that receives the packets that will be forwarded to the destination network. |
| **extip** string | | IP address or address range on the external interface that you want to map to an address or address range on t he destination network. |
| **extport** string | | Incoming port number range that you want to map to a port number range on the destination network. |
| **gratuitous\_arp\_interval** string | | Enable to have the VIP send gratuitous ARPs. 0=disabled. Set from 5 up to 8640000 seconds to enable. |
| **http\_cookie\_age** string | | Time in minutes that client web browsers should keep a cookie. Default is 60 seconds. 0 = no time limit. |
| **http\_cookie\_domain** string | | Domain that HTTP cookie persistence should apply to. |
| **http\_cookie\_domain\_from\_host** string | **Choices:*** disable
* enable
| Enable/disable use of HTTP cookie domain from host field in HTTP. choice | disable | Disable use of HTTP cookie domain from host field in HTTP (use http-cooke-domain setting). choice | enable | Enable use of HTTP cookie domain from host field in HTTP. |
| **http\_cookie\_generation** string | | Generation of HTTP cookie to be accepted. Changing invalidates all existing cookies. |
| **http\_cookie\_path** string | | Limit HTTP cookie persistence to the specified path. |
| **http\_cookie\_share** string | **Choices:*** disable
* same-ip
| Control sharing of cookies across virtual servers. same-ip means a cookie from one virtual server can be used by another. Disable stops cookie sharing. choice | disable | Only allow HTTP cookie to match this virtual server. choice | same-ip | Allow HTTP cookie to match any virtual server with same IP. |
| **http\_ip\_header** string | **Choices:*** disable
* enable
| For HTTP multiplexing, enable to add the original client IP address in the XForwarded-For HTTP header. choice | disable | Disable adding HTTP header. choice | enable | Enable adding HTTP header. |
| **http\_ip\_header\_name** string | | For HTTP multiplexing, enter a custom HTTPS header name. The orig client IP address is added to this header. If empty, X-Forwarded-For is used. |
| **http\_multiplex** string | **Choices:*** disable
* enable
| Enable/disable HTTP multiplexing. choice | disable | Disable HTTP session multiplexing. choice | enable | Enable HTTP session multiplexing. |
| **https\_cookie\_secure** string | **Choices:*** disable
* enable
| Enable/disable verification that inserted HTTPS cookies are secure. choice | disable | Do not mark cookie as secure, allow sharing between an HTTP and HTTPS connection. choice | enable | Mark inserted cookie as secure, cookie can only be used for HTTPS a connection. |
| **ldb\_method** string | **Choices:*** static
* round-robin
* weighted
* least-session
* least-rtt
* first-alive
* http-host
| Method used to distribute sessions to real servers. choice | static | Distribute to server based on source IP. choice | round-robin | Distribute to server based round robin order. choice | weighted | Distribute to server based on weight. choice | least-session | Distribute to server with lowest session count. choice | least-rtt | Distribute to server with lowest Round-Trip-Time. choice | first-alive | Distribute to the first server that is alive. choice | http-host | Distribute to server based on host field in HTTP header. |
| **mapped\_addr** string | | Mapped FQDN address name. |
| **mappedip** string | | IP address or address range on the destination network to which the external IP address is mapped. |
| **mappedport** string | | Port number range on the destination network to which the external port number range is mapped. |
| **max\_embryonic\_connections** string | | Maximum number of incomplete connections. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **monitor** string | | Name of the health check monitor to use when polling to determine a virtual server's connectivity status. |
| **name** string | | Virtual IP name. |
| **nat\_source\_vip** string | **Choices:*** disable
* enable
| Enable to prevent unintended servers from using a virtual IP. Disable to use the actual IP address of the server as the source address. choice | disable | Do not force to NAT as VIP. choice | enable | Force to NAT as VIP. |
| **outlook\_web\_access** string | **Choices:*** disable
* enable
| Enable to add the Front-End-Https header for Microsoft Outlook Web Access. choice | disable | Disable Outlook Web Access support. choice | enable | Enable Outlook Web Access support. |
| **persistence** string | **Choices:*** none
* http-cookie
* ssl-session-id
| Configure how to make sure that clients connect to the same server every time they make a request that is part of the same session. choice | none | None. choice | http-cookie | HTTP cookie. choice | ssl-session-id | SSL session ID. |
| **portforward** string | **Choices:*** disable
* enable
| Enable/disable port forwarding. choice | disable | Disable port forward. choice | enable | Enable port forward. |
| **portmapping\_type** string | **Choices:*** 1-to-1
* m-to-n
| Port mapping type. choice | 1-to-1 | One to one. choice | m-to-n | Many to many. |
| **protocol** string | **Choices:*** tcp
* udp
* sctp
* icmp
| Protocol to use when forwarding packets. choice | tcp | TCP. choice | udp | UDP. choice | sctp | SCTP. choice | icmp | ICMP. |
| **realservers** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **realservers\_client\_ip** string | | Only clients in this IP range can connect to this real server. |
| **realservers\_healthcheck** string | **Choices:*** disable
* enable
* vip
| Enable to check the responsiveness of the real server before forwarding traffic. choice | disable | Disable per server health check. choice | enable | Enable per server health check. choice | vip | Use health check defined in VIP. |
| **realservers\_holddown\_interval** string | | Time in seconds that the health check monitor monitors an unresponsive server that should be active. |
| **realservers\_http\_host** string | | HTTP server domain name in HTTP header. |
| **realservers\_ip** string | | IP address of the real server. |
| **realservers\_max\_connections** string | | Max number of active connections that can be directed to the real server. When reached, sessions are sent to their real servers. |
| **realservers\_monitor** string | | Name of the health check monitor to use when polling to determine a virtual server's connectivity status. |
| **realservers\_port** string | | Port for communicating with the real server. Required if port forwarding is enabled. |
| **realservers\_seq** string | | Real Server Sequence Number |
| **realservers\_status** string | **Choices:*** active
* standby
* disable
| Set the status of the real server to active so that it can accept traffic. Or on standby or disabled so no traffic is sent. choice | active | Server status active. choice | standby | Server status standby. choice | disable | Server status disable. |
| **realservers\_weight** string | | Weight of the real server. If weighted load balancing is enabled, the server with the highest weight gets more connections. |
| **server\_type** string | **Choices:*** http
* https
* ssl
* tcp
* udp
* ip
* imaps
* pop3s
* smtps
| Protocol to be load balanced by the virtual server (also called the server load balance virtual IP). choice | http | HTTP choice | https | HTTPS choice | ssl | SSL choice | tcp | TCP choice | udp | UDP choice | ip | IP choice | imaps | IMAPS choice | pop3s | POP3S choice | smtps | SMTPS |
| **service** string | | Service name. |
| **src\_filter** string | | Source address filter. Each address must be either an IP/subnet (x.x.x.x/n) or a range (x.x.x.x-y.y.y.y). Separate addresses with spaces. |
| **srcintf\_filter** string | | Interfaces to which the VIP applies. Separate the names with spaces. |
| **ssl\_algorithm** string | **Choices:*** high
* medium
* low
* custom
| Permitted encryption algorithms for SSL sessions according to encryption strength. choice | high | High encryption. Allow only AES and ChaCha. choice | medium | Medium encryption. Allow AES, ChaCha, 3DES, and RC4. choice | low | Low encryption. Allow AES, ChaCha, 3DES, RC4, and DES. choice | custom | Custom encryption. Use config ssl-cipher-suites to select the cipher suites that are allowed. |
| **ssl\_certificate** string | | The name of the SSL certificate to use for SSL acceleration. |
| **ssl\_cipher\_suites** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **ssl\_cipher\_suites\_cipher** string | **Choices:*** TLS-RSA-WITH-RC4-128-MD5
* TLS-RSA-WITH-RC4-128-SHA
* TLS-RSA-WITH-DES-CBC-SHA
* TLS-RSA-WITH-3DES-EDE-CBC-SHA
* TLS-RSA-WITH-AES-128-CBC-SHA
* TLS-RSA-WITH-AES-256-CBC-SHA
* TLS-RSA-WITH-AES-128-CBC-SHA256
* TLS-RSA-WITH-AES-256-CBC-SHA256
* TLS-RSA-WITH-CAMELLIA-128-CBC-SHA
* TLS-RSA-WITH-CAMELLIA-256-CBC-SHA
* TLS-RSA-WITH-CAMELLIA-128-CBC-SHA256
* TLS-RSA-WITH-CAMELLIA-256-CBC-SHA256
* TLS-RSA-WITH-SEED-CBC-SHA
* TLS-RSA-WITH-ARIA-128-CBC-SHA256
* TLS-RSA-WITH-ARIA-256-CBC-SHA384
* TLS-DHE-RSA-WITH-DES-CBC-SHA
* TLS-DHE-RSA-WITH-3DES-EDE-CBC-SHA
* TLS-DHE-RSA-WITH-AES-128-CBC-SHA
* TLS-DHE-RSA-WITH-AES-256-CBC-SHA
* TLS-DHE-RSA-WITH-AES-128-CBC-SHA256
* TLS-DHE-RSA-WITH-AES-256-CBC-SHA256
* TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA
* TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA
* TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA256
* TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA256
* TLS-DHE-RSA-WITH-SEED-CBC-SHA
* TLS-DHE-RSA-WITH-ARIA-128-CBC-SHA256
* TLS-DHE-RSA-WITH-ARIA-256-CBC-SHA384
* TLS-ECDHE-RSA-WITH-RC4-128-SHA
* TLS-ECDHE-RSA-WITH-3DES-EDE-CBC-SHA
* TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA
* TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA
* TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256
* TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256
* TLS-DHE-RSA-WITH-CHACHA20-POLY1305-SHA256
* TLS-DHE-RSA-WITH-AES-128-GCM-SHA256
* TLS-DHE-RSA-WITH-AES-256-GCM-SHA384
* TLS-DHE-DSS-WITH-AES-128-CBC-SHA
* TLS-DHE-DSS-WITH-AES-256-CBC-SHA
* TLS-DHE-DSS-WITH-AES-128-CBC-SHA256
* TLS-DHE-DSS-WITH-AES-128-GCM-SHA256
* TLS-DHE-DSS-WITH-AES-256-CBC-SHA256
* TLS-DHE-DSS-WITH-AES-256-GCM-SHA384
* TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256
* TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256
* TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384
* TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384
* TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA
* TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256
* TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
* TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384
* TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384
* TLS-RSA-WITH-AES-128-GCM-SHA256
* TLS-RSA-WITH-AES-256-GCM-SHA384
* TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA
* TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA
* TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA256
* TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA256
* TLS-DHE-DSS-WITH-SEED-CBC-SHA
* TLS-DHE-DSS-WITH-ARIA-128-CBC-SHA256
* TLS-DHE-DSS-WITH-ARIA-256-CBC-SHA384
* TLS-ECDHE-RSA-WITH-ARIA-128-CBC-SHA256
* TLS-ECDHE-RSA-WITH-ARIA-256-CBC-SHA384
* TLS-ECDHE-ECDSA-WITH-ARIA-128-CBC-SHA256
* TLS-ECDHE-ECDSA-WITH-ARIA-256-CBC-SHA384
* TLS-DHE-DSS-WITH-3DES-EDE-CBC-SHA
* TLS-DHE-DSS-WITH-DES-CBC-SHA
| Cipher suite name. choice | TLS-RSA-WITH-RC4-128-MD5 | Cipher suite TLS-RSA-WITH-RC4-128-MD5. choice | TLS-RSA-WITH-RC4-128-SHA | Cipher suite TLS-RSA-WITH-RC4-128-SHA. choice | TLS-RSA-WITH-DES-CBC-SHA | Cipher suite TLS-RSA-WITH-DES-CBC-SHA. choice | TLS-RSA-WITH-3DES-EDE-CBC-SHA | Cipher suite TLS-RSA-WITH-3DES-EDE-CBC-SHA. choice | TLS-RSA-WITH-AES-128-CBC-SHA | Cipher suite TLS-RSA-WITH-AES-128-CBC-SHA. choice | TLS-RSA-WITH-AES-256-CBC-SHA | Cipher suite TLS-RSA-WITH-AES-256-CBC-SHA. choice | TLS-RSA-WITH-AES-128-CBC-SHA256 | Cipher suite TLS-RSA-WITH-AES-128-CBC-SHA256. choice | TLS-RSA-WITH-AES-256-CBC-SHA256 | Cipher suite TLS-RSA-WITH-AES-256-CBC-SHA256. choice | TLS-RSA-WITH-CAMELLIA-128-CBC-SHA | Cipher suite TLS-RSA-WITH-CAMELLIA-128-CBC-SHA. choice | TLS-RSA-WITH-CAMELLIA-256-CBC-SHA | Cipher suite TLS-RSA-WITH-CAMELLIA-256-CBC-SHA. choice | TLS-RSA-WITH-CAMELLIA-128-CBC-SHA256 | Cipher suite TLS-RSA-WITH-CAMELLIA-128-CBC-SHA256. choice | TLS-RSA-WITH-CAMELLIA-256-CBC-SHA256 | Cipher suite TLS-RSA-WITH-CAMELLIA-256-CBC-SHA256. choice | TLS-RSA-WITH-SEED-CBC-SHA | Cipher suite TLS-RSA-WITH-SEED-CBC-SHA. choice | TLS-RSA-WITH-ARIA-128-CBC-SHA256 | Cipher suite TLS-RSA-WITH-ARIA-128-CBC-SHA256. choice | TLS-RSA-WITH-ARIA-256-CBC-SHA384 | Cipher suite TLS-RSA-WITH-ARIA-256-CBC-SHA384. choice | TLS-DHE-RSA-WITH-DES-CBC-SHA | Cipher suite TLS-DHE-RSA-WITH-DES-CBC-SHA. choice | TLS-DHE-RSA-WITH-3DES-EDE-CBC-SHA | Cipher suite TLS-DHE-RSA-WITH-3DES-EDE-CBC-SHA. choice | TLS-DHE-RSA-WITH-AES-128-CBC-SHA | Cipher suite TLS-DHE-RSA-WITH-AES-128-CBC-SHA. choice | TLS-DHE-RSA-WITH-AES-256-CBC-SHA | Cipher suite TLS-DHE-RSA-WITH-AES-256-CBC-SHA. choice | TLS-DHE-RSA-WITH-AES-128-CBC-SHA256 | Cipher suite TLS-DHE-RSA-WITH-AES-128-CBC-SHA256. choice | TLS-DHE-RSA-WITH-AES-256-CBC-SHA256 | Cipher suite TLS-DHE-RSA-WITH-AES-256-CBC-SHA256. choice | TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA | Cipher suite TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA. choice | TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA | Cipher suite TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA. choice | TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA256 | Cipher suite TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA256. choice | TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA256 | Cipher suite TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA256. choice | TLS-DHE-RSA-WITH-SEED-CBC-SHA | Cipher suite TLS-DHE-RSA-WITH-SEED-CBC-SHA. choice | TLS-DHE-RSA-WITH-ARIA-128-CBC-SHA256 | Cipher suite TLS-DHE-RSA-WITH-ARIA-128-CBC-SHA256. choice | TLS-DHE-RSA-WITH-ARIA-256-CBC-SHA384 | Cipher suite TLS-DHE-RSA-WITH-ARIA-256-CBC-SHA384. choice | TLS-ECDHE-RSA-WITH-RC4-128-SHA | Cipher suite TLS-ECDHE-RSA-WITH-RC4-128-SHA. choice | TLS-ECDHE-RSA-WITH-3DES-EDE-CBC-SHA | Cipher suite TLS-ECDHE-RSA-WITH-3DES-EDE-CBC-SHA. choice | TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA | Cipher suite TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA. choice | TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA | Cipher suite TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA. choice | TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 | Cipher suite TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256. choice | TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 | Cipher suite TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256. choice | TLS-DHE-RSA-WITH-CHACHA20-POLY1305-SHA256 | Cipher suite TLS-DHE-RSA-WITH-CHACHA20-POLY1305-SHA256. choice | TLS-DHE-RSA-WITH-AES-128-GCM-SHA256 | Cipher suite TLS-DHE-RSA-WITH-AES-128-GCM-SHA256. choice | TLS-DHE-RSA-WITH-AES-256-GCM-SHA384 | Cipher suite TLS-DHE-RSA-WITH-AES-256-GCM-SHA384. choice | TLS-DHE-DSS-WITH-AES-128-CBC-SHA | Cipher suite TLS-DHE-DSS-WITH-AES-128-CBC-SHA. choice | TLS-DHE-DSS-WITH-AES-256-CBC-SHA | Cipher suite TLS-DHE-DSS-WITH-AES-256-CBC-SHA. choice | TLS-DHE-DSS-WITH-AES-128-CBC-SHA256 | Cipher suite TLS-DHE-DSS-WITH-AES-128-CBC-SHA256. choice | TLS-DHE-DSS-WITH-AES-128-GCM-SHA256 | Cipher suite TLS-DHE-DSS-WITH-AES-128-GCM-SHA256. choice | TLS-DHE-DSS-WITH-AES-256-CBC-SHA256 | Cipher suite TLS-DHE-DSS-WITH-AES-256-CBC-SHA256. choice | TLS-DHE-DSS-WITH-AES-256-GCM-SHA384 | Cipher suite TLS-DHE-DSS-WITH-AES-256-GCM-SHA384. choice | TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256 | Cipher suite TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256. choice | TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 | Cipher suite TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256. choice | TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384 | Cipher suite TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384. choice | TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384 | Cipher suite TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384. choice | TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA | Cipher suite TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA. choice | TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 | Cipher suite TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256. choice | TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 | Cipher suite TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256. choice | TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 | Cipher suite TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384. choice | TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 | Cipher suite TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384. choice | TLS-RSA-WITH-AES-128-GCM-SHA256 | Cipher suite TLS-RSA-WITH-AES-128-GCM-SHA256. choice | TLS-RSA-WITH-AES-256-GCM-SHA384 | Cipher suite TLS-RSA-WITH-AES-256-GCM-SHA384. choice | TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA | Cipher suite TLS-DSS-RSA-WITH-CAMELLIA-128-CBC-SHA. choice | TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA | Cipher suite TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA. choice | TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA256 | Cipher suite TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA256. choice | TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA256 | Cipher suite TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA256. choice | TLS-DHE-DSS-WITH-SEED-CBC-SHA | Cipher suite TLS-DHE-DSS-WITH-SEED-CBC-SHA. choice | TLS-DHE-DSS-WITH-ARIA-128-CBC-SHA256 | Cipher suite TLS-DHE-DSS-WITH-ARIA-128-CBC-SHA256. choice | TLS-DHE-DSS-WITH-ARIA-256-CBC-SHA384 | Cipher suite TLS-DHE-DSS-WITH-ARIA-256-CBC-SHA384. choice | TLS-ECDHE-RSA-WITH-ARIA-128-CBC-SHA256 | Cipher suite TLS-ECDHE-RSA-WITH-ARIA-128-CBC-SHA256. choice | TLS-ECDHE-RSA-WITH-ARIA-256-CBC-SHA384 | Cipher suite TLS-ECDHE-RSA-WITH-ARIA-256-CBC-SHA384. choice | TLS-ECDHE-ECDSA-WITH-ARIA-128-CBC-SHA256 | Cipher suite TLS-ECDHE-ECDSA-WITH-ARIA-128-CBC\_SHA256. choice | TLS-ECDHE-ECDSA-WITH-ARIA-256-CBC-SHA384 | Cipher suite TLS-ECDHE-ECDSA-WITH-ARIA-256-CBC\_SHA384. choice | TLS-DHE-DSS-WITH-3DES-EDE-CBC-SHA | Cipher suite TLS-DHE-DSS-WITH-3DES-EDE-CBC-SHA. choice | TLS-DHE-DSS-WITH-DES-CBC-SHA | Cipher suite TLS-DHE-DSS-WITH-DES-CBC-SHA. |
| **ssl\_cipher\_suites\_versions** string | **Choices:*** ssl-3.0
* tls-1.0
* tls-1.1
* tls-1.2
| SSL/TLS versions that the cipher suite can be used with. FLAG Based Options. Specify multiple in list form. flag | ssl-3.0 | SSL 3.0. flag | tls-1.0 | TLS 1.0. flag | tls-1.1 | TLS 1.1. flag | tls-1.2 | TLS 1.2. |
| **ssl\_client\_fallback** string | **Choices:*** disable
* enable
| Enable/disable support for preventing Downgrade Attacks on client connections (RFC 7507). choice | disable | Disable. choice | enable | Enable. |
| **ssl\_client\_renegotiation** string | **Choices:*** deny
* allow
* secure
| Allow, deny, or require secure renegotiation of client sessions to comply with RFC 5746. choice | deny | Abort any client initiated SSL re-negotiation attempt. choice | allow | Allow a SSL client to renegotiate. choice | secure | Abort any client initiated SSL re-negotiation attempt that does not use RFC 5746. |
| **ssl\_client\_session\_state\_max** string | | Maximum number of client to FortiGate SSL session states to keep. |
| **ssl\_client\_session\_state\_timeout** string | | Number of minutes to keep client to FortiGate SSL session state. |
| **ssl\_client\_session\_state\_type** string | **Choices:*** disable
* time
* count
* both
| How to expire SSL sessions for the segment of the SSL connection between the client and the FortiGate. choice | disable | Do not keep session states. choice | time | Expire session states after this many minutes. choice | count | Expire session states when this maximum is reached. choice | both | Expire session states based on time or count, whichever occurs first. |
| **ssl\_dh\_bits** string | **Choices:*** 768
* 1024
* 1536
* 2048
* 3072
* 4096
| Number of bits to use in the Diffie-Hellman exchange for RSA encryption of SSL sessions. choice | 768 | 768-bit Diffie-Hellman prime. choice | 1024 | 1024-bit Diffie-Hellman prime. choice | 1536 | 1536-bit Diffie-Hellman prime. choice | 2048 | 2048-bit Diffie-Hellman prime. choice | 3072 | 3072-bit Diffie-Hellman prime. choice | 4096 | 4096-bit Diffie-Hellman prime. |
| **ssl\_hpkp** string | **Choices:*** disable
* enable
* report-only
| Enable/disable including HPKP header in response. choice | disable | Do not add a HPKP header to each HTTP response. choice | enable | Add a HPKP header to each a HTTP response. choice | report-only | Add a HPKP Report-Only header to each HTTP response. |
| **ssl\_hpkp\_age** string | | Number of seconds the client should honour the HPKP setting. |
| **ssl\_hpkp\_backup** string | | Certificate to generate backup HPKP pin from. |
| **ssl\_hpkp\_include\_subdomains** string | **Choices:*** disable
* enable
| Indicate that HPKP header applies to all subdomains. choice | disable | HPKP header does not apply to subdomains. choice | enable | HPKP header applies to subdomains. |
| **ssl\_hpkp\_primary** string | | Certificate to generate primary HPKP pin from. |
| **ssl\_hpkp\_report\_uri** string | | URL to report HPKP violations to. |
| **ssl\_hsts** string | **Choices:*** disable
* enable
| Enable/disable including HSTS header in response. choice | disable | Do not add a HSTS header to each a HTTP response. choice | enable | Add a HSTS header to each HTTP response. |
| **ssl\_hsts\_age** string | | Number of seconds the client should honour the HSTS setting. |
| **ssl\_hsts\_include\_subdomains** string | **Choices:*** disable
* enable
| Indicate that HSTS header applies to all subdomains. choice | disable | HSTS header does not apply to subdomains. choice | enable | HSTS header applies to subdomains. |
| **ssl\_http\_location\_conversion** string | **Choices:*** disable
* enable
| Enable to replace HTTP with HTTPS in the reply's Location HTTP header field. choice | disable | Disable HTTP location conversion. choice | enable | Enable HTTP location conversion. |
| **ssl\_http\_match\_host** string | **Choices:*** disable
* enable
| Enable/disable HTTP host matching for location conversion. choice | disable | Do not match HTTP host. choice | enable | Match HTTP host in response header. |
| **ssl\_max\_version** string | **Choices:*** ssl-3.0
* tls-1.0
* tls-1.1
* tls-1.2
| Highest SSL/TLS version acceptable from a client. choice | ssl-3.0 | SSL 3.0. choice | tls-1.0 | TLS 1.0. choice | tls-1.1 | TLS 1.1. choice | tls-1.2 | TLS 1.2. |
| **ssl\_min\_version** string | **Choices:*** ssl-3.0
* tls-1.0
* tls-1.1
* tls-1.2
| Lowest SSL/TLS version acceptable from a client. choice | ssl-3.0 | SSL 3.0. choice | tls-1.0 | TLS 1.0. choice | tls-1.1 | TLS 1.1. choice | tls-1.2 | TLS 1.2. |
| **ssl\_mode** string | **Choices:*** half
* full
| Apply SSL offloading mode choice | half | Client to FortiGate SSL. choice | full | Client to FortiGate and FortiGate to Server SSL. |
| **ssl\_pfs** string | **Choices:*** require
* deny
* allow
| Select the cipher suites that can be used for SSL perfect forward secrecy (PFS). choice | require | Allow only Diffie-Hellman cipher-suites, so PFS is applied. choice | deny | Allow only non-Diffie-Hellman cipher-suites, so PFS is not applied. choice | allow | Allow use of any cipher suite so PFS may or may not be used depending on the cipher suite |
| **ssl\_send\_empty\_frags** string | **Choices:*** disable
* enable
| Enable/disable sending empty fragments to avoid CBC IV attacks (SSL 3.0 & TLS 1.0 only). choice | disable | Do not send empty fragments. choice | enable | Send empty fragments. |
| **ssl\_server\_algorithm** string | **Choices:*** high
* low
* medium
* custom
* client
| Permitted encryption algorithms for the server side of SSL full mode sessions according to encryption strength choice | high | High encryption. Allow only AES and ChaCha. choice | low | Low encryption. Allow AES, ChaCha, 3DES, RC4, and DES. choice | medium | Medium encryption. Allow AES, ChaCha, 3DES, and RC4. choice | custom | Custom encryption. Use ssl-server-cipher-suites to select the cipher suites that are allowed. choice | client | Use the same encryption algorithms for both client and server sessions. |
| **ssl\_server\_cipher\_suites** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **ssl\_server\_cipher\_suites\_cipher** string | **Choices:*** TLS-RSA-WITH-RC4-128-MD5
* TLS-RSA-WITH-RC4-128-SHA
* TLS-RSA-WITH-DES-CBC-SHA
* TLS-RSA-WITH-3DES-EDE-CBC-SHA
* TLS-RSA-WITH-AES-128-CBC-SHA
* TLS-RSA-WITH-AES-256-CBC-SHA
* TLS-RSA-WITH-AES-128-CBC-SHA256
* TLS-RSA-WITH-AES-256-CBC-SHA256
* TLS-RSA-WITH-CAMELLIA-128-CBC-SHA
* TLS-RSA-WITH-CAMELLIA-256-CBC-SHA
* TLS-RSA-WITH-CAMELLIA-128-CBC-SHA256
* TLS-RSA-WITH-CAMELLIA-256-CBC-SHA256
* TLS-RSA-WITH-SEED-CBC-SHA
* TLS-RSA-WITH-ARIA-128-CBC-SHA256
* TLS-RSA-WITH-ARIA-256-CBC-SHA384
* TLS-DHE-RSA-WITH-DES-CBC-SHA
* TLS-DHE-RSA-WITH-3DES-EDE-CBC-SHA
* TLS-DHE-RSA-WITH-AES-128-CBC-SHA
* TLS-DHE-RSA-WITH-AES-256-CBC-SHA
* TLS-DHE-RSA-WITH-AES-128-CBC-SHA256
* TLS-DHE-RSA-WITH-AES-256-CBC-SHA256
* TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA
* TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA
* TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA256
* TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA256
* TLS-DHE-RSA-WITH-SEED-CBC-SHA
* TLS-DHE-RSA-WITH-ARIA-128-CBC-SHA256
* TLS-DHE-RSA-WITH-ARIA-256-CBC-SHA384
* TLS-ECDHE-RSA-WITH-RC4-128-SHA
* TLS-ECDHE-RSA-WITH-3DES-EDE-CBC-SHA
* TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA
* TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA
* TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256
* TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256
* TLS-DHE-RSA-WITH-CHACHA20-POLY1305-SHA256
* TLS-DHE-RSA-WITH-AES-128-GCM-SHA256
* TLS-DHE-RSA-WITH-AES-256-GCM-SHA384
* TLS-DHE-DSS-WITH-AES-128-CBC-SHA
* TLS-DHE-DSS-WITH-AES-256-CBC-SHA
* TLS-DHE-DSS-WITH-AES-128-CBC-SHA256
* TLS-DHE-DSS-WITH-AES-128-GCM-SHA256
* TLS-DHE-DSS-WITH-AES-256-CBC-SHA256
* TLS-DHE-DSS-WITH-AES-256-GCM-SHA384
* TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256
* TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256
* TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384
* TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384
* TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA
* TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256
* TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
* TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384
* TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384
* TLS-RSA-WITH-AES-128-GCM-SHA256
* TLS-RSA-WITH-AES-256-GCM-SHA384
* TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA
* TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA
* TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA256
* TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA256
* TLS-DHE-DSS-WITH-SEED-CBC-SHA
* TLS-DHE-DSS-WITH-ARIA-128-CBC-SHA256
* TLS-DHE-DSS-WITH-ARIA-256-CBC-SHA384
* TLS-ECDHE-RSA-WITH-ARIA-128-CBC-SHA256
* TLS-ECDHE-RSA-WITH-ARIA-256-CBC-SHA384
* TLS-ECDHE-ECDSA-WITH-ARIA-128-CBC-SHA256
* TLS-ECDHE-ECDSA-WITH-ARIA-256-CBC-SHA384
* TLS-DHE-DSS-WITH-3DES-EDE-CBC-SHA
* TLS-DHE-DSS-WITH-DES-CBC-SHA
| Cipher suite name. choice | TLS-RSA-WITH-RC4-128-MD5 | Cipher suite TLS-RSA-WITH-RC4-128-MD5. choice | TLS-RSA-WITH-RC4-128-SHA | Cipher suite TLS-RSA-WITH-RC4-128-SHA. choice | TLS-RSA-WITH-DES-CBC-SHA | Cipher suite TLS-RSA-WITH-DES-CBC-SHA. choice | TLS-RSA-WITH-3DES-EDE-CBC-SHA | Cipher suite TLS-RSA-WITH-3DES-EDE-CBC-SHA. choice | TLS-RSA-WITH-AES-128-CBC-SHA | Cipher suite TLS-RSA-WITH-AES-128-CBC-SHA. choice | TLS-RSA-WITH-AES-256-CBC-SHA | Cipher suite TLS-RSA-WITH-AES-256-CBC-SHA. choice | TLS-RSA-WITH-AES-128-CBC-SHA256 | Cipher suite TLS-RSA-WITH-AES-128-CBC-SHA256. choice | TLS-RSA-WITH-AES-256-CBC-SHA256 | Cipher suite TLS-RSA-WITH-AES-256-CBC-SHA256. choice | TLS-RSA-WITH-CAMELLIA-128-CBC-SHA | Cipher suite TLS-RSA-WITH-CAMELLIA-128-CBC-SHA. choice | TLS-RSA-WITH-CAMELLIA-256-CBC-SHA | Cipher suite TLS-RSA-WITH-CAMELLIA-256-CBC-SHA. choice | TLS-RSA-WITH-CAMELLIA-128-CBC-SHA256 | Cipher suite TLS-RSA-WITH-CAMELLIA-128-CBC-SHA256. choice | TLS-RSA-WITH-CAMELLIA-256-CBC-SHA256 | Cipher suite TLS-RSA-WITH-CAMELLIA-256-CBC-SHA256. choice | TLS-RSA-WITH-SEED-CBC-SHA | Cipher suite TLS-RSA-WITH-SEED-CBC-SHA. choice | TLS-RSA-WITH-ARIA-128-CBC-SHA256 | Cipher suite TLS-RSA-WITH-ARIA-128-CBC-SHA256. choice | TLS-RSA-WITH-ARIA-256-CBC-SHA384 | Cipher suite TLS-RSA-WITH-ARIA-256-CBC-SHA384. choice | TLS-DHE-RSA-WITH-DES-CBC-SHA | Cipher suite TLS-DHE-RSA-WITH-DES-CBC-SHA. choice | TLS-DHE-RSA-WITH-3DES-EDE-CBC-SHA | Cipher suite TLS-DHE-RSA-WITH-3DES-EDE-CBC-SHA. choice | TLS-DHE-RSA-WITH-AES-128-CBC-SHA | Cipher suite TLS-DHE-RSA-WITH-AES-128-CBC-SHA. choice | TLS-DHE-RSA-WITH-AES-256-CBC-SHA | Cipher suite TLS-DHE-RSA-WITH-AES-256-CBC-SHA. choice | TLS-DHE-RSA-WITH-AES-128-CBC-SHA256 | Cipher suite TLS-DHE-RSA-WITH-AES-128-CBC-SHA256. choice | TLS-DHE-RSA-WITH-AES-256-CBC-SHA256 | Cipher suite TLS-DHE-RSA-WITH-AES-256-CBC-SHA256. choice | TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA | Cipher suite TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA. choice | TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA | Cipher suite TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA. choice | TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA256 | Cipher suite TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA256. choice | TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA256 | Cipher suite TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA256. choice | TLS-DHE-RSA-WITH-SEED-CBC-SHA | Cipher suite TLS-DHE-RSA-WITH-SEED-CBC-SHA. choice | TLS-DHE-RSA-WITH-ARIA-128-CBC-SHA256 | Cipher suite TLS-DHE-RSA-WITH-ARIA-128-CBC-SHA256. choice | TLS-DHE-RSA-WITH-ARIA-256-CBC-SHA384 | Cipher suite TLS-DHE-RSA-WITH-ARIA-256-CBC-SHA384. choice | TLS-ECDHE-RSA-WITH-RC4-128-SHA | Cipher suite TLS-ECDHE-RSA-WITH-RC4-128-SHA. choice | TLS-ECDHE-RSA-WITH-3DES-EDE-CBC-SHA | Cipher suite TLS-ECDHE-RSA-WITH-3DES-EDE-CBC-SHA. choice | TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA | Cipher suite TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA. choice | TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA | Cipher suite TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA. choice | TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 | Cipher suite TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256. choice | TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 | Suite TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256. choice | TLS-DHE-RSA-WITH-CHACHA20-POLY1305-SHA256 | Cipher suite TLS-DHE-RSA-WITH-CHACHA20-POLY1305-SHA256. choice | TLS-DHE-RSA-WITH-AES-128-GCM-SHA256 | Cipher suite TLS-DHE-RSA-WITH-AES-128-GCM-SHA256. choice | TLS-DHE-RSA-WITH-AES-256-GCM-SHA384 | Cipher suite TLS-DHE-RSA-WITH-AES-256-GCM-SHA384. choice | TLS-DHE-DSS-WITH-AES-128-CBC-SHA | Cipher suite TLS-DHE-DSS-WITH-AES-128-CBC-SHA. choice | TLS-DHE-DSS-WITH-AES-256-CBC-SHA | Cipher suite TLS-DHE-DSS-WITH-AES-256-CBC-SHA. choice | TLS-DHE-DSS-WITH-AES-128-CBC-SHA256 | Cipher suite TLS-DHE-DSS-WITH-AES-128-CBC-SHA256. choice | TLS-DHE-DSS-WITH-AES-128-GCM-SHA256 | Cipher suite TLS-DHE-DSS-WITH-AES-128-GCM-SHA256. choice | TLS-DHE-DSS-WITH-AES-256-CBC-SHA256 | Cipher suite TLS-DHE-DSS-WITH-AES-256-CBC-SHA256. choice | TLS-DHE-DSS-WITH-AES-256-GCM-SHA384 | Cipher suite TLS-DHE-DSS-WITH-AES-256-GCM-SHA384. choice | TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256 | Cipher suite TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256. choice | TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 | Cipher suite TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256. choice | TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384 | Cipher suite TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384. choice | TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384 | Cipher suite TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384. choice | TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA | Cipher suite TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA. choice | TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 | Cipher suite TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256. choice | TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 | Cipher suite TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256. choice | TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 | Cipher suite TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384. choice | TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 | Cipher suite TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384. choice | TLS-RSA-WITH-AES-128-GCM-SHA256 | Cipher suite TLS-RSA-WITH-AES-128-GCM-SHA256. choice | TLS-RSA-WITH-AES-256-GCM-SHA384 | Cipher suite TLS-RSA-WITH-AES-256-GCM-SHA384. choice | TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA | Cipher suite TLS-DSS-RSA-WITH-CAMELLIA-128-CBC-SHA. choice | TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA | Cipher suite TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA. choice | TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA256 | Cipher suite TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA256. choice | TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA256 | Cipher suite TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA256. choice | TLS-DHE-DSS-WITH-SEED-CBC-SHA | Cipher suite TLS-DHE-DSS-WITH-SEED-CBC-SHA. choice | TLS-DHE-DSS-WITH-ARIA-128-CBC-SHA256 | Cipher suite TLS-DHE-DSS-WITH-ARIA-128-CBC-SHA256. choice | TLS-DHE-DSS-WITH-ARIA-256-CBC-SHA384 | Cipher suite TLS-DHE-DSS-WITH-ARIA-256-CBC-SHA384. choice | TLS-ECDHE-RSA-WITH-ARIA-128-CBC-SHA256 | Cipher suite TLS-ECDHE-RSA-WITH-ARIA-128-CBC-SHA256. choice | TLS-ECDHE-RSA-WITH-ARIA-256-CBC-SHA384 | Cipher suite TLS-ECDHE-RSA-WITH-ARIA-256-CBC-SHA384. choice | TLS-ECDHE-ECDSA-WITH-ARIA-128-CBC-SHA256 | Cipher suite TLS-ECDHE-ECDSA-WITH-ARIA-128-CBC\_SHA256. choice | TLS-ECDHE-ECDSA-WITH-ARIA-256-CBC-SHA384 | Cipher suite TLS-ECDHE-ECDSA-WITH-ARIA-256-CBC\_SHA384. choice | TLS-DHE-DSS-WITH-3DES-EDE-CBC-SHA | Cipher suite TLS-DHE-DSS-WITH-3DES-EDE-CBC-SHA. choice | TLS-DHE-DSS-WITH-DES-CBC-SHA | Cipher suite TLS-DHE-DSS-WITH-DES-CBC-SHA. |
| **ssl\_server\_cipher\_suites\_priority** string | | SSL/TLS cipher suites priority. |
| **ssl\_server\_cipher\_suites\_versions** string | **Choices:*** ssl-3.0
* tls-1.0
* tls-1.1
* tls-1.2
| SSL/TLS versions that the cipher suite can be used with. FLAG Based Options. Specify multiple in list form. flag | ssl-3.0 | SSL 3.0. flag | tls-1.0 | TLS 1.0. flag | tls-1.1 | TLS 1.1. flag | tls-1.2 | TLS 1.2. |
| **ssl\_server\_max\_version** string | **Choices:*** ssl-3.0
* tls-1.0
* tls-1.1
* tls-1.2
* client
| Highest SSL/TLS version acceptable from a server. Use the client setting by default. choice | ssl-3.0 | SSL 3.0. choice | tls-1.0 | TLS 1.0. choice | tls-1.1 | TLS 1.1. choice | tls-1.2 | TLS 1.2. choice | client | Use same value as client configuration. |
| **ssl\_server\_min\_version** string | **Choices:*** ssl-3.0
* tls-1.0
* tls-1.1
* tls-1.2
* client
| Lowest SSL/TLS version acceptable from a server. Use the client setting by default. choice | ssl-3.0 | SSL 3.0. choice | tls-1.0 | TLS 1.0. choice | tls-1.1 | TLS 1.1. choice | tls-1.2 | TLS 1.2. choice | client | Use same value as client configuration. |
| **ssl\_server\_session\_state\_max** string | | Maximum number of FortiGate to Server SSL session states to keep. |
| **ssl\_server\_session\_state\_timeout** string | | Number of minutes to keep FortiGate to Server SSL session state. |
| **ssl\_server\_session\_state\_type** string | **Choices:*** disable
* time
* count
* both
| How to expire SSL sessions for the segment of the SSL connection between the server and the FortiGate. choice | disable | Do not keep session states. choice | time | Expire session states after this many minutes. choice | count | Expire session states when this maximum is reached. choice | both | Expire session states based on time or count, whichever occurs first. |
| **type** string | **Choices:*** static-nat
* load-balance
* server-load-balance
* dns-translation
* fqdn
| Configure a static NAT, load balance, server load balance, DNS translation, or FQDN VIP. choice | static-nat | Static NAT. choice | load-balance | Load balance. choice | server-load-balance | Server load balance. choice | dns-translation | DNS translation. choice | fqdn | FQDN Translation |
| **weblogic\_server** string | **Choices:*** disable
* enable
| Enable to add an HTTP header to indicate SSL offloading for a WebLogic server. choice | disable | Do not add HTTP header indicating SSL offload for WebLogic server. choice | enable | Add HTTP header indicating SSL offload for WebLogic server. |
| **websphere\_server** string | **Choices:*** disable
* enable
| Enable to add an HTTP header to indicate SSL offloading for a WebSphere server. choice | disable | Do not add HTTP header indicating SSL offload for WebSphere server. choice | enable | Add HTTP header indicating SSL offload for WebSphere server. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
# BASIC FULL STATIC NAT MAPPING
- name: EDIT FMGR_FIREWALL_VIP SNAT
community.fortios.fmgr_fwobj_vip:
name: "Basic StaticNAT Map"
mode: "set"
adom: "ansible"
type: "static-nat"
extip: "82.72.192.185"
extintf: "any"
mappedip: "10.7.220.25"
comment: "Created by Ansible"
color: "17"
# BASIC PORT PNAT MAPPING
- name: EDIT FMGR_FIREWALL_VIP PNAT
community.fortios.fmgr_fwobj_vip:
name: "Basic PNAT Map Port 10443"
mode: "set"
adom: "ansible"
type: "static-nat"
extip: "82.72.192.185"
extport: "10443"
extintf: "any"
portforward: "enable"
protocol: "tcp"
mappedip: "10.7.220.25"
mappedport: "443"
comment: "Created by Ansible"
color: "17"
# BASIC DNS TRANSLATION NAT
- name: EDIT FMGR_FIREWALL_DNST
community.fortios.fmgr_fwobj_vip:
name: "Basic DNS Translation"
mode: "set"
adom: "ansible"
type: "dns-translation"
extip: "192.168.0.1-192.168.0.100"
extintf: "dmz"
mappedip: "3.3.3.0/24, 4.0.0.0/24"
comment: "Created by Ansible"
color: "12"
# BASIC FQDN NAT
- name: EDIT FMGR_FIREWALL_FQDN
community.fortios.fmgr_fwobj_vip:
name: "Basic FQDN Translation"
mode: "set"
adom: "ansible"
type: "fqdn"
mapped_addr: "google-play"
comment: "Created by Ansible"
color: "5"
# DELETE AN ENTRY
- name: DELETE FMGR_FIREWALL_VIP PNAT
community.fortios.fmgr_fwobj_vip:
name: "Basic PNAT Map Port 10443"
mode: "delete"
adom: "ansible"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
| programming_docs |
ansible community.fortios.fmgr_secprof_profile_group – Manage security profiles within FortiManager community.fortios.fmgr\_secprof\_profile\_group – Manage security profiles within FortiManager
==============================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_secprof_profile_group`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage security profile group which allows you to create a group of security profiles and apply that to a policy.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **application\_list** string | | Name of an existing Application list. |
| **av\_profile** string | | Name of an existing Antivirus profile. |
| **dlp\_sensor** string | | Name of an existing DLP sensor. |
| **dnsfilter\_profile** string | | Name of an existing DNS filter profile. |
| **icap\_profile** string | | Name of an existing ICAP profile. |
| **ips\_sensor** string | | Name of an existing IPS sensor. |
| **mms\_profile** string | | Name of an existing MMS profile. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values. |
| **name** string | | Profile group name. |
| **profile\_protocol\_options** string | | Name of an existing Protocol options profile. |
| **spamfilter\_profile** string | | Name of an existing Spam filter profile. |
| **ssh\_filter\_profile** string | | Name of an existing SSH filter profile. |
| **ssl\_ssh\_profile** string | | Name of an existing SSL SSH profile. |
| **voip\_profile** string | | Name of an existing VoIP profile. |
| **waf\_profile** string | | Name of an existing Web application firewall profile. |
| **webfilter\_profile** string | | Name of an existing Web filter profile. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: DELETE Profile
community.fortios.fmgr_secprof_profile_group:
name: "Ansible_TEST_Profile_Group"
mode: "delete"
- name: CREATE Profile
community.fortios.fmgr_secprof_profile_group:
name: "Ansible_TEST_Profile_Group"
mode: "set"
av_profile: "Ansible_AV_Profile"
profile_protocol_options: "default"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible community.fortios.fmgr_secprof_appctrl – Manage application control security profiles community.fortios.fmgr\_secprof\_appctrl – Manage application control security profiles
=======================================================================================
Note
This plugin is part of the [community.fortios collection](https://galaxy.ansible.com/community/fortios) (version 1.0.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 community.fortios`.
To use it in a playbook, specify: `community.fortios.fmgr_secprof_appctrl`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage application control security profiles within FortiManager
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adom** string | **Default:**"root" | The ADOM the configuration should belong to. |
| **app\_replacemsg** string | **Choices:*** disable
* enable
| Enable/disable replacement messages for blocked applications. choice | disable | Disable replacement messages for blocked applications. choice | enable | Enable replacement messages for blocked applications. |
| **comment** string | | comments |
| **deep\_app\_inspection** string | **Choices:*** disable
* enable
| Enable/disable deep application inspection. choice | disable | Disable deep application inspection. choice | enable | Enable deep application inspection. |
| **entries** string | | EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. WHEN IN DOUBT, OMIT THE USE OF THIS PARAMETER AND USE THE SUB OPTIONS BELOW INSTEAD TO CREATE OBJECTS WITH MULTIPLE TASKS |
| **entries\_action** string | **Choices:*** pass
* block
* reset
| Pass or block traffic, or reset connection for traffic from this application. choice | pass | Pass or allow matching traffic. choice | block | Block or drop matching traffic. choice | reset | Reset sessions for matching traffic. |
| **entries\_application** string | | ID of allowed applications. |
| **entries\_behavior** string | | Application behavior filter. |
| **entries\_category** string | | Category ID list. |
| **entries\_log** string | **Choices:*** disable
* enable
| Enable/disable logging for this application list. choice | disable | Disable logging. choice | enable | Enable logging. |
| **entries\_log\_packet** string | **Choices:*** disable
* enable
| Enable/disable packet logging. choice | disable | Disable packet logging. choice | enable | Enable packet logging. |
| **entries\_parameters\_value** string | | Parameter value. |
| **entries\_per\_ip\_shaper** string | | Per-IP traffic shaper. |
| **entries\_popularity** string | **Choices:*** 1
* 2
* 3
* 4
* 5
| Application popularity filter (1 - 5, from least to most popular). FLAG Based Options. Specify multiple in list form. flag | 1 | Popularity level 1. flag | 2 | Popularity level 2. flag | 3 | Popularity level 3. flag | 4 | Popularity level 4. flag | 5 | Popularity level 5. |
| **entries\_protocols** string | | Application protocol filter. |
| **entries\_quarantine** string | **Choices:*** none
* attacker
| Quarantine method. choice | none | Quarantine is disabled. choice | attacker | Block all traffic sent from attacker's IP address. The attacker's IP address is also added to the banned user list. The target's address is not affected. |
| **entries\_quarantine\_expiry** string | | Duration of quarantine. (Format Requires quarantine set to attacker. |
| **entries\_quarantine\_log** string | **Choices:*** disable
* enable
| Enable/disable quarantine logging. choice | disable | Disable quarantine logging. choice | enable | Enable quarantine logging. |
| **entries\_rate\_count** string | | Count of the rate. |
| **entries\_rate\_duration** string | | Duration (sec) of the rate. |
| **entries\_rate\_mode** string | **Choices:*** periodical
* continuous
| Rate limit mode. choice | periodical | Allow configured number of packets every rate-duration. choice | continuous | Block packets once the rate is reached. |
| **entries\_rate\_track** string | **Choices:*** none
* src-ip
* dest-ip
* dhcp-client-mac
* dns-domain
| Track the packet protocol field. choice | none | choice | src-ip | Source IP. choice | dest-ip | Destination IP. choice | dhcp-client-mac | DHCP client. choice | dns-domain | DNS domain. |
| **entries\_risk** string | | Risk, or impact, of allowing traffic from this application to occur 1 - 5; (Low, Elevated, Medium, High, and Critical). |
| **entries\_session\_ttl** string | | Session TTL (0 = default). |
| **entries\_shaper** string | | Traffic shaper. |
| **entries\_shaper\_reverse** string | | Reverse traffic shaper. |
| **entries\_sub\_category** string | | Application Sub-category ID list. |
| **entries\_technology** string | | Application technology filter. |
| **entries\_vendor** string | | Application vendor filter. |
| **extended\_log** string | **Choices:*** disable
* enable
| Enable/disable extended logging. choice | disable | Disable setting. choice | enable | Enable setting. |
| **mode** string | **Choices:*** **add** ←
* set
* delete
* update
| Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values |
| **name** string | | List name. |
| **options** string | **Choices:*** allow-dns
* allow-icmp
* allow-http
* allow-ssl
* allow-quic
| NO DESCRIPTION PARSED ENTER MANUALLY FLAG Based Options. Specify multiple in list form. flag | allow-dns | Allow DNS. flag | allow-icmp | Allow ICMP. flag | allow-http | Allow generic HTTP web browsing. flag | allow-ssl | Allow generic SSL communication. flag | allow-quic | Allow QUIC. |
| **other\_application\_action** string | **Choices:*** pass
* block
| Action for other applications. choice | pass | Allow sessions matching an application in this application list. choice | block | Block sessions matching an application in this application list. |
| **other\_application\_log** string | **Choices:*** disable
* enable
| Enable/disable logging for other applications. choice | disable | Disable logging for other applications. choice | enable | Enable logging for other applications. |
| **p2p\_black\_list** string | **Choices:*** skype
* edonkey
* bittorrent
| NO DESCRIPTION PARSED ENTER MANUALLY FLAG Based Options. Specify multiple in list form. flag | skype | Skype. flag | edonkey | Edonkey. flag | bittorrent | Bit torrent. |
| **replacemsg\_group** string | | Replacement message group. |
| **unknown\_application\_action** string | **Choices:*** pass
* block
| Pass or block traffic from unknown applications. choice | pass | Pass or allow unknown applications. choice | block | Drop or block unknown applications. |
| **unknown\_application\_log** string | **Choices:*** disable
* enable
| Enable/disable logging for unknown applications. choice | disable | Disable logging for unknown applications. choice | enable | Enable logging for unknown applications. |
Notes
-----
Note
* Full Documentation at <https://ftnt-ansible-docs.readthedocs.io/en/latest/>.
Examples
--------
```
- name: DELETE Profile
community.fortios.fmgr_secprof_appctrl:
name: "Ansible_Application_Control_Profile"
comment: "Created by Ansible Module TEST"
mode: "delete"
- name: CREATE Profile
community.fortios.fmgr_secprof_appctrl:
name: "Ansible_Application_Control_Profile"
comment: "Created by Ansible Module TEST"
mode: "set"
entries: [{
action: "block",
log: "enable",
log-packet: "enable",
protocols: ["1"],
quarantine: "attacker",
quarantine-log: "enable",
},
{action: "pass",
category: ["2","3","4"]},
]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **api\_result** string | always | full API response, includes status code and message |
### Authors
* Luke Weighall (@lweighall)
* Andrew Welsh (@Ghilli3)
* Jim Huber (@p4r4n0y1ng)
ansible community.aws.elasticache_info – Retrieve information for AWS ElastiCache clusters community.aws.elasticache\_info – Retrieve information for AWS ElastiCache clusters
===================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.elasticache_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Retrieve information from AWS ElastiCache clusters
* This module was called `elasticache_facts` before Ansible 2.9. The usage did not change.
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. |
| **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 |
| **name** string | | The name of an ElastiCache cluster. |
| **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
--------
```
- name: obtain all ElastiCache information
community.aws.elasticache_info:
- name: obtain all information for a single ElastiCache cluster
community.aws.elasticache_info:
name: test_elasticache
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **elasticache\_clusters** complex | always | List of ElastiCache clusters |
| | **auto\_minor\_version\_upgrade** boolean | always | Whether to automatically upgrade to minor versions **Sample:** True |
| | **cache\_cluster\_create\_time** string | always | Date and time cluster was created **Sample:** 2017-09-15T05:43:46.038000+00:00 |
| | **cache\_cluster\_id** string | always | ID of the cache cluster **Sample:** abcd-1234-001 |
| | **cache\_cluster\_status** string | always | Status of ElastiCache cluster **Sample:** available |
| | **cache\_node\_type** string | always | Instance type of ElastiCache nodes **Sample:** cache.t2.micro |
| | **cache\_nodes** complex | always | List of ElastiCache nodes in the cluster |
| | | **cache\_node\_create\_time** string | always | Date and time node was created **Sample:** 2017-09-15T05:43:46.038000+00:00 |
| | | **cache\_node\_id** string | always | ID of the cache node **Sample:** 0001 |
| | | **cache\_node\_status** string | always | Status of the cache node **Sample:** available |
| | | **customer\_availability\_zone** string | always | Availability Zone in which the cache node was created **Sample:** ap-southeast-2b |
| | | **endpoint** complex | always | Connection details for the cache node |
| | | | **address** string | always | URL of the cache node endpoint **Sample:** abcd-1234-001.bgiz2p.0001.apse2.cache.amazonaws.com |
| | | | **port** integer | always | Port of the cache node endpoint **Sample:** 6379 |
| | | **parameter\_group\_status** string | always | Status of the Cache Parameter Group **Sample:** in-sync |
| | **cache\_parameter\_group** complex | always | Contents of the Cache Parameter Group |
| | | **cache\_node\_ids\_to\_reboot** list / elements=string | always | Cache nodes which need to be rebooted for parameter changes to be applied |
| | | **cache\_parameter\_group\_name** string | always | Name of the cache parameter group **Sample:** default.redis3.2 |
| | | **parameter\_apply\_status** string | always | Status of parameter updates **Sample:** in-sync |
| | **cache\_security\_groups** list / elements=string | always | Security Groups used by the cache **Sample:** ['sg-abcd1234'] |
| | **cache\_subnet\_group\_name** string | always | ElastiCache Subnet Group used by the cache **Sample:** abcd-subnet-group |
| | **client\_download\_landing\_page** string | always | URL of client download web page **Sample:** https://console.aws.amazon.com/elasticache/home#client-download: |
| | **engine** string | always | Engine used by ElastiCache **Sample:** redis |
| | **engine\_version** string | always | Version of ElastiCache engine **Sample:** 3.2.4 |
| | **notification\_configuration** complex | if notifications are enabled | Configuration of notifications |
| | | **topic\_arn** string | if notifications are enabled | ARN of notification destination topic **Sample:** arn:aws:sns:\*:123456789012:my\_topic |
| | | **topic\_name** string | if notifications are enabled | Name of notification destination topic **Sample:** MyTopic |
| | **num\_cache\_nodes** integer | always | Number of Cache Nodes **Sample:** 1 |
| | **pending\_modified\_values** complex | always | Values that are pending modification |
| | **preferred\_availability\_zone** string | always | Preferred Availability Zone **Sample:** ap-southeast-2b |
| | **preferred\_maintenance\_window** string | always | Time slot for preferred maintenance window **Sample:** sat:12:00-sat:13:00 |
| | **replication\_group\_id** string | always | Replication Group Id **Sample:** replication-001 |
| | **security\_groups** complex | always | List of Security Groups associated with ElastiCache |
| | | **security\_group\_id** string | always | Security Group ID **Sample:** sg-abcd1234 |
| | | **status** string | always | Status of Security Group **Sample:** active |
| | **tags** complex | always | Tags applied to the ElastiCache cluster **Sample:** {'Application': 'web', 'Environment': 'test'} |
### Authors
* Will Thames (@willthames)
| programming_docs |
ansible community.aws.ec2_metric_alarm – Create/update or delete AWS Cloudwatch ‘metric alarms’ community.aws.ec2\_metric\_alarm – Create/update or delete AWS Cloudwatch ‘metric alarms’
=========================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_metric_alarm`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Can create or delete AWS metric alarms.
* Metrics you wish to alarm on must already exist.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.6
* boto
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **alarm\_actions** list / elements=string | | A list of the names action(s) taken when the alarm is in the `alarm` status, denoted as Amazon Resource Name(s). |
| **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 |
| **comparison** string | **Choices:*** GreaterThanOrEqualToThreshold
* GreaterThanThreshold
* LessThanThreshold
* LessThanOrEqualToThreshold
* <=
* <
* >=
* >
| Determines how the threshold value is compared Symbolic comparison operators have been deprecated, and will be removed after 2022-06-22. |
| **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 | | A longer description of the alarm. |
| **dimensions** dictionary | | A dictionary describing which metric the alarm is applied to. For more information see the AWS documentation: <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Dimension> |
| **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 |
| **evaluation\_periods** integer | | The number of times in which the metric is evaluated before final calculation. |
| **insufficient\_data\_actions** list / elements=string | | A list of the names of action(s) to take when the alarm is in the `insufficient_data` status. |
| **metric** string | | Name of the monitored metric (e.g. `CPUUtilization`). Metric must already exist. |
| **name** string / required | | Unique name for the alarm. |
| **namespace** string | | Name of the appropriate namespace (`AWS/EC2`, `System/Linux`, etc.), which determines the category it will appear under in cloudwatch. |
| **ok\_actions** list / elements=string | | A list of the names of action(s) to take when the alarm is in the `ok` status, denoted as Amazon Resource Name(s). |
| **period** integer | | The time (in seconds) between metric evaluations. |
| **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
| Register or deregister the alarm. |
| **statistic** string | **Choices:*** SampleCount
* Average
* Sum
* Minimum
* Maximum
| Operation applied to the metric. Works in conjunction with *period* and *evaluation\_periods* to determine the comparison value. |
| **threshold** float | | Sets the min/max bound for triggering the alarm. |
| **treat\_missing\_data** string | **Choices:*** breaching
* notBreaching
* ignore
* **missing** ←
| Sets how the alarm handles missing data points. |
| **unit** string | **Choices:*** Seconds
* Microseconds
* Milliseconds
* Bytes
* Kilobytes
* Megabytes
* Gigabytes
* Terabytes
* Bits
* Kilobits
* Megabits
* Gigabits
* Terabits
* Percent
* Count
* Bytes/Second
* Kilobytes/Second
* Megabytes/Second
* Gigabytes/Second
* Terabytes/Second
* Bits/Second
* Kilobits/Second
* Megabits/Second
* Gigabits/Second
* Terabits/Second
* Count/Second
* None
| The threshold's unit of measurement. |
| **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: create alarm
community.aws.ec2_metric_alarm:
state: present
region: ap-southeast-2
name: "cpu-low"
metric: "CPUUtilization"
namespace: "AWS/EC2"
statistic: Average
comparison: "LessThanOrEqualToThreshold"
threshold: 5.0
period: 300
evaluation_periods: 3
unit: "Percent"
description: "This will alarm when a instance's CPU usage average is lower than 5% for 15 minutes"
dimensions: {'InstanceId':'i-XXX'}
alarm_actions: ["action1","action2"]
- name: Create an alarm to recover a failed instance
community.aws.ec2_metric_alarm:
state: present
region: us-west-1
name: "recover-instance"
metric: "StatusCheckFailed_System"
namespace: "AWS/EC2"
statistic: "Minimum"
comparison: ">="
threshold: 1.0
period: 60
evaluation_periods: 2
unit: "Count"
description: "This will recover an instance when it fails"
dimensions: {"InstanceId":'i-XXX'}
alarm_actions: ["arn:aws:automate:us-west-1:ec2:recover"]
```
### Authors
* Zacharie Eakin (@Zeekin)
ansible community.aws.efs_info – Get information about Amazon EFS file systems community.aws.efs\_info – Get information about Amazon EFS file systems
=======================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.efs_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module can be used to search Amazon EFS file systems.
* This module was called `efs_facts` before Ansible 2.9, returning `ansible_facts`. Note that the [community.aws.efs\_info](#ansible-collections-community-aws-efs-info-module) module no longer returns `ansible_facts`!
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 |
| **id** string | | ID of Amazon EFS. |
| **name** string | | Creation Token of Amazon EFS file system.
aliases: creation\_token |
| **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 |
| **tags** dictionary | | List of tags of Amazon EFS. Should be defined as dictionary. |
| **targets** list / elements=string | | List of targets on which to filter the returned results. Result must match all of the specified targets, each of which can be a security group ID, a subnet ID or an IP address. |
| **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: Find all existing efs
community.aws.efs_info:
register: result
- name: Find efs using id
community.aws.efs_info:
id: fs-1234abcd
register: result
- name: Searching all EFS instances with tag Name = 'myTestNameTag', in subnet 'subnet-1a2b3c4d' and with security group 'sg-4d3c2b1a'
community.aws.efs_info:
tags:
Name: myTestNameTag
targets:
- subnet-1a2b3c4d
- sg-4d3c2b1a
register: result
- ansible.builtin.debug:
msg: "{{ result['efs'] }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **creation\_time** string | always | timestamp of creation date **Sample:** 2015-11-16 07:30:57-05:00 |
| **creation\_token** string | always | EFS creation token **Sample:** console-88609e04-9a0e-4a2e-912c-feaa99509961 |
| **file\_system\_id** string | always | ID of the file system **Sample:** fs-xxxxxxxx |
| **filesystem\_address** string | always | url of file system **Sample:** fs-xxxxxxxx.efs.us-west-2.amazonaws.com:/ |
| **life\_cycle\_state** string | always | state of the EFS file system **Sample:** creating, available, deleting, deleted |
| **mount\_point** string | always | url of file system with leading dot from the time AWS EFS required to add network suffix to EFS address **Sample:** .fs-xxxxxxxx.efs.us-west-2.amazonaws.com:/ |
| **mount\_targets** list / elements=string | always | list of mount targets **Sample:** [{'file\_system\_id': 'fs-a7ad440e', 'ip\_address': '172.31.17.173', 'life\_cycle\_state': 'available', 'mount\_target\_id': 'fsmt-d8907871', 'network\_interface\_id': 'eni-6e387e26', 'owner\_id': '740748460359', 'security\_groups': ['sg-a30b22c6'], 'subnet\_id': 'subnet-e265c895'}, '...'] |
| **name** string | always | name of the file system **Sample:** my-efs |
| **number\_of\_mount\_targets** integer | always | the number of targets mounted **Sample:** 3 |
| **owner\_id** string | always | AWS account ID of EFS owner **Sample:** XXXXXXXXXXXX |
| **performance\_mode** string | always | performance mode of the file system **Sample:** generalPurpose |
| **provisioned\_throughput\_in\_mibps** float | when botocore >= 1.10.57 and throughput\_mode is set to "provisioned" | throughput provisioned in Mibps **Sample:** 15.0 |
| **size\_in\_bytes** dictionary | always | size of the file system in bytes as of a timestamp **Sample:** {'timestamp': '2015-12-21 13:59:59-05:00', 'value': 12288} |
| **tags** dictionary | always | tags on the efs instance **Sample:** {'key': 'Value', 'name': 'my-efs'} |
| **throughput\_mode** string | when botocore >= 1.10.57 | mode of throughput for the file system **Sample:** bursting |
### Authors
* Ryan Sydnor (@ryansydnor)
ansible community.aws.elb_target – Manage a target in a target group community.aws.elb\_target – Manage a target in a target group
=============================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.elb_target`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Used to register or deregister a target in a target group.
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. |
| **deregister\_unused** boolean | **Choices:*** **no** ←
* yes
| The default behaviour for targets that are unused is to leave them registered. If instead you would like to remove them set *deregister\_unused=true*. |
| **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 |
| **state** string / required | **Choices:*** present
* absent
| Register or deregister the target. |
| **target\_az** string | | An Availability Zone or `all`. This determines whether the target receives traffic from the load balancer nodes in the specified Availability Zone or from all enabled Availability Zones for the load balancer. This parameter is not supported if the target type of the target group is instance. |
| **target\_group\_arn** string | | The Amazon Resource Name (ARN) of the target group. Mutually exclusive of *target\_group\_name*. |
| **target\_group\_name** string | | The name of the target group. Mutually exclusive of *target\_group\_arn*. |
| **target\_id** string / required | | The ID of the target. |
| **target\_port** integer | | The port on which the target is listening. You can specify a port override. If a target is already registered, you can register it again using a different port. The default port for a target is the port for the target group. |
| **target\_status** string | **Choices:*** initial
* healthy
* unhealthy
* unused
* draining
* unavailable
| Blocks and waits for the target status to equal given value. For more detail on target status see <https://docs.aws.amazon.com/elasticloadbalancing/latest/application/target-group-health-checks.html#target-health-states>
|
| **target\_status\_timeout** integer | **Default:**60 | Maximum time in seconds to wait for *target\_status* change. |
| **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 you specified a port override when you registered a target, you must specify both the target ID and the port when you deregister it.
* 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: Register an IP address target to a target group
community.aws.elb_target:
target_group_name: myiptargetgroup
target_id: i-1234567
state: present
- name: Register an instance target to a target group
community.aws.elb_target:
target_group_name: mytargetgroup
target_id: i-1234567
state: present
- name: Deregister a target from a target group
community.aws.elb_target:
target_group_name: mytargetgroup
target_id: i-1234567
state: absent
# Modify a target to use a different port
- name: Register a target to a target group
community.aws.elb_target:
target_group_name: mytargetgroup
target_id: i-1234567
target_port: 8080
state: present
```
### Authors
* Rob White (@wimnat)
| programming_docs |
ansible community.aws.ecs_ecr – Manage Elastic Container Registry repositories community.aws.ecs\_ecr – Manage Elastic Container Registry repositories
=======================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ecs_ecr`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Elastic Container Registry repositories.
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\_set\_policy** boolean | **Choices:*** **no** ←
* yes
| If *force\_set\_policy=false*, it prevents setting a policy that would prevent you from setting another policy in the future. |
| **image\_tag\_mutability** string | **Choices:*** **mutable** ←
* immutable
| Configure whether repository should be mutable (ie. an already existing tag can be overwritten) or not. |
| **lifecycle\_policy** json | | JSON or dict that represents the new lifecycle policy. |
| **name** string / required | | The name of the repository. |
| **policy** json | | JSON or dict that represents the new policy. |
| **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\_lifecycle\_policy** boolean | **Choices:*** no
* yes
| if `true`, remove the lifecycle policy from the repository. Defaults to `false`. |
| **purge\_policy** boolean | **Choices:*** no
* yes
| If yes, remove the policy from the repository. Alias `delete_policy` has been deprecated and will be removed after 2022-06-01. Defaults to `false`.
aliases: delete\_policy |
| **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 |
| **registry\_id** string | | AWS account id associated with the registry. If not specified, the default registry is assumed. |
| **scan\_on\_push** boolean added in 1.3.0 of community.aws | **Choices:*** **no** ←
* yes
| if `true`, images are scanned for known vulnerabilities after being pushed to the repository.
*scan\_on\_push* requires botocore >= 1.13.3 |
| **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 destroy the repository. |
| **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
--------
```
# If the repository does not exist, it is created. If it does exist, would not
# affect any policies already on it.
- name: ecr-repo
community.aws.ecs_ecr:
name: super/cool
- name: destroy-ecr-repo
community.aws.ecs_ecr:
name: old/busted
state: absent
- name: Cross account ecr-repo
community.aws.ecs_ecr:
registry_id: 999999999999
name: cross/account
- name: set-policy as object
community.aws.ecs_ecr:
name: needs-policy-object
policy:
Version: '2008-10-17'
Statement:
- Sid: read-only
Effect: Allow
Principal:
AWS: '{{ read_only_arn }}'
Action:
- ecr:GetDownloadUrlForLayer
- ecr:BatchGetImage
- ecr:BatchCheckLayerAvailability
- name: set-policy as string
community.aws.ecs_ecr:
name: needs-policy-string
policy: "{{ lookup('template', 'policy.json.j2') }}"
- name: delete-policy
community.aws.ecs_ecr:
name: needs-no-policy
purge_policy: yes
- name: create immutable ecr-repo
community.aws.ecs_ecr:
name: super/cool
image_tag_mutability: immutable
- name: set-lifecycle-policy
community.aws.ecs_ecr:
name: needs-lifecycle-policy
scan_on_push: yes
lifecycle_policy:
rules:
- rulePriority: 1
description: new policy
selection:
tagStatus: untagged
countType: sinceImagePushed
countUnit: days
countNumber: 365
action:
type: expire
- name: purge-lifecycle-policy
community.aws.ecs_ecr:
name: needs-no-lifecycle-policy
purge_lifecycle_policy: 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 |
| --- | --- | --- |
| **created** boolean | always | If true, the repository was created |
| **name** string | when state == 'absent' | The name of the repository |
| **repository** dictionary | when state == 'present' | The created or updated repository **Sample:** {'createdAt': '2017-01-17T08:41:32-06:00', 'registryId': '999999999999', 'repositoryArn': 'arn:aws:ecr:us-east-1:999999999999:repository/ecr-test-1484664090', 'repositoryName': 'ecr-test-1484664090', 'repositoryUri': '999999999999.dkr.ecr.us-east-1.amazonaws.com/ecr-test-1484664090'} |
| **state** string | always | The asserted state of the repository (present, absent) |
### Authors
* David M. Lee (@leedm777)
ansible community.aws.wafv2_web_acl – wafv2_web_acl community.aws.wafv2\_web\_acl – wafv2\_web\_acl
===============================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.wafv2_web_acl`.
New in version 1.5.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, modify or delete a wafv2 web acl.
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 |
| **cloudwatch\_metrics** boolean | **Choices:*** no
* **yes** ←
| Enable cloudwatch metric for wafv2 web acl. |
| **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. |
| **default\_action** string | **Choices:*** Block
* Allow
| Default action of the wafv2 web acl. |
| **description** string | | Description of wafv2 web acl. |
| **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 |
| **metric\_name** string | | Name of cloudwatch metrics. If not given and cloudwatch\_metrics is enabled, the name of the web acl itself will be taken. |
| **name** string / required | | The name of the web acl. |
| **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** ←
| When set to `no`, keep the existing load balancer rules in place. Will modify and add, but will not delete. |
| **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 | | The Rule statements used to identify the web requests that you want to allow, block, or count. |
| | **action** dictionary | | Wether a rule is blocked, allowed or counted. |
| | **name** string | | The name of the wafv2 rule |
| | **priority** integer | | The rule priority |
| | **statement** dictionary | | Rule configuration. |
| | **visibility\_config** dictionary | | Visibility of single wafv2 rule. |
| **sampled\_requests** boolean | **Choices:*** **no** ←
* yes
| Whether to store a sample of the web requests, true or false. |
| **scope** string / required | **Choices:*** CLOUDFRONT
* REGIONAL
| Scope of wafv2 web acl. |
| **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:*** present
* absent
| Whether the rule is present or absent. |
| **tags** dictionary | | tags for wafv2 web acl. |
| **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: create web acl
community.aws.wafv2_web_acl:
name: test05
state: present
description: hallo eins
scope: REGIONAL
default_action: Allow
sampled_requests: no
cloudwatch_metrics: yes
metric_name: blub
rules:
- name: zwei
priority: 2
action:
block: {}
visibility_config:
sampled_requests_enabled: yes
cloud_watch_metrics_enabled: yes
metric_name: ddos
statement:
xss_match_statement:
field_to_match:
body: {}
text_transformations:
- type: NONE
priority: 0
- name: admin_protect
priority: 1
override_action:
none: {}
visibility_config:
sampled_requests_enabled: yes
cloud_watch_metrics_enabled: yes
metric_name: fsd
statement:
managed_rule_group_statement:
vendor_name: AWS
name: AWSManagedRulesAdminProtectionRuleSet
tags:
A: B
C: D
register: out
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **arn** string | Always, as long as the web acl exists | web acl arn **Sample:** arn:aws:wafv2:eu-central-1:11111111:regional/webacl/test05/318c1ab9-fa74-4b3b-a974-f92e25106f61 |
| **capacity** integer | Always, as long as the web acl exists | Current capacity of the web acl **Sample:** 140 |
| **description** string | Always, as long as the web acl exists | Description of the web acl **Sample:** Some web acl description |
| **name** string | Always, as long as the web acl exists | Web acl name **Sample:** test02 |
| **rules** list / elements=string | Always, as long as the web acl exists | Current rules of the web acl **Sample:** [{'name': 'admin\_protect', 'override\_action': {'none': {}}, 'priority': 1, 'statement': {'managed\_rule\_group\_statement': {'name': 'AWSManagedRulesAdminProtectionRuleSet', 'vendor\_name': 'AWS'}}, 'visibility\_config': {'cloud\_watch\_metrics\_enabled': True, 'metric\_name': 'admin\_protect', 'sampled\_requests\_enabled': True}}] |
| **visibility\_config** dictionary | Always, as long as the web acl exists | Visibility config of the web acl **Sample:** {'cloud\_watch\_metrics\_enabled': True, 'metric\_name': 'blub', 'sampled\_requests\_enabled': False} |
### Authors
* Markus Bergholz (@markuman)
ansible community.aws.sts_assume_role – Assume a role using AWS Security Token Service and obtain temporary credentials community.aws.sts\_assume\_role – Assume a role using AWS Security Token Service and obtain temporary credentials
=================================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.sts_assume_role`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Assume a role using AWS Security Token Service and obtain temporary credentials.
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. |
| **duration\_seconds** integer | | The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 43200 seconds (12 hours). The max depends on the IAM role's sessions duration setting. By default, the value is set to 3600 seconds. |
| **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 |
| **external\_id** string | | A unique identifier that is used by third parties to assume a role in their customers' accounts. |
| **mfa\_serial\_number** string | | The identification number of the MFA device that is associated with the user who is making the AssumeRole call. |
| **mfa\_token** string | | The value provided by the MFA device, if the trust policy of the role being assumed requires MFA. |
| **policy** string | | Supplemental policy to use in addition to assumed role's policies. |
| **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 / required | | The Amazon Resource Name (ARN) of the role that the caller is assuming <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html#Identifiers_ARNs>. |
| **role\_session\_name** string / required | | Name of the role's session - will be used by CloudTrail. |
| **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
* In order to use the assumed role in a following playbook task you must pass the access\_key, access\_secret and access\_token.
* 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.
# Assume an existing role (more details: https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html)
- community.aws.sts_assume_role:
role_arn: "arn:aws:iam::123456789012:role/someRole"
role_session_name: "someRoleSession"
register: assumed_role
# Use the assumed role above to tag an instance in account 123456789012
- amazon.aws.ec2_tag:
aws_access_key: "{{ assumed_role.sts_creds.access_key }}"
aws_secret_key: "{{ assumed_role.sts_creds.secret_key }}"
security_token: "{{ assumed_role.sts_creds.session_token }}"
resource: i-xyzxyz01
state: present
tags:
MyNewTag: value
```
Return Values
-------------
Common return 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 obtaining the credentials succeeds |
| **sts\_creds** dictionary | always | The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token **Sample:** {'access\_key': 'XXXXXXXXXXXXXXXXXXXX', 'expiration': '2017-11-11T11:11:11+00:00', 'secret\_key': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'session\_token': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'} |
| **sts\_user** dictionary | always | The Amazon Resource Name (ARN) and the assumed role ID **Sample:** {'arn': 'ARO123EXAMPLE123:Bob', 'assumed\_role\_id': 'arn:aws:sts::123456789012:assumed-role/demo/Bob'} |
### Authors
* Boris Ekelchik (@bekelchik)
* Marek Piatek (@piontas)
| programming_docs |
ansible community.aws.cloudwatchevent_rule – Manage CloudWatch Event rules and targets community.aws.cloudwatchevent\_rule – Manage CloudWatch Event rules and targets
===============================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.cloudwatchevent_rule`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module creates and manages CloudWatch event rules and targets.
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 | | A description of the rule. |
| **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 |
| **event\_pattern** string | | A string pattern (in valid JSON format) that is used to match against incoming events to determine if the rule should be triggered. |
| **name** string / required | | The name of the rule you are creating, updating or deleting. No spaces or special characters allowed (i.e. must match `[\.\-_A-Za-z0-9]+`). |
| **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 Amazon Resource Name (ARN) of the IAM role associated with the rule. |
| **schedule\_expression** string | | A cron or rate expression that defines the schedule the rule will trigger on. For example, `cron(0 20 * * ? *`), `rate(5 minutes`). |
| **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** ←
* disabled
* absent
| Whether the rule is present (and enabled), disabled, or absent. |
| **targets** list / elements=dictionary | | A list of targets to add to or update for the rule. |
| | **arn** string / required | | The ARN associated with the target. |
| | **ecs\_parameters** dictionary | | Contains the ECS task definition and task count to be used, if the event target is an ECS task. |
| | | **task\_count** integer | | The number of tasks to create based on *task\_definition*. |
| | | **task\_definition\_arn** string | | The full ARN of the task definition. |
| | **id** string / required | | The unique target assignment ID. |
| | **input** string | | A JSON object that will override the event data when passed to the target. If neither *input* nor *input\_path* is specified, then the entire event is passed to the target in JSON form. |
| | **input\_path** string | | A JSONPath string (e.g. `$.detail`) that specifies the part of the event data to be passed to the target. If neither *input* nor *input\_path* is specified, then the entire event is passed to the target in JSON form. |
| | **role\_arn** string | | The ARN of the IAM role to be used for this target when the rule is triggered. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* A rule must contain at least an *event\_pattern* or *schedule\_expression*. A rule can have both an *event\_pattern* and a *schedule\_expression*, in which case the rule will trigger on matching events as well as on a schedule.
* When specifying targets, *input* and *input\_path* are mutually-exclusive and optional parameters.
* 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
--------
```
- community.aws.cloudwatchevent_rule:
name: MyCronTask
schedule_expression: "cron(0 20 * * ? *)"
description: Run my scheduled task
targets:
- id: MyTargetId
arn: arn:aws:lambda:us-east-1:123456789012:function:MyFunction
- community.aws.cloudwatchevent_rule:
name: MyDisabledCronTask
schedule_expression: "rate(5 minutes)"
description: Run my disabled scheduled task
state: disabled
targets:
- id: MyOtherTargetId
arn: arn:aws:lambda:us-east-1:123456789012:function:MyFunction
input: '{"foo": "bar"}'
- community.aws.cloudwatchevent_rule:
name: MyCronTask
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 |
| --- | --- | --- |
| **rule** dictionary | success | CloudWatch Event rule data. **Sample:** {'arn': 'arn:aws:events:us-east-1:123456789012:rule/MyCronTask', 'description': 'Run my scheduled task', 'name': 'MyCronTask', 'schedule\_expression': 'cron(0 20 \* \* ? \*)', 'state': 'ENABLED'} |
| **targets** list / elements=string | success | CloudWatch Event target(s) assigned to the rule. **Sample:** [{ 'arn': 'arn:aws:lambda:us-east-1:123456789012:function:MyFunction', 'id': 'MyTargetId' }] |
### Authors
* Jim Dalton (@jsdalton) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#8ee4e7e3a8adbab8b5eaefe2fae1e0a8adbdb9b5a8adbbbcb5a8adbab6b5e9e3efe7e2a8adbab8b5ede1e3)>
ansible community.aws.ec2_lc_info – Gather information about AWS Autoscaling Launch Configurations. community.aws.ec2\_lc\_info – Gather information about AWS Autoscaling Launch Configurations.
=============================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_lc_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about AWS Autoscaling Launch Configurations.
* This module was called `ec2_lc_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 |
| **name** list / elements=string | **Default:**[] | A name or a list of name to match. |
| **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 |
| **sort** string | **Choices:*** launch\_configuration\_name
* image\_id
* created\_time
* instance\_type
* kernel\_id
* ramdisk\_id
* key\_name
| Optional attribute which with to sort the results. |
| **sort\_end** integer | | Which result to end with (when sorting). Corresponds to Python slice notation. |
| **sort\_order** string | **Choices:*** **ascending** ←
* descending
| Order in which to sort results. Only used when the 'sort' parameter is specified. |
| **sort\_start** integer | | Which result to start with (when sorting). Corresponds to Python slice notation. |
| **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 launch configurations
community.aws.ec2_lc_info:
- name: Gather information about launch configuration with name "example"
community.aws.ec2_lc_info:
name: example
- name: Gather information sorted by created_time from most recent to least recent
community.aws.ec2_lc_info:
sort: created_time
sort_order: descending
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **block\_device\_mapping** list / elements=string | always | Block device mapping for the instances of launch configuration **Sample:** [{ 'device\_name': '/dev/xvda':, 'ebs': { 'delete\_on\_termination': true, 'volume\_size': 8, 'volume\_type': 'gp2' }] |
| **classic\_link\_vpc\_security\_groups** string | always | IDs of one or more security groups for the VPC specified in classic\_link\_vpc\_id |
| **created\_time** string | always | The creation date and time for the launch configuration **Sample:** 2016-05-27T13:47:44.216000+00:00 |
| **ebs\_optimized** boolean | always | EBS I/O optimized (true ) or not (false ) **Sample:** true, |
| **image\_id** string | always | ID of the Amazon Machine Image (AMI) **Sample:** ami-12345678 |
| **instance\_monitoring** dictionary | always | Launched with detailed monitoring or not **Sample:** { 'enabled': true } |
| **instance\_type** string | always | Instance type **Sample:** t2.micro |
| **kernel\_id** string | always | ID of the kernel associated with the AMI |
| **key\_name** string | always | Name of the key pair **Sample:** user\_app |
| **launch\_configuration\_arn** string | always | Amazon Resource Name (ARN) of the launch configuration **Sample:** arn:aws:autoscaling:us-east-1:666612345678:launchConfiguration:ba785e3a-dd42-6f02-4585-ea1a2b458b3d:launchConfigurationName/lc-app |
| **launch\_configuration\_name** string | always | Name of the launch configuration **Sample:** lc-app |
| **ramdisk\_id** string | always | ID of the RAM disk associated with the AMI |
| **security\_groups** list / elements=string | always | Security groups to associated **Sample:** [ 'web' ] |
| **user\_data** string | always | User data available |
### Authors
* Loïc Latreille (@psykotox)
ansible community.aws.lambda_policy – Creates, updates or deletes AWS Lambda policy statements. community.aws.lambda\_policy – Creates, updates or deletes AWS Lambda policy statements.
========================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.lambda_policy`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module allows the management of AWS Lambda policy statements.
* It is idempotent and supports “Check” mode.
* Use module [community.aws.lambda](lambda_module#ansible-collections-community-aws-lambda-module) to manage the lambda function itself, [community.aws.lambda\_alias](lambda_alias_module#ansible-collections-community-aws-lambda-alias-module) to manage function aliases, [community.aws.lambda\_event](lambda_event_module#ansible-collections-community-aws-lambda-event-module) to manage event source mappings such as Kinesis streams, [community.aws.execute\_lambda](execute_lambda_module#ansible-collections-community-aws-execute-lambda-module) to execute a lambda function and [community.aws.lambda\_info](lambda_info_module#ansible-collections-community-aws-lambda-info-module) to gather information relating to one or more lambda functions.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **action** string / required | | The AWS Lambda action you want to allow in this statement. Each Lambda action is a string starting with lambda: followed by the API name (see Operations ). For example, `lambda:CreateFunction` . You can use wildcard (`lambda:*`) to grant permission for all AWS Lambda actions. |
| **alias** string | | Name of the function alias. Mutually exclusive with *version*. |
| **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 |
| **event\_source\_token** string | | Token string representing source ARN or account. Mutually exclusive with *source\_arn* or *source\_account*. |
| **function\_name** string / required | | Name of the Lambda function whose resource policy you are updating by adding a new permission. You can specify a function name (for example, Thumbnail ) or you can specify Amazon Resource Name (ARN) of the function (for example, `arn:aws:lambda:us-west-2:account-id:function:ThumbNail` ). AWS Lambda also allows you to specify partial ARN (for example, `account-id:Thumbnail` ). Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length.
aliases: lambda\_function\_arn, function\_arn |
| **principal** string / required | | The principal who is getting this permission. It can be Amazon S3 service Principal (s3.amazonaws.com ) if you want Amazon S3 to invoke the function, an AWS account ID if you are granting cross-account permission, or any valid AWS service principal such as sns.amazonaws.com . For example, you might want to allow a custom application in another AWS account to push events to AWS Lambda by invoking your function. |
| **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 |
| **source\_account** string | | The AWS account ID (without a hyphen) of the source owner. For example, if *source\_arn* identifies a bucket, then this is the bucket owner's account ID. You can use this additional condition to ensure the bucket you specify is owned by a specific account (it is possible the bucket owner deleted the bucket and some other AWS account created the bucket). You can also use this condition to specify all sources (that is, you don't specify the *source\_arn* ) owned by a specific account. |
| **source\_arn** string | | This is optional; however, when granting Amazon S3 permission to invoke your function, you should specify this field with the bucket Amazon Resource Name (ARN) as its value. This ensures that only events generated from the specified bucket can invoke the function. |
| **state** string | **Choices:*** **present** ←
* absent
| Describes the desired state. |
| **statement\_id** string / required | | A unique statement identifier.
aliases: sid |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **version** integer | | Version of the Lambda function. Mutually exclusive with *alias*. |
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: Lambda S3 event notification
community.aws.lambda_policy:
state: present
function_name: functionName
alias: Dev
statement_id: lambda-s3-myBucket-create-data-log
action: lambda:InvokeFunction
principal: s3.amazonaws.com
source_arn: arn:aws:s3:eu-central-1:123456789012:bucketName
source_account: 123456789012
register: lambda_policy_action
- name: show results
ansible.builtin.debug:
var: lambda_policy_action
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **lambda\_policy\_action** string | success | describes what action was taken |
### Authors
* Pierre Jodouin (@pjodouin)
* Michael De La Rue (@mikedlr)
| programming_docs |
ansible community.aws.cloudformation_stack_set – Manage groups of CloudFormation stacks community.aws.cloudformation\_stack\_set – Manage groups of CloudFormation stacks
=================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.cloudformation_stack_set`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Launches/updates/deletes AWS CloudFormation Stack Sets.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3>=1.6
* botocore>=1.10.26
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **accounts** list / elements=string | | A list of AWS accounts in which to create instance of CloudFormation stacks. At least one region must be specified to create a stack set. On updates, if fewer regions are specified only the specified regions will have their stack instances updated. |
| **administration\_role\_arn** string | | ARN of the administration role, meaning the role that CloudFormation Stack Sets use to assume the roles in your child accounts. This defaults to `arn:aws:iam::{{ account ID }}:role/AWSCloudFormationStackSetAdministrationRole` where `{{ account ID }}` is replaced with the account number of the current IAM role/user/STS credentials.
aliases: admin\_role\_arn, admin\_role, administration\_role |
| **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 |
| **capabilities** list / elements=string | **Choices:*** CAPABILITY\_IAM
* CAPABILITY\_NAMED\_IAM
| Capabilities allow stacks to create and modify IAM resources, which may include adding users or roles. Currently the only available values are 'CAPABILITY\_IAM' and 'CAPABILITY\_NAMED\_IAM'. Either or both may be provided. The following resources require that one or both of these parameters is specified: AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, AWS::IAM::UserToGroupAddition |
| **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 | | A description of what this stack set creates. |
| **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 |
| **execution\_role\_name** string | | ARN of the execution role, meaning the role that CloudFormation Stack Sets assumes in your child accounts. This MUST NOT be an ARN, and the roles must exist in each child account specified. The default name for the execution role is `AWSCloudFormationStackSetExecutionRole`
aliases: exec\_role\_name, exec\_role, execution\_role |
| **failure\_tolerance** dictionary | | Settings to change what is considered "failed" when running stack instance updates, and how many to do at a time. |
| | **fail\_count** integer | | The number of accounts, per region, for which this operation can fail before CloudFormation stops the operation in that region. You must specify one of *fail\_count* and *fail\_percentage*. |
| | **fail\_percentage** integer | | The percentage of accounts, per region, for which this stack operation can fail before CloudFormation stops the operation in that region. You must specify one of *fail\_count* and *fail\_percentage*. |
| | **parallel\_count** integer | | The maximum number of accounts in which to perform this operation at one time.
*parallel\_count* may be at most one more than the *fail\_count*. You must specify one of *parallel\_count* and *parallel\_percentage*. Note that this setting lets you specify the maximum for operations. For large deployments, under certain circumstances the actual count may be lower. |
| | **parallel\_percentage** integer | | The maximum percentage of accounts in which to perform this operation at one time. You must specify one of *parallel\_count* and *parallel\_percentage*. Note that this setting lets you specify the maximum for operations. For large deployments, under certain circumstances the actual percentage may be lower. |
| **name** string / required | | Name of the CloudFormation stack set. |
| **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). |
| **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\_stacks** boolean | **Choices:*** no
* **yes** ←
| Only applicable when *state=absent*. Sets whether, when deleting a stack set, the stack instances should also be deleted. By default, instances will be deleted. To keep stacks when stack set is deleted set *purge\_stacks=false*. |
| **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 |
| **regions** list / elements=string | | A list of AWS regions to create instances of a stack in. The *region* parameter chooses where the Stack Set is created, and *regions* specifies the region for stack instances. At least one region must be specified to create a stack set. On updates, if fewer regions are specified only the specified regions will have their stack instances updated. |
| **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
| 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\_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. |
| **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
| Whether or not to wait for stack operation to complete. This includes waiting for stack instances to reach UPDATE\_COMPLETE status. If you choose not to wait, this module will not notify when stack operations fail because it will not wait for them to finish. |
| **wait\_timeout** integer | **Default:**900 | How long to wait (in seconds) for stacks to complete create/update/delete operations. |
Notes
-----
Note
* To make an individual stack, you want the [amazon.aws.cloudformation](../../amazon/aws/cloudformation_module#ansible-collections-amazon-aws-cloudformation-module) module.
* 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 stack set with instances in two accounts
community.aws.cloudformation_stack_set:
name: my-stack
description: Test stack in two accounts
state: present
template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template
accounts: [1234567890, 2345678901]
regions:
- us-east-1
- name: on subsequent calls, templates are optional but parameters and tags can be altered
community.aws.cloudformation_stack_set:
name: my-stack
state: present
parameters:
InstanceName: my_stacked_instance
tags:
foo: bar
test: stack
accounts: [1234567890, 2345678901]
regions:
- us-east-1
- name: The same type of update, but wait for the update to complete in all stacks
community.aws.cloudformation_stack_set:
name: my-stack
state: present
wait: true
parameters:
InstanceName: my_restacked_instance
tags:
foo: bar
test: stack
accounts: [1234567890, 2345678901]
regions:
- us-east-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 |
| --- | --- | --- |
| **operations** list / elements=string | always | All operations initiated by this run of the cloudformation\_stack\_set module **Sample:** [{'action': 'CREATE', 'administration\_role\_arn': 'arn:aws:iam::1234567890:role/AWSCloudFormationStackSetAdministrationRole', 'creation\_timestamp': '2018-06-18T17:40:46.372000+00:00', 'end\_timestamp': '2018-06-18T17:41:24.560000+00:00', 'execution\_role\_name': 'AWSCloudFormationStackSetExecutionRole', 'operation\_id': 'Ansible-StackInstance-Create-0ff2af5b-251d-4fdb-8b89-1ee444eba8b8', 'operation\_preferences': {'region\_order': ['us-east-1', 'us-east-2']}, 'stack\_set\_id': 'TestStackPrime:19f3f684-aae9-4e67-ba36-e09f92cf5929', 'status': 'FAILED'}] |
| **operations\_log** list / elements=string | always | Most recent events in CloudFormation's event log. This may be from a previous run in some cases. **Sample:** [{'action': 'CREATE', 'creation\_timestamp': '2018-06-18T17:40:46.372000+00:00', 'end\_timestamp': '2018-06-18T17:41:24.560000+00:00', 'operation\_id': 'Ansible-StackInstance-Create-0ff2af5b-251d-4fdb-8b89-1ee444eba8b8', 'stack\_instances': [{'account': '1234567890', 'region': 'us-east-1', 'stack\_set\_id': 'TestStackPrime:19f3f684-aae9-4e67-ba36-e09f92cf5929', 'status': 'OUTDATED', 'status\_reason': "Account 1234567890 should have 'AWSCloudFormationStackSetAdministrationRole' role with trust relationship to CloudFormation service."}], 'status': 'FAILED'}] |
| **stack\_instances** list / elements=string | state == present | CloudFormation stack instances that are members of this stack set. This will also include their region and account ID. **Sample:** [{'account': '1234567890', 'region': 'us-east-1', 'stack\_set\_id': 'TestStackPrime:19f3f684-aae9-4e67-ba36-e09f92cf5929', 'status': 'OUTDATED', 'status\_reason': "Account 1234567890 should have 'AWSCloudFormationStackSetAdministrationRole' role with trust relationship to CloudFormation service.\n"}, {'account': '1234567890', 'region': 'us-east-2', 'stack\_set\_id': 'TestStackPrime:19f3f684-aae9-4e67-ba36-e09f92cf5929', 'status': 'OUTDATED', 'status\_reason': 'Cancelled since failure tolerance has exceeded'}] |
| **stack\_set** dictionary | state == present | Facts about the currently deployed stack set, its parameters, and its tags **Sample:** {'administration\_role\_arn': 'arn:aws:iam::1234567890:role/AWSCloudFormationStackSetAdministrationRole', 'capabilities': [], 'description': 'test stack PRIME', 'execution\_role\_name': 'AWSCloudFormationStackSetExecutionRole', 'parameters': [], 'stack\_set\_arn': 'arn:aws:cloudformation:us-east-1:1234567890:stackset/TestStackPrime:19f3f684-aae9-467-ba36-e09f92cf5929', 'stack\_set\_id': 'TestStackPrime:19f3f684-aae9-4e67-ba36-e09f92cf5929', 'stack\_set\_name': 'TestStackPrime', 'status': 'ACTIVE', 'tags': {'Some': 'Thing', 'an': 'other'}, 'template\_body': 'AWSTemplateFormatVersion: "2010-09-09"\nParameters: {}\nResources:\n Bukkit:\n Type: "AWS::S3::Bucket"\n Properties: {}\n other:\n Type: "AWS::SNS::Topic"\n Properties: {}\n'} |
### Authors
* Ryan Scott Brown (@ryansb)
ansible community.aws.route53_info – Retrieves route53 details using AWS methods community.aws.route53\_info – Retrieves route53 details using AWS methods
=========================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.route53_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Gets various details related to Route53 zone, record set or health check details.
* This module was called `route53_facts` before Ansible 2.9. The usage did not change.
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 |
| **change\_id** string | | The ID of the change batch request. The value that you specify here is the value that ChangeResourceRecordSets returned in the Id element when you submitted the request. Required if *query=change*. |
| **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. |
| **delegation\_set\_id** string | | The DNS Zone delegation set ID. |
| **dns\_name** string | | The first name in the lexicographic ordering of domain names that you want the list\_command to start listing from. |
| **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\_id** string | | The ID of the health check. Required if `query` is set to `health_check` and `health_check_method` is set to `details` or `status` or `failure_reason`. |
| **health\_check\_method** string | **Choices:*** **list** ←
* details
* status
* failure\_reason
* count
* tags
| This is used in conjunction with query: health\_check. It allows for listing details, counts or tags of various health check details. |
| **hosted\_zone\_id** string | | The Hosted Zone ID of the DNS zone. Required if *query* is set to *hosted\_zone* and *hosted\_zone\_method* is set to *details*. Required if *query* is set to *record\_sets*. |
| **hosted\_zone\_method** string | **Choices:*** details
* **list** ←
* list\_by\_name
* count
* tags
| This is used in conjunction with query: hosted\_zone. It allows for listing details, counts or tags of various hosted zone details. |
| **max\_items** string | | Maximum number of items to return for various get/list requests. |
| **next\_marker** string | | Some requests such as list\_command: hosted\_zones will return a maximum number of entries - EG 100 or the number specified by *max\_items*. If the number of entries exceeds this maximum another request can be sent using the NextMarker entry from the first response to get the next page of results. |
| **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 |
| **query** string / required | **Choices:*** change
* checker\_ip\_range
* health\_check
* hosted\_zone
* record\_sets
* reusable\_delegation\_set
| Specifies the query action to take. |
| **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\_id** list / elements=string | | The ID/s of the specified resource/s. Required if *query=health\_check* and *health\_check\_method=tags*. Required if *query=hosted\_zone* and *hosted\_zone\_method=tags*.
aliases: resource\_ids |
| **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 |
| **start\_record\_name** string | | The first name in the lexicographic ordering of domain names that you want the list\_command: record\_sets to start listing from. |
| **type** string | **Choices:*** A
* CNAME
* MX
* AAAA
* TXT
* PTR
* SRV
* SPF
* CAA
* NS
| The type of DNS record. |
| **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
--------
```
# Simple example of listing all hosted zones
- name: List all hosted zones
community.aws.route53_info:
query: hosted_zone
register: hosted_zones
# Getting a count of hosted zones
- name: Return a count of all hosted zones
community.aws.route53_info:
query: hosted_zone
hosted_zone_method: count
register: hosted_zone_count
- name: List the first 20 resource record sets in a given hosted zone
community.aws.route53_info:
profile: account_name
query: record_sets
hosted_zone_id: ZZZ1111112222
max_items: 20
register: record_sets
- name: List first 20 health checks
community.aws.route53_info:
query: health_check
health_check_method: list
max_items: 20
register: health_checks
- name: Get health check last failure_reason
community.aws.route53_info:
query: health_check
health_check_method: failure_reason
health_check_id: 00000000-1111-2222-3333-12345678abcd
register: health_check_failure_reason
- name: Retrieve reusable delegation set details
community.aws.route53_info:
query: reusable_delegation_set
delegation_set_id: delegation id
register: delegation_sets
- name: setup of example for using next_marker
community.aws.route53_info:
query: hosted_zone
max_items: 1
register: first_info
- name: example for using next_marker
community.aws.route53_info:
query: hosted_zone
next_marker: "{{ first_info.NextMarker }}"
max_items: 1
when: "{{ 'NextMarker' in first_info }}"
- name: retrieve host entries starting with host1.workshop.test.io
block:
- name: grab zone id
community.aws.route53_zone:
zone: "test.io"
register: AWSINFO
- name: grab Route53 record information
community.aws.route53_info:
type: A
query: record_sets
hosted_zone_id: "{{ AWSINFO.zone_id }}"
start_record_name: "host1.workshop.test.io"
register: RECORDS
```
### Authors
* Karen Cheng (@Etherdaemon)
| programming_docs |
ansible community.aws.lightsail – Manage instances in AWS Lightsail community.aws.lightsail – Manage instances in AWS Lightsail
===========================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.lightsail`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage instances in AWS Lightsail.
* Instance tagging is not yet supported in this module.
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 |
| **blueprint\_id** string | | ID of the instance blueprint image. Required when *state=present*
|
| **bundle\_id** string | | Bundle of specification info for the instance. Required when *state=present*. |
| **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 |
| **key\_pair\_name** string | | Name of the key pair to use with the instance. If *state=present* and a key\_pair\_name is not provided, the default keypair from the region will be used. |
| **name** string / required | | Name 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 |
| **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
* running
* restarted
* rebooted
* stopped
| Indicate desired state of the target.
*rebooted* and *restarted* are aliases. |
| **user\_data** string | | Launch script that can configure the instance with additional data. |
| **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** ←
| Wait for the instance to be in state 'running' before returning. If *wait=false* an ip\_address may not be returned. Has no effect when *state=rebooted* or *state=absent*. |
| **wait\_timeout** integer | **Default:**300 | How long before *wait* gives up, in seconds. |
| **zone** string | | AWS availability zone in which to launch the instance. Required when *state=present*
|
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: Create a new Lightsail instance
community.aws.lightsail:
state: present
name: my_instance
region: us-east-1
zone: us-east-1a
blueprint_id: ubuntu_16_04
bundle_id: nano_1_0
key_pair_name: id_rsa
user_data: " echo 'hello world' > /home/ubuntu/test.txt"
register: my_instance
- name: Delete an instance
community.aws.lightsail:
state: absent
region: us-east-1
name: my_instance
```
Return Values
-------------
Common return 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 | if a snapshot has been modified/created **Sample:** {'changed': True} |
| **instance** dictionary | always | instance data **Sample:** {'arn': 'arn:aws:lightsail:us-east-1:448830907657:Instance/1fef0175-d6c8-480e-84fa-214f969cda87', 'blueprint\_id': 'ubuntu\_16\_04', 'blueprint\_name': 'Ubuntu', 'bundle\_id': 'nano\_1\_0', 'created\_at': '2017-03-27T08:38:59.714000-04:00', 'hardware': {'cpu\_count': 1, 'ram\_size\_in\_gb': 0.5}, 'is\_static\_ip': False, 'location': {'availability\_zone': 'us-east-1a', 'region\_name': 'us-east-1'}, 'name': 'my\_instance', 'networking': {'monthly\_transfer': {'gb\_per\_month\_allocated': 1024}, 'ports': [{'access\_direction': 'inbound', 'access\_from': 'Anywhere (0.0.0.0/0)', 'access\_type': 'public', 'common\_name': '', 'from\_port': 80, 'protocol': 'tcp', 'to\_port': 80}, {'access\_direction': 'inbound', 'access\_from': 'Anywhere (0.0.0.0/0)', 'access\_type': 'public', 'common\_name': '', 'from\_port': 22, 'protocol': 'tcp', 'to\_port': 22}]}, 'private\_ip\_address': '172.26.8.14', 'public\_ip\_address': '34.207.152.202', 'resource\_type': 'Instance', 'ssh\_key\_name': 'keypair', 'state': {'code': 16, 'name': 'running'}, 'support\_code': '588307843083/i-0997c97831ee21e33', 'username': 'ubuntu'} |
### Authors
* Nick Ball (@nickball)
* Prasad Katti (@prasadkatti)
ansible community.aws.ec2_vpc_nat_gateway_info – Retrieves AWS VPC Managed Nat Gateway details using AWS methods. community.aws.ec2\_vpc\_nat\_gateway\_info – Retrieves AWS VPC Managed Nat Gateway details using AWS methods.
=============================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_vpc_nat_gateway_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gets various details related to AWS VPC Managed Nat Gateways
* This module was called `ec2_vpc_nat_gateway_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_DescribeNatGateways.html> for possible filters. |
| **nat\_gateway\_ids** list / elements=string | | List of specific nat gateway IDs to fetch details for. |
| **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
--------
```
# Simple example of listing all nat gateways
- name: List all managed nat gateways in ap-southeast-2
community.aws.ec2_vpc_nat_gateway_info:
region: ap-southeast-2
register: all_ngws
- name: Debugging the result
ansible.builtin.debug:
msg: "{{ all_ngws.result }}"
- name: Get details on specific nat gateways
community.aws.ec2_vpc_nat_gateway_info:
nat_gateway_ids:
- nat-1234567891234567
- nat-7654321987654321
region: ap-southeast-2
register: specific_ngws
- name: Get all nat gateways with specific filters
community.aws.ec2_vpc_nat_gateway_info:
region: ap-southeast-2
filters:
state: ['pending']
register: pending_ngws
- name: Get nat gateways with specific filter
community.aws.ec2_vpc_nat_gateway_info:
region: ap-southeast-2
filters:
subnet-id: subnet-12345678
state: ['available']
register: existing_nat_gateways
```
Return Values
-------------
Common return 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 internet gateways succeeds |
| **result** list / elements=string | suceess | The result of the describe, converted to ansible snake case style. See also <http://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.Client.describe_nat_gateways>
|
| | **create\_time** string | always | The date and time the NAT gateway was created **Sample:** 2021-03-11T22:43:25+00:00 |
| | **delete\_time** string | when the NAT gateway has been deleted | The date and time the NAT gateway was deleted **Sample:** 2021-03-11T22:43:25+00:00 |
| | **nat\_gateway\_addresses** dictionary | always | List containing a dictionary with the IP addresses and network interface associated with the NAT gateway |
| | | **allocation\_id** string | always | The allocation ID of the Elastic IP address that's associated with the NAT gateway **Sample:** eipalloc-0853e66a40803da76 |
| | | **network\_interface\_id** string | always | The ID of the network interface associated with the NAT gateway **Sample:** eni-0a37acdbe306c661c |
| | | **private\_ip** string | always | The private IP address associated with the Elastic IP address **Sample:** 10.0.238.227 |
| | | **public\_ip** string | always | The Elastic IP address associated with the NAT gateway **Sample:** 34.204.123.52 |
| | **nat\_gateway\_id** string | always | The ID of the NAT gateway **Sample:** nat-0c242a2397acf6173 |
| | **state** string | always | state of the NAT gateway **Sample:** available |
| | **subnet\_id** string | always | The ID of the subnet in which the NAT gateway is located **Sample:** subnet-098c447465d4344f9 |
| | **tags** dictionary | always | Tags applied to the NAT gateway **Sample:** {'Tag1': 'tag1', 'Tag\_2': 'tag\_2'} |
| | **vpc\_id** string | always | The ID of the VPC in which the NAT gateway is located **Sample:** vpc-02f37f48438ab7d4c |
### Authors
* Karen Cheng (@Etherdaemon)
ansible community.aws.elasticache – Manage cache clusters in Amazon ElastiCache community.aws.elasticache – Manage cache clusters in Amazon ElastiCache
=======================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.elasticache`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Manage cache clusters in Amazon ElastiCache.
* Returns information about the specified cache cluster.
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 |
| **cache\_engine\_version** string | | The version number of the cache engine. |
| **cache\_parameter\_group** string | | The name of the cache parameter group to associate with this cache cluster. If this argument is omitted, the default cache parameter group for the specified engine will be used.
aliases: parameter\_group |
| **cache\_port** integer | | The port number on which each of the cache nodes will accept connections. |
| **cache\_security\_groups** list / elements=string | | A list of cache security group names to associate with this cache cluster. Don't use if your Cache is inside a VPC. In that case use *security\_group\_ids* instead! |
| **cache\_subnet\_group** string | | The subnet group name to associate with. Only use if inside a VPC. Required if inside a VPC. |
| **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 |
| **engine** string | **Default:**"memcached" | Name of the cache engine to be used. Supported values are `redis` and `memcached`. |
| **hard\_modify** boolean | **Choices:*** no
* yes
| Whether to destroy and recreate an existing cache cluster if necessary in order to modify its state. Defaults to `false`. |
| **name** string / required | | The cache cluster identifier. |
| **node\_type** string | **Default:**"cache.t2.small" | The compute and memory capacity of the nodes in the cache cluster. |
| **num\_nodes** integer | **Default:**1 | The initial number of cache nodes that the cache cluster will have. Required when *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 |
| **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\_group\_ids** list / elements=string | | A list of VPC security group IDs to associate with this cache cluster. Only use if inside a VPC. |
| **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:*** present
* absent
* rebooted
|
`absent` or `present` are idempotent actions that will create or destroy a cache cluster as needed.
`rebooted` will reboot the cluster, resulting in a momentary outage. |
| **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** ←
| Wait for cache cluster result before returning. |
| **zone** string | | The EC2 Availability Zone in which the cache cluster will be 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
--------
```
# Note: None of these examples set aws_access_key, aws_secret_key, or region.
# It is assumed that their matching environment variables are set.
- name: Basic example
community.aws.elasticache:
name: "test-please-delete"
state: present
engine: memcached
cache_engine_version: 1.4.14
node_type: cache.m1.small
num_nodes: 1
cache_port: 11211
cache_security_groups:
- default
zone: us-east-1d
- name: Ensure cache cluster is gone
community.aws.elasticache:
name: "test-please-delete"
state: absent
- name: Reboot cache cluster
community.aws.elasticache:
name: "test-please-delete"
state: rebooted
```
### Authors
* Jim Dalton (@jsdalton)
| programming_docs |
ansible community.aws.wafv2_web_acl_info – wafv2_web_acl community.aws.wafv2\_web\_acl\_info – wafv2\_web\_acl
=====================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.wafv2_web_acl_info`.
New in version 1.5.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Info about web acl
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 |
| **name** string / required | | The name of the web acl. |
| **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 |
| **scope** string / required | **Choices:*** CLOUDFRONT
* REGIONAL
| Scope of wafv2 web acl. |
| **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: get web acl
community.aws.wafv2_web_acl_info:
name: test05
scope: REGIONAL
register: out
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **arn** string | Always, as long as the web acl exists | web acl arn **Sample:** arn:aws:wafv2:eu-central-1:11111111:regional/webacl/test05/318c1ab9-fa74-4b3b-a974-f92e25106f61 |
| **capacity** integer | Always, as long as the web acl exists | Current capacity of the web acl **Sample:** 140 |
| **description** string | Always, as long as the web acl exists | Description of the web acl **Sample:** Some web acl description |
| **name** string | Always, as long as the web acl exists | Web acl name **Sample:** test02 |
| **rules** list / elements=string | Always, as long as the web acl exists | Current rules of the web acl **Sample:** [{'name': 'admin\_protect', 'override\_action': {'none': {}}, 'priority': 1, 'statement': {'managed\_rule\_group\_statement': {'name': 'AWSManagedRulesAdminProtectionRuleSet', 'vendor\_name': 'AWS'}}, 'visibility\_config': {'cloud\_watch\_metrics\_enabled': True, 'metric\_name': 'admin\_protect', 'sampled\_requests\_enabled': True}}] |
| **visibility\_config** dictionary | Always, as long as the web acl exists | Visibility config of the web acl **Sample:** {'cloud\_watch\_metrics\_enabled': True, 'metric\_name': 'blub', 'sampled\_requests\_enabled': False} |
### Authors
* Markus Bergholz (@markuman)
ansible community.aws.aws_batch_compute_environment – Manage AWS Batch Compute Environments community.aws.aws\_batch\_compute\_environment – Manage AWS Batch Compute Environments
======================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_batch_compute_environment`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module allows the management of AWS Batch Compute Environments.
* It is idempotent and supports “Check” mode.
* Use module [community.aws.aws\_batch\_compute\_environment](#ansible-collections-community-aws-aws-batch-compute-environment-module) to manage the compute environment, [community.aws.aws\_batch\_job\_queue](aws_batch_job_queue_module#ansible-collections-community-aws-aws-batch-job-queue-module) to manage job queues, [community.aws.aws\_batch\_job\_definition](aws_batch_job_definition_module#ansible-collections-community-aws-aws-batch-job-definition-module) to manage job definitions.
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 |
| **bid\_percentage** integer | | The minimum percentage that a Spot Instance price must be when compared with the On-Demand price for that instance type before instances are launched. For example, if your bid percentage is 20%, then the Spot price must be below 20% of the current On-Demand price for that EC2 instance. |
| **compute\_environment\_name** string / required | | The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. |
| **compute\_environment\_state** string | **Choices:*** **ENABLED** ←
* DISABLED
| The state of the compute environment. If the state is `ENABLED`, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. |
| **compute\_resource\_type** string / required | **Choices:*** EC2
* SPOT
| The type of compute resource. |
| **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. |
| **desiredv\_cpus** integer | | The desired number of EC2 vCPUS in the compute environment. |
| **ec2\_key\_pair** string | | The EC2 key pair that is used for instances launched in the compute environment. |
| **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 |
| **image\_id** string | | The Amazon Machine Image (AMI) ID used for instances launched in the compute environment. |
| **instance\_role** string / required | | The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment. |
| **instance\_types** list / elements=string / required | | The instance types that may be launched. |
| **maxv\_cpus** integer / required | | The maximum number of EC2 vCPUs that an environment can reach. |
| **minv\_cpus** integer / required | | The minimum number of EC2 vCPUs that an environment should maintain. |
| **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\_group\_ids** list / elements=string / required | | The EC2 security groups that are associated with instances launched in the compute environment. |
| **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 |
| **service\_role** string / required | | The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf. |
| **spot\_iam\_fleet\_role** string | | The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. |
| **state** string | **Choices:*** **present** ←
* absent
| Describes the desired state. |
| **subnets** list / elements=string / required | | The VPC subnets into which the compute resources are launched. |
| **tags** dictionary | | Key-value pair tags to be applied to resources that are launched in the compute environment. |
| **type** string / required | **Choices:*** MANAGED
* UNMANAGED
| The type of the compute environment. |
| **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: My Batch Compute Environment
community.aws.aws_batch_compute_environment:
compute_environment_name: computeEnvironmentName
state: present
region: us-east-1
compute_environment_state: ENABLED
type: MANAGED
compute_resource_type: EC2
minv_cpus: 0
maxv_cpus: 2
desiredv_cpus: 1
instance_types:
- optimal
subnets:
- my-subnet1
- my-subnet2
security_group_ids:
- my-sg1
- my-sg2
instance_role: arn:aws:iam::<account>:instance-profile/<role>
tags:
tag1: value1
tag2: value2
service_role: arn:aws:iam::<account>:role/service-role/<role>
register: aws_batch_compute_environment_action
- name: show results
ansible.builtin.debug:
var: aws_batch_compute_environment_action
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **output** dictionary | always | returns what action was taken, whether something was changed, invocation and response **Sample:** {'batch\_compute\_environment\_action': 'none', 'changed': False, 'invocation': {'module\_args': {'aws\_access\_key': None, 'aws\_secret\_key': None, 'bid\_percentage': None, 'compute\_environment\_name': '<name>', 'compute\_environment\_state': 'ENABLED', 'compute\_resource\_type': 'EC2', 'desiredv\_cpus': 0, 'ec2\_key\_pair': None, 'ec2\_url': None, 'image\_id': None, 'instance\_role': 'arn:aws:iam::...', 'instance\_types': ['optimal'], 'maxv\_cpus': 8, 'minv\_cpus': 0, 'profile': None, 'region': 'us-east-1', 'security\_group\_ids': ['\*\*\*\*\*\*\*'], 'security\_token': None, 'service\_role': 'arn:aws:iam::....', 'spot\_iam\_fleet\_role': None, 'state': 'present', 'subnets': ['\*\*\*\*\*\*'], 'tags': {'Environment': '<name>', 'Name': '<name>'}, 'type': 'MANAGED', 'validate\_certs': True}}, 'response': {'computeEnvironmentArn': 'arn:aws:batch:....', 'computeEnvironmentName': '<name>', 'computeResources': {'desiredvCpus': 0, 'instanceRole': 'arn:aws:iam::...', 'instanceTypes': ['optimal'], 'maxvCpus': 8, 'minvCpus': 0, 'securityGroupIds': ['\*\*\*\*\*\*'], 'subnets': ['\*\*\*\*\*\*\*'], 'tags': {'Environment': '<name>', 'Name': '<name>'}, 'type': 'EC2'}, 'ecsClusterArn': 'arn:aws:ecs:.....', 'serviceRole': 'arn:aws:iam::...', 'state': 'ENABLED', 'status': 'VALID', 'statusReason': 'ComputeEnvironment Healthy', 'type': 'MANAGED'}} |
### Authors
* Jon Meran (@jonmer85)
ansible community.aws.ec2_transit_gateway_info – Gather information about ec2 transit gateways in AWS community.aws.ec2\_transit\_gateway\_info – Gather information about ec2 transit gateways in AWS
================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_transit_gateway_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about ec2 transit gateways in AWS
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_DescribeTransitGateways.html> for 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 |
| **transit\_gateway\_ids** list / elements=string | | A list of transit gateway IDs to gather information for.
aliases: transit\_gateway\_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.
- name: Gather info about all transit gateways
community.aws.ec2_transit_gateway_info:
- name: Gather info about a particular transit gateway using filter transit gateway ID
community.aws.ec2_transit_gateway_info:
filters:
transit-gateway-id: tgw-02c42332e6b7da829
- name: Gather info about a particular transit gateway using multiple option filters
community.aws.ec2_transit_gateway_info:
filters:
options.dns-support: enable
options.vpn-ecmp-support: enable
- name: Gather info about multiple transit gateways using module param
community.aws.ec2_transit_gateway_info:
transit_gateway_ids:
- tgw-02c42332e6b7da829
- tgw-03c53443d5a8cb716
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **transit\_gateways** complex | on success | Transit gateways that match the provided filters. Each element consists of a dict with all the information related to that transit gateway. |
| | **creation\_time** string | always | The creation time. **Sample:** 2019-02-05T16:19:58+00:00 |
| | **description** string | always | The description of the transit gateway. **Sample:** A transit gateway |
| | **options** complex | always | A dictionary of the transit gateway options. |
| | | **amazon\_side\_asn** integer | always | A private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 for 32-bit ASNs. **Sample:** 64512 |
| | | **association\_default\_route\_table\_id** string | when present | The ID of the default association route table. **Sample:** rtb-11223344 |
| | | **auto\_accept\_shared\_attachments** string | always | Indicates whether attachment requests are automatically accepted. **Sample:** enable |
| | | **default\_route\_table\_association** string | always | Indicates whether resource attachments are automatically associated with the default association route table. **Sample:** disable |
| | | **default\_route\_table\_propagation** string | always | Indicates whether resource attachments automatically propagate routes to the default propagation route table. **Sample:** disable |
| | | **dns\_support** string | always | Indicates whether DNS support is enabled. **Sample:** enable |
| | | **propagation\_default\_route\_table\_id** string | when present | The ID of the default propagation route table. **Sample:** rtb-11223344 |
| | | **vpn\_ecmp\_support** string | always | Indicates whether Equal Cost Multipath Protocol support is enabled. **Sample:** enable |
| | **owner\_id** string | always | The AWS account number ID which owns the transit gateway. **Sample:** 1234567654323 |
| | **state** string | always | The state of the transit gateway. **Sample:** available |
| | **tags** dictionary | always | A dict of tags associated with the transit gateway. **Sample:** { "Name": "A sample TGW" } |
| | **transit\_gateway\_arn** string | always | The Amazon Resource Name (ARN) of the transit gateway. **Sample:** arn:aws:ec2:us-west-2:1234567654323:transit-gateway/tgw-02c42332e6b7da829 |
| | **transit\_gateway\_id** string | always | The ID of the transit gateway. **Sample:** tgw-02c42332e6b7da829 |
### Authors
* Bob Boldin (@BobBoldin)
| programming_docs |
ansible community.aws.aws_eks_cluster – Manage Elastic Kubernetes Service Clusters community.aws.aws\_eks\_cluster – Manage Elastic Kubernetes Service Clusters
============================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_eks_cluster`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Elastic Kubernetes Service Clusters
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 |
| **name** string / required | | Name of EKS cluster |
| **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 | | ARN of IAM role used by the EKS cluster |
| **security\_groups** list / elements=string | | list of security group names or IDs |
| **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** ←
| desired state of the EKS cluster |
| **subnets** list / elements=string | | list of subnet IDs for the Kubernetes cluster |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **version** string | | Kubernetes version - defaults to latest |
| **wait** boolean | **Choices:*** **no** ←
* yes
| Specifies whether the module waits until the cluster is active or deleted before moving on. It takes "usually less than 10 minutes" per AWS documentation. |
| **wait\_timeout** integer | **Default:**1200 | The duration in seconds to wait for the cluster to become active. Defaults to 1200 seconds (20 minutes). |
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 an EKS cluster
community.aws.aws_eks_cluster:
name: my_cluster
version: 1.14
role_arn: my_eks_role
subnets:
- subnet-aaaa1111
security_groups:
- my_eks_sg
- sg-abcd1234
register: caller_facts
- name: Remove an EKS cluster
community.aws.aws_eks_cluster:
name: my_cluster
wait: yes
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 |
| --- | --- | --- |
| **arn** string | when state is present | ARN of the EKS cluster **Sample:** arn:aws:eks:us-west-2:111111111111:cluster/my-eks-cluster |
| **certificate\_authority** complex | after creation | Dictionary containing Certificate Authority Data for cluster |
| | **data** string | when the cluster has been created and is active | Base-64 encoded Certificate Authority Data for cluster |
| **created\_at** string | when state is present | Cluster creation date and time **Sample:** 2018-06-06T11:56:56.242000+00:00 |
| **endpoint** string | when the cluster has been created and is active | Kubernetes API server endpoint **Sample:** https://API\_SERVER\_ENDPOINT.yl4.us-west-2.eks.amazonaws.com |
| **name** string | when state is present | EKS cluster name **Sample:** my-eks-cluster |
| **resources\_vpc\_config** complex | when state is present | VPC configuration of the cluster |
| | **security\_group\_ids** list / elements=string | always | List of security group IDs **Sample:** ['sg-abcd1234', 'sg-aaaa1111'] |
| | **subnet\_ids** list / elements=string | always | List of subnet IDs **Sample:** ['subnet-abcdef12', 'subnet-345678ab', 'subnet-cdef1234'] |
| | **vpc\_id** string | always | VPC id **Sample:** vpc-a1b2c3d4 |
| **role\_arn** string | when state is present | ARN of the IAM role used by the cluster **Sample:** arn:aws:iam::111111111111:role/aws\_eks\_cluster\_role |
| **status** string | when state is present | status of the EKS cluster **Sample:** ['CREATING', 'ACTIVE'] |
| **version** string | when state is present | Kubernetes version of the cluster **Sample:** 1.10 |
### Authors
* Will Thames (@willthames)
ansible community.aws.aws_s3_bucket_info – lists S3 buckets in AWS community.aws.aws\_s3\_bucket\_info – lists S3 buckets in AWS
=============================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_s3_bucket_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Lists S3 buckets and details about those buckets.
* This module was called `aws_s3_bucket_facts` before Ansible 2.9, returning `ansible_facts`. Note that the [community.aws.aws\_s3\_bucket\_info](#ansible-collections-community-aws-aws-s3-bucket-info-module) module no longer returns `ansible_facts`!
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3 >= 1.4.4
* 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\_facts** dictionary added in 1.4.0 of community.aws | | Retrieve requested S3 bucket detailed information Each bucket\_X option executes one API call, hence many options being set to `true` will cause slower module execution. You can limit buckets by using the *name* or *name\_filter* option. |
| | **bucket\_accelerate\_configuration** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 accelerate configuration. |
| | **bucket\_acl** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 bucket ACLs. |
| | **bucket\_cors** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 bucket CORS configuration. |
| | **bucket\_encryption** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 bucket encryption. |
| | **bucket\_lifecycle\_configuration** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 bucket lifecycle configuration. |
| | **bucket\_location** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 bucket location. |
| | **bucket\_logging** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 bucket logging. |
| | **bucket\_notification\_configuration** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 bucket notification configuration. |
| | **bucket\_ownership\_controls** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 ownership controls. |
| | **bucket\_policy** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 bucket policy. |
| | **bucket\_policy\_status** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 bucket policy status. |
| | **bucket\_replication** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 bucket replication. |
| | **bucket\_request\_payment** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 bucket request payment. |
| | **bucket\_tagging** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 bucket tagging. |
| | **bucket\_website** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 bucket website. |
| | **public\_access\_block** boolean | **Choices:*** **no** ←
* yes
| Retrive S3 bucket public access block. |
| **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 |
| **name** string added in 1.4.0 of community.aws | **Default:**"" | Name of bucket to query. |
| **name\_filter** string added in 1.4.0 of community.aws | **Default:**"" | Limits buckets to only buckets who's name contain the string in *name\_filter*. |
| **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 |
| **transform\_location** boolean added in 1.4.0 of community.aws | **Choices:*** **no** ←
* yes
| S3 bucket location for default us-east-1 is normally reported as `null`. Setting this option to `true` will return `us-east-1` instead. Affects only queries with *bucket\_facts=true* and *bucket\_location=true*. |
| **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.
# Note: Only AWS S3 is currently supported
# Lists all s3 buckets
- community.aws.aws_s3_bucket_info:
register: result
# Retrieve detailed bucket information
- community.aws.aws_s3_bucket_info:
# Show only buckets with name matching
name_filter: your.testing
# Choose facts to retrieve
bucket_facts:
# bucket_accelerate_configuration: true
bucket_acl: true
bucket_cors: true
bucket_encryption: true
# bucket_lifecycle_configuration: true
bucket_location: true
# bucket_logging: true
# bucket_notification_configuration: true
# bucket_ownership_controls: true
# bucket_policy: true
# bucket_policy_status: true
# bucket_replication: true
# bucket_request_payment: true
# bucket_tagging: true
# bucket_website: true
# public_access_block: true
transform_location: true
register: result
# Print out result
- name: List buckets
ansible.builtin.debug:
msg: "{{ result['buckets'] }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **bucket\_list** complex | always | List of buckets |
| | **bucket\_acl** complex | when *bucket\_facts=true* and *bucket\_acl=true* | Bucket ACL configuration. |
| | | **Grants** list / elements=string | success | List of ACL grants. |
| | | **Owner** complex | success | Bucket owner information. |
| | | | **DisplayName** string | always | Bucket owner user display name. **Sample:** username |
| | | | **ID** string | always | Bucket owner user ID. **Sample:** 123894e509349etc |
| | **bucket\_cors** complex | when *bucket\_facts=true* and *bucket\_cors=true* | Bucket CORS configuration. |
| | | **CORSRules** list / elements=string | when CORS rules are defined for the bucket | Bucket CORS configuration. |
| | **bucket\_encryption** complex | when *bucket\_facts=true* and *bucket\_encryption=true* | Bucket encryption configuration. |
| | | **ServerSideEncryptionConfiguration** complex | when encryption is enabled on the bucket | ServerSideEncryptionConfiguration configuration. |
| | | | **Rules** list / elements=string | when encryption is enabled on the bucket | List of applied encryptio rules. **Sample:** {'ApplyServerSideEncryptionByDefault': {'SSEAlgorithm': 'AES256'}, 'BucketKeyEnabled': False} |
| | **bucket\_lifecycle\_configuration** complex | when *bucket\_facts=true* and *bucket\_lifecycle\_configuration=true* | Bucket lifecycle configuration settings. |
| | | **Rules** list / elements=string | when lifecycle configuration is present | List of lifecycle management rules. **Sample:** [{'ID': 'example-rule', 'Status': 'Enabled'}] |
| | **bucket\_location** complex | when *bucket\_facts=true* and *bucket\_location=true* | Bucket location. |
| | | **LocationConstraint** string | always | AWS region. **Sample:** us-east-2 |
| | **bucket\_logging** complex | when *bucket\_facts=true* and *bucket\_logging=true* | Server access logging configuration. |
| | | **LoggingEnabled** complex | when server access logging is defined for the bucket | Server access logging configuration. |
| | | | **TargetBucket** string | always | Target bucket name. **Sample:** logging-bucket-name |
| | | | **TargetPrefix** string | always | Prefix in target bucket. |
| | **bucket\_name\_filter** string | when *name\_filter* is defined | String used to limit buckets. See *name\_filter*. **Sample:** filter-by-this-string |
| | **bucket\_notification\_configuration** complex | when *bucket\_facts=true* and *bucket\_notification\_configuration=true* | Bucket notification settings. |
| | | **TopicConfigurations** list / elements=string | when at least one notification is configured | List of notification events configurations. |
| | **bucket\_ownership\_controls** complex | when *bucket\_facts=true* and *bucket\_ownership\_controls=true* | Preffered object ownership settings. |
| | | **OwnershipControls** complex | when ownership controls are defined for the bucket | Object ownership settings. |
| | | | **Rules** list / elements=string | when ownership rule is defined | List of ownership rules. **Sample:** [{'ObjectOwnership:': 'ObjectWriter'}] |
| | **bucket\_policy** string | when *bucket\_facts=true* and *bucket\_policy=true* | Bucket policy contents. **Sample:** {"Version":"2012-10-17","Statement":[{"Sid":"AddCannedAcl","Effect":"Allow",..}}]} |
| | **bucket\_policy\_status** complex | when *bucket\_facts=true* and *bucket\_policy\_status=true* | Status of bucket policy. |
| | | **PolicyStatus** complex | when bucket policy is present | Status of bucket policy. |
| | | | **IsPublic** boolean | when bucket policy is present | Report bucket policy public status. **Sample:** True |
| | **bucket\_replication** complex | when *bucket\_facts=true* and *bucket\_replication=true* | Replication configuration settings. |
| | | **Role** string | when replication rule is defined | IAM role used for replication. **Sample:** arn:aws:iam::123:role/example-role |
| | | **Rules** list / elements=string | when replication rule is defined | List of replication rules. **Sample:** [{'Filter': '{}', 'ID': 'rule-1'}] |
| | **bucket\_request\_payment** complex | when *bucket\_facts=true* and *bucket\_request\_payment=true* | Requester pays setting. |
| | | **Payer** string | always | Current payer. **Sample:** BucketOwner |
| | **bucket\_tagging** dictionary | when *bucket\_facts=true* and *bucket\_tagging=true* | Bucket tags. **Sample:** {'Tag1': 'Value1', 'Tag2': 'Value2'} |
| | **bucket\_website** complex | when *bucket\_facts=true* and *bucket\_website=true* | Static website hosting. |
| | | **ErrorDocument** dictionary | when static website hosting is enabled | Object serving as HTTP error page. **Sample:** {'Key': 'error.html'} |
| | | **IndexDocument** dictionary | when static website hosting is enabled | Object serving as HTTP index page. **Sample:** {'Suffix': 'error.html'} |
| | | **RedirectAllRequestsTo** complex | when redirect requests is configured | Website redict settings. |
| | | | **HostName** string | always | Hostname to redirect. **Sample:** www.example.com |
| | | | **Protocol** string | always | Protocol used for redirect. **Sample:** https |
| | **creation\_date** string | always | Bucket creation date timestamp. **Sample:** 2021-01-21T12:44:10+00:00 |
| | **name** string | always | Bucket name. **Sample:** a-testing-bucket-name |
| | **public\_access\_block** complex | when *bucket\_facts=true* and *public\_access\_block=true* | Bucket public access block configuration. |
| | | **PublicAccessBlockConfiguration** complex | when PublicAccessBlockConfiguration is defined for the bucket | PublicAccessBlockConfiguration data. |
| | | | **BlockPublicAcls** boolean | success | BlockPublicAcls setting value. **Sample:** True |
| | | | **BlockPublicPolicy** boolean | success | BlockPublicPolicy setting value. **Sample:** True |
| | | | **IgnorePublicAcls** boolean | success | IgnorePublicAcls setting value. **Sample:** True |
| | | | **RestrictPublicBuckets** boolean | success | RestrictPublicBuckets setting value. **Sample:** True |
### Authors
* Gerben Geijteman (@hyperized)
| programming_docs |
ansible community.aws.aws_glue_connection – Manage an AWS Glue connection community.aws.aws\_glue\_connection – Manage an AWS Glue connection
===================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_glue_connection`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage an AWS Glue connection. See <https://aws.amazon.com/glue/> for details.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **availability\_zone** string added in 1.5.0 of community.aws | | Availability Zone used by the connection Required when *connection\_type=NETWORK*. |
| **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 |
| **catalog\_id** string | | The ID of the Data Catalog in which to create the connection. If none is supplied, the AWS account ID is used by default. |
| **connection\_properties** dictionary | | A dict of key-value pairs used as parameters for this connection. Required when *state=present*. |
| **connection\_type** string | **Choices:*** CUSTOM
* **JDBC** ←
* KAFKA
* MARKETPLACE
* MONGODB
* NETWORK
| The type of the connection. Currently, SFTP is not supported. |
| **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 | | The description of the connection. |
| **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 |
| **match\_criteria** list / elements=string | | A list of UTF-8 strings that specify the criteria that you can use in selecting this connection. |
| **name** string / required | | The name of the connection. |
| **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\_groups** list / elements=string | | A list of security groups to be used by the connection. Use either security group name or ID. Required when *connection\_type=NETWORK*. |
| **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:*** present
* absent
| Create or delete the AWS Glue connection. |
| **subnet\_id** string | | The subnet ID used by the connection. Required when *connection\_type=NETWORK*. |
| **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.
# Create an AWS Glue connection
- community.aws.aws_glue_connection:
name: my-glue-connection
connection_properties:
JDBC_CONNECTION_URL: jdbc:mysql://mydb:3306/databasename
USERNAME: my-username
PASSWORD: my-password
state: present
# Create an AWS Glue network connection
- community.aws.aws_glue_connection:
name: my-glue-network-connection
availability_zone: us-east-1a
connection_properties:
JDBC_ENFORCE_SSL: "false"
connection_type: NETWORK
description: Test connection
security_groups:
- sg-glue
subnet_id: subnet-123abc
state: present
# Delete an AWS Glue connection
- community.aws.aws_glue_connection:
name: my-glue-connection
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\_properties** dictionary | when state is present | A dict of key-value pairs used as parameters for this connection. **Sample:** {'JDBC\_CONNECTION\_URL': 'jdbc:mysql://mydb:3306/databasename', 'PASSWORD': 'y', 'USERNAME': 'x'} |
| **connection\_type** string | when state is present | The type of the connection. **Sample:** JDBC |
| **creation\_time** string | when state is present | The time this connection definition was created. **Sample:** 2018-04-21T05:19:58.326000+00:00 |
| **description** string | when state is present | Description of the job being defined. **Sample:** My first Glue job |
| **last\_updated\_time** string | when state is present | The last time this connection definition was updated. **Sample:** 2018-04-21T05:19:58.326000+00:00 |
| **match\_criteria** list / elements=string | when state is present | A list of criteria that can be used in selecting this connection. |
| **name** string | when state is present | The name of the connection definition. **Sample:** my-glue-connection |
| **physical\_connection\_requirements** dictionary | when state is present | A dict of physical connection requirements, such as VPC and SecurityGroup, needed for making this connection successfully. **Sample:** {'subnet-id': 'subnet-aabbccddee'} |
### Authors
* Rob White (@wimnat)
ansible community.aws.aws_config_rule – Manage AWS Config resources community.aws.aws\_config\_rule – Manage AWS Config resources
=============================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_config_rule`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Module manages AWS Config rules
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. |
| **description** string | | The description that you provide for the AWS Config rule. |
| **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 |
| **execution\_frequency** string | **Choices:*** One\_Hour
* Three\_Hours
* Six\_Hours
* Twelve\_Hours
* TwentyFour\_Hours
| The maximum frequency with which AWS Config runs evaluations for a rule. |
| **input\_parameters** string | | A string, in JSON format, that is passed to the AWS Config rule Lambda function. |
| **name** string / required | | The name of the AWS Config resource. |
| **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 |
| **scope** dictionary | | Defines which resources can trigger an evaluation for the rule. |
| | **compliance\_id** string | | The ID of the only AWS resource that you want to trigger an evaluation for the rule. If you specify a resource ID, you must specify one resource type for *compliance\_types*. |
| | **compliance\_types** string | | The resource types of only those AWS resources that you want to trigger an evaluation for the rule. You can only specify one type if you also specify a resource ID for *compliance\_id*. |
| | **tag\_key** string | | The tag key that is applied to only those AWS resources that you want to trigger an evaluation for the rule. |
| | **tag\_value** string | | The tag value applied to only those AWS resources that you want to trigger an evaluation for the rule. If you specify a value for *tag\_value*, you must also specify a value for *tag\_key*. |
| **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** dictionary / required | | Provides the rule owner (AWS or customer), the rule identifier, and the notifications that cause the function to evaluate your AWS resources. |
| | **details** string | | Provides the source and type of the event that causes AWS Config to evaluate your AWS resources. This parameter expects a list of dictionaries. Each dictionary expects the following key/value pairs. Key `EventSource` The source of the event, such as an AWS service, that triggers AWS Config to evaluate your AWS resources. Key `MessageType` The type of notification that triggers AWS Config to run an evaluation for a rule. Key `MaximumExecutionFrequency` The frequency at which you want AWS Config to run evaluations for a custom rule with a periodic trigger. |
| | **identifier** string | | The ID of the only AWS resource that you want to trigger an evaluation for the rule. If you specify a resource ID, you must specify one resource type for *compliance\_types*. |
| | **owner** string | | The resource types of only those AWS resources that you want to trigger an evaluation for the rule. You can only specify one type if you also specify a resource ID for *compliance\_id*. |
| **state** string | **Choices:*** **present** ←
* absent
| Whether the Config rule should be present or 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: Create Config Rule for AWS Config
community.aws.aws_config_rule:
name: test_config_rule
state: present
description: 'This AWS Config rule checks for public write access on S3 buckets'
scope:
compliance_types:
- 'AWS::S3::Bucket'
source:
owner: AWS
identifier: 'S3_BUCKET_PUBLIC_WRITE_PROHIBITED'
```
### Authors
* Aaron Smith (@slapula)
ansible community.aws.rds – create, delete, or modify Amazon rds instances, rds snapshots, and related facts community.aws.rds – create, delete, or modify Amazon rds instances, rds snapshots, and related facts
====================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.rds`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates, deletes, or modifies rds resources.
* When creating an instance it can be either a new instance or a read-only replica of an existing instance.
* This module has a dependency on python-boto >= 2.5 and will soon be deprecated.
* The ‘promote’ command requires boto >= 2.18.0. Certain features such as tags rely on boto.rds2 (boto >= 2.26.0).
* Please use boto3 based [community.aws.rds\_instance](rds_instance_module#ansible-collections-community-aws-rds-instance-module) instead.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **apply\_immediately** boolean | **Choices:*** **no** ←
* yes
| When *apply\_immediately=true*, the modifications will be applied as soon as possible rather than waiting for the next preferred maintenance window. Used only when *command=modify*. |
| **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 |
| **backup\_retention** string | | Number of days backups are retained. Set to 0 to disable backups. Default is 1 day. Valid range: 0-35. Used only when *command=create* or *command=modify*. |
| **backup\_window** string | | Backup window in format of `hh24:mi-hh24:mi`. (Example: `18:00-20:30`) Times are specified in UTC. If not specified then a random backup window is assigned. Used only when command=create or command=modify. |
| **character\_set\_name** string | | Associate the DB instance with a specified character set. Used with *command=create*. |
| **command** string / required | **Choices:*** create
* replicate
* delete
* facts
* modify
* promote
* snapshot
* reboot
* restore
| Specifies the action to take. The 'reboot' option is available starting at version 2.0. |
| **db\_engine** string | **Choices:*** mariadb
* MySQL
* oracle-se1
* oracle-se2
* oracle-se
* oracle-ee
* sqlserver-ee
* sqlserver-se
* sqlserver-ex
* sqlserver-web
* postgres
* aurora
| The type of database. Used only when *command=create*. mariadb was added in version 2.2. |
| **db\_name** string | | Name of a database to create within the instance. If not specified then no database is created. Used only when *command=create*. |
| **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 |
| **engine\_version** string | | Version number of the database engine to use. If not specified then the current Amazon RDS default engine version is used Used only when *command=create*. |
| **force\_failover** boolean | **Choices:*** **no** ←
* yes
| If enabled, the reboot is done using a MultiAZ failover. Used only when *command=reboot*. |
| **instance\_name** string | | Database instance identifier. Required except when using *command=facts* or *command=delete* on just a snapshot. |
| **instance\_type** string | | The instance type of the database. If not specified then the replica inherits the same instance type as the source instance. Required when *command=create*. Optional when *command=replicate*, *command=modify* or *command=restore*.
aliases: type |
| **iops** string | | Specifies the number of IOPS for the instance. Used only when *command=create* or *command=modify*. Must be an integer greater than 1000. |
| **license\_model** string | **Choices:*** license-included
* bring-your-own-license
* general-public-license
* postgresql-license
| The license model for this DB instance. Used only when *command=create* or *command=restore*. |
| **maint\_window** string | | Maintenance window in format of `ddd:hh24:mi-ddd:hh24:mi`. (Example: `Mon:22:00-Mon:23:15`) Times are specified in UTC. If not specified then a random maintenance window is assigned. Used only when *command=create* or *command=modify*. |
| **multi\_zone** boolean | **Choices:*** no
* yes
| Specifies if this is a Multi-availability-zone deployment. Can not be used in conjunction with *zone* parameter. Used only when *command=create* or *command=modify*. |
| **new\_instance\_name** string | | Name to rename an instance to. Used only when *command=modify*. |
| **option\_group** string | | The name of the option group to use. If not specified then the default option group is used. Used only when *command=create*. |
| **parameter\_group** string | | Name of the DB parameter group to associate with this instance. If omitted then the RDS default DBParameterGroup will be used. Used only when *command=create* or *command=modify*. |
| **password** string | | Password for the master database username. Used only when *command=create* or *command=modify*. |
| **port** integer | | Port number that the DB instance uses for connections. Used only when *command=create* or *command=replicate*. Defaults to the standard ports for each *db\_engine*: `3306` for MySQL and MariaDB, `1521` for Oracle `1433` for SQL Server, `5432` for PostgreSQL. |
| **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 |
| **publicly\_accessible** string | | Explicitly set whether the resource should be publicly accessible or not. Used with *command=create*, *command=replicate*. Requires boto >= 2.26.0 |
| **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\_groups** string | | Comma separated list of one or more security groups. Used only when *command=create* or *command=modify*. |
| **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 |
| **size** string | | Size in gigabytes of the initial storage for the DB instance. Used only when *command=create* or *command=modify*. |
| **snapshot** string | | Name of snapshot to take. When *command=delete*, if no *snapshot* name is provided then no snapshot is taken. When *command=delete*, if no *instance\_name* is provided the snapshot is deleted. Used with *command=facts*, *command=delete* or *command=snapshot*. |
| **source\_instance** string | | Name of the database to replicate. Used only when *command=replicate*. |
| **subnet** string | | VPC subnet group. If specified then a VPC instance is created. Used only when *command=create*. |
| **tags** dictionary | | tags dict to apply to a resource. Used with *command=create*, *command=replicate*, *command=restore*. Requires boto >= 2.26.0 |
| **upgrade** boolean | **Choices:*** **no** ←
* yes
| Indicates that minor version upgrades should be applied automatically. Used only when *command=create* or *command=modify* or *command=restore* or *command=replicate*. |
| **username** string | | Master database username. Used only when *command=create*. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **vpc\_security\_groups** list / elements=string | | Comma separated list of one or more vpc security group ids. Also requires *subnet* to be specified. Used only when *command=create* or *command=modify*. |
| **wait** boolean | **Choices:*** **no** ←
* yes
| When *command=create*, replicate, modify or restore then wait for the database to enter the 'available' state. When *command=delete*, wait for the database to be terminated. |
| **wait\_timeout** integer | **Default:**300 | How long before wait gives up, in seconds. Used when *wait=true*. |
| **zone** string | | availability zone in which to launch the instance. Used only when *command=create*, *command=replicate* or *command=restore*. Can not be used in conjunction with *multi\_zone* parameter.
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
--------
```
- name: Basic mysql provisioning example
community.aws.rds:
command: create
instance_name: new-database
db_engine: MySQL
size: 10
instance_type: db.m1.small
username: mysql_admin
password: 1nsecure
tags:
Environment: testing
Application: cms
- name: Create a read-only replica and wait for it to become available
community.aws.rds:
command: replicate
instance_name: new-database-replica
source_instance: new_database
wait: yes
wait_timeout: 600
- name: Delete an instance, but create a snapshot before doing so
community.aws.rds:
command: delete
instance_name: new-database
snapshot: new_database_snapshot
- name: Get facts about an instance
community.aws.rds:
command: facts
instance_name: new-database
register: new_database_facts
- name: Rename an instance and wait for the change to take effect
community.aws.rds:
command: modify
instance_name: new-database
new_instance_name: renamed-database
wait: yes
- name: Reboot an instance and wait for it to become available again
community.aws.rds:
command: reboot
instance_name: database
wait: yes
# Restore a Postgres db instance from a snapshot, wait for it to become available again, and
# then modify it to add your security group. Also, display the new endpoint.
# Note that the "publicly_accessible" option is allowed here just as it is in the AWS CLI
- community.aws.rds:
command: restore
snapshot: mypostgres-snapshot
instance_name: MyNewInstanceName
region: us-west-2
zone: us-west-2b
subnet: default-vpc-xx441xxx
publicly_accessible: yes
wait: yes
wait_timeout: 600
tags:
Name: pg1_test_name_tag
register: rds
- community.aws.rds:
command: modify
instance_name: MyNewInstanceName
region: us-west-2
vpc_security_groups: sg-xxx945xx
- ansible.builtin.debug:
msg: "The new db endpoint is {{ rds.instance.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 |
| --- | --- | --- |
| **instance** complex | always | the rds instance |
| | **allocated\_storage** string | when RDS instance exists | the allocated storage size in gigabytes (GB) **Sample:** 100 |
| | **auto\_minor\_version\_upgrade** boolean | when RDS instance exists | indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window **Sample:** true |
| | **backup\_window** string | when RDS instance exists and automated backups are enabled | the daily time range during which automated backups are created if automated backups are enabled **Sample:** 03:00-03:30 |
| | **character\_set\_name** string | when RDS instance exists | the name of the character set that this instance is associated with **Sample:** AL32UTF8 |
| | **db\_name** string | when RDS instance exists | the name of the database to create when the DB instance is created **Sample:** ASERTG |
| | **db\_subnet\_groups** complex | when RDS instance exists | information on the subnet group associated with this RDS instance |
| | | **description** string | when RDS instance exists | the subnet group associated with the DB instance **Sample:** Subnets for the UAT RDS SQL DB Instance |
| | | **name** string | when RDS instance exists | the name of the DB subnet group **Sample:** samplesubnetgrouprds-j6paiqkxqp4z |
| | | **status** string | when RDS instance exists | the status of the DB subnet group **Sample:** complete |
| | | **subnets** complex | when RDS instance exists | the description of the DB subnet group |
| | | | **availability\_zone** complex | when RDS instance exists | subnet availability zone information |
| | | | | **name** string | when RDS instance exists | availability zone **Sample:** eu-west-1b |
| | | | | **provisioned\_iops\_capable** boolean | when RDS instance exists | whether provisioned iops are available in AZ subnet **Sample:** false |
| | | | **identifier** string | when RDS instance exists | the identifier of the subnet **Sample:** subnet-3fdba63e |
| | | | **status** string | when RDS instance exists | the status of the subnet **Sample:** active |
| | **endpoint** string | when RDS instance exists | the endpoint uri of the database instance **Sample:** my-ansible-database.asdfaosdgih.us-east-1.rds.amazonaws.com |
| | **engine** string | when RDS instance exists | the name of the database engine **Sample:** oracle-se |
| | **engine\_version** string | when RDS instance exists | the version of the database engine **Sample:** 11.2.0.4.v6 |
| | **latest\_restorable\_time** string | when RDS instance exists | the latest time to which a database can be restored with point-in-time restore **Sample:** 1489707802.0 |
| | **license\_model** string | when RDS instance exists | the license model information **Sample:** bring-your-own-license |
| | **option\_groups** complex | when RDS instance exists | the list of option group memberships for this RDS instance |
| | | **option\_group\_name** string | when RDS instance exists | the option group name for this RDS instance **Sample:** default:oracle-se-11-2 |
| | | **status** string | when RDS instance exists | the status of the RDS instance's option group membership **Sample:** in-sync |
| | **parameter\_groups** complex | when RDS instance exists and parameter groups are defined | the list of DB parameter groups applied to this RDS instance |
| | | **parameter\_apply\_status** string | when RDS instance exists | the status of parameter updates **Sample:** in-sync |
| | | **parameter\_group\_name** string | when RDS instance exists | the name of the DP parameter group **Sample:** testawsrpprodb01spfile-1ujg7nrs7sgyz |
| | **pending\_modified\_values** complex | when RDS instance exists | a dictionary of changes to the RDS instance that are pending |
| | | **allocated\_storage** string | when RDS instance exists | the new allocated storage size for this RDS instance that will be applied or is in progress **Sample:** null |
| | | **backup\_retention\_period** string | when RDS instance exists | the pending number of days for which automated backups are retained **Sample:** null |
| | | **db\_instance\_class** string | when RDS instance exists | the new DB instance class for this RDS instance that will be applied or is in progress **Sample:** null |
| | | **db\_instance\_identifier** string | when RDS instance exists | the new DB instance identifier this RDS instance that will be applied or is in progress **Sample:** null |
| | | **engine\_version** string | when RDS instance exists | indicates the database engine version **Sample:** null |
| | | **iops** string | when RDS instance exists | the new provisioned IOPS value for this RDS instance that will be applied or is being applied **Sample:** null |
| | | **master\_user\_password** string | when RDS instance exists | the pending or in-progress change of the master credentials for this RDS instance **Sample:** null |
| | | **multi\_az** string | when RDS instance exists | indicates that the single-AZ RDS instance is to change to a multi-AZ deployment **Sample:** null |
| | | **port** string | when RDS instance exists | specifies the pending port for this RDS instance **Sample:** null |
| | **port** integer | when RDS instance exists | the listening port of the database instance **Sample:** 3306 |
| | **publicly\_accessible** boolean | when RDS instance exists | the accessibility options for the DB instance **Sample:** true |
| | **read\_replica\_source\_dbinstance\_identifier** string | when read replica RDS instance exists | the identifier of the source DB instance if this RDS instance is a read replica **Sample:** null |
| | **secondary\_availability\_zone** string | when RDS instance exists and is multi-AZ | the name of the secondary AZ for a DB instance with multi-AZ support **Sample:** eu-west-1b |
### Authors
* Bruce Pennypacker (@bpennypacker)
* Will Thames (@willthames)
| programming_docs |
ansible community.aws.s3_metrics_configuration – Manage s3 bucket metrics configuration in AWS community.aws.s3\_metrics\_configuration – Manage s3 bucket metrics configuration in AWS
========================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.s3_metrics_configuration`.
New in version 1.3.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Manage s3 bucket metrics configuration in AWS which allows to get the CloudWatch request metrics for the objects in a bucket
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 |
| **bucket\_name** string / required | | Name of the s3 bucket |
| **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 |
| **filter\_prefix** string | | A prefix used when evaluating a metrics filter |
| **filter\_tags** dictionary | | A dictionary of one or more tags used when evaluating a metrics filter
aliases: filter\_tag |
| **id** string / required | | The ID used to identify the metrics configuration |
| **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 metrics configuration |
| **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 modules manages single metrics configuration, the s3 bucket might have up to 1,000 metrics configurations
* To request metrics for the entire bucket, create a metrics configuration without a filter
* Metrics configurations are necessary only to enable request metric, bucket-level daily storage metrics are always turned on
* 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 metrics configuration that enables metrics for an entire bucket
community.aws.s3_metrics_configuration:
bucket_name: my-bucket
id: EntireBucket
state: present
- name: Put a metrics configuration that enables metrics for objects starting with a prefix
community.aws.s3_metrics_configuration:
bucket_name: my-bucket
id: Assets
filter_prefix: assets
state: present
- name: Put a metrics configuration that enables metrics for objects with specific tag
community.aws.s3_metrics_configuration:
bucket_name: my-bucket
id: Assets
filter_tag:
kind: asset
state: present
- name: Put a metrics configuration that enables metrics for objects that start with a particular prefix and have specific tags applied
community.aws.s3_metrics_configuration:
bucket_name: my-bucket
id: ImportantBlueDocuments
filter_prefix: documents
filter_tags:
priority: high
class: blue
state: present
- name: Delete metrics configuration
community.aws.s3_metrics_configuration:
bucket_name: my-bucket
id: EntireBucket
state: absent
```
### Authors
* Dmytro Vorotyntsev (@vorotech)
ansible community.aws.aws_config_recorder – Manage AWS Config Recorders community.aws.aws\_config\_recorder – Manage AWS Config Recorders
=================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_config_recorder`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Module manages AWS Config configuration recorder settings.
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 |
| **name** string / required | | The name of the AWS Config resource. |
| **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 |
| **recording\_group** dictionary | | Specifies the types of AWS resources for which AWS Config records configuration changes. Required when *state=present*
|
| | **all\_supported** string | | Specifies whether AWS Config records configuration changes for every supported type of regional resource. If *all\_supported=true*, when AWS Config adds support for a new type of regional resource, it starts recording resources of that type automatically. If *all\_supported=true*, you cannot enumerate a list of *resource\_types*. |
| | **include\_global\_types** string | | Specifies whether AWS Config includes all supported types of global resources (for example, IAM resources) with the resources that it records. The configuration details for any global resource are the same in all regions. To prevent duplicate configuration items, you should consider customizing AWS Config in only one region to record global resources. If you set *include\_global\_types=true*, you must also set *all\_supported=true*. If you set *include\_global\_types=true*, when AWS Config adds support for a new type of global resource, it starts recording resources of that type automatically. |
| | **resource\_types** string | | A list that specifies the types of AWS resources for which AWS Config records configuration changes (for example, `AWS::EC2::Instance` or `AWS::CloudTrail::Trail`). Before you can set this option, you must set *all\_supported=false*. |
| **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 | | Amazon Resource Name (ARN) of the IAM role used to describe the AWS resources associated with the account. Required when *state=present*. |
| **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
| Whether the Config rule should be present or 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: Create Configuration Recorder for AWS Config
community.aws.aws_config_recorder:
name: test_configuration_recorder
state: present
role_arn: 'arn:aws:iam::123456789012:role/AwsConfigRecorder'
recording_group:
all_supported: true
include_global_types: true
```
### Authors
* Aaron Smith (@slapula)
ansible community.aws.ecs_taskdefinition – register a task definition in ecs community.aws.ecs\_taskdefinition – register a task definition in ecs
=====================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ecs_taskdefinition`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Registers or deregisters task definitions in the Amazon Web Services (AWS) EC2 Container Service (ECS).
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* json
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **arn** string | | The ARN of the task description to delete. |
| **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 |
| **containers** list / elements=dictionary / required | | A list of containers definitions. See <https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html> for a complete list of parameters. |
| | **command** list / elements=string | | The command that is passed to the container. |
| | **cpu** integer | | The number of cpu units reserved for the container. |
| | **dependsOn** list / elements=dictionary | | The dependencies defined for container startup and shutdown. When a dependency is defined for container startup, for container shutdown it is reversed. |
| | | **condition** string / required | **Choices:*** start
* complete
* success
* healthy
| The dependency condition of the container. |
| | | **containerName** string / required | | The name of a container. |
| | **disableNetworking** boolean | **Choices:*** no
* yes
| When this parameter is `True`, networking is disabled within the container. |
| | **dnsSearchDomains** list / elements=string | | A list of DNS search domains that are presented to the container. This parameter is not supported for Windows containers. |
| | **dnsServers** list / elements=string | | A list of DNS servers that are presented to the container. This parameter is not supported for Windows containers. |
| | **dockerLabels** dictionary | | A key/value map of labels to add to the container. |
| | **dockerSecurityOptions** list / elements=string | | A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems. This parameter is not supported for Windows containers. |
| | **entryPoint** string | | The entry point that is passed to the container. |
| | **environment** list / elements=dictionary | | The environment variables to pass to a container. |
| | | **name** string | | The name of the key-value pair. |
| | | **value** string | | The value of the key-value pair. |
| | **environmentFiles** list / elements=dictionary | | A list of files containing the environment variables to pass to a container. |
| | | **type** string | | The file type to use. The only supported value is `s3`. |
| | | **value** string | | The Amazon Resource Name (ARN) of the Amazon S3 object containing the environment variable file. |
| | **essential** boolean | **Choices:*** no
* yes
| If *essential=True*, and the container fails or stops for any reason, all other containers that are part of the task are stopped. |
| | **extraHosts** list / elements=dictionary | | A list of hostnames and IP address mappings to append to the /etc/hosts file on the container. This parameter is not supported for Windows containers or tasks that use *network\_mode=awsvpc*. |
| | | **hostname** string | | The hostname to use in the /etc/hosts entry. |
| | | **ipAddress** string | | The IP address to use in the /etc/hosts entry. |
| | **healthCheck** dictionary | | The health check command and associated configuration parameters for the container. |
| | **hostname** string | | The hostname to use for your container. This parameter is not supported if *network\_mode=awsvpc*. |
| | **image** string | | The image used to start a container. |
| | **interactive** boolean | **Choices:*** no
* yes
| When *interactive=True*, it allows to deploy containerized applications that require stdin or a tty to be allocated. |
| | **links** list / elements=string | | Allows containers to communicate with each other without the need for port mappings. This parameter is only supported if *network\_mode=bridge*. |
| | **linuxParameters** list / elements=string | | Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. |
| | | **capabilities** dictionary | | The Linux capabilities for the container that are added to or dropped from the default configuration provided by Docker. |
| | | | **add** list / elements=string | **Choices:*** ALL
* AUDIT\_CONTROL
* AUDIT\_WRITE
* BLOCK\_SUSPEND
* CHOWN
* DAC\_OVERRIDE
* DAC\_READ\_SEARCH
* FOWNER
* FSETID
* IPC\_LOCK
* IPC\_OWNER
* KILL
* LEASE
* LINUX\_IMMUTABLE
* MAC\_ADMIN
* MAC\_OVERRIDE
* MKNOD
* NET\_ADMIN
* NET\_BIND\_SERVICE
* NET\_BROADCAST
* NET\_RAW
* SETFCAP
* SETGID
* SETPCAP
* SETUID
* SYS\_ADMIN
* SYS\_BOOT
* SYS\_CHROOT
* SYS\_MODULE
* SYS\_NICE
* SYS\_PACCT
* SYS\_PTRACE
* SYS\_RAWIO
* SYS\_RESOURCE
* SYS\_TIME
* SYS\_TTY\_CONFIG
* SYSLOG
* WAKE\_ALARM
| The Linux capabilities for the container that have been added to the default configuration provided by Docker. If *launch\_type=FARGATE*, this parameter is not supported. |
| | | | **drop** list / elements=string | **Choices:*** ALL
* AUDIT\_CONTROL
* AUDIT\_WRITE
* BLOCK\_SUSPEND
* CHOWN
* DAC\_OVERRIDE
* DAC\_READ\_SEARCH
* FOWNER
* FSETID
* IPC\_LOCK
* IPC\_OWNER
* KILL
* LEASE
* LINUX\_IMMUTABLE
* MAC\_ADMIN
* MAC\_OVERRIDE
* MKNOD
* NET\_ADMIN
* NET\_BIND\_SERVICE
* NET\_BROADCAST
* NET\_RAW
* SETFCAP
* SETGID
* SETPCAP
* SETUID
* SYS\_ADMIN
* SYS\_BOOT
* SYS\_CHROOT
* SYS\_MODULE
* SYS\_NICE
* SYS\_PACCT
* SYS\_PTRACE
* SYS\_RAWIO
* SYS\_RESOURCE
* SYS\_TIME
* SYS\_TTY\_CONFIG
* SYSLOG
* WAKE\_ALARM
| The Linux capabilities for the container that have been removed from the default configuration provided by Docker. |
| | | **devices** list / elements=dictionary | | Any host devices to expose to the container. If *launch\_type=FARGATE*, this parameter is not supported. |
| | | | **containerPath** string | | The path inside the container at which to expose the host device. |
| | | | **hostPath** string / required | | The path for the device on the host container instance. |
| | | | **permissions** list / elements=string | | The explicit permissions to provide to the container for the device. |
| | | **initProcessEnabled** boolean | **Choices:*** no
* yes
| Run an init process inside the container that forwards signals and reaps processes. |
| | | **maxSwap** integer | | The total amount of swap memory (in MiB) a container can use. If *launch\_type=FARGATE*, this parameter is not supported. |
| | | **sharedMemorySize** integer | | The value for the size (in MiB) of the /dev/shm volume. If *launch\_type=FARGATE*, this parameter is not supported. |
| | | **swappiness** integer | | This allows you to tune a container's memory swappiness behavior. If *launch\_type=FARGATE*, this parameter is not supported. |
| | | **tmpfs** list / elements=dictionary | | The container path, mount options, and size (in MiB) of the tmpfs mount. If *launch\_type=FARGATE*, this parameter is not supported. |
| | | | **containerPath** string / required | | The absolute file path where the tmpfs volume is to be mounted. |
| | | | **mountOptions** list / elements=string | **Choices:*** defaults
* ro
* rw
* suid
* nosuid
* dev
* nodev
* exec
* noexec
* sync
* async
* dirsync
* remount
* mand
* nomand
* atime
* noatime
* diratime
* nodiratime
* bind
* rbind
* unbindable
* runbindable
* private
* rprivate
* shared
* rshared
* slave
* rslave
* relatime
* norelatime
* strictatime
* nostrictatime
* mode
* uid
* gid
* nr\_inodes
* nr\_blocks
* mpol
| The list of tmpfs volume mount options. |
| | | | **size** integer / required | | The size (in MiB) of the tmpfs volume. |
| | **logConfiguration** dictionary | | The log configuration specification for the container. |
| | | **logDriver** string | | The log driver to use for the container. For tasks on AWS Fargate, the supported log drivers are `awslogs`, `splunk`, and `awsfirelens`. For tasks hosted on Amazon EC2 instances, the supported log drivers are `awslogs`, `fluentd`, `gelf`, `json-file`, `journald`, `logentries`, `syslog`, `splunk`, and `awsfirelens`. |
| | **memory** integer | | The amount (in MiB) of memory to present to the container. |
| | **memoryReservation** integer | | The soft limit (in MiB) of memory to reserve for the container. |
| | **mountPoints** list / elements=dictionary | | The mount points for data volumes in your container. |
| | | **containerPath** string | | The path on the container to mount the host volume at. |
| | | **readOnly** boolean | **Choices:*** **no** ←
* yes
| If this value is `True`, the container has read-only access to the volume. If this value is `False`, then the container can write to the volume. |
| | | **sourceVolume** string | | The name of the volume to mount. |
| | **name** string | | The name of a container. |
| | **options** string | | The configuration options to send to the log driver. |
| | **portMappings** list / elements=dictionary | | The list of port mappings for the container. |
| | | **containerPort** integer | | The port number on the container that is bound to the user-specified or automatically assigned host port. |
| | | **hostPort** integer | | The port number on the container instance to reserve for your container. |
| | | **protocol** string | **Choices:*** **tcp** ←
* udp
| The protocol used for the port mapping. |
| | **privileged** boolean | **Choices:*** no
* yes
| When this parameter is `True`, the container is given elevated privileges on the host container instance. |
| | **pseudoTerminal** boolean | **Choices:*** no
* yes
| When this parameter is `True`, a TTY is allocated. |
| | **readonlyRootFilesystem** boolean | **Choices:*** no
* yes
| When this parameter is `True`, the container is given read-only access to its root file system. |
| | **repositoryCredentials** dictionary | | The private repository authentication credentials to use. |
| | | **credentialsParameter** string / required | | The Amazon Resource Name (ARN) of the secret containing the private repository credentials. |
| | **resourceRequirements** list / elements=string | | The type and amount of a resource to assign to a container. The only supported resource is a `GPU`. |
| | **secretOptions** list / elements=dictionary | | The secrets to pass to the log configuration. |
| | | **name** string | | The name of the secret. |
| | | **valueFrom** string | | The secret to expose to the container. |
| | **secrets** list / elements=dictionary | | The secrets to pass to the container. |
| | | **name** string / required | | The value to set as the environment variable on the container. |
| | | **size** string / required | | The secret to expose to the container. |
| | **startTimeout** integer | | Time duration (in seconds) to wait before giving up on resolving dependencies for a container. |
| | **stopTimeout** integer | | Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. |
| | **systemControls** list / elements=string | | A list of namespaced kernel parameters to set in the container. |
| | **ulimits** list / elements=dictionary | | A list of ulimits to set in the container. This parameter is not supported for Windows containers. |
| | | **hardLimit** integer | | The hard limit for the ulimit type. |
| | | **name** string | | The type of the ulimit. |
| | | **softLimit** integer | | The soft limit for the ulimit type. |
| | **user** string | | The user to use inside the container. This parameter is not supported for Windows containers. |
| | **volumesFrom** list / elements=dictionary | | Data volumes to mount from another container. |
| | | **readOnly** boolean | **Choices:*** **no** ←
* yes
| If this value is `True`, the container has read-only access to the volume. If this value is `False`, then the container can write to the volume. |
| | | **sourceContainer** string | | The name of another container within the same task definition from which to mount volumes. |
| | **workingDirectory** string | | The working directory in which to run commands inside the container. |
| **cpu** string | | The number of cpu units used by the task. If *launch\_type=EC2*, this field is optional and any value can be used. If *launch\_type=FARGATE*, this field is required and you must use one of `256`, `512`, `1024`, `2048`, `4096`. |
| **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 |
| **execution\_role\_arn** string | | The Amazon Resource Name (ARN) of the task execution role that the Amazon ECS container agent and the Docker daemon can assume. |
| **family** string | | A Name that would be given to the task definition. |
| **force\_create** boolean | **Choices:*** **no** ←
* yes
| Always create new task definition. |
| **launch\_type** string | **Choices:*** EC2
* FARGATE
| The launch type on which to run your task. |
| **memory** string | | The amount (in MiB) of memory used by the task. If *launch\_type=EC2*, this field is optional and any value can be used. If *launch\_type=FARGATE*, this field is required and is limited by the CPU. |
| **network\_mode** string | **Choices:*** default
* **bridge** ←
* host
* none
* awsvpc
| The Docker networking mode to use for the containers in the task.
`awsvpc` mode was added in Ansible 2.5 Windows containers must use *network\_mode=default*, which will utilize docker NAT networking. Setting *network\_mode=default* for a Linux container will use `bridge` 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 |
| **revision** integer | | A revision number for the task definition. |
| **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:*** present
* absent
| State whether the task definition should exist or be deleted. |
| **task\_role\_arn** string | | The Amazon Resource Name (ARN) of the IAM role that containers in this task can assume. All containers in this task are granted the permissions that are specified in this role. |
| **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 names of volumes to be attached. |
| | **name** string / required | | The name of the volume. |
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: Create task definition
community.aws.ecs_taskdefinition:
containers:
- name: simple-app
cpu: 10
essential: true
image: "httpd:2.4"
memory: 300
mountPoints:
- containerPath: /usr/local/apache2/htdocs
sourceVolume: my-vol
portMappings:
- containerPort: 80
hostPort: 80
logConfiguration:
logDriver: awslogs
options:
awslogs-group: /ecs/test-cluster-taskdef
awslogs-region: us-west-2
awslogs-stream-prefix: ecs
- name: busybox
command:
- >
/bin/sh -c "while true; do echo '<html><head><title>Amazon ECS Sample App</title></head><body><div><h1>Amazon ECS Sample App</h1><h2>Congratulations!
</h2><p>Your application is now running on a container in Amazon ECS.</p>' > top; /bin/date > date ; echo '</div></body></html>' > bottom;
cat top date bottom > /usr/local/apache2/htdocs/index.html ; sleep 1; done"
cpu: 10
entryPoint:
- sh
- "-c"
essential: false
image: busybox
memory: 200
volumesFrom:
- sourceContainer: simple-app
volumes:
- name: my-vol
family: test-cluster-taskdef
state: present
register: task_output
- name: Create task definition
community.aws.ecs_taskdefinition:
family: nginx
containers:
- name: nginx
essential: true
image: "nginx"
portMappings:
- containerPort: 8080
hostPort: 8080
cpu: 512
memory: 1024
state: present
- name: Create task definition
community.aws.ecs_taskdefinition:
family: nginx
containers:
- name: nginx
essential: true
image: "nginx"
portMappings:
- containerPort: 8080
hostPort: 8080
launch_type: FARGATE
cpu: 512
memory: 1024
state: present
network_mode: awsvpc
- name: Create task definition
community.aws.ecs_taskdefinition:
family: nginx
containers:
- name: nginx
essential: true
image: "nginx"
portMappings:
- containerPort: 8080
hostPort: 8080
cpu: 512
memory: 1024
dependsOn:
- containerName: "simple-app"
condition: "start"
# Create Task Definition with Environment Variables and Secrets
- name: Create task definition
community.aws.ecs_taskdefinition:
family: nginx
containers:
- name: nginx
essential: true
image: "nginx"
environment:
- name: "PORT"
value: "8080"
secrets:
# For variables stored in Secrets Manager
- name: "NGINX_HOST"
valueFrom: "arn:aws:secretsmanager:us-west-2:123456789012:secret:nginx/NGINX_HOST"
# For variables stored in Parameter Store
- name: "API_KEY"
valueFrom: "arn:aws:ssm:us-west-2:123456789012:parameter/nginx/API_KEY"
launch_type: FARGATE
cpu: 512
memory: 1GB
state: present
network_mode: awsvpc
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **taskdefinition** dictionary | always | a reflection of the input parameters |
### Authors
* Mark Chance (@Java1Guy)
| programming_docs |
ansible community.aws.dms_replication_subnet_group – creates or destroys a data migration services subnet group community.aws.dms\_replication\_subnet\_group – creates or destroys a data migration services subnet group
==========================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.dms_replication_subnet_group`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Creates or destroys a data migration services subnet group.
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 / required | | The description for the subnet group. |
| **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 |
| **identifier** string / required | | The name for the replication subnet group. This value is stored as a lowercase string. Must contain no more than 255 alphanumeric characters, periods, spaces, underscores, or hyphens. Must not be "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 |
| **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
| State of the subnet group. |
| **subnet\_ids** list / elements=string / required | | A list containing the subnet ids for the replication subnet group, needs to be at least 2 items in the list. |
| **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
--------
```
- community.aws.dms_replication_subnet_group:
state: present
identifier: "dev-sngroup"
description: "Development Subnet Group asdasdas"
subnet_ids: ['subnet-id1','subnet-id2']
```
### Authors
* Rui Moreira (@ruimoreira)
ansible community.aws.iam – Manage IAM users, groups, roles and keys community.aws.iam – Manage IAM users, groups, roles and keys
============================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.iam`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for the management of IAM users, user API keys, groups, roles.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.6
* boto
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_key\_ids** list / elements=string | | A list of the keys that you want affected by the *access\_key\_state* parameter. |
| **access\_key\_state** string | **Choices:*** create
* remove
* active
* inactive
* Create
* Remove
* Active
* Inactive
| When type is user, it creates, removes, deactivates or activates a user's access key(s). Note that actions apply only to keys specified. |
| **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 |
| **groups** list / elements=string | | A list of groups the user should belong to. When *state=update*, will gracefully remove groups not listed. |
| **iam\_type** string / required | **Choices:*** user
* group
* role
| Type of IAM resource. |
| **key\_count** integer | **Default:**1 | When *access\_key\_state=create* it will ensure this quantity of keys are present. |
| **name** string / required | | Name of IAM resource to create or identify. |
| **new\_name** string | | When *state=update*, will replace *name* with *new\_name* on IAM resource. |
| **new\_path** string | | When *state=update*, will replace the path with new\_path on the IAM resource. |
| **password** string | | When *type=user* and either *state=present* or *state=update*, define the users login password. Note that this will always return 'changed'. |
| **path** string | **Default:**"/" | When creating or updating, specify the desired path of the resource. If *state=present*, it will replace the current path to match what is passed in when they do not match. |
| **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 / required | **Choices:*** present
* absent
* update
| Whether to create, delete or update the IAM resource. Note, roles cannot be updated. |
| **trust\_policy** dictionary | | The inline (JSON or YAML) trust policy document that grants an entity permission to assume the role. Mutually exclusive with *trust\_policy\_filepath*. |
| **trust\_policy\_filepath** string | | The path to the trust policy document that grants an entity permission to assume the role. Mutually exclusive with *trust\_policy*. |
| **update\_password** string | **Choices:*** **always** ←
* on\_create
| When to update user passwords.
*update\_password=always* will ensure the password is set to *password*.
*update\_password=on\_create* will only set the password for newly created users. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* Currently boto does not support the removal of Managed Policies, the module will error out if your user/group/role has managed policies when you try to do state=absent. They will need to be removed manually.
* 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
--------
```
# Basic user creation example
- name: Create two new IAM users with API keys
community.aws.iam:
iam_type: user
name: "{{ item }}"
state: present
password: "{{ temp_pass }}"
access_key_state: create
loop:
- jcleese
- mpython
# Advanced example, create two new groups and add the pre-existing user
# jdavila to both groups.
- name: Create Two Groups, Mario and Luigi
community.aws.iam:
iam_type: group
name: "{{ item }}"
state: present
loop:
- Mario
- Luigi
register: new_groups
- name: Update user
community.aws.iam:
iam_type: user
name: jdavila
state: update
groups: "{{ item.created_group.group_name }}"
loop: "{{ new_groups.results }}"
# Example of role with custom trust policy for Lambda service
- name: Create IAM role with custom trust relationship
community.aws.iam:
iam_type: role
name: AAALambdaTestRole
state: present
trust_policy:
Version: '2012-10-17'
Statement:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: lambda.amazonaws.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 |
| --- | --- | --- |
| **role\_result** string | if iam\_type=role and state=present | the IAM.role dict returned by Boto **Sample:** {'arn': 'arn:aws:iam::A1B2C3D4E5F6:role/my-new-role', 'assume\_role\_policy\_document': '...truncated...', 'create\_date': '2017-09-02T14:32:23Z', 'path': '/', 'role\_id': 'AROAA1B2C3D4E5F6G7H8I', 'role\_name': 'my-new-role'} |
| **roles** list / elements=string | if iam\_type=role and state=present | a list containing the name of the currently defined roles **Sample:** ['my-new-role', 'my-existing-role-1', 'my-existing-role-2', 'my-existing-role-3', 'my-existing-role-...'] |
### Authors
* Jonathan I. Davila (@defionscode)
* Paul Seiffert (@seiffert)
ansible community.aws.iam_managed_policy – Manage User Managed IAM policies community.aws.iam\_managed\_policy – Manage User Managed IAM policies
=====================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.iam_managed_policy`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows creating and removing managed IAM policies
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 |
| **fail\_on\_delete** boolean | **Choices:*** no
* yes
| The *fail\_on\_delete* option does nothing and will be removed after 2022-06-01 |
| **make\_default** boolean | **Choices:*** no
* **yes** ←
| Make this revision the default revision. |
| **only\_version** boolean | **Choices:*** **no** ←
* yes
| Remove all other non default revisions, if this is used with `make_default` it will result in all other versions of this policy being deleted. |
| **policy** json | | A properly json formatted policy |
| **policy\_description** string | **Default:**"" | A helpful description of this policy, this value is immutable and only set when creating a new policy. |
| **policy\_name** string / required | | The name of the managed policy. |
| **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
| Should this managed policy be present or absent. Set to absent to detach all entities from this policy and remove it if found. |
| **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
--------
```
# Create Policy ex nihilo
- name: Create IAM Managed Policy
community.aws.iam_managed_policy:
policy_name: "ManagedPolicy"
policy_description: "A Helpful managed policy"
policy: "{{ lookup('template', 'managed_policy.json.j2') }}"
state: present
# Update a policy with a new default version
- name: Create IAM Managed Policy
community.aws.iam_managed_policy:
policy_name: "ManagedPolicy"
policy: "{{ lookup('file', 'managed_policy_update.json') }}"
state: present
# Update a policy with a new non default version
- name: Create IAM Managed Policy
community.aws.iam_managed_policy:
policy_name: "ManagedPolicy"
policy:
Version: "2012-10-17"
Statement:
- Effect: "Allow"
Action: "logs:CreateLogGroup"
Resource: "*"
make_default: false
state: present
# Update a policy and make it the only version and the default version
- name: Create IAM Managed Policy
community.aws.iam_managed_policy:
policy_name: "ManagedPolicy"
policy: |
{
"Version": "2012-10-17",
"Statement":[{
"Effect": "Allow",
"Action": "logs:PutRetentionPolicy",
"Resource": "*"
}]
}
only_version: true
state: present
# Remove a policy
- name: Create IAM Managed Policy
community.aws.iam_managed_policy:
policy_name: "ManagedPolicy"
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 |
| --- | --- | --- |
| **policy** string | success | Returns the policy json structure, when state == absent this will return the value of the removed policy. **Sample:** { "arn": "arn:aws:iam::aws:policy/AdministratorAccess " "attachment\_count": 0, "create\_date": "2017-03-01T15:42:55.981000+00:00", "default\_version\_id": "v1", "is\_attachable": true, "path": "/", "policy\_id": "ANPALM4KLDMTFXGOOJIHL", "policy\_name": "AdministratorAccess", "update\_date": "2017-03-01T15:42:55.981000+00:00" } |
### Authors
* Dan Kozlowski (@dkhenry)
| programming_docs |
ansible community.aws.lambda_facts – Gathers AWS Lambda function details as Ansible facts community.aws.lambda\_facts – Gathers AWS Lambda function details as Ansible facts
==================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.lambda_facts`.
New in version 1.0.0: of community.aws
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2021-12-01
Why
Deprecated in favour of `_info` module.
Alternative
Use [community.aws.lambda\_info](lambda_info_module#ansible-collections-community-aws-lambda-info-module) instead.
Synopsis
--------
* Gathers various details related to Lambda functions, including aliases, versions and event source mappings. Use module [community.aws.lambda](lambda_module#ansible-collections-community-aws-lambda-module) to manage the lambda function itself, [community.aws.lambda\_alias](lambda_alias_module#ansible-collections-community-aws-lambda-alias-module) to manage function aliases and [community.aws.lambda\_event](lambda_event_module#ansible-collections-community-aws-lambda-event-module) to manage lambda event source mappings.
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 |
| **event\_source\_arn** string | | For query type 'mappings', this is the Amazon Resource Name (ARN) of the Amazon Kinesis or DynamoDB stream. |
| **function\_name** string | | The name of the lambda function for which facts are requested.
aliases: function, name |
| **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 |
| **query** string | **Choices:*** aliases
* **all** ←
* config
* mappings
* policy
* versions
| Specifies the resource type for which to gather facts. Leave blank to retrieve all facts. |
| **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
--------
```
---
# Simple example of listing all info for a function
- name: List all for a specific function
community.aws.lambda_facts:
query: all
function_name: myFunction
register: my_function_details
# List all versions of a function
- name: List function versions
community.aws.lambda_facts:
query: versions
function_name: myFunction
register: my_function_versions
# List all lambda function versions
- name: List all function
community.aws.lambda_facts:
query: all
max_items: 20
- name: show Lambda facts
ansible.builtin.debug:
var: lambda_facts
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **lambda\_facts** dictionary | success | lambda facts |
| **lambda\_facts.function** dictionary | success | lambda function list |
| **lambda\_facts.function.TheName** dictionary | success | lambda function information, including event, mapping, and version information |
Status
------
* This module will be removed in a major release after 2021-12-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Pierre Jodouin (@pjodouin)
ansible Community.Aws Community.Aws
=============
Collection version 1.5.0
Plugin Index
------------
These are the plugins in the community.aws collection
### Connection Plugins
* [aws\_ssm](aws_ssm_connection#ansible-collections-community-aws-aws-ssm-connection) – execute via AWS Systems Manager
### Modules
* [aws\_acm](aws_acm_module#ansible-collections-community-aws-aws-acm-module) – Upload and delete certificates in the AWS Certificate Manager service
* [aws\_acm\_info](aws_acm_info_module#ansible-collections-community-aws-aws-acm-info-module) – Retrieve certificate information from AWS Certificate Manager service
* [aws\_api\_gateway](aws_api_gateway_module#ansible-collections-community-aws-aws-api-gateway-module) – Manage AWS API Gateway APIs
* [aws\_application\_scaling\_policy](aws_application_scaling_policy_module#ansible-collections-community-aws-aws-application-scaling-policy-module) – Manage Application Auto Scaling Scaling Policies
* [aws\_batch\_compute\_environment](aws_batch_compute_environment_module#ansible-collections-community-aws-aws-batch-compute-environment-module) – Manage AWS Batch Compute Environments
* [aws\_batch\_job\_definition](aws_batch_job_definition_module#ansible-collections-community-aws-aws-batch-job-definition-module) – Manage AWS Batch Job Definitions
* [aws\_batch\_job\_queue](aws_batch_job_queue_module#ansible-collections-community-aws-aws-batch-job-queue-module) – Manage AWS Batch Job Queues
* [aws\_codebuild](aws_codebuild_module#ansible-collections-community-aws-aws-codebuild-module) – Create or delete an AWS CodeBuild project
* [aws\_codecommit](aws_codecommit_module#ansible-collections-community-aws-aws-codecommit-module) – Manage repositories in AWS CodeCommit
* [aws\_codepipeline](aws_codepipeline_module#ansible-collections-community-aws-aws-codepipeline-module) – Create or delete AWS CodePipelines
* [aws\_config\_aggregation\_authorization](aws_config_aggregation_authorization_module#ansible-collections-community-aws-aws-config-aggregation-authorization-module) – Manage cross-account AWS Config authorizations
* [aws\_config\_aggregator](aws_config_aggregator_module#ansible-collections-community-aws-aws-config-aggregator-module) – Manage AWS Config aggregations across multiple accounts
* [aws\_config\_delivery\_channel](aws_config_delivery_channel_module#ansible-collections-community-aws-aws-config-delivery-channel-module) – Manage AWS Config delivery channels
* [aws\_config\_recorder](aws_config_recorder_module#ansible-collections-community-aws-aws-config-recorder-module) – Manage AWS Config Recorders
* [aws\_config\_rule](aws_config_rule_module#ansible-collections-community-aws-aws-config-rule-module) – Manage AWS Config resources
* [aws\_direct\_connect\_confirm\_connection](aws_direct_connect_confirm_connection_module#ansible-collections-community-aws-aws-direct-connect-confirm-connection-module) – Confirms the creation of a hosted DirectConnect connection.
* [aws\_direct\_connect\_connection](aws_direct_connect_connection_module#ansible-collections-community-aws-aws-direct-connect-connection-module) – Creates, deletes, modifies a DirectConnect connection
* [aws\_direct\_connect\_gateway](aws_direct_connect_gateway_module#ansible-collections-community-aws-aws-direct-connect-gateway-module) – Manage AWS Direct Connect gateway
* [aws\_direct\_connect\_link\_aggregation\_group](aws_direct_connect_link_aggregation_group_module#ansible-collections-community-aws-aws-direct-connect-link-aggregation-group-module) – Manage Direct Connect LAG bundles
* [aws\_direct\_connect\_virtual\_interface](aws_direct_connect_virtual_interface_module#ansible-collections-community-aws-aws-direct-connect-virtual-interface-module) – Manage Direct Connect virtual interfaces
* [aws\_eks\_cluster](aws_eks_cluster_module#ansible-collections-community-aws-aws-eks-cluster-module) – Manage Elastic Kubernetes Service Clusters
* [aws\_elasticbeanstalk\_app](aws_elasticbeanstalk_app_module#ansible-collections-community-aws-aws-elasticbeanstalk-app-module) – Create, update, and delete an elastic beanstalk application
* [aws\_glue\_connection](aws_glue_connection_module#ansible-collections-community-aws-aws-glue-connection-module) – Manage an AWS Glue connection
* [aws\_glue\_job](aws_glue_job_module#ansible-collections-community-aws-aws-glue-job-module) – Manage an AWS Glue job
* [aws\_inspector\_target](aws_inspector_target_module#ansible-collections-community-aws-aws-inspector-target-module) – Create, Update and Delete Amazon Inspector Assessment Targets
* [aws\_kms](aws_kms_module#ansible-collections-community-aws-aws-kms-module) – Perform various KMS management tasks.
* [aws\_kms\_info](aws_kms_info_module#ansible-collections-community-aws-aws-kms-info-module) – Gather information about AWS KMS keys
* [aws\_region\_info](aws_region_info_module#ansible-collections-community-aws-aws-region-info-module) – Gather information about AWS regions.
* [aws\_s3\_bucket\_info](aws_s3_bucket_info_module#ansible-collections-community-aws-aws-s3-bucket-info-module) – lists S3 buckets in AWS
* [aws\_s3\_cors](aws_s3_cors_module#ansible-collections-community-aws-aws-s3-cors-module) – Manage CORS for S3 buckets in AWS
* [aws\_secret](aws_secret_module#ansible-collections-community-aws-aws-secret-module) – Manage secrets stored in AWS Secrets Manager.
* [aws\_ses\_identity](aws_ses_identity_module#ansible-collections-community-aws-aws-ses-identity-module) – Manages SES email and domain identity
* [aws\_ses\_identity\_policy](aws_ses_identity_policy_module#ansible-collections-community-aws-aws-ses-identity-policy-module) – Manages SES sending authorization policies
* [aws\_ses\_rule\_set](aws_ses_rule_set_module#ansible-collections-community-aws-aws-ses-rule-set-module) – Manages SES inbound receipt rule sets
* [aws\_sgw\_info](aws_sgw_info_module#ansible-collections-community-aws-aws-sgw-info-module) – Fetch AWS Storage Gateway information
* [aws\_ssm\_parameter\_store](aws_ssm_parameter_store_module#ansible-collections-community-aws-aws-ssm-parameter-store-module) – Manage key-value pairs in aws parameter store.
* [aws\_step\_functions\_state\_machine](aws_step_functions_state_machine_module#ansible-collections-community-aws-aws-step-functions-state-machine-module) – Manage AWS Step Functions state machines
* [aws\_step\_functions\_state\_machine\_execution](aws_step_functions_state_machine_execution_module#ansible-collections-community-aws-aws-step-functions-state-machine-execution-module) – Start or stop execution of an AWS Step Functions state machine.
* [aws\_waf\_condition](aws_waf_condition_module#ansible-collections-community-aws-aws-waf-condition-module) – Create and delete WAF Conditions
* [aws\_waf\_info](aws_waf_info_module#ansible-collections-community-aws-aws-waf-info-module) – Retrieve information for WAF ACLs, Rule , Conditions and Filters.
* [aws\_waf\_rule](aws_waf_rule_module#ansible-collections-community-aws-aws-waf-rule-module) – Create and delete WAF Rules
* [aws\_waf\_web\_acl](aws_waf_web_acl_module#ansible-collections-community-aws-aws-waf-web-acl-module) – Create and delete WAF Web ACLs.
* [cloudformation\_exports\_info](cloudformation_exports_info_module#ansible-collections-community-aws-cloudformation-exports-info-module) – Read a value from CloudFormation Exports
* [cloudformation\_stack\_set](cloudformation_stack_set_module#ansible-collections-community-aws-cloudformation-stack-set-module) – Manage groups of CloudFormation stacks
* [cloudfront\_distribution](cloudfront_distribution_module#ansible-collections-community-aws-cloudfront-distribution-module) – Create, update and delete AWS CloudFront distributions.
* [cloudfront\_info](cloudfront_info_module#ansible-collections-community-aws-cloudfront-info-module) – Obtain facts about an AWS CloudFront distribution
* [cloudfront\_invalidation](cloudfront_invalidation_module#ansible-collections-community-aws-cloudfront-invalidation-module) – create invalidations for AWS CloudFront distributions
* [cloudfront\_origin\_access\_identity](cloudfront_origin_access_identity_module#ansible-collections-community-aws-cloudfront-origin-access-identity-module) – Create, update and delete origin access identities for a CloudFront distribution
* [cloudtrail](cloudtrail_module#ansible-collections-community-aws-cloudtrail-module) – manage CloudTrail create, delete, update
* [cloudwatchevent\_rule](cloudwatchevent_rule_module#ansible-collections-community-aws-cloudwatchevent-rule-module) – Manage CloudWatch Event rules and targets
* [cloudwatchlogs\_log\_group](cloudwatchlogs_log_group_module#ansible-collections-community-aws-cloudwatchlogs-log-group-module) – create or delete log\_group in CloudWatchLogs
* [cloudwatchlogs\_log\_group\_info](cloudwatchlogs_log_group_info_module#ansible-collections-community-aws-cloudwatchlogs-log-group-info-module) – Get information about log\_group in CloudWatchLogs
* [cloudwatchlogs\_log\_group\_metric\_filter](cloudwatchlogs_log_group_metric_filter_module#ansible-collections-community-aws-cloudwatchlogs-log-group-metric-filter-module) – Manage CloudWatch log group metric filter
* [data\_pipeline](data_pipeline_module#ansible-collections-community-aws-data-pipeline-module) – Create and manage AWS Datapipelines
* [dms\_endpoint](dms_endpoint_module#ansible-collections-community-aws-dms-endpoint-module) – Creates or destroys a data migration services endpoint
* [dms\_replication\_subnet\_group](dms_replication_subnet_group_module#ansible-collections-community-aws-dms-replication-subnet-group-module) – creates or destroys a data migration services subnet group
* [dynamodb\_table](dynamodb_table_module#ansible-collections-community-aws-dynamodb-table-module) – Create, update or delete AWS Dynamo DB tables
* [dynamodb\_ttl](dynamodb_ttl_module#ansible-collections-community-aws-dynamodb-ttl-module) – Set TTL for a given DynamoDB table
* [ec2\_ami\_copy](ec2_ami_copy_module#ansible-collections-community-aws-ec2-ami-copy-module) – copies AMI between AWS regions, return new image id
* [ec2\_asg](ec2_asg_module#ansible-collections-community-aws-ec2-asg-module) – Create or delete AWS AutoScaling Groups (ASGs)
* [ec2\_asg\_info](ec2_asg_info_module#ansible-collections-community-aws-ec2-asg-info-module) – Gather information about ec2 Auto Scaling Groups (ASGs) in AWS
* [ec2\_asg\_lifecycle\_hook](ec2_asg_lifecycle_hook_module#ansible-collections-community-aws-ec2-asg-lifecycle-hook-module) – Create, delete or update AWS ASG Lifecycle Hooks.
* [ec2\_customer\_gateway](ec2_customer_gateway_module#ansible-collections-community-aws-ec2-customer-gateway-module) – Manage an AWS customer gateway
* [ec2\_customer\_gateway\_info](ec2_customer_gateway_info_module#ansible-collections-community-aws-ec2-customer-gateway-info-module) – Gather information about customer gateways in AWS
* [ec2\_eip](ec2_eip_module#ansible-collections-community-aws-ec2-eip-module) – manages EC2 elastic IP (EIP) addresses.
* [ec2\_eip\_info](ec2_eip_info_module#ansible-collections-community-aws-ec2-eip-info-module) – List EC2 EIP details
* [ec2\_elb](ec2_elb_module#ansible-collections-community-aws-ec2-elb-module) – De-registers or registers instances from EC2 ELBs
* [ec2\_elb\_info](ec2_elb_info_module#ansible-collections-community-aws-ec2-elb-info-module) – Gather information about EC2 Elastic Load Balancers in AWS
* [ec2\_instance](ec2_instance_module#ansible-collections-community-aws-ec2-instance-module) – Create & manage EC2 instances
* [ec2\_instance\_info](ec2_instance_info_module#ansible-collections-community-aws-ec2-instance-info-module) – Gather information about ec2 instances in AWS
* [ec2\_launch\_template](ec2_launch_template_module#ansible-collections-community-aws-ec2-launch-template-module) – Manage EC2 launch templates
* [ec2\_lc](ec2_lc_module#ansible-collections-community-aws-ec2-lc-module) – Create or delete AWS Autoscaling Launch Configurations
* [ec2\_lc\_find](ec2_lc_find_module#ansible-collections-community-aws-ec2-lc-find-module) – Find AWS Autoscaling Launch Configurations
* [ec2\_lc\_info](ec2_lc_info_module#ansible-collections-community-aws-ec2-lc-info-module) – Gather information about AWS Autoscaling Launch Configurations.
* [ec2\_metric\_alarm](ec2_metric_alarm_module#ansible-collections-community-aws-ec2-metric-alarm-module) – Create/update or delete AWS Cloudwatch ‘metric alarms’
* [ec2\_placement\_group](ec2_placement_group_module#ansible-collections-community-aws-ec2-placement-group-module) – Create or delete an EC2 Placement Group
* [ec2\_placement\_group\_info](ec2_placement_group_info_module#ansible-collections-community-aws-ec2-placement-group-info-module) – List EC2 Placement Group(s) details
* [ec2\_scaling\_policy](ec2_scaling_policy_module#ansible-collections-community-aws-ec2-scaling-policy-module) – Create or delete AWS scaling policies for Autoscaling groups
* [ec2\_snapshot\_copy](ec2_snapshot_copy_module#ansible-collections-community-aws-ec2-snapshot-copy-module) – Copies an EC2 snapshot and returns the new Snapshot ID.
* [ec2\_transit\_gateway](ec2_transit_gateway_module#ansible-collections-community-aws-ec2-transit-gateway-module) – Create and delete AWS Transit Gateways
* [ec2\_transit\_gateway\_info](ec2_transit_gateway_info_module#ansible-collections-community-aws-ec2-transit-gateway-info-module) – Gather information about ec2 transit gateways in AWS
* [ec2\_vpc\_egress\_igw](ec2_vpc_egress_igw_module#ansible-collections-community-aws-ec2-vpc-egress-igw-module) – Manage an AWS VPC Egress Only Internet gateway
* [ec2\_vpc\_endpoint](ec2_vpc_endpoint_module#ansible-collections-community-aws-ec2-vpc-endpoint-module) – Create and delete AWS VPC Endpoints.
* [ec2\_vpc\_endpoint\_info](ec2_vpc_endpoint_info_module#ansible-collections-community-aws-ec2-vpc-endpoint-info-module) – Retrieves AWS VPC endpoints details using AWS methods.
* [ec2\_vpc\_endpoint\_service\_info](ec2_vpc_endpoint_service_info_module#ansible-collections-community-aws-ec2-vpc-endpoint-service-info-module) – retrieves AWS VPC endpoint service details
* [ec2\_vpc\_igw](ec2_vpc_igw_module#ansible-collections-community-aws-ec2-vpc-igw-module) – Manage an AWS VPC Internet gateway
* [ec2\_vpc\_igw\_info](ec2_vpc_igw_info_module#ansible-collections-community-aws-ec2-vpc-igw-info-module) – Gather information about internet gateways in AWS
* [ec2\_vpc\_nacl](ec2_vpc_nacl_module#ansible-collections-community-aws-ec2-vpc-nacl-module) – create and delete Network ACLs.
* [ec2\_vpc\_nacl\_info](ec2_vpc_nacl_info_module#ansible-collections-community-aws-ec2-vpc-nacl-info-module) – Gather information about Network ACLs in an AWS VPC
* [ec2\_vpc\_nat\_gateway](ec2_vpc_nat_gateway_module#ansible-collections-community-aws-ec2-vpc-nat-gateway-module) – Manage AWS VPC NAT Gateways.
* [ec2\_vpc\_nat\_gateway\_info](ec2_vpc_nat_gateway_info_module#ansible-collections-community-aws-ec2-vpc-nat-gateway-info-module) – Retrieves AWS VPC Managed Nat Gateway details using AWS methods.
* [ec2\_vpc\_peer](ec2_vpc_peer_module#ansible-collections-community-aws-ec2-vpc-peer-module) – create, delete, accept, and reject VPC peering connections between two VPCs.
* [ec2\_vpc\_peering\_info](ec2_vpc_peering_info_module#ansible-collections-community-aws-ec2-vpc-peering-info-module) – Retrieves AWS VPC Peering details using AWS methods.
* [ec2\_vpc\_route\_table](ec2_vpc_route_table_module#ansible-collections-community-aws-ec2-vpc-route-table-module) – Manage route tables for AWS virtual private clouds
* [ec2\_vpc\_route\_table\_info](ec2_vpc_route_table_info_module#ansible-collections-community-aws-ec2-vpc-route-table-info-module) – Gather information about ec2 VPC route tables in AWS
* [ec2\_vpc\_vgw](ec2_vpc_vgw_module#ansible-collections-community-aws-ec2-vpc-vgw-module) – Create and delete AWS VPN Virtual Gateways.
* [ec2\_vpc\_vgw\_info](ec2_vpc_vgw_info_module#ansible-collections-community-aws-ec2-vpc-vgw-info-module) – Gather information about virtual gateways in AWS
* [ec2\_vpc\_vpn](ec2_vpc_vpn_module#ansible-collections-community-aws-ec2-vpc-vpn-module) – Create, modify, and delete EC2 VPN connections.
* [ec2\_vpc\_vpn\_info](ec2_vpc_vpn_info_module#ansible-collections-community-aws-ec2-vpc-vpn-info-module) – Gather information about VPN Connections in AWS.
* [ec2\_win\_password](ec2_win_password_module#ansible-collections-community-aws-ec2-win-password-module) – Gets the default administrator password for ec2 windows instances
* [ecs\_attribute](ecs_attribute_module#ansible-collections-community-aws-ecs-attribute-module) – manage ecs attributes
* [ecs\_cluster](ecs_cluster_module#ansible-collections-community-aws-ecs-cluster-module) – Create or terminate ECS clusters.
* [ecs\_ecr](ecs_ecr_module#ansible-collections-community-aws-ecs-ecr-module) – Manage Elastic Container Registry repositories
* [ecs\_service](ecs_service_module#ansible-collections-community-aws-ecs-service-module) – Create, terminate, start or stop a service in ECS
* [ecs\_service\_info](ecs_service_info_module#ansible-collections-community-aws-ecs-service-info-module) – List or describe services in ECS
* [ecs\_tag](ecs_tag_module#ansible-collections-community-aws-ecs-tag-module) – create and remove tags on Amazon ECS resources
* [ecs\_task](ecs_task_module#ansible-collections-community-aws-ecs-task-module) – Run, start or stop a task in ecs
* [ecs\_taskdefinition](ecs_taskdefinition_module#ansible-collections-community-aws-ecs-taskdefinition-module) – register a task definition in ecs
* [ecs\_taskdefinition\_info](ecs_taskdefinition_info_module#ansible-collections-community-aws-ecs-taskdefinition-info-module) – Describe a task definition in ECS
* [efs](efs_module#ansible-collections-community-aws-efs-module) – create and maintain EFS file systems
* [efs\_info](efs_info_module#ansible-collections-community-aws-efs-info-module) – Get information about Amazon EFS file systems
* [elasticache](elasticache_module#ansible-collections-community-aws-elasticache-module) – Manage cache clusters in Amazon ElastiCache
* [elasticache\_info](elasticache_info_module#ansible-collections-community-aws-elasticache-info-module) – Retrieve information for AWS ElastiCache clusters
* [elasticache\_parameter\_group](elasticache_parameter_group_module#ansible-collections-community-aws-elasticache-parameter-group-module) – Manage cache parameter groups in Amazon ElastiCache.
* [elasticache\_snapshot](elasticache_snapshot_module#ansible-collections-community-aws-elasticache-snapshot-module) – Manage cache snapshots in Amazon ElastiCache
* [elasticache\_subnet\_group](elasticache_subnet_group_module#ansible-collections-community-aws-elasticache-subnet-group-module) – manage ElastiCache subnet groups
* [elb\_application\_lb](elb_application_lb_module#ansible-collections-community-aws-elb-application-lb-module) – Manage an Application Load Balancer
* [elb\_application\_lb\_info](elb_application_lb_info_module#ansible-collections-community-aws-elb-application-lb-info-module) – Gather information about application ELBs in AWS
* [elb\_classic\_lb](elb_classic_lb_module#ansible-collections-community-aws-elb-classic-lb-module) – Creates or destroys Amazon ELB.
* [elb\_classic\_lb\_info](elb_classic_lb_info_module#ansible-collections-community-aws-elb-classic-lb-info-module) – Gather information about EC2 Elastic Load Balancers in AWS
* [elb\_instance](elb_instance_module#ansible-collections-community-aws-elb-instance-module) – De-registers or registers instances from EC2 ELBs
* [elb\_network\_lb](elb_network_lb_module#ansible-collections-community-aws-elb-network-lb-module) – Manage a Network Load Balancer
* [elb\_target](elb_target_module#ansible-collections-community-aws-elb-target-module) – Manage a target in a target group
* [elb\_target\_group](elb_target_group_module#ansible-collections-community-aws-elb-target-group-module) – Manage a target group for an Application or Network load balancer
* [elb\_target\_group\_info](elb_target_group_info_module#ansible-collections-community-aws-elb-target-group-info-module) – Gather information about ELB target groups in AWS
* [elb\_target\_info](elb_target_info_module#ansible-collections-community-aws-elb-target-info-module) – Gathers which target groups a target is associated with.
* [execute\_lambda](execute_lambda_module#ansible-collections-community-aws-execute-lambda-module) – Execute an AWS Lambda function
* [iam](iam_module#ansible-collections-community-aws-iam-module) – Manage IAM users, groups, roles and keys
* [iam\_cert](iam_cert_module#ansible-collections-community-aws-iam-cert-module) – Manage server certificates for use on ELBs and CloudFront
* [iam\_group](iam_group_module#ansible-collections-community-aws-iam-group-module) – Manage AWS IAM groups
* [iam\_managed\_policy](iam_managed_policy_module#ansible-collections-community-aws-iam-managed-policy-module) – Manage User Managed IAM policies
* [iam\_mfa\_device\_info](iam_mfa_device_info_module#ansible-collections-community-aws-iam-mfa-device-info-module) – List the MFA (Multi-Factor Authentication) devices registered for a user
* [iam\_password\_policy](iam_password_policy_module#ansible-collections-community-aws-iam-password-policy-module) – Update an IAM Password Policy
* [iam\_policy](iam_policy_module#ansible-collections-community-aws-iam-policy-module) – Manage inline IAM policies for users, groups, and roles
* [iam\_policy\_info](iam_policy_info_module#ansible-collections-community-aws-iam-policy-info-module) – Retrieve inline IAM policies for users, groups, and roles
* [iam\_role](iam_role_module#ansible-collections-community-aws-iam-role-module) – Manage AWS IAM roles
* [iam\_role\_info](iam_role_info_module#ansible-collections-community-aws-iam-role-info-module) – Gather information on IAM roles
* [iam\_saml\_federation](iam_saml_federation_module#ansible-collections-community-aws-iam-saml-federation-module) – Maintain IAM SAML federation configuration.
* [iam\_server\_certificate\_info](iam_server_certificate_info_module#ansible-collections-community-aws-iam-server-certificate-info-module) – Retrieve the information of a server certificate
* [iam\_user](iam_user_module#ansible-collections-community-aws-iam-user-module) – Manage AWS IAM users
* [iam\_user\_info](iam_user_info_module#ansible-collections-community-aws-iam-user-info-module) – Gather IAM user(s) facts in AWS
* [kinesis\_stream](kinesis_stream_module#ansible-collections-community-aws-kinesis-stream-module) – Manage a Kinesis Stream.
* [lambda](lambda_module#ansible-collections-community-aws-lambda-module) – Manage AWS Lambda functions
* [lambda\_alias](lambda_alias_module#ansible-collections-community-aws-lambda-alias-module) – Creates, updates or deletes AWS Lambda function aliases
* [lambda\_event](lambda_event_module#ansible-collections-community-aws-lambda-event-module) – Creates, updates or deletes AWS Lambda function event mappings
* [lambda\_facts](lambda_facts_module#ansible-collections-community-aws-lambda-facts-module) – Gathers AWS Lambda function details as Ansible facts
* [lambda\_info](lambda_info_module#ansible-collections-community-aws-lambda-info-module) – Gathers AWS Lambda function details
* [lambda\_policy](lambda_policy_module#ansible-collections-community-aws-lambda-policy-module) – Creates, updates or deletes AWS Lambda policy statements.
* [lightsail](lightsail_module#ansible-collections-community-aws-lightsail-module) – Manage instances in AWS Lightsail
* [rds](rds_module#ansible-collections-community-aws-rds-module) – create, delete, or modify Amazon rds instances, rds snapshots, and related facts
* [rds\_instance](rds_instance_module#ansible-collections-community-aws-rds-instance-module) – Manage RDS instances
* [rds\_instance\_info](rds_instance_info_module#ansible-collections-community-aws-rds-instance-info-module) – obtain information about one or more RDS instances
* [rds\_param\_group](rds_param_group_module#ansible-collections-community-aws-rds-param-group-module) – manage RDS parameter groups
* [rds\_snapshot](rds_snapshot_module#ansible-collections-community-aws-rds-snapshot-module) – manage Amazon RDS snapshots.
* [rds\_snapshot\_info](rds_snapshot_info_module#ansible-collections-community-aws-rds-snapshot-info-module) – obtain information about one or more RDS snapshots
* [rds\_subnet\_group](rds_subnet_group_module#ansible-collections-community-aws-rds-subnet-group-module) – manage RDS database subnet groups
* [redshift](redshift_module#ansible-collections-community-aws-redshift-module) – create, delete, or modify an Amazon Redshift instance
* [redshift\_cross\_region\_snapshots](redshift_cross_region_snapshots_module#ansible-collections-community-aws-redshift-cross-region-snapshots-module) – Manage Redshift Cross Region Snapshots
* [redshift\_info](redshift_info_module#ansible-collections-community-aws-redshift-info-module) – Gather information about Redshift cluster(s)
* [redshift\_subnet\_group](redshift_subnet_group_module#ansible-collections-community-aws-redshift-subnet-group-module) – manage Redshift cluster subnet groups
* [route53](route53_module#ansible-collections-community-aws-route53-module) – add or delete entries in Amazons Route 53 DNS service
* [route53\_health\_check](route53_health_check_module#ansible-collections-community-aws-route53-health-check-module) – Add or delete health-checks in Amazons Route53 DNS service
* [route53\_info](route53_info_module#ansible-collections-community-aws-route53-info-module) – Retrieves route53 details using AWS methods
* [route53\_zone](route53_zone_module#ansible-collections-community-aws-route53-zone-module) – add or delete Route53 zones
* [s3\_bucket\_notification](s3_bucket_notification_module#ansible-collections-community-aws-s3-bucket-notification-module) – Creates, updates or deletes S3 Bucket notification for lambda
* [s3\_lifecycle](s3_lifecycle_module#ansible-collections-community-aws-s3-lifecycle-module) – Manage S3 bucket lifecycle rules in AWS
* [s3\_logging](s3_logging_module#ansible-collections-community-aws-s3-logging-module) – Manage logging facility of an s3 bucket in AWS
* [s3\_metrics\_configuration](s3_metrics_configuration_module#ansible-collections-community-aws-s3-metrics-configuration-module) – Manage s3 bucket metrics configuration in AWS
* [s3\_sync](s3_sync_module#ansible-collections-community-aws-s3-sync-module) – Efficiently upload multiple files to S3
* [s3\_website](s3_website_module#ansible-collections-community-aws-s3-website-module) – Configure an s3 bucket as a website
* [sns](sns_module#ansible-collections-community-aws-sns-module) – Send Amazon Simple Notification Service messages
* [sns\_topic](sns_topic_module#ansible-collections-community-aws-sns-topic-module) – Manages AWS SNS topics and subscriptions
* [sqs\_queue](sqs_queue_module#ansible-collections-community-aws-sqs-queue-module) – Creates or deletes AWS SQS queues
* [sts\_assume\_role](sts_assume_role_module#ansible-collections-community-aws-sts-assume-role-module) – Assume a role using AWS Security Token Service and obtain temporary credentials
* [sts\_session\_token](sts_session_token_module#ansible-collections-community-aws-sts-session-token-module) – Obtain a session token from the AWS Security Token Service
* [wafv2\_ip\_set](wafv2_ip_set_module#ansible-collections-community-aws-wafv2-ip-set-module) – wafv2\_ip\_set
* [wafv2\_ip\_set\_info](wafv2_ip_set_info_module#ansible-collections-community-aws-wafv2-ip-set-info-module) – Get information about wafv2 ip sets
* [wafv2\_resources](wafv2_resources_module#ansible-collections-community-aws-wafv2-resources-module) – wafv2\_web\_acl
* [wafv2\_resources\_info](wafv2_resources_info_module#ansible-collections-community-aws-wafv2-resources-info-module) – wafv2\_resources\_info
* [wafv2\_rule\_group](wafv2_rule_group_module#ansible-collections-community-aws-wafv2-rule-group-module) – wafv2\_web\_acl
* [wafv2\_rule\_group\_info](wafv2_rule_group_info_module#ansible-collections-community-aws-wafv2-rule-group-info-module) – wafv2\_web\_acl\_info
* [wafv2\_web\_acl](wafv2_web_acl_module#ansible-collections-community-aws-wafv2-web-acl-module) – wafv2\_web\_acl
* [wafv2\_web\_acl\_info](wafv2_web_acl_info_module#ansible-collections-community-aws-wafv2-web-acl-info-module) – wafv2\_web\_acl
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
| programming_docs |
ansible community.aws.elb_target_group_info – Gather information about ELB target groups in AWS community.aws.elb\_target\_group\_info – Gather information about ELB target groups in AWS
==========================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.elb_target_group_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about ELB target groups in AWS
* This module was called `elb_target_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 |
| **collect\_targets\_health** boolean | **Choices:*** **no** ←
* yes
| When set to "yes", output contains targets health description |
| **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 |
| **load\_balancer\_arn** string | | The Amazon Resource Name (ARN) of the load balancer. |
| **names** list / elements=string | | The names of the target groups. |
| **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 |
| **target\_group\_arns** list / elements=string | | The Amazon Resource Names (ARN) of the target groups. |
| **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 target groups
community.aws.elb_target_group_info:
- name: Gather information about the target group attached to a particular ELB
community.aws.elb_target_group_info:
load_balancer_arn: "arn:aws:elasticloadbalancing:ap-southeast-2:001122334455:loadbalancer/app/my-elb/aabbccddeeff"
- name: Gather information about a target groups named 'tg1' and 'tg2'
community.aws.elb_target_group_info:
names:
- tg1
- tg2
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **target\_groups** complex | always | a list of target groups |
| | **deregistration\_delay\_timeout\_seconds** integer | always | The amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. **Sample:** 300 |
| | **health\_check\_interval\_seconds** integer | always | The approximate amount of time, in seconds, between health checks of an individual target. **Sample:** 30 |
| | **health\_check\_path** string | always | The destination for the health check request. **Sample:** /index.html |
| | **health\_check\_port** string | always | The port to use to connect with the target. **Sample:** traffic-port |
| | **health\_check\_protocol** string | always | The protocol to use to connect with the target. **Sample:** HTTP |
| | **health\_check\_timeout\_seconds** integer | always | The amount of time, in seconds, during which no response means a failed health check. **Sample:** 5 |
| | **healthy\_threshold\_count** integer | always | The number of consecutive health checks successes required before considering an unhealthy target healthy. **Sample:** 5 |
| | **load\_balancer\_arns** list / elements=string | always | The Amazon Resource Names (ARN) of the load balancers that route traffic to this target group. |
| | **matcher** dictionary | always | The HTTP codes to use when checking for a successful response from a target. **Sample:** {'http\_code': '200'} |
| | **port** integer | always | The port on which the targets are listening. **Sample:** 80 |
| | **protocol** string | always | The protocol to use for routing traffic to the targets. **Sample:** HTTP |
| | **stickiness\_enabled** boolean | always | Indicates whether sticky sessions are enabled. **Sample:** True |
| | **stickiness\_lb\_cookie\_duration\_seconds** integer | always | Indicates whether sticky sessions are enabled. **Sample:** 86400 |
| | **stickiness\_type** string | always | The type of sticky sessions. **Sample:** lb\_cookie |
| | **tags** dictionary | always | The tags attached to the target group. **Sample:** { 'Tag': 'Example' } |
| | **target\_group\_arn** string | always | The Amazon Resource Name (ARN) of the target group. **Sample:** arn:aws:elasticloadbalancing:ap-southeast-2:01234567890:targetgroup/mytargetgroup/aabbccddee0044332211 |
| | **target\_group\_name** string | always | The name of the target group. **Sample:** mytargetgroup |
| | **targets\_health\_description** complex | when collect\_targets\_health is enabled | Targets health description. |
| | | **health\_check\_port** string | always | The port to check target health. **Sample:** 80 |
| | | **target** complex | always | The target metadata. |
| | | | **id** string | always | The ID of the target. **Sample:** i-0123456789 |
| | | | **port** integer | always | The port to use to connect with the target. **Sample:** 80 |
| | | **target\_health** complex | always | The target health status. |
| | | | **state** string | always | The state of the target health. **Sample:** healthy |
| | **unhealthy\_threshold\_count** integer | always | The number of consecutive health check failures required before considering the target unhealthy. **Sample:** 2 |
| | **vpc\_id** string | always | The ID of the VPC for the targets. **Sample:** vpc-0123456 |
### Authors
* Rob White (@wimnat)
ansible community.aws.kinesis_stream – Manage a Kinesis Stream. community.aws.kinesis\_stream – Manage a Kinesis Stream.
========================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.kinesis_stream`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create or Delete a Kinesis Stream.
* Update the retention period of a Kinesis Stream.
* Update Tags on a Kinesis Stream.
* Enable/disable server side encryption on a Kinesis Stream.
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 |
| **encryption\_state** string | **Choices:*** enabled
* disabled
| Enable or Disable encryption on the Kinesis Stream. |
| **encryption\_type** string | **Choices:*** KMS
* NONE
| The type of encryption. Defaults to `KMS`
|
| **key\_id** string | | The GUID or alias for the KMS key. |
| **name** string / required | | The name of the Kinesis Stream you are managing. |
| **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 |
| **retention\_period** integer | | The length of time (in hours) data records are accessible after they are added to the stream. The default retention period is 24 hours and can not be less than 24 hours. The maximum retention period is 168 hours. The retention period can be modified during any point in time. |
| **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 |
| **shards** integer | | The number of shards you want to have with this stream. This is required when *state=present*
|
| **state** string | **Choices:*** **present** ←
* absent
| Create or Delete the Kinesis Stream. |
| **tags** dictionary | | A dictionary of resource tags of the form: `{ tag1: value1, tag2: value2 }`.
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. |
| **wait** boolean | **Choices:*** no
* **yes** ←
| Wait for operation to complete before returning. |
| **wait\_timeout** integer | **Default:**300 | How many seconds to wait for an operation to complete before timing out. |
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 creation example:
- name: Set up Kinesis Stream with 10 shards and wait for the stream to become ACTIVE
community.aws.kinesis_stream:
name: test-stream
shards: 10
wait: yes
wait_timeout: 600
register: test_stream
# Basic creation example with tags:
- name: Set up Kinesis Stream with 10 shards, tag the environment, and wait for the stream to become ACTIVE
community.aws.kinesis_stream:
name: test-stream
shards: 10
tags:
Env: development
wait: yes
wait_timeout: 600
register: test_stream
# Basic creation example with tags and increase the retention period from the default 24 hours to 48 hours:
- name: Set up Kinesis Stream with 10 shards, tag the environment, increase the retention period and wait for the stream to become ACTIVE
community.aws.kinesis_stream:
name: test-stream
retention_period: 48
shards: 10
tags:
Env: development
wait: yes
wait_timeout: 600
register: test_stream
# Basic delete example:
- name: Delete Kinesis Stream test-stream and wait for it to finish deleting.
community.aws.kinesis_stream:
name: test-stream
state: absent
wait: yes
wait_timeout: 600
register: test_stream
# Basic enable encryption example:
- name: Encrypt Kinesis Stream test-stream.
community.aws.kinesis_stream:
name: test-stream
state: present
shards: 1
encryption_state: enabled
encryption_type: KMS
key_id: alias/aws/kinesis
wait: yes
wait_timeout: 600
register: test_stream
# Basic disable encryption example:
- name: Encrypt Kinesis Stream test-stream.
community.aws.kinesis_stream:
name: test-stream
state: present
shards: 1
encryption_state: disabled
encryption_type: KMS
key_id: alias/aws/kinesis
wait: yes
wait_timeout: 600
register: test_stream
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **retention\_period\_hours** integer | when state == present. | Number of hours messages will be kept for a Kinesis Stream. **Sample:** 24 |
| **stream\_arn** string | when state == present. | The amazon resource identifier **Sample:** arn:aws:kinesis:east-side:123456789:stream/test-stream |
| **stream\_name** string | when state == present. | The name of the Kinesis Stream. **Sample:** test-stream |
| **stream\_status** string | when state == present. | The current state of the Kinesis Stream. **Sample:** ACTIVE |
| **tags** dictionary | when state == present. | Dictionary containing all the tags associated with the Kinesis stream. **Sample:** {'Env': 'development', 'Name': 'Splunk'} |
### Authors
* Allen Sanabria (@linuxdynasty)
| programming_docs |
ansible community.aws.ec2_vpc_igw_info – Gather information about internet gateways in AWS community.aws.ec2\_vpc\_igw\_info – Gather information about internet gateways in AWS
=====================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_vpc_igw_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about internet gateways in AWS.
* This module was called `ec2_vpc_igw_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 |
| **convert\_tags** boolean added in 1.3.0 of community.aws | **Choices:*** no
* yes
| Convert tags from boto3 format (list of dictionaries) to the standard dictionary format. This currently defaults to `False`. The default will be changed to `True` after 2022-06-22. |
| **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_DescribeInternetGateways.html> for possible filters. |
| **internet\_gateway\_ids** list / elements=string | | Get details of specific Internet Gateway ID. Provide this value as a list. |
| **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 Internet Gateways for an account or profile
community.aws.ec2_vpc_igw_info:
region: ap-southeast-2
profile: production
register: igw_info
- name: Gather information about a filtered list of Internet Gateways
community.aws.ec2_vpc_igw_info:
region: ap-southeast-2
profile: production
filters:
"tag:Name": "igw-123"
register: igw_info
- name: Gather information about a specific internet gateway by InternetGatewayId
community.aws.ec2_vpc_igw_info:
region: ap-southeast-2
profile: production
internet_gateway_ids: igw-c1231234
register: igw_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 internet gateways succeeds. **Sample:** false |
| **internet\_gateways** complex | always | The internet gateways for the account. |
| | **attachments** complex | *state=present* | Any VPCs attached to the internet gateway |
| | | **state** string | *state=present* | The current state of the attachment **Sample:** available |
| | | **vpc\_id** string | *state=present* | The ID of the VPC. **Sample:** vpc-02123b67 |
| | **internet\_gateway\_id** string | *state=present* | The ID of the internet gateway **Sample:** igw-2123634d |
| | **tags** dictionary | *state=present* | Any tags assigned to the internet gateway **Sample:** {'tags': {'Ansible': 'Test'}} |
### Authors
* Nick Aslanidis (@naslanidis)
ansible community.aws.ec2_elb_info – Gather information about EC2 Elastic Load Balancers in AWS community.aws.ec2\_elb\_info – Gather information about EC2 Elastic Load Balancers in AWS
=========================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_elb_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Gather information about EC2 Elastic Load Balancers in AWS
* This module was called `ec2_elb_facts` before Ansible 2.9. The usage did not change.
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. |
| **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 |
| **names** list / elements=string | | List of ELB names to gather information about. Pass this option to gather information about a set of ELBs, otherwise, all ELBs 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 |
| **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.
# Output format tries to match amazon.aws.ec2_elb_lb module input parameters
- name: Gather information about all ELBs
community.aws.ec2_elb_info:
register: elb_info
- ansible.builtin.debug:
msg: "{{ item.dns_name }}"
loop: "{{ elb_info.elbs }}"
- name: Gather information about a particular ELB
community.aws.ec2_elb_info:
names: frontend-prod-elb
register: elb_info
- ansible.builtin.debug:
msg: "{{ elb_info.elbs.0.dns_name }}"
- name: Gather information about a set of ELBs
community.aws.ec2_elb_info:
names:
- frontend-prod-elb
- backend-prod-elb
register: elb_info
- ansible.builtin.debug:
msg: "{{ item.dns_name }}"
loop: "{{ elb_info.elbs }}"
```
### Authors
* Michael Schultz (@mjschultz)
* Fernando Jose Pando (@nand0p)
ansible community.aws.wafv2_ip_set – wafv2_ip_set community.aws.wafv2\_ip\_set – wafv2\_ip\_set
=============================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.wafv2_ip_set`.
New in version 1.5.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, modify and delete IP sets for WAFv2.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **addresses** list / elements=string | | Contains an array of strings that specify one or more IP addresses or blocks of IP addresses in Classless Inter-Domain Routing (CIDR) notation. Required when *state=present*. When *state=absent* and *addresses* is defined, only the given IP addresses will be removed from the IP set. The entire IP set itself will stay present. |
| **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 IP 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 |
| **ip\_address\_version** string | **Choices:*** IPV4
* IPV6
| Specifies whether this is an IPv4 or an IPv6 IP set. Required when *state=present*. |
| **name** string / required | | The name of the IP set. |
| **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\_addresses** boolean | **Choices:*** no
* **yes** ←
| When set to `no`, keep the existing addresses in place. Will modify and add, but will not delete. |
| **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 |
| **scope** string / required | **Choices:*** CLOUDFRONT
* REGIONAL
| Specifies whether this is for an AWS CloudFront distribution or for a regional application, such as API Gateway or Application LoadBalancer. |
| **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:*** present
* absent
| Whether the rule is present or absent. |
| **tags** dictionary | | Key value pairs to associate with the resource. Currently tags are not visible. Nor in the web ui, nor via cli and nor in boto3. |
| **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: test ip set
wafv2_ip_set:
name: test02
state: present
description: hallo eins
scope: REGIONAL
ip_address_version: IPV4
addresses:
- 8.8.8.8/32
- 8.8.4.4/32
tags:
A: B
C: D
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **addresses** list / elements=string | Always, as long as the ip set exists | Current addresses of the ip set **Sample:** ['8.8.8.8/32', '8.8.4.4/32'] |
| **arn** string | Always, as long as the ip set exists | IP set arn **Sample:** arn:aws:wafv2:eu-central-1:11111111:regional/ipset/test02/4b007330-2934-4dc5-af24-82dcb3aeb127 |
| **description** string | Always, as long as the ip set exists | Description of the ip set **Sample:** Some IP set description |
| **ip\_address\_version** string | Always, as long as the ip set exists | IP version of the ip set **Sample:** IPV4 |
| **name** string | Always, as long as the ip set exists | IP set name **Sample:** test02 |
### Authors
* Markus Bergholz (@markuman)
| programming_docs |
ansible community.aws.sqs_queue – Creates or deletes AWS SQS queues community.aws.sqs\_queue – Creates or deletes AWS SQS queues
============================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.sqs_queue`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create or delete AWS SQS queues.
* Update attributes on existing queues.
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 |
| **content\_based\_deduplication** boolean | **Choices:*** no
* yes
| Enables content-based deduplication. Used for FIFOs only. 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. |
| **delay\_seconds** integer | | The delivery delay in seconds.
aliases: delivery\_delay |
| **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 |
| **kms\_data\_key\_reuse\_period\_seconds** integer | | The length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again.
aliases: kms\_data\_key\_reuse\_period |
| **kms\_master\_key\_id** string | | The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. |
| **maximum\_message\_size** integer | | The maximum message size in bytes. |
| **message\_retention\_period** integer | | The message retention period in seconds. |
| **name** string / required | | Name of the queue. |
| **policy** dictionary | | The JSON dict policy to attach to queue. |
| **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
| Remove tags not listed in *tags*. |
| **queue\_type** string | **Choices:*** **standard** ←
* fifo
| Standard or FIFO queue.
*queue\_type* can only be set at queue creation and will otherwise be ignored. |
| **receive\_message\_wait\_time\_seconds** integer | | The receive message wait time in seconds.
aliases: receive\_message\_wait\_time |
| **redrive\_policy** dictionary | | JSON dict with the redrive\_policy (see example). |
| **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 the queue. |
| **tags** dictionary | | Tag dict to apply to the queue (requires botocore 1.5.40 or above). To remove all tags set *tags={}* and *purge\_tags=true*. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **visibility\_timeout** integer | | The default visibility timeout in seconds.
aliases: default\_visibility\_timeout |
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: Create SQS queue with redrive policy
community.aws.sqs_queue:
name: my-queue
region: ap-southeast-2
default_visibility_timeout: 120
message_retention_period: 86400
maximum_message_size: 1024
delivery_delay: 30
receive_message_wait_time: 20
policy: "{{ json_dict }}"
redrive_policy:
maxReceiveCount: 5
deadLetterTargetArn: arn:aws:sqs:eu-west-1:123456789012:my-dead-queue
- name: Drop redrive policy
community.aws.sqs_queue:
name: my-queue
region: ap-southeast-2
redrive_policy: {}
- name: Create FIFO queue
community.aws.sqs_queue:
name: fifo-queue
region: ap-southeast-2
queue_type: fifo
content_based_deduplication: yes
- name: Tag queue
community.aws.sqs_queue:
name: fifo-queue
region: ap-southeast-2
tags:
example: SomeValue
- name: Configure Encryption, automatically uses a new data key every hour
community.aws.sqs_queue:
name: fifo-queue
region: ap-southeast-2
kms_master_key_id: alias/MyQueueKey
kms_data_key_reuse_period_seconds: 3600
- name: Delete SQS queue
community.aws.sqs_queue:
name: my-queue
region: ap-southeast-2
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 |
| --- | --- | --- |
| **content\_based\_deduplication** boolean | always | Enables content-based deduplication. Used for FIFOs only. **Sample:** True |
| **delay\_seconds** integer | always | The delivery delay in seconds. |
| **kms\_data\_key\_reuse\_period\_seconds** integer | always | The length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. **Sample:** 300 |
| **kms\_master\_key\_id** string | always | The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. **Sample:** alias/MyAlias |
| **maximum\_message\_size** integer | always | The maximum message size in bytes. **Sample:** 262144 |
| **message\_retention\_period** integer | always | The message retention period in seconds. **Sample:** 345600 |
| **name** string | always | Name of the SQS Queue **Sample:** queuename-987d2de0 |
| **queue\_arn** string | on success | The queue's Amazon resource name (ARN). **Sample:** arn:aws:sqs:us-east-1:199999999999:queuename-987d2de0 |
| **queue\_url** string | on success | URL to access the queue **Sample:** https://queue.amazonaws.com/123456789012/MyQueue |
| **receive\_message\_wait\_time\_seconds** integer | always | The receive message wait time in seconds. |
| **region** string | always | Region that the queue was created within **Sample:** us-east-1 |
| **tags** dictionary | always | List of queue tags **Sample:** {"Env": "prod"} |
| **visibility\_timeout** integer | always | The default visibility timeout in seconds. **Sample:** 30 |
### Authors
* Alan Loi (@loia)
* Fernando Jose Pando (@nand0p)
* Nadir Lloret (@nadirollo)
* Dennis Podkovyrin (@sbj-ss)
ansible community.aws.ec2_vpc_vpn_info – Gather information about VPN Connections in AWS. community.aws.ec2\_vpc\_vpn\_info – Gather information about VPN Connections in AWS.
====================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_vpc_vpn_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about VPN Connections in AWS.
* This module was called `ec2_vpc_vpn_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_DescribeVpnConnections.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. |
| **vpn\_connection\_ids** list / elements=string | | Get details of a specific VPN connections using vpn connection ID/IDs. This value should be provided as a list. |
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 vpn connections
community.aws.ec2_vpc_vpn_info:
- name: Gather information about a filtered list of vpn connections, based on tags
community.aws.ec2_vpc_vpn_info:
filters:
"tag:Name": test-connection
register: vpn_conn_info
- name: Gather information about vpn connections by specifying connection IDs.
community.aws.ec2_vpc_vpn_info:
filters:
vpn-gateway-id: vgw-cbe66beb
register: vpn_conn_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\_connections** complex | always | List of one or more VPN Connections. |
| | **category** string | always | The category of the VPN connection. **Sample:** VPN |
| | **customer\_gateway\_id** string | always | The ID of the customer gateway at your end of the VPN connection. **Sample:** cgw-17a53c37 |
| | **customer\_gatway\_configuration** string | always | The configuration information for the VPN connection's customer gateway (in the native XML format). |
| | **options** dictionary | always | The VPN connection options. **Sample:** {'static\_routes\_only': False} |
| | **routes** complex | always | List of static routes associated with the VPN connection. |
| | | **destination\_cidr\_block** string | always | The CIDR block associated with the local subnet of the customer data center. **Sample:** 10.0.0.0/16 |
| | | **state** string | always | The current state of the static route. **Sample:** available |
| | **state** string | always | The current state of the VPN connection. **Sample:** available |
| | **tags** dictionary | always | Any tags assigned to the VPN connection. **Sample:** {'Name': 'test-conn'} |
| | **type** string | always | The type of VPN connection. **Sample:** ipsec.1 |
| | **vgw\_telemetry** complex | always | Information about the VPN tunnel. |
| | | **accepted\_route\_count** integer | always | The number of accepted routes. |
| | | **certificate\_arn** string | when a private certificate is used for authentication | The Amazon Resource Name of the virtual private gateway tunnel endpoint certificate. **Sample:** arn:aws:acm:us-east-1:123456789101:certificate/c544d8ce-20b8-4fff-98b0-example |
| | | **last\_status\_change** string | always | The date and time of the last change in status. **Sample:** 2018-02-09T14:35:27+00:00 |
| | | **outside\_ip\_address** string | always | The Internet-routable IP address of the virtual private gateway's outside interface. **Sample:** 13.127.79.191 |
| | | **status** string | always | The status of the VPN tunnel. **Sample:** DOWN |
| | | **status\_message** string | always | If an error occurs, a description of the error. **Sample:** IPSEC IS DOWN |
| | **vpn\_connection\_id** string | always | The ID of the VPN connection. **Sample:** vpn-f700d5c0 |
| | **vpn\_gateway\_id** string | always | The ID of the virtual private gateway at the AWS side of the VPN connection. **Sample:** vgw-cbe56bfb |
### Authors
* Madhura Naniwadekar (@Madhura-CSI)
ansible community.aws.ecs_service_info – List or describe services in ECS community.aws.ecs\_service\_info – List or describe services in ECS
===================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ecs_service_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Lists or describes services in ECS.
* This module was called `ecs_service_facts` before Ansible 2.9, returning `ansible_facts`. Note that the [community.aws.ecs\_service\_info](#ansible-collections-community-aws-ecs-service-info-module) module no longer returns `ansible_facts`!
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* json
* 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 |
| **cluster** string | | The cluster ARNS in which to list the services. |
| **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. |
| **details** boolean | **Choices:*** **no** ←
* yes
| Set this to true if you want detailed information about the services. |
| **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** boolean | **Choices:*** no
* **yes** ←
| Whether to return ECS service events. Only has an effect if *details=true*. |
| **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 |
| **service** list / elements=string | | One or more services to get details for |
| **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.
# Basic listing example
- community.aws.ecs_service_info:
cluster: test-cluster
service: console-test-service
details: true
register: output
# Basic listing example
- community.aws.ecs_service_info:
cluster: test-cluster
register: 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 |
| --- | --- | --- |
| **services** complex | success | When details is false, returns an array of service ARNs, otherwise an array of complex objects as described below. |
| | **clusterArn** string | always | The Amazon Resource Name (ARN) of the of the cluster that hosts the service. |
| | **deployments** list / elements=dictionary | always | list of service deployments |
| | **desiredCount** integer | always | The desired number of instantiations of the task definition to keep running on the service. |
| | **events** list / elements=dictionary | when events is true | list of service events |
| | **loadBalancers** complex | always | A list of load balancer objects |
| | | **containerName** string | always | The name of the container to associate with the load balancer. |
| | | **containerPort** integer | always | The port on the container to associate with the load balancer. |
| | | **loadBalancerName** string | always | the name |
| | **pendingCount** integer | always | The number of tasks in the cluster that are in the PENDING state. |
| | **runningCount** integer | always | The number of tasks in the cluster that are in the RUNNING state. |
| | **serviceArn** string | always | The Amazon Resource Name (ARN) that identifies the service. The ARN contains the arn:aws:ecs namespace, followed by the region of the service, the AWS account ID of the service owner, the service namespace, and then the service name. For example, arn:aws:ecs:region :012345678910 :service/my-service . |
| | **serviceName** string | always | A user-generated string used to identify the service |
| | **status** string | always | The valid values are ACTIVE, DRAINING, or INACTIVE. |
| | **taskDefinition** string | always | The ARN of a task definition to use for tasks in the service. |
### Authors
* Mark Chance (@Java1Guy)
* Darek Kaczynski (@kaczynskid)
| programming_docs |
ansible community.aws.aws_acm – Upload and delete certificates in the AWS Certificate Manager service community.aws.aws\_acm – Upload and delete certificates in the AWS Certificate Manager service
==============================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_acm`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Import and delete certificates in Amazon Web Service’s Certificate Manager (AWS ACM).
* This module does not currently interact with AWS-provided certificates. It currently only manages certificates provided to AWS by the user.
* The ACM API allows users to upload multiple certificates for the same domain name, and even multiple identical certificates. This module attempts to restrict such freedoms, to be idempotent, as per the Ansible philosophy. It does this through applying AWS resource “Name” tags to ACM certificates.
* When *state=present*, if there is one certificate in ACM with a `Name` tag equal to the `name_tag` parameter, and an identical body and chain, this task will succeed without effect.
* When *state=present*, if there is one certificate in ACM a *Name* tag equal to the *name\_tag* parameter, and a different body, this task will overwrite that certificate.
* When *state=present*, if there are multiple certificates in ACM with a *Name* tag equal to the *name\_tag* parameter, this task will fail.
* When *state=absent* and *certificate\_arn* is defined, this module will delete the ACM resource with that ARN if it exists in this region, and succeed without effect if it doesn’t exist.
* When *state=absent* and *domain\_name* is defined, this module will delete all ACM resources in this AWS region with a corresponding domain name. If there are none, it will succeed without effect.
* When *state=absent* and *certificate\_arn* is not defined, and *domain\_name* is not defined, this module will delete all ACM resources in this AWS region with a corresponding *Name* tag. If there are none, it will succeed without effect.
* Note that this may not work properly with keys of size 4096 bits, due to a limitation of the ACM API.
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 |
| **certificate** string | | The body of the PEM encoded public certificate. Required when *state* is not `absent`. If your certificate is in a file, use `lookup('file', 'path/to/cert.pem'`). |
| **certificate\_arn** string | | The ARN of a certificate in ACM to delete Ignored when *state=present*. If *state=absent*, you must provide one of *certificate\_arn*, *domain\_name* or *name\_tag*. If *state=absent* and no resource exists with this ARN in this region, the task will succeed with no effect. If *state=absent* and the corresponding resource exists in a different region, this task may report success without deleting that resource.
aliases: arn |
| **certificate\_chain** string | | The body of the PEM encoded chain for your certificate. If your certificate chain is in a file, use `lookup('file', 'path/to/chain.pem'`). Ignored when *state=absent*
|
| **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. |
| **domain\_name** string | | The domain name of the certificate. If *state=absent* and *domain\_name* is specified, this task will delete all ACM certificates with this domain. Exactly one of *domain\_name*, *name\_tag* and *certificate\_arn* must be provided. If *state=present* this must not be specified. (Since the domain name is encoded within the public certificate's body.)
aliases: domain |
| **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 |
| **name\_tag** string | | The unique identifier for tagging resources using AWS tags, with key *Name*. This can be any set of characters accepted by AWS for tag values. This is to ensure Ansible can treat certificates idempotently, even though the ACM API allows duplicate certificates. If *state=preset*, this must be specified. If *state=absent*, you must provide exactly one of *certificate\_arn*, *domain\_name* or *name\_tag*.
aliases: name |
| **private\_key** string | | The body of the PEM encoded private key. Required when *state=present*. Ignored when *state=absent*. If your private key is in a file, use `lookup('file', 'path/to/key.pem'`). |
| **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
| If *state=present*, the specified public certificate and private key will be uploaded, with *Name* tag equal to *name\_tag*. If *state=absent*, any certificates in this region with a corresponding *domain\_name*, *name\_tag* or *certificate\_arn* will be deleted. |
| **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: upload a self-signed certificate
community.aws.aws_acm:
certificate: "{{ lookup('file', 'cert.pem' ) }}"
privateKey: "{{ lookup('file', 'key.pem' ) }}"
name_tag: my_cert # to be applied through an AWS tag as "Name":"my_cert"
region: ap-southeast-2 # AWS region
- name: create/update a certificate with a chain
community.aws.aws_acm:
certificate: "{{ lookup('file', 'cert.pem' ) }}"
privateKey: "{{ lookup('file', 'key.pem' ) }}"
name_tag: my_cert
certificate_chain: "{{ lookup('file', 'chain.pem' ) }}"
state: present
region: ap-southeast-2
register: cert_create
- name: print ARN of cert we just created
ansible.builtin.debug:
var: cert_create.certificate.arn
- name: delete the cert we just created
community.aws.aws_acm:
name_tag: my_cert
state: absent
region: ap-southeast-2
- name: delete a certificate with a particular ARN
community.aws.aws_acm:
certificate_arn: "arn:aws:acm:ap-southeast-2:123456789012:certificate/01234567-abcd-abcd-abcd-012345678901"
state: absent
region: ap-southeast-2
- name: delete all certificates with a particular domain name
community.aws.aws_acm:
domain_name: acm.ansible.com
state: absent
region: ap-southeast-2
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **arns** list / elements=string | when *state=absent* | A list of the ARNs of the certificates in ACM which were deleted **Sample:** ['arn:aws:acm:ap-southeast-2:123456789012:certificate/01234567-abcd-abcd-abcd-012345678901'] |
| **certificate** complex | when *state=present* | Information about the certificate which was uploaded |
| | **arn** string | when *state=present* and not in check mode | The ARN of the certificate in ACM **Sample:** arn:aws:acm:ap-southeast-2:123456789012:certificate/01234567-abcd-abcd-abcd-012345678901 |
| | **domain\_name** string | when *state=present* | The domain name encoded within the public certificate **Sample:** acm.ansible.com |
### Authors
* Matthew Davis (@matt-telstra) on behalf of Telstra Corporation Limited
ansible community.aws.redshift_info – Gather information about Redshift cluster(s) community.aws.redshift\_info – Gather information about Redshift cluster(s)
===========================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.redshift_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about Redshift cluster(s).
* This module was called `redshift_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 |
| **cluster\_identifier** string | | The prefix of cluster identifier of the Redshift cluster you are searching for. This is a regular expression match with implicit '^'. Append '$' for a complete match.
aliases: name, identifier |
| **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 |
| **tags** dictionary | | A dictionary/hash of tags in the format { tag1\_name: 'tag1\_value', tag2\_name: 'tag2\_value' } to match against the security group(s) you are searching for. |
| **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 net set authentication details, see the AWS guide for details.
- name: Find all clusters
community.aws.redshift_info:
register: redshift
- name: Find cluster(s) with matching tags
community.aws.redshift_info:
tags:
env: prd
stack: monitoring
register: redshift_tags
- name: Find cluster(s) with matching name/prefix and tags
community.aws.redshift_info:
tags:
env: dev
stack: web
name: user-
register: redshift_web
- name: Fail if no cluster(s) is/are found
community.aws.redshift_info:
tags:
env: stg
stack: db
register: redshift_user
failed_when: "{{ redshift_user.results | length == 0 }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **allow\_version\_upgrade** boolean | success | A Boolean value that, if true, indicates that major version upgrades will be applied automatically to the cluster during the maintenance window. **Sample:** true|false |
| **automated\_snapshot\_retention\_period** integer | success | The number of days that automatic cluster snapshots are retained. **Sample:** 1 |
| **availability\_zone** string | success | The name of the Availability Zone in which the cluster is located. **Sample:** us-east-1b |
| **cluster\_create\_time** string | success | The date and time that the cluster was created. **Sample:** 2016-05-10T08:33:16.629000+00:00 |
| **cluster\_identifier** string | success | Unique key to identify the cluster. **Sample:** redshift-identifier |
| **cluster\_nodes** list / elements=string | success | The nodes in the cluster. **Sample:** [{'node\_role': 'LEADER', 'private\_ip\_address': '10.0.0.1', 'public\_ip\_address': 'x.x.x.x'}, {'node\_role': 'COMPUTE-1', 'private\_ip\_address': '10.0.0.3', 'public\_ip\_address': 'x.x.x.x'}] |
| **cluster\_paramater\_groups** list / elements=string | success | The list of cluster parameters that are associated with this cluster. **Sample:** [{'cluster\_parameter\_status\_list': [{'parameter\_apply\_status': 'in-sync', 'parameter\_name': 'statement\_timeout'}, {'parameter\_apply\_status': 'in-sync', 'parameter\_name': 'require\_ssl'}], 'parameter\_apply\_status': 'in-sync', 'parameter\_group\_name': 'tuba'}] |
| **cluster\_public\_keys** string | success | The public key for the cluster. **Sample:** ssh-rsa anjigfam Amazon-Redshift |
| **cluster\_revision\_number** string | success | The specific revision number of the database in the cluster. **Sample:** 1231 |
| **cluster\_security\_groups** list / elements=string | success | A list of cluster security groups that are associated with the cluster. |
| **cluster\_snapshot\_copy\_status** dictionary | success | A value that returns the destination region and retention period that are configured for cross-region snapshot copy. |
| **cluster\_status** string | success | Current state of the cluster. **Sample:** available |
| **cluster\_subnet\_group\_name** string | success | The name of the subnet group that is associated with the cluster. **Sample:** redshift-subnet |
| **cluster\_version** string | success | The version ID of the Amazon Redshift engine that is running on the cluster. **Sample:** 1.0 |
| **db\_name** string | success | The name of the initial database that was created when the cluster was created. **Sample:** dev |
| **elastic\_ip\_status** dictionary | success | The status of the elastic IP (EIP) address. |
| **encrypted** boolean | success | Boolean value that, if true , indicates that data in the cluster is encrypted at rest. **Sample:** true|false |
| **endpoint** string | success | The connection endpoint. **Sample:** {'address': 'cluster-ds2.ocmugla0rf.us-east-1.redshift.amazonaws.com', 'port': 5439} |
| **enhanced\_vpc\_routing** boolean | success | An option that specifies whether to create the cluster with enhanced VPC routing enabled. **Sample:** true|false |
| **hsm\_status** dictionary | success | A value that reports whether the Amazon Redshift cluster has finished applying any hardware security module (HSM) settings changes specified in a modify cluster command. |
| **iam\_roles** list / elements=string | success | List of IAM roles attached to the cluster. |
| **kms\_key\_id** string | success | The AWS Key Management Service (AWS KMS) key ID of the encryption key used to encrypt data in the cluster. |
| **master\_username** string | success | The master user name for the cluster. **Sample:** admin |
| **modify\_status** string | optional | The status of a modify operation. |
| **node\_type** string | success | The node type for nodes in the cluster. **Sample:** ds2.xlarge |
| **number\_of\_nodes** integer | success | The number of compute nodes in the cluster. **Sample:** 12 |
| **pending\_modified\_values** dictionary | success | A value that, if present, indicates that changes to the cluster are pending. |
| **preferred\_maintenance\_window** string | success | The weekly time range, in Universal Coordinated Time (UTC), during which system maintenance can occur. **Sample:** tue:07:30-tue:08:00 |
| **publicly\_accessible** boolean | success | A Boolean value that, if true , indicates that the cluster can be accessed from a public network. **Sample:** true|false |
| **restore\_status** dictionary | success | A value that describes the status of a cluster restore action. |
| **tags** list / elements=string | success | The list of tags for the cluster. |
| **vpc\_id** string | success | The identifier of the VPC the cluster is in, if the cluster is in a VPC. **Sample:** vpc-1234567 |
| **vpc\_security\_groups** list / elements=string | success | A list of VPC security groups the are associated with the cluster. **Sample:** [{'status': 'active', 'vpc\_security\_group\_id': 'sg-12cghhg'}] |
### Authors
* Jens Carl (@j-carl)
| programming_docs |
ansible community.aws.aws_elasticbeanstalk_app – Create, update, and delete an elastic beanstalk application community.aws.aws\_elasticbeanstalk\_app – Create, update, and delete an elastic beanstalk application
======================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_elasticbeanstalk_app`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates, updates, deletes beanstalk applications if app\_name is provided.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.6
* boto
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **app\_name** string | | Name of the beanstalk application you wish to manage.
aliases: name |
| **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 | | The description of the application. |
| **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 |
| **state** string | **Choices:*** absent
* **present** ←
| Whether to ensure the application is present or absent. |
| **terminate\_by\_force** boolean | **Choices:*** **no** ←
* yes
| When *terminate\_by\_force=true*, running environments will be terminated before deleting the application. |
| **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
--------
```
# Create or update an application
- community.aws.aws_elasticbeanstalk_app:
app_name: Sample_App
description: "Hello World App"
state: present
# Delete application
- community.aws.aws_elasticbeanstalk_app:
app_name: Sample_App
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 |
| --- | --- | --- |
| **app** dictionary | always | Beanstalk application. **Sample:** {'ApplicationName': 'app-name', 'ConfigurationTemplates': [], 'DateCreated': '2016-12-28T14:50:03.185000+00:00', 'DateUpdated': '2016-12-28T14:50:03.185000+00:00', 'Description': 'description', 'Versions': ['1.0.0', '1.0.1']} |
| **output** string | in check mode | Message indicating what change will occur. **Sample:** App is up-to-date |
### Authors
* Harpreet Singh (@hsingh)
* Stephen Granger (@viper233)
ansible community.aws.elb_target_info – Gathers which target groups a target is associated with. community.aws.elb\_target\_info – Gathers which target groups a target is associated with.
==========================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.elb_target_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module will search through every target group in a region to find which ones have registered a given instance ID or IP.
* This module was called `elb_target_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 |
| **get\_unused\_target\_groups** boolean | **Choices:*** no
* **yes** ←
| Whether or not to get target groups not used by any load balancers. |
| **instance\_id** string / required | | What instance ID to get information for. |
| **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
--------
```
# practical use case - dynamically de-registering and re-registering nodes
- name: Get EC2 Metadata
amazon.aws.ec2_metadata_facts:
- name: Get initial list of target groups
delegate_to: localhost
community.aws.elb_target_info:
instance_id: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}"
register: target_info
- name: save fact for later
ansible.builtin.set_fact:
original_tgs: "{{ target_info.instance_target_groups }}"
- name: Deregister instance from all target groups
delegate_to: localhost
community.aws.elb_target:
target_group_arn: "{{ item.0.target_group_arn }}"
target_port: "{{ item.1.target_port }}"
target_az: "{{ item.1.target_az }}"
target_id: "{{ item.1.target_id }}"
state: absent
target_status: "draining"
region: "{{ ansible_ec2_placement_region }}"
with_subelements:
- "{{ original_tgs }}"
- "targets"
# This avoids having to wait for 'elb_target' to serially deregister each
# target group. An alternative would be to run all of the 'elb_target'
# tasks async and wait for them to finish.
- name: wait for all targets to deregister simultaneously
delegate_to: localhost
community.aws.elb_target_info:
get_unused_target_groups: false
instance_id: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}"
register: target_info
until: (target_info.instance_target_groups | length) == 0
retries: 60
delay: 10
- name: reregister in elbv2s
community.aws.elb_target:
region: "{{ ansible_ec2_placement_region }}"
target_group_arn: "{{ item.0.target_group_arn }}"
target_port: "{{ item.1.target_port }}"
target_az: "{{ item.1.target_az }}"
target_id: "{{ item.1.target_id }}"
state: present
target_status: "initial"
with_subelements:
- "{{ original_tgs }}"
- "targets"
# wait until all groups associated with this instance are 'healthy' or
# 'unused'
- name: wait for registration
community.aws.elb_target_info:
get_unused_target_groups: false
instance_id: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}"
register: target_info
until: (target_info.instance_target_groups |
map(attribute='targets') |
flatten |
map(attribute='target_health') |
rejectattr('state', 'equalto', 'healthy') |
rejectattr('state', 'equalto', 'unused') |
list |
length) == 0
retries: 61
delay: 10
# using the target groups to generate AWS CLI commands to reregister the
# instance - useful in case the playbook fails mid-run and manual
# rollback is required
- name: "reregistration commands: ELBv2s"
ansible.builtin.debug:
msg: >
aws --region {{ansible_ec2_placement_region}} elbv2
register-targets --target-group-arn {{item.target_group_arn}}
--targets{%for target in item.targets%}
Id={{target.target_id}},
Port={{target.target_port}}{%if target.target_az%},AvailabilityZone={{target.target_az}}
{%endif%}
{%endfor%}
loop: "{{target_info.instance_target_groups}}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **instance\_target\_groups** complex | always | a list of target groups to which the instance is registered to |
| | **target\_group\_arn** string | always | The ARN of the target group **Sample:** ['arn:aws:elasticloadbalancing:eu-west-1:111111111111:targetgroup/target-group/deadbeefdeadbeef'] |
| | **target\_group\_type** string | always | Which target type is used for this group **Sample:** ['ip', 'instance'] |
| | **targets** complex | always | A list of targets that point to this instance ID |
| | | **target\_az** string | when an AZ is associated with this instance | which availability zone is explicitly associated with this target **Sample:** ['us-west-2a'] |
| | | **target\_health** complex | always | The target health description. See following link for all the possible values <https://boto3.readthedocs.io/en/latest/reference/services/elbv2.html#ElasticLoadBalancingv2.Client.describe_target_health>
|
| | | | **description** string | if *state!=present* | description of target health **Sample:** ['Target desregistration is in progress'] |
| | | | **reason** string | if *state!=healthy* | reason code for target health **Sample:** ['Target.Deregistration in progress'] |
| | | | **state** string | always | health state **Sample:** ['healthy', 'draining', 'initial', 'unhealthy', 'unused', 'unavailable'] |
| | | **target\_id** string | always | the target ID referring to this instance **Sample:** ['i-deadbeef', '1.2.3.4'] |
| | | **target\_port** string | always | which port this target is listening on **Sample:** [80] |
### Authors
* Yaakov Kuperman (@yaakov-github)
ansible community.aws.ec2_vpc_route_table_info – Gather information about ec2 VPC route tables in AWS community.aws.ec2\_vpc\_route\_table\_info – Gather information about ec2 VPC route tables in AWS
=================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_vpc_route_table_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about ec2 VPC route tables in AWS
* This module was called `ec2_vpc_route_table_facts` before Ansible 2.9. The usage did not change.
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. |
| **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_DescribeRouteTables.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 VPC route tables
community.aws.ec2_vpc_route_table_info:
- name: Gather information about a particular VPC route table using route table ID
community.aws.ec2_vpc_route_table_info:
filters:
route-table-id: rtb-00112233
- name: Gather information about any VPC route table with a tag key Name and value Example
community.aws.ec2_vpc_route_table_info:
filters:
"tag:Name": Example
- name: Gather information about any VPC route table within VPC with ID vpc-abcdef00
community.aws.ec2_vpc_route_table_info:
filters:
vpc-id: vpc-abcdef00
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **route\_tables** complex | always | A list of dictionarys describing route tables See also <https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Client.describe_route_tables>
|
| | **associations** complex | always | List of subnets associated with the route table |
| | | **association\_state** complex | always | The state of the association |
| | | | **state** string | always | The state of the association **Sample:** associated |
| | | | **state\_message** string | when available | Additional information about the state of the association **Sample:** Creating association |
| | | **id** string | always | ID of association between route table and subnet **Sample:** rtbassoc-ab47cfc3 |
| | | **main** boolean | always | Whether this is the main route table |
| | | **route\_table\_association\_id** string | always | ID of association between route table and subnet **Sample:** rtbassoc-ab47cfc3 |
| | | **route\_table\_id** string | always | ID of the route table **Sample:** rtb-bf779ed7 |
| | | **subnet\_id** string | always | ID of the subnet **Sample:** subnet-82055af9 |
| | **id** string | always | ID of the route table (same as route\_table\_id for backwards compatibility) **Sample:** rtb-bf779ed7 |
| | **owner\_id** string | always | ID of the account which owns the route table **Sample:** 012345678912 |
| | **propagating\_vgws** list / elements=string | always | List of Virtual Private Gateways propagating routes |
| | **route\_table\_id** string | always | ID of the route table **Sample:** rtb-bf779ed7 |
| | **routes** complex | always | List of routes in the route table |
| | | **destination\_cidr\_block** string | always | CIDR block of destination **Sample:** 10.228.228.0/22 |
| | | **gateway\_id** string | when gateway is local or internet gateway | ID of the gateway **Sample:** local |
| | | **instance\_id** string | always | ID of a NAT instance. Empty unless the route is via an EC2 instance **Sample:** i-abcd123456789 |
| | | **instance\_owner\_id** string | always | AWS account owning the NAT instance Empty unless the route is via an EC2 instance **Sample:** 123456789012 |
| | | **nat\_gateway\_id** string | when the route is via a NAT gateway | ID of the NAT gateway **Sample:** local |
| | | **network\_interface\_id** string | always | The ID of the network interface Empty unless the route is via an EC2 instance **Sample:** 123456789012 |
| | | **origin** string | always | mechanism through which the route is in the table **Sample:** CreateRouteTable |
| | | **state** string | always | state of the route **Sample:** active |
| | **tags** dictionary | always | Tags applied to the route table **Sample:** {'Name': 'Public route table', 'Public': 'true'} |
| | **vpc\_id** string | always | ID for the VPC in which the route lives **Sample:** vpc-6e2d2407 |
### Authors
* Rob White (@wimnat)
* Mark Chappell (@tremble)
| programming_docs |
ansible community.aws.aws_ses_identity – Manages SES email and domain identity community.aws.aws\_ses\_identity – Manages SES email and domain identity
========================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_ses_identity`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module allows the user to manage verified email and domain identity for SES.
* This covers verifying and removing identities as well as setting up complaint, bounce and delivery notification settings.
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 |
| **bounce\_notifications** dictionary | | Setup the SNS topic used to report bounce notifications. If omitted, bounce notifications will not be delivered to a SNS topic. If bounce notifications are not delivered to a SNS topic, *feedback\_forwarding* must be enabled. |
| | **include\_headers** boolean | **Choices:*** **no** ←
* yes
| Whether or not to include headers when delivering to the SNS topic. If *topic* is not specified this will have no impact, but the SES setting is updated even if there is no topic. |
| | **topic** string | | The ARN of the topic to send notifications to. If omitted, notifications will not be delivered to a SNS topic. |
| **complaint\_notifications** dictionary | | Setup the SNS topic used to report complaint notifications. If omitted, complaint notifications will not be delivered to a SNS topic. If complaint notifications are not delivered to a SNS topic, *feedback\_forwarding* must be enabled. |
| | **include\_headers** boolean | **Choices:*** **no** ←
* yes
| Whether or not to include headers when delivering to the SNS topic. If *topic* is not specified this will have no impact, but the SES setting is updated even if there is no topic. |
| | **topic** string | | The ARN of the topic to send notifications to. If omitted, notifications will not be delivered to a SNS topic. |
| **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. |
| **delivery\_notifications** dictionary | | Setup the SNS topic used to report delivery notifications. If omitted, delivery notifications will not be delivered to a SNS topic. |
| | **include\_headers** boolean | **Choices:*** **no** ←
* yes
| Whether or not to include headers when delivering to the SNS topic. If *topic* is not specified this will have no impact, but the SES setting is updated even if there is no topic. |
| | **topic** string | | The ARN of the topic to send notifications to. If omitted, notifications will not be delivered to a SNS topic. |
| **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 |
| **feedback\_forwarding** boolean | **Choices:*** no
* **yes** ←
| Whether or not to enable feedback forwarding. This can only be false if both *bounce\_notifications* and *complaint\_notifications* specify SNS topics. |
| **identity** string / required | | This is the email address or domain to verify / delete. If this contains an '@' then it will be considered an email. Otherwise it will be considered a domain. |
| **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
| Whether to create(or update) or delete the identity. |
| **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: Ensure [email protected] email identity exists
community.aws.aws_ses_identity:
identity: [email protected]
state: present
- name: Delete [email protected] email identity
community.aws.aws_ses_identity:
email: [email protected]
state: absent
- name: Ensure example.com domain identity exists
community.aws.aws_ses_identity:
identity: example.com
state: present
# Create an SNS topic and send bounce and complaint notifications to it
# instead of emailing the identity owner
- name: Ensure complaints-topic exists
community.aws.sns_topic:
name: "complaints-topic"
state: present
purge_subscriptions: False
register: topic_info
- name: Deliver feedback to topic instead of owner email
community.aws.aws_ses_identity:
identity: [email protected]
state: present
complaint_notifications:
topic: "{{ topic_info.sns_arn }}"
include_headers: True
bounce_notifications:
topic: "{{ topic_info.sns_arn }}"
include_headers: False
feedback_forwarding: False
# Create an SNS topic for delivery notifications and leave complaints
# Being forwarded to the identity owner email
- name: Ensure delivery-notifications-topic exists
community.aws.sns_topic:
name: "delivery-notifications-topic"
state: present
purge_subscriptions: False
register: topic_info
- name: Delivery notifications to topic
community.aws.aws_ses_identity:
identity: [email protected]
state: present
delivery_notifications:
topic: "{{ topic_info.sns_arn }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **identity** string | success | The identity being modified. **Sample:** [email protected] |
| **identity\_arn** string | success | The arn of the identity being modified. **Sample:** arn:aws:ses:us-east-1:12345678:identity/[email protected] |
| **notification\_attributes** complex | success | The notification setup for the identity. **Sample:** {'bounce\_topic': 'arn:aws:sns:....', 'complaint\_topic': 'arn:aws:sns:....', 'delivery\_topic': 'arn:aws:sns:....', 'forwarding\_enabled': False, 'headers\_in\_bounce\_notifications\_enabled': True, 'headers\_in\_complaint\_notifications\_enabled': True, 'headers\_in\_delivery\_notifications\_enabled': True} |
| | **bounce\_topic** string | success | The ARN of the topic bounce notifications are delivered to. Omitted if bounce notifications are not delivered to a topic. |
| | **complaint\_topic** string | success | The ARN of the topic complaint notifications are delivered to. Omitted if complaint notifications are not delivered to a topic. |
| | **delivery\_topic** string | success | The ARN of the topic delivery notifications are delivered to. Omitted if delivery notifications are not delivered to a topic. |
| | **forwarding\_enabled** boolean | success | Whether or not feedback forwarding is enabled. |
| | **headers\_in\_bounce\_notifications\_enabled** boolean | success | Whether or not headers are included in messages delivered to the bounce topic. |
| | **headers\_in\_complaint\_notifications\_enabled** boolean | success | Whether or not headers are included in messages delivered to the complaint topic. |
| | **headers\_in\_delivery\_notifications\_enabled** boolean | success | Whether or not headers are included in messages delivered to the delivery topic. |
| **verification\_attributes** complex | success | The verification information for the identity. **Sample:** {'verification\_status': 'Pending', 'verification\_token': '....'} |
| | **verification\_status** string | success | The verification status of the identity. **Sample:** Pending |
| | **verification\_token** string | success | The verification token for a domain identity. |
### Authors
* Ed Costello (@orthanc)
ansible community.aws.ec2_transit_gateway – Create and delete AWS Transit Gateways community.aws.ec2\_transit\_gateway – Create and delete AWS Transit Gateways
============================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_transit_gateway`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates AWS Transit Gateways.
* Deletes AWS Transit Gateways.
* Updates tags on existing transit gateways.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **asn** integer | | A private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 for 32-bit ASNs. |
| **auto\_associate** boolean | **Choices:*** no
* **yes** ←
| Enable or disable automatic association with the default association route table. |
| **auto\_attach** boolean | **Choices:*** **no** ←
* yes
| Enable or disable automatic acceptance of attachment requests. |
| **auto\_propagate** boolean | **Choices:*** no
* **yes** ←
| Enable or disable automatic propagation of routes to the default propagation route table. |
| **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 | | The description of the transit gateway. |
| **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 |
| **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 purge existing tags not included with tags argument. |
| **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
|
`present` to ensure resource is created.
`absent` to remove resource. |
| **tags** dictionary | | A dictionary of resource tags |
| **transit\_gateway\_id** string | | The ID of the transit gateway. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **vpn\_ecmp\_support** boolean | **Choices:*** no
* **yes** ←
| Enable or disable Equal Cost Multipath Protocol support. |
| **wait** boolean | **Choices:*** no
* **yes** ←
| Whether to wait for status |
| **wait\_timeout** integer | **Default:**300 | number of seconds to wait for status |
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: Create a new transit gateway using defaults
community.aws.ec2_transit_gateway:
state: present
region: us-east-1
description: personal-testing
register: created_tgw
- name: Create a new transit gateway with options
community.aws.ec2_transit_gateway:
asn: 64514
auto_associate: no
auto_propagate: no
dns_support: True
description: "nonprod transit gateway"
purge_tags: False
state: present
region: us-east-1
tags:
Name: nonprod transit gateway
status: testing
- name: Remove a transit gateway by description
community.aws.ec2_transit_gateway:
state: absent
region: us-east-1
description: personal-testing
- name: Remove a transit gateway by id
community.aws.ec2_transit_gateway:
state: absent
region: ap-southeast-2
transit_gateway_id: tgw-3a9aa123
register: deleted_tgw
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **transit\_gateway** complex | *state=present* | The attributes of the transit gateway. |
| | **creation\_time** string | always | The creation time of the transit gateway. **Sample:** 2019-03-06T17:13:51+00:00 |
| | **description** string | always | The description of the transit gateway. **Sample:** my test tgw |
| | **options** complex | always | The options attributes of the transit gateway |
| | | **amazon\_side\_asn** string | always | A private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 for 32-bit ASNs. **Sample:** 64512 |
| | | **association\_default\_route\_table\_id** string | Iwhen exists | The ID of the default association route table. **Sample:** tgw-rtb-abc123444 |
| | | **auto\_accept\_shared\_attachements** string | always | Indicates whether attachment requests are automatically accepted. **Sample:** disable |
| | | **default\_route\_table\_association** string | always | Indicates whether resource attachments are automatically associated with the default association route table. **Sample:** enable |
| | | **default\_route\_table\_propagation** string | always | Indicates whether resource attachments automatically propagate routes to the default propagation route table. **Sample:** disable |
| | | **dns\_support** string | always | Indicates whether DNS support is enabled. **Sample:** enable |
| | | **propagation\_default\_route\_table\_id** string | when exists | The ID of the default propagation route table. **Sample:** tgw-rtb-def456777 |
| | | **vpn\_ecmp\_support** string | always | Indicates whether Equal Cost Multipath Protocol support is enabled. **Sample:** enable |
| | **owner\_id** string | always | The account that owns the transit gateway. **Sample:** 123456789012 |
| | **state** string | always | The state of the transit gateway. **Sample:** pending |
| | **tags** dictionary | always | A dictionary of resource tags **Sample:** {'tags': {'Name': 'nonprod\_tgw'}} |
| | **transit\_gateway\_arn** string | always | The ID of the transit\_gateway. **Sample:** tgw-3a9aa123 |
| | **transit\_gateway\_id** string | always | The ID of the transit\_gateway. **Sample:** tgw-3a9aa123 |
### Authors
* Bob Boldin (@BobBoldin)
| programming_docs |
ansible community.aws.ec2_vpc_peering_info – Retrieves AWS VPC Peering details using AWS methods. community.aws.ec2\_vpc\_peering\_info – Retrieves AWS VPC Peering details using AWS methods.
============================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_vpc_peering_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gets various details related to AWS VPC Peers
* This module was called `ec2_vpc_peering_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_DescribeVpcPeeringConnections.html> for possible filters. |
| **peer\_connection\_ids** list / elements=string | | List of specific VPC peer IDs to get details for. |
| **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
--------
```
# Simple example of listing all VPC Peers
- name: List all vpc peers
community.aws.ec2_vpc_peering_info:
region: ap-southeast-2
register: all_vpc_peers
- name: Debugging the result
ansible.builtin.debug:
msg: "{{ all_vpc_peers.result }}"
- name: Get details on specific VPC peer
community.aws.ec2_vpc_peering_info:
peer_connection_ids:
- pcx-12345678
- pcx-87654321
region: ap-southeast-2
register: all_vpc_peers
- name: Get all vpc peers with specific filters
community.aws.ec2_vpc_peering_info:
region: ap-southeast-2
filters:
status-code: ['pending-acceptance']
register: pending_vpc_peers
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **result** list / elements=string | success | The result of the describe. |
| **vpc\_peering\_connections** list / elements=string | success | Details of the matching VPC peering connections. |
| | **accepter\_vpc\_info** complex | success | Information about the VPC which accepted the connection. |
| | | **cidr\_block** string | when connection is in the accepted state. | The primary CIDR for the VPC. **Sample:** 10.10.10.0/23 |
| | | **cidr\_block\_set** complex | when connection is in the accepted state. | A list of all CIDRs for the VPC. |
| | | | **cidr\_block** string | success | A CIDR block used by the VPC. **Sample:** 10.10.10.0/23 |
| | | **owner\_id** string | success | The AWS account that owns the VPC. **Sample:** 012345678901 |
| | | **peering\_options** dictionary | when connection is in the accepted state. | Additional peering configuration. |
| | | | **allow\_dns\_resolution\_from\_remote\_vpc** boolean | success | Indicates whether a VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC. |
| | | | **allow\_egress\_from\_local\_classic\_link\_to\_remote\_vpc** boolean | success | Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection. |
| | | | **allow\_egress\_from\_local\_vpc\_to\_remote\_classic\_link** boolean | success | Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection. |
| | | **region** string | success | The AWS region that the VPC is in. **Sample:** us-east-1 |
| | | **vpc\_id** string | success | The ID of the VPC **Sample:** vpc-0123456789abcdef0 |
| | **requester\_vpc\_info** complex | success | Information about the VPC which requested the connection. |
| | | **cidr\_block** string | when connection is not in the deleted state. | The primary CIDR for the VPC. **Sample:** 10.10.10.0/23 |
| | | **cidr\_block\_set** complex | when connection is not in the deleted state. | A list of all CIDRs for the VPC. |
| | | | **cidr\_block** string | success | A CIDR block used by the VPC **Sample:** 10.10.10.0/23 |
| | | **owner\_id** string | success | The AWS account that owns the VPC. **Sample:** 012345678901 |
| | | **peering\_options** dictionary | when connection is not in the deleted state. | Additional peering configuration. |
| | | | **allow\_dns\_resolution\_from\_remote\_vpc** boolean | success | Indicates whether a VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC. |
| | | | **allow\_egress\_from\_local\_classic\_link\_to\_remote\_vpc** boolean | success | Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection. |
| | | | **allow\_egress\_from\_local\_vpc\_to\_remote\_classic\_link** boolean | success | Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection. |
| | | **region** string | success | The AWS region that the VPC is in. **Sample:** us-east-1 |
| | | **vpc\_id** string | success | The ID of the VPC **Sample:** vpc-0123456789abcdef0 |
| | **status** complex | success | Details of the current status of the connection. |
| | | **code** string | success | A short code describing the status of the connection. **Sample:** active |
| | | **message** string | success | Additional information about the status of the connection. **Sample:** Pending Acceptance by 012345678901 |
| | **tags** dictionary | success | Tags applied to the connection. |
| | **vpc\_peering\_connection\_id** string | success | The ID of the VPC peering connection. **Sample:** pcx-0123456789abcdef0 |
### Authors
* Karen Cheng (@Etherdaemon)
ansible community.aws.efs – create and maintain EFS file systems community.aws.efs – create and maintain EFS file systems
========================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.efs`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Module allows create, search and destroy Amazon EFS file systems.
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 |
| **encrypt** boolean | **Choices:*** **no** ←
* yes
| If *encrypt=true* creates an encrypted file system. This can not be modified after the file system is created. |
| **id** string | | ID of Amazon EFS. Either name or ID required for delete. |
| **kms\_key\_id** string | | The id of the AWS KMS CMK that will be used to protect the encrypted file system. This parameter is only required if you want to use a non-default CMK. If this parameter is not specified, the default CMK for Amazon EFS is used. The key id can be Key ID, Key ID ARN, Key Alias or Key Alias ARN. |
| **name** string | | Creation Token of Amazon EFS file system. Required for create and update. Either name or ID required for delete. |
| **performance\_mode** string | **Choices:*** **general\_purpose** ←
* max\_io
| File system's performance mode to use. Only takes effect during creation. |
| **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 |
| **provisioned\_throughput\_in\_mibps** float | | If the throughput\_mode is provisioned, select the amount of throughput to provisioned in Mibps. Requires botocore >= 1.10.57 |
| **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 |
| **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
| Allows to create, search and destroy Amazon EFS file system. |
| **tags** dictionary | | List of tags of Amazon EFS. Should be defined as dictionary In case of 'present' state with list of tags and existing EFS (matched by 'name'), tags of EFS will be replaced with provided data. |
| **targets** list / elements=dictionary | | List of mounted targets. It should be a list of dictionaries, every dictionary should include next attributes: This data may be modified for existing EFS using state 'present' and new list of mount targets. |
| | **ip\_address** string | | A valid IPv4 address within the address range of the specified subnet. |
| | **security\_groups** list / elements=string | | List of security group IDs, of the form 'sg-xxxxxxxx'. These must be for the same VPC as subnet specified |
| | **subnet\_id** string / required | | The ID of the subnet to add the mount target in. |
| **throughput\_mode** string | **Choices:*** bursting
* provisioned
| The throughput\_mode for the file system to be created. Requires botocore >= 1.10.57 |
| **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
| In case of 'present' state should wait for EFS 'available' life cycle state (of course, if current state not 'deleting' or 'deleted') In case of 'absent' state should wait for EFS 'deleted' life cycle state |
| **wait\_timeout** integer | **Default:**0 | How long the module should wait (in seconds) for desired state before returning. Zero means wait as long as necessary. |
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: EFS provisioning
community.aws.efs:
state: present
name: myTestEFS
tags:
Name: myTestNameTag
purpose: file-storage
targets:
- subnet_id: subnet-748c5d03
security_groups: [ "sg-1a2b3c4d" ]
- name: Modifying EFS data
community.aws.efs:
state: present
name: myTestEFS
tags:
name: myAnotherTestTag
targets:
- subnet_id: subnet-7654fdca
security_groups: [ "sg-4c5d6f7a" ]
- name: Deleting EFS
community.aws.efs:
state: absent
name: myTestEFS
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **creation\_time** string | always | timestamp of creation date **Sample:** 2015-11-16 07:30:57-05:00 |
| **creation\_token** string | always | EFS creation token **Sample:** console-88609e04-9a0e-4a2e-912c-feaa99509961 |
| **file\_system\_id** string | always | ID of the file system **Sample:** fs-xxxxxxxx |
| **filesystem\_address** string | always | url of file system valid for use with mount **Sample:** fs-xxxxxxxx.efs.us-west-2.amazonaws.com:/ |
| **life\_cycle\_state** string | always | state of the EFS file system **Sample:** creating, available, deleting, deleted |
| **mount\_point** string | always | url of file system with leading dot from the time when AWS EFS required to add a region suffix to the address **Sample:** .fs-xxxxxxxx.efs.us-west-2.amazonaws.com:/ |
| **mount\_targets** list / elements=string | always | list of mount targets **Sample:** [{'file\_system\_id': 'fs-a7ad440e', 'ip\_address': '172.31.17.173', 'life\_cycle\_state': 'available', 'mount\_target\_id': 'fsmt-d8907871', 'network\_interface\_id': 'eni-6e387e26', 'owner\_id': '740748460359', 'security\_groups': ['sg-a30b22c6'], 'subnet\_id': 'subnet-e265c895'}, '...'] |
| **name** string | always | name of the file system **Sample:** my-efs |
| **number\_of\_mount\_targets** integer | always | the number of targets mounted **Sample:** 3 |
| **owner\_id** string | always | AWS account ID of EFS owner **Sample:** XXXXXXXXXXXX |
| **performance\_mode** string | always | performance mode of the file system **Sample:** generalPurpose |
| **size\_in\_bytes** dictionary | always | size of the file system in bytes as of a timestamp **Sample:** {'timestamp': '2015-12-21 13:59:59-05:00', 'value': 12288} |
| **tags** dictionary | always | tags on the efs instance **Sample:** {'key': 'Value', 'name': 'my-efs'} |
### Authors
* Ryan Sydnor (@ryansydnor)
* Artem Kazakov (@akazakov)
| programming_docs |
ansible community.aws.s3_sync – Efficiently upload multiple files to S3 community.aws.s3\_sync – Efficiently upload multiple files to S3
================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.s3_sync`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* The S3 module is great, but it is very slow for a large volume of files- even a dozen will be noticeable. In addition to speed, it handles globbing, inclusions/exclusions, mime types, expiration mapping, recursion, cache control and smart directory mapping.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3 >= 1.4.4
* botocore
* python >= 2.6
* python-dateutil
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. |
| **cache\_control** string | | Cache-Control header set on uploaded objects. Directives are separated by commas. |
| **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** boolean | **Choices:*** **no** ←
* yes
| Remove remote files that exist in bucket but are not present in the file root. |
| **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 |
| **exclude** string | **Default:**".\*" | Shell pattern-style file matching. Used after include to remove files (for instance, skip "\*.txt") For multiple patterns, comma-separate them. |
| **file\_change\_strategy** string | **Choices:*** force
* checksum
* **date\_size** ←
| Difference determination method to allow changes-only syncing. Unlike rsync, files are not patched- they are fully skipped or fully uploaded. date\_size will upload if file sizes don't match or if local file modified date is newer than s3's version checksum will compare etag values based on s3's implementation of chunked md5s. force will always upload all files. |
| **file\_root** path / required | | File/directory path for synchronization. This is a local path. This root path is scrubbed from the key name, so subdirectories will remain as keys. |
| **include** string | **Default:**"\*" | Shell pattern-style file matching. Used before exclude to determine eligible files (for instance, only "\*.gif") For multiple patterns, comma-separate them. |
| **key\_prefix** string | | In addition to file path, prepend s3 path with this prefix. Module will add slash at end of prefix if necessary. |
| **mime\_map** dictionary | | Dict entry from extension to MIME type. This will override any default/sniffed MIME type. For example `{".txt": "application/text", ".yml": "application/text"}`
|
| **mode** string | **Choices:*** **push** ←
| sync direction. |
| **permission** string | **Choices:*** private
* public-read
* public-read-write
* authenticated-read
* aws-exec-read
* bucket-owner-read
* bucket-owner-full-control
| Canned ACL to apply to synced files. Changing this ACL only changes newly synced files, it does not trigger a full reupload. |
| **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** string | | The *retries* option does nothing and will be removed after 2022-06-01 |
| **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 |
| **storage\_class** string added in 1.5.0 of community.aws | **Choices:*** **STANDARD** ←
* REDUCED\_REDUNDANCY
* STANDARD\_IA
* ONEZONE\_IA
* INTELLIGENT\_TIERING
* GLACIER
* DEEP\_ARCHIVE
* OUTPOSTS
| Storage class to be associated to each object added to the S3 bucket. |
| **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: basic upload
community.aws.s3_sync:
bucket: tedder
file_root: roles/s3/files/
- name: basic upload using the glacier storage class
community.aws.s3_sync:
bucket: tedder
file_root: roles/s3/files/
storage_class: GLACIER
- name: all the options
community.aws.s3_sync:
bucket: tedder
file_root: roles/s3/files
mime_map:
.yml: application/text
.json: application/text
key_prefix: config_files/web
file_change_strategy: force
permission: public-read
cache_control: "public, max-age=31536000"
storage_class: "GLACIER"
include: "*"
exclude: "*.txt,.*"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **filelist\_actionable** list / elements=string | always | file listing (dicts) of files that will be uploaded after the strategy decision **Sample:** [{'bytes': 151, 'chopped\_path': 'policy.json', 'fullpath': 'roles/cf/files/policy.json', 'mime\_type': 'application/json', 'modified\_epoch': 1477931256, 's3\_path': 's3sync/policy.json', 'whysize': '151 / 151', 'whytime': '1477931256 / 1477929260'}] |
| **filelist\_initial** list / elements=string | always | file listing (dicts) from initial globbing **Sample:** [{'bytes': 151, 'chopped\_path': 'policy.json', 'fullpath': 'roles/cf/files/policy.json', 'modified\_epoch': 1477416706}] |
| **filelist\_local\_etag** list / elements=string | always | file listing (dicts) including calculated local etag **Sample:** [{'bytes': 151, 'chopped\_path': 'policy.json', 'fullpath': 'roles/cf/files/policy.json', 'mime\_type': 'application/json', 'modified\_epoch': 1477416706, 's3\_path': 's3sync/policy.json'}] |
| **filelist\_s3** list / elements=string | always | file listing (dicts) including information about previously-uploaded versions **Sample:** [{'bytes': 151, 'chopped\_path': 'policy.json', 'fullpath': 'roles/cf/files/policy.json', 'mime\_type': 'application/json', 'modified\_epoch': 1477416706, 's3\_path': 's3sync/policy.json'}] |
| **filelist\_typed** list / elements=string | always | file listing (dicts) with calculated or overridden mime types **Sample:** [{'bytes': 151, 'chopped\_path': 'policy.json', 'fullpath': 'roles/cf/files/policy.json', 'mime\_type': 'application/json', 'modified\_epoch': 1477416706}] |
| **uploaded** list / elements=string | always | file listing (dicts) of files that were actually uploaded **Sample:** [{'bytes': 151, 'chopped\_path': 'policy.json', 'fullpath': 'roles/cf/files/policy.json', 's3\_path': 's3sync/policy.json', 'whysize': '151 / 151', 'whytime': '1477931637 / 1477931489'}] |
### Authors
* Ted Timmons (@tedder)
ansible community.aws.iam_policy – Manage inline IAM policies for users, groups, and roles community.aws.iam\_policy – Manage inline IAM policies for users, groups, and roles
===================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.iam_policy`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Allows uploading or removing inline IAM policies for IAM users, groups or roles.
* To administer managed policies please see [community.aws.iam\_user](iam_user_module#ansible-collections-community-aws-iam-user-module), [community.aws.iam\_role](iam_role_module#ansible-collections-community-aws-iam-role-module), [community.aws.iam\_group](iam_group_module#ansible-collections-community-aws-iam-group-module) and [community.aws.iam\_managed\_policy](iam_managed_policy_module#ansible-collections-community-aws-iam-managed-policy-module)
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. |
| **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 |
| **iam\_name** string / required | | Name of IAM resource you wish to target for policy actions. In other words, the user name, group name or role name. |
| **iam\_type** string / required | **Choices:*** user
* group
* role
| Type of IAM resource. |
| **policy\_document** string | | The path to the properly json formatted policy file. Mutually exclusive with *policy\_json*. This option has been deprecated and will be removed in 2.14. The existing behavior can be reproduced by using the *policy\_json* option and reading the file using the lookup plugin. |
| **policy\_json** json | | A properly json formatted policy as string. Mutually exclusive with *policy\_document*. See <https://github.com/ansible/ansible/issues/7005#issuecomment-42894813> on how to use it properly. |
| **policy\_name** string / required | | The name label for the policy to create or remove. |
| **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 |
| **skip\_duplicates** boolean | **Choices:*** no
* yes
| When *skip\_duplicates=true* the module looks for any policies that match the document you pass in. If there is a match it will not make a new policy object with the same rules. The current default is `true`. However, this behavior can be confusing and as such the default will change to `false` in 2.14. To maintain the existing behavior explicitly set *skip\_duplicates=true*. |
| **state** string | **Choices:*** **present** ←
* absent
| Whether to create or delete the IAM policy. |
| **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
--------
```
# Create a policy with the name of 'Admin' to the group 'administrators'
- name: Assign a policy called Admin to the administrators group
community.aws.iam_policy:
iam_type: group
iam_name: administrators
policy_name: Admin
state: present
policy_document: admin_policy.json
# Advanced example, create two new groups and add a READ-ONLY policy to both
# groups.
- name: Create Two Groups, Mario and Luigi
community.aws.iam:
iam_type: group
name: "{{ item }}"
state: present
loop:
- Mario
- Luigi
register: new_groups
- name: Apply READ-ONLY policy to new groups that have been recently created
community.aws.iam_policy:
iam_type: group
iam_name: "{{ item.created_group.group_name }}"
policy_name: "READ-ONLY"
policy_document: readonlypolicy.json
state: present
loop: "{{ new_groups.results }}"
# Create a new S3 policy with prefix per user
- name: Create S3 policy from template
community.aws.iam_policy:
iam_type: user
iam_name: "{{ item.user }}"
policy_name: "s3_limited_access_{{ item.prefix }}"
state: present
policy_json: " {{ lookup( 'template', 's3_policy.json.j2') }} "
loop:
- user: s3_user
prefix: s3_user_prefix
```
### Authors
* Jonathan I. Davila (@defionscode)
* Dennis Podkovyrin (@sbj-ss)
ansible community.aws.cloudfront_invalidation – create invalidations for AWS CloudFront distributions community.aws.cloudfront\_invalidation – create invalidations for AWS CloudFront distributions
==============================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.cloudfront_invalidation`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for invalidation of a batch of paths for a CloudFront distribution.
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 |
| --- | --- | --- |
| **alias** string | | The alias of the CloudFront distribution to invalidate paths for. Can be specified instead of distribution\_id. |
| **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 |
| **caller\_reference** string | | A unique reference identifier for the invalidation paths. Defaults to current datetime stamp. |
| **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. |
| **distribution\_id** string | | The ID of the CloudFront distribution to invalidate paths for. Can be specified instead of the alias. |
| **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 |
| **target\_paths** list / elements=string / required | | A list of paths on the distribution to invalidate. Each path should begin with '/'. Wildcards are allowed. eg. '/foo/bar/\*' |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* does not support check mode
* 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 batch of invalidations using a distribution_id for a reference
community.aws.cloudfront_invalidation:
distribution_id: E15BU8SDCGSG57
caller_reference: testing 123
target_paths:
- /testpathone/test1.css
- /testpathtwo/test2.js
- /testpaththree/test3.ss
- name: create a batch of invalidations using an alias as a reference and one path using a wildcard match
community.aws.cloudfront_invalidation:
alias: alias.test.com
caller_reference: testing 123
target_paths:
- /testpathone/test4.css
- /testpathtwo/test5.js
- /testpaththree/*
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **invalidation** complex | always | The invalidation's information. |
| | **create\_time** string | always | The date and time the invalidation request was first made. **Sample:** 2018-02-01T15:50:41.159000+00:00 |
| | **id** string | always | The identifier for the invalidation request. **Sample:** I2G9MOWJZFV612 |
| | **invalidation\_batch** complex | always | The current invalidation information for the batch request. |
| | | **caller\_reference** string | always | The value used to uniquely identify an invalidation request. **Sample:** testing 123 |
| | | **paths** complex | always | A dict that contains information about the objects that you want to invalidate. |
| | | | **items** list / elements=string | always | A list of the paths that you want to invalidate. **Sample:** ['/testpathtwo/test2.js', '/testpathone/test1.css', '/testpaththree/test3.ss'] |
| | | | **quantity** integer | always | The number of objects that you want to invalidate. **Sample:** 3 |
| | **status** string | always | The status of the invalidation request. **Sample:** Completed |
| **location** string | always | The fully qualified URI of the distribution and invalidation batch request. **Sample:** https://cloudfront.amazonaws.com/2017-03-25/distribution/E1ZID6KZJECZY7/invalidation/I2G9MOWJZFV622 |
### Authors
* Willem van Ketwich (@wilvk)
| programming_docs |
ansible community.aws.aws_glue_job – Manage an AWS Glue job community.aws.aws\_glue\_job – Manage an AWS Glue job
=====================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_glue_job`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage an AWS Glue job. See <https://aws.amazon.com/glue/> for details.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **allocated\_capacity** integer | | The number of AWS Glue data processing units (DPUs) to allocate to this Job. From 2 to 100 DPUs can be allocated; the default is 10. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB of memory. |
| **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 |
| **command\_name** string | **Default:**"glueetl" | The name of the job command. This must be 'glueetl'. |
| **command\_script\_location** string | | The S3 path to a script that executes a job. Required when *state=present*. |
| **connections** list / elements=string | | A list of Glue connections used for this job. |
| **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. |
| **default\_arguments** dictionary | | A dict of default arguments for this job. You can specify arguments here that your own job-execution script consumes, as well as arguments that AWS Glue itself consumes. |
| **description** string | | Description of the job being defined. |
| **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 |
| **glue\_version** string added in 1.5.0 of community.aws | | Glue version determines the versions of Apache Spark and Python that AWS Glue supports. |
| **max\_concurrent\_runs** integer | | The maximum number of concurrent runs allowed for the job. The default is 1. An error is returned when this threshold is reached. The maximum value you can specify is controlled by a service limit. |
| **max\_retries** integer | | The maximum number of times to retry this job if it fails. |
| **name** string / required | | The name you assign to this job definition. It must be unique in your account. |
| **number\_of\_workers** integer added in 1.5.0 of community.aws | | The number of workers of a defined workerType that are allocated when a job runs. |
| **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** string | | The name or ARN of the IAM role associated with this job. Required when *state=present*. |
| **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:*** present
* absent
| Create or delete the AWS Glue job. |
| **timeout** integer | | The job timeout in minutes. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **worker\_type** string added in 1.5.0 of community.aws | **Choices:*** Standard
* G.1X
* G.2X
| The type of predefined worker that is allocated when a job runs. |
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.
# Create an AWS Glue job
- community.aws.aws_glue_job:
command_script_location: s3bucket/script.py
name: my-glue-job
role: my-iam-role
state: present
# Delete an AWS Glue job
- community.aws.aws_glue_job:
name: my-glue-job
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 |
| --- | --- | --- |
| **allocated\_capacity** integer | when state is present | The number of AWS Glue data processing units (DPUs) allocated to runs of this job. From 2 to 100 DPUs can be allocated; the default is 10. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB of memory. **Sample:** 10 |
| **command** complex | when state is present | The JobCommand that executes this job. |
| | **name** string | when state is present | The name of the job command. **Sample:** glueetl |
| | **script\_location** string | when state is present | Specifies the S3 path to a script that executes a job. **Sample:** mybucket/myscript.py |
| **connections** dictionary | when state is present | The connections used for this job. **Sample:** { Connections: [ 'list', 'of', 'connections' ] } |
| **created\_on** string | when state is present | The time and date that this job definition was created. **Sample:** 2018-04-21T05:19:58.326000+00:00 |
| **default\_arguments** dictionary | when state is present | The default arguments for this job, specified as name-value pairs. **Sample:** { 'mykey1': 'myvalue1' } |
| **description** string | when state is present | Description of the job being defined. **Sample:** My first Glue job |
| **execution\_property** complex | always | An ExecutionProperty specifying the maximum number of concurrent runs allowed for this job. |
| | **max\_concurrent\_runs** integer | when state is present | The maximum number of concurrent runs allowed for the job. The default is 1. An error is returned when this threshold is reached. The maximum value you can specify is controlled by a service limit. **Sample:** 1 |
| **job\_name** string | always | The name of the AWS Glue job. **Sample:** my-glue-job |
| **last\_modified\_on** string | when state is present | The last point in time when this job definition was modified. **Sample:** 2018-04-21T05:19:58.326000+00:00 |
| **max\_retries** integer | when state is present | The maximum number of times to retry this job after a JobRun fails. **Sample:** 5 |
| **name** string | when state is present | The name assigned to this job definition. **Sample:** my-glue-job |
| **role** string | when state is present | The name or ARN of the IAM role associated with this job. **Sample:** my-iam-role |
| **timeout** integer | when state is present | The job timeout in minutes. **Sample:** 300 |
### Authors
* Rob White (@wimnat)
* Vijayanand Sharma (@vijayanandsharma)
ansible community.aws.elb_application_lb_info – Gather information about application ELBs in AWS community.aws.elb\_application\_lb\_info – Gather information about application ELBs in AWS
===========================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.elb_application_lb_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about application ELBs in AWS
* This module was called `elb_application_lb_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 |
| **load\_balancer\_arns** list / elements=string | | The Amazon Resource Names (ARN) of the load balancers. You can specify up to 20 load balancers in a single call. |
| **names** list / elements=string | | The names of the load balancers. |
| **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 target groups
community.aws.elb_application_lb_info:
- name: Gather information about the target group attached to a particular ELB
community.aws.elb_application_lb_info:
load_balancer_arns:
- "arn:aws:elasticloadbalancing:ap-southeast-2:001122334455:loadbalancer/app/my-elb/aabbccddeeff"
- name: Gather information about a target groups named 'tg1' and 'tg2'
community.aws.elb_application_lb_info:
names:
- elb1
- elb2
- name: Gather information about specific ALB
community.aws.elb_application_lb_info:
names: "alb-name"
region: "aws-region"
register: alb_info
- ansible.builtin.debug:
var: alb_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 |
| --- | --- | --- |
| **load\_balancers** complex | always | a list of load balancers |
| | **access\_logs\_s3\_bucket** string | success | The name of the S3 bucket for the access logs. **Sample:** mys3bucket |
| | **access\_logs\_s3\_enabled** string | success | Indicates whether access logs stored in Amazon S3 are enabled. **Sample:** True |
| | **access\_logs\_s3\_prefix** string | success | The prefix for the location in the S3 bucket. **Sample:** /my/logs |
| | **availability\_zones** list / elements=string | success | The Availability Zones for the load balancer. **Sample:** [{'subnet\_id': 'subnet-aabbccddff', 'zone\_name': 'ap-southeast-2a'}] |
| | **canonical\_hosted\_zone\_id** string | success | The ID of the Amazon Route 53 hosted zone associated with the load balancer. **Sample:** ABCDEF12345678 |
| | **created\_time** string | success | The date and time the load balancer was created. **Sample:** 2015-02-12T02:14:02+00:00 |
| | **deletion\_protection\_enabled** string | success | Indicates whether deletion protection is enabled. **Sample:** True |
| | **dns\_name** string | success | The public DNS name of the load balancer. **Sample:** internal-my-elb-123456789.ap-southeast-2.elb.amazonaws.com |
| | **idle\_timeout\_timeout\_seconds** string | success | The idle timeout value, in seconds. **Sample:** 60 |
| | **ip\_address\_type** string | success | The type of IP addresses used by the subnets for the load balancer. **Sample:** ipv4 |
| | **load\_balancer\_arn** string | success | The Amazon Resource Name (ARN) of the load balancer. **Sample:** arn:aws:elasticloadbalancing:ap-southeast-2:0123456789:loadbalancer/app/my-elb/001122334455 |
| | **load\_balancer\_name** string | success | The name of the load balancer. **Sample:** my-elb |
| | **scheme** string | success | Internet-facing or internal load balancer. **Sample:** internal |
| | **security\_groups** list / elements=string | success | The IDs of the security groups for the load balancer. **Sample:** ['sg-0011223344'] |
| | **state** dictionary | success | The state of the load balancer. **Sample:** {'code': 'active'} |
| | **tags** dictionary | success | The tags attached to the load balancer. **Sample:** { 'Tag': 'Example' } |
| | **type** string | success | The type of load balancer. **Sample:** application |
| | **vpc\_id** string | success | The ID of the VPC for the load balancer. **Sample:** vpc-0011223344 |
### Authors
* Rob White (@wimnat)
| programming_docs |
ansible community.aws.iam_policy_info – Retrieve inline IAM policies for users, groups, and roles community.aws.iam\_policy\_info – Retrieve inline IAM policies for users, groups, and roles
===========================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.iam_policy_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Supports fetching of inline IAM policies for IAM users, groups and roles.
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. |
| **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 |
| **iam\_name** string / required | | Name of IAM resource you wish to retrieve inline policies for. In other words, the user name, group name or role name. |
| **iam\_type** string / required | **Choices:*** user
* group
* role
| Type of IAM resource you wish to retrieve inline policies for. |
| **policy\_name** string | | Name of a specific IAM inline policy you with to retrieve. |
| **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
--------
```
- name: Describe all inline IAM policies on an IAM User
community.aws.iam_policy_info:
iam_type: user
iam_name: example_user
- name: Describe a specific inline policy on an IAM Role
community.aws.iam_policy_info:
iam_type: role
iam_name: example_role
policy_name: example_policy
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **all\_policy\_names** list / elements=string | success | A list of names of all of the IAM inline policies on the queried object |
| **policies** complex | success | A list containing the matching IAM inline policy names and their data |
| | **policy\_document** list / elements=string | success | The JSON document representing the inline IAM policy |
| | **policy\_name** string | success | The Name of the inline policy |
| **policy\_names** list / elements=string | success | A list of matching names of the IAM inline policies on the queried object |
### Authors
* Mark Chappell (@tremble)
ansible community.aws.ec2_vpc_nat_gateway – Manage AWS VPC NAT Gateways. community.aws.ec2\_vpc\_nat\_gateway – Manage AWS VPC NAT Gateways.
===================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_vpc_nat_gateway`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Ensure the state of AWS VPC NAT Gateways based on their id, allocation and subnet ids.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **allocation\_id** string | | The id of the elastic IP allocation. If this is not passed and the eip\_address is not passed. An EIP is generated for this NAT Gateway. |
| **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 |
| **client\_token** string | | Optional unique token to be used during create to ensure idempotency. When specifying this option, ensure you specify the eip\_address parameter as well otherwise any subsequent runs will fail. |
| **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 |
| **eip\_address** string | | The elastic IP address of the EIP you want attached to this NAT Gateway. If this is not passed and the allocation\_id is not passed, an EIP is generated for this NAT Gateway. |
| **if\_exist\_do\_not\_create** boolean | **Choices:*** **no** ←
* yes
| if a NAT Gateway exists already in the subnet\_id, then do not create a new one. |
| **nat\_gateway\_id** string | | The id AWS dynamically allocates to the NAT Gateway on creation. This is required when the absent option is 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\_tags** boolean added in 1.4.0 of community.aws | **Choices:*** no
* **yes** ←
| Remove tags not listed in *tags*. |
| **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 |
| **release\_eip** boolean | **Choices:*** **no** ←
* yes
| Deallocate the EIP from the VPC. Option is only valid with the absent state. You should use this with the wait option. Since you can not release an address while a delete operation is happening. |
| **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
| Ensure NAT Gateway is present or absent. |
| **subnet\_id** string | | The id of the subnet to create the NAT Gateway in. This is required with the present option. |
| **tags** dictionary added in 1.4.0 of community.aws | | A dict of tags to apply to the NAT gateway. To remove all tags set *tags={}* and *purge\_tags=true*.
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. |
| **wait** boolean | **Choices:*** **no** ←
* yes
| Wait for operation to complete before returning. |
| **wait\_timeout** integer | **Default:**320 | How many seconds to wait for an operation to complete before timing out. |
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 new nat gateway with client token.
community.aws.ec2_vpc_nat_gateway:
state: present
subnet_id: subnet-12345678
eip_address: 52.1.1.1
region: ap-southeast-2
client_token: abcd-12345678
register: new_nat_gateway
- name: Create new nat gateway using an allocation-id.
community.aws.ec2_vpc_nat_gateway:
state: present
subnet_id: subnet-12345678
allocation_id: eipalloc-12345678
region: ap-southeast-2
register: new_nat_gateway
- name: Create new nat gateway, using an EIP address and wait for available status.
community.aws.ec2_vpc_nat_gateway:
state: present
subnet_id: subnet-12345678
eip_address: 52.1.1.1
wait: true
region: ap-southeast-2
register: new_nat_gateway
- name: Create new nat gateway and allocate new EIP.
community.aws.ec2_vpc_nat_gateway:
state: present
subnet_id: subnet-12345678
wait: true
region: ap-southeast-2
register: new_nat_gateway
- name: Create new nat gateway and allocate new EIP if a nat gateway does not yet exist in the subnet.
community.aws.ec2_vpc_nat_gateway:
state: present
subnet_id: subnet-12345678
wait: true
region: ap-southeast-2
if_exist_do_not_create: true
register: new_nat_gateway
- name: Delete nat gateway using discovered nat gateways from facts module.
community.aws.ec2_vpc_nat_gateway:
state: absent
region: ap-southeast-2
wait: true
nat_gateway_id: "{{ item.NatGatewayId }}"
release_eip: true
register: delete_nat_gateway_result
loop: "{{ gateways_to_remove.result }}"
- name: Delete nat gateway and wait for deleted status.
community.aws.ec2_vpc_nat_gateway:
state: absent
nat_gateway_id: nat-12345678
wait: true
wait_timeout: 500
region: ap-southeast-2
- name: Delete nat gateway and release EIP.
community.aws.ec2_vpc_nat_gateway:
state: absent
nat_gateway_id: nat-12345678
release_eip: true
wait: yes
wait_timeout: 300
region: ap-southeast-2
- name: Create new nat gateway using allocation-id and tags.
community.aws.ec2_vpc_nat_gateway:
state: present
subnet_id: subnet-12345678
allocation_id: eipalloc-12345678
region: ap-southeast-2
tags:
Tag1: tag1
Tag2: tag2
register: new_nat_gateway
- name: Update tags without purge
community.aws.ec2_vpc_nat_gateway:
subnet_id: subnet-12345678
allocation_id: eipalloc-12345678
region: ap-southeast-2
purge_tags: no
tags:
Tag3: tag3
wait: yes
register: update_tags_nat_gateway
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **create\_time** string | In all cases. | The ISO 8601 date time format in UTC. **Sample:** 2016-03-05T05:19:20.282000+00:00' |
| **nat\_gateway\_addresses** string | In all cases. | List of dictionaries containing the public\_ip, network\_interface\_id, private\_ip, and allocation\_id. **Sample:** [{'allocation\_id': 'eipalloc-12345', 'network\_interface\_id': 'eni-12345', 'private\_ip': '10.0.0.100', 'public\_ip': '52.52.52.52'}] |
| **nat\_gateway\_id** string | In all cases. | id of the VPC NAT Gateway **Sample:** nat-0d1e3a878585988f8 |
| **state** string | In all cases. | The current state of the NAT Gateway. **Sample:** available |
| **subnet\_id** string | In all cases. | id of the Subnet **Sample:** subnet-12345 |
| **tags** dictionary | When tags are present. | The tags associated the VPC NAT Gateway. **Sample:** {'tags': {'Ansible': 'Test'}} |
| **vpc\_id** string | In all cases. | id of the VPC. **Sample:** vpc-12345 |
### Authors
* Allen Sanabria (@linuxdynasty)
* Jon Hadfield (@jonhadfield)
* Karen Cheng (@Etherdaemon)
* Alina Buzachis (@alinabuzachis)
ansible community.aws.aws_codebuild – Create or delete an AWS CodeBuild project community.aws.aws\_codebuild – Create or delete an AWS CodeBuild project
========================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_codebuild`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create or delete a CodeBuild projects on AWS, used for building code artifacts from source code.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **artifacts** dictionary / required | | Information about the build output artifacts for the build project. |
| | **location** string | | Information about the build output artifact location. When choosing type S3, set the bucket name here. |
| | **name** string | | Along with path and namespace\_type, the pattern that AWS CodeBuild will use to name and store the output artifact. |
| | **namespace\_type** string | | Along with path and name, the pattern that AWS CodeBuild will use to determine the name and location to store the output artifacts. Accepts `BUILD_ID` and `NONE`. See docs here: <http://boto3.readthedocs.io/en/latest/reference/services/codebuild.html#CodeBuild.Client.create_project>. |
| | **packaging** string | | The type of build output artifact to create on S3, can be NONE for creating a folder or ZIP for a ZIP file. |
| | **path** string | | Along with namespace\_type and name, the pattern that AWS CodeBuild will use to name and store the output artifacts. Used for path in S3 bucket when type is `S3`. |
| | **type** string / required | | The type of build output for artifacts. Can be one of the following: `CODEPIPELINE`, `NO_ARTIFACTS`, `S3`. |
| **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 |
| **cache** dictionary | | Caching params to speed up following builds. |
| | **location** string / required | | Caching location on S3. |
| | **type** string / required | | Cache type. Can be `NO_CACHE` or `S3`. |
| **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 | | Descriptive text of the CodeBuild project. |
| **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\_key** string | | The AWS Key Management Service (AWS KMS) customer master key (CMK) to be used for encrypting the build output artifacts. |
| **environment** dictionary | | Information about the build environment for the build project. |
| | **compute\_type** string / required | | Information about the compute resources the build project will use. Available values include: `BUILD_GENERAL1_SMALL`, `BUILD_GENERAL1_MEDIUM`, `BUILD_GENERAL1_LARGE`. |
| | **environment\_variables** string | | A set of environment variables to make available to builds for the build project. List of dictionaries with name and value fields. Example: { name: 'MY\_ENV\_VARIABLE', value: 'test' } |
| | **image** string / required | | The ID of the Docker image to use for this build project. |
| | **privileged\_mode** string | | Enables running the Docker daemon inside a Docker container. Set to true only if the build project is be used to build Docker images. |
| | **type** string / required | | The type of build environment to use for the project. Usually `LINUX_CONTAINER`. |
| **name** string / required | | Name of the CodeBuild project. |
| **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 |
| **service\_role** string | | The ARN of the AWS IAM role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account. |
| **source** dictionary / required | | Configure service and location for the build input source. |
| | **buildspec** string | | The build spec declaration to use for the builds in this build project. Leave empty if part of the code project. |
| | **git\_clone\_depth** integer | | When using git you can specify the clone depth as an integer here. |
| | **insecure\_ssl** boolean | **Choices:*** no
* yes
| Enable this flag to ignore SSL warnings while connecting to the project source code. |
| | **location** string | | Information about the location of the source code to be built. For type CODEPIPELINE location should not be specified. |
| | **type** string / required | | The type of the source. Allows one of these: `CODECOMMIT`, `CODEPIPELINE`, `GITHUB`, `S3`, `BITBUCKET`, `GITHUB_ENTERPRISE`. |
| **state** string | **Choices:*** **present** ←
* absent
| Create or remove code build project. |
| **tags** list / elements=dictionary | | A set of tags for the build project. |
| | **key** string | | The name of the Tag. |
| | **value** string | | The value of the Tag. |
| **timeout\_in\_minutes** integer | **Default:**60 | How long CodeBuild should wait until timing out any build that has not been marked as completed. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **vpc\_config** dictionary | | The VPC config enables AWS CodeBuild to access resources in an Amazon VPC. |
Notes
-----
Note
* For details of the parameters and returns see <http://boto3.readthedocs.io/en/latest/reference/services/codebuild.html>.
* 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.
- community.aws.aws_codebuild:
name: my_project
description: My nice little project
service_role: "arn:aws:iam::123123:role/service-role/code-build-service-role"
source:
# Possible values: BITBUCKET, CODECOMMIT, CODEPIPELINE, GITHUB, S3
type: CODEPIPELINE
buildspec: ''
artifacts:
namespaceType: NONE
packaging: NONE
type: CODEPIPELINE
name: my_project
environment:
computeType: BUILD_GENERAL1_SMALL
privilegedMode: "true"
image: "aws/codebuild/docker:17.09.0"
type: LINUX_CONTAINER
environmentVariables:
- { name: 'PROFILE', value: 'staging' }
encryption_key: "arn:aws:kms:us-east-1:123123:alias/aws/s3"
region: us-east-1
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 |
| --- | --- | --- |
| **project** complex | success | Returns the dictionary describing the code project configuration. |
| | **arn** string | always | ARN of the CodeBuild project **Sample:** arn:aws:codebuild:us-east-1:123123123:project/vod-api-app-builder |
| | **artifacts** complex | always | Information about the output of build artifacts |
| | | **location** string | when configured | Output location for build artifacts |
| | | **type** string | always | The type of build artifact. **Sample:** CODEPIPELINE |
| | **cache** dictionary | when configured | Cache settings for the build project. |
| | **created** string | always | Timestamp of the create time of the project **Sample:** 2018-04-17T16:56:03.245000+02:00 |
| | **description** string | always | A description of the build project **Sample:** My nice little project |
| | **environment** dictionary | always | Environment settings for the build |
| | **name** string | always | Name of the CodeBuild project **Sample:** my\_project |
| | **service\_role** string | always | IAM role to be used during build to access other AWS services. **Sample:** arn:aws:iam::123123123:role/codebuild-service-role |
| | **source** complex | always | Information about the build input source code. |
| | | **auth** complex | when configured | Information about the authorization settings for AWS CodeBuild to access the source code to be built. |
| | | **build\_spec** string | always | The build spec declaration to use for the builds in this build project. |
| | | **git\_clone\_depth** integer | when configured | The git clone depth |
| | | **insecure\_ssl** boolean | when configured | True if set to ignore SSL warnings. |
| | | **location** string | when configured | Location identifier, depending on the source type. |
| | | **type** string | always | The type of the repository **Sample:** CODEPIPELINE |
| | **tags** list / elements=string | when configured | Tags added to the project |
| | **timeout\_in\_minutes** integer | always | The timeout of a build in minutes **Sample:** 60 |
### Authors
* Stefan Horning (@stefanhorning) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#9ff7f0edf1f6f1f8b9bcaca8a4b9bcaaada4b9bcaba7a4f2fafbf6feeffafaedecb9bcaba9a4fcf0f2)>
| programming_docs |
ansible community.aws.elb_instance – De-registers or registers instances from EC2 ELBs community.aws.elb\_instance – De-registers or registers instances from EC2 ELBs
===============================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.elb_instance`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* This module de-registers or registers an AWS EC2 instance from the ELBs that it belongs to.
* Returns fact “ec2\_elbs” which is a list of elbs attached to the instance if state=absent is passed as an argument.
* Will be marked changed when called only if there are ELBs found to operate on.
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. |
| **ec2\_elbs** list / elements=string | | List of ELB names, required for registration. The ec2\_elbs fact should be used if there was a previous de-register. |
| **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 |
| **enable\_availability\_zone** boolean | **Choices:*** no
* **yes** ←
| Whether to enable the availability zone of the instance on the target ELB if the availability zone has not already been enabled. If set to no, the task will fail if the availability zone is not enabled on the ELB. |
| **instance\_id** string / required | | EC2 Instance 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 |
| **state** string / required | **Choices:*** present
* absent
| register or deregister the instance |
| **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** ←
| Wait for instance registration or deregistration to complete successfully before returning. |
| **wait\_timeout** integer | **Default:**0 | Number of seconds to wait for an instance to change state. If 0 then this module may return an error if a transient error occurs. If non-zero then any transient errors are ignored until the timeout is reached. Ignored when wait=no. |
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
--------
```
# basic pre_task and post_task example
pre_tasks:
- name: Instance De-register
community.aws.elb_instance:
instance_id: "{{ ansible_ec2_instance_id }}"
state: absent
delegate_to: localhost
roles:
- myrole
post_tasks:
- name: Instance Register
community.aws.elb_instance:
instance_id: "{{ ansible_ec2_instance_id }}"
ec2_elbs: "{{ item }}"
state: present
delegate_to: localhost
loop: "{{ ec2_elbs }}"
```
### Authors
* John Jarvis (@jarv)
ansible community.aws.ec2_vpc_vpn – Create, modify, and delete EC2 VPN connections. community.aws.ec2\_vpc\_vpn – Create, modify, and delete EC2 VPN connections.
=============================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_vpc_vpn`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module creates, modifies, and deletes VPN connections. Idempotence is achieved by using the filters option or specifying the VPN connection identifier.
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 |
| **connection\_type** string | **Default:**"ipsec.1" | The type of VPN connection. At this time only `ipsec.1` is supported. |
| **customer\_gateway\_id** string | | The ID of the customer gateway. |
| **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. |
| **delay** integer | **Default:**15 | The time, in seconds, to wait before checking operation again. |
| **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 | | An alternative to using *vpn\_connection\_id*. If multiple matches are found, vpn\_connection\_id is required. If one of the following suboptions is a list of items to filter by, only one item needs to match to find the VPN that correlates. e.g. if the filter *cidr* is `['194.168.2.0/24', '192.168.2.0/24']` and the VPN route only has the destination cidr block of `192.168.2.0/24` it will be found with this filter (assuming there are not multiple VPNs that are matched). Another example, if the filter *vpn* is equal to `['vpn-ccf7e7ad', 'vpn-cb0ae2a2']` and one of of the VPNs has the state deleted (exists but is unmodifiable) and the other exists and is not deleted, it will be found via this filter. See examples. |
| | **bgp** string | | The BGP ASN number associated with a BGP device. Only works if the connection is attached. This filtering option is currently not working. |
| | **cgw** string | | The customer gateway id as a string or a list of those strings. |
| | **cgw-config** string | | The customer gateway configuration of the VPN as a string (in the format of the return value) or a list of those strings. |
| | **cidr** string | | The destination cidr of the VPN's route as a string or a list of those strings. |
| | **static-routes-only** string | | The type of routing; `true` or `false`. |
| | **tag-keys** string | | The key of a tag as a string or a list of those strings. |
| | **tag-values** string | | The value of a tag as a string or a list of those strings. |
| | **tags** string | | A dict of key value pairs. |
| | **vgw** string | | The virtual private gateway as a string or a list of those strings. |
| | **vpn** string | | The VPN connection id as a string or a list of those strings. |
| **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\_routes** boolean | **Choices:*** **no** ←
* yes
| Whether or not to delete VPN connections routes that are not specified in the task. |
| **purge\_tags** boolean | **Choices:*** **no** ←
* yes
| Whether or not to delete VPN connections tags that are associated with the connection but not specified in the task. |
| **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 |
| **routes** list / elements=string | | Routes to add to the connection. |
| **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 desired state of the VPN connection. |
| **static\_only** boolean | **Choices:*** **no** ←
* yes
| Indicates whether the VPN connection uses static routes only. Static routes must be used for devices that don't support BGP. |
| **tags** dictionary | | Tags to attach to the VPN connection. |
| **tunnel\_options** list / elements=dictionary | | An optional list object containing no more than two dict members, each of which may contain *TunnelInsideCidr* and/or *PreSharedKey* keys with appropriate string values. AWS defaults will apply in absence of either of the aforementioned keys. |
| | **PreSharedKey** string | | The pre-shared key (PSK) to establish initial authentication between the virtual private gateway and customer gateway. |
| | **TunnelInsideCidr** string | | The range of inside IP addresses for the tunnel. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **vpn\_connection\_id** string | | The ID of the VPN connection. Required to modify or delete a connection if the filters option does not provide a unique match. |
| **vpn\_gateway\_id** string | | The ID of the virtual private gateway. |
| **wait\_timeout** integer | **Default:**600 | How long, in seconds, before wait gives up. |
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.
- name: create a VPN connection
community.aws.ec2_vpc_vpn:
state: present
vpn_gateway_id: vgw-XXXXXXXX
customer_gateway_id: cgw-XXXXXXXX
- name: modify VPN connection tags
community.aws.ec2_vpc_vpn:
state: present
vpn_connection_id: vpn-XXXXXXXX
tags:
Name: ansible-tag-1
Other: ansible-tag-2
- name: delete a connection
community.aws.ec2_vpc_vpn:
vpn_connection_id: vpn-XXXXXXXX
state: absent
- name: modify VPN tags (identifying VPN by filters)
community.aws.ec2_vpc_vpn:
state: present
filters:
cidr: 194.168.1.0/24
tag-keys:
- Ansible
- Other
tags:
New: Tag
purge_tags: true
static_only: true
- name: set up VPN with tunnel options utilizing 'TunnelInsideCidr' only
community.aws.ec2_vpc_vpn:
state: present
filters:
vpn: vpn-XXXXXXXX
static_only: true
tunnel_options:
-
TunnelInsideCidr: '169.254.100.1/30'
-
TunnelInsideCidr: '169.254.100.5/30'
- name: add routes and remove any preexisting ones
community.aws.ec2_vpc_vpn:
state: present
filters:
vpn: vpn-XXXXXXXX
routes:
- 195.168.2.0/24
- 196.168.2.0/24
purge_routes: true
- name: remove all routes
community.aws.ec2_vpc_vpn:
state: present
vpn_connection_id: vpn-XXXXXXXX
routes: []
purge_routes: true
- name: delete a VPN identified by filters
community.aws.ec2_vpc_vpn:
state: absent
filters:
tags:
Ansible: Tag
```
Return Values
-------------
Common return 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 | If the VPN connection has changed. **Sample:** {'changed': True} |
| **customer\_gateway\_configuration** string | *state=present* | The configuration of the VPN connection. |
| **customer\_gateway\_id** string | *state=present* | The customer gateway connected via the connection. **Sample:** {'customer\_gateway\_id': 'cgw-1220c87b'} |
| **options** complex | *state=present* | The VPN connection options (currently only containing static\_routes\_only). |
| | **static\_routes\_only** string | *state=present* | If the VPN connection only allows static routes. **Sample:** {'static\_routes\_only': True} |
| **routes** list / elements=string | *state=present* | The routes of the VPN connection. **Sample:** {'routes': [{'destination\_cidr\_block': '192.168.1.0/24', 'state': 'available'}]} |
| **state** string | *state=present* | The status of the VPN connection. **Sample:** {'state': 'available'} |
| **tags** dictionary | *state=present* | The tags associated with the connection. **Sample:** {'tags': {'name': 'ansible-test', 'other': 'tag'}} |
| **type** string | *state=present* | The type of VPN connection (currently only ipsec.1 is available). **Sample:** {'type': 'ipsec.1'} |
| **vgw\_telemetry** list / elements=string | *state=present* | The telemetry for the VPN tunnel. **Sample:** {'vgw\_telemetry': [{'accepted\_route\_count': 123, 'last\_status\_change': 'datetime(2015, 1, 1)', 'outside\_ip\_address': 'string', 'status': 'up', 'status\_message': 'string'}]} |
| **vpn\_connection\_id** string | *state=present* | The identifier for the VPN connection. **Sample:** {'vpn\_connection\_id': 'vpn-781e0e19'} |
| **vpn\_gateway\_id** string | *state=present* | The virtual private gateway connected via the connection. **Sample:** {'vpn\_gateway\_id': 'vgw-cb0ae2a2'} |
### Authors
* Sloane Hertel (@s-hertel)
| programming_docs |
ansible community.aws.iam_password_policy – Update an IAM Password Policy community.aws.iam\_password\_policy – Update an IAM Password Policy
===================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.iam_password_policy`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Module updates an IAM Password Policy on a given AWS account
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **allow\_pw\_change** boolean | **Choices:*** **no** ←
* yes
| Allow users to change their password.
aliases: allow\_password\_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. |
| **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 |
| **min\_pw\_length** integer | **Default:**6 | Minimum password length.
aliases: minimum\_password\_length |
| **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 |
| **pw\_expire** boolean | **Choices:*** **no** ←
* yes
| Prevents users from change an expired password.
aliases: password\_expire, expire |
| **pw\_max\_age** integer | **Default:**0 | Maximum age for a password in days. When this option is 0 then passwords do not expire automatically.
aliases: password\_max\_age |
| **pw\_reuse\_prevent** integer | **Default:**0 | Prevent re-use of passwords.
aliases: password\_reuse\_prevent, prevent\_reuse |
| **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 |
| **require\_lowercase** boolean | **Choices:*** **no** ←
* yes
| Require lowercase letters in password. |
| **require\_numbers** boolean | **Choices:*** **no** ←
* yes
| Require numbers in password. |
| **require\_symbols** boolean | **Choices:*** **no** ←
* yes
| Require symbols in password. |
| **require\_uppercase** boolean | **Choices:*** **no** ←
* yes
| Require uppercase letters in password. |
| **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:*** present
* absent
| Specifies the overall state of the password policy. |
| **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: Password policy for AWS account
community.aws.iam_password_policy:
state: present
min_pw_length: 8
require_symbols: false
require_numbers: true
require_uppercase: true
require_lowercase: true
allow_pw_change: true
pw_max_age: 60
pw_reuse_prevent: 5
pw_expire: false
```
### Authors
* Aaron Smith (@slapula)
ansible community.aws.cloudfront_origin_access_identity – Create, update and delete origin access identities for a CloudFront distribution community.aws.cloudfront\_origin\_access\_identity – Create, update and delete origin access identities for a CloudFront distribution
=====================================================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.cloudfront_origin_access_identity`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for easy creation, updating and deletion of origin access identities.
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 |
| --- | --- | --- |
| **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 |
| **caller\_reference** string | | A unique identifier to reference the origin access identity by. |
| **comment** string | | A comment to describe the CloudFront origin access identity. |
| **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 |
| **origin\_access\_identity\_id** string | | The origin\_access\_identity\_id of the CloudFront distribution. |
| **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
| If the named resource should exist. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* Does not support check mode.
* 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 an origin access identity
community.aws.cloudfront_origin_access_identity:
state: present
caller_reference: this is an example reference
comment: this is an example comment
- name: update an existing origin access identity using caller_reference as an identifier
community.aws.cloudfront_origin_access_identity:
origin_access_identity_id: E17DRN9XUOAHZX
caller_reference: this is an example reference
comment: this is a new comment
- name: delete an existing origin access identity using caller_reference as an identifier
community.aws.cloudfront_origin_access_identity:
state: absent
caller_reference: this is an example reference
comment: this is a new comment
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **cloud\_front\_origin\_access\_identity** complex | always | The origin access identity's information. |
| | **cloud\_front\_origin\_access\_identity\_config** complex | always | describes a url specifying the origin access identity. |
| | | **caller\_reference** string | always | a caller reference for the oai |
| | | **comment** string | always | a comment describing the oai |
| | **id** string | always | a unique identifier of the oai |
| | **s3\_canonical\_user\_id** string | always | the canonical user ID of the user who created the oai |
| **e\_tag** string | always | The current version of the origin access identity created. |
| **location** string | when initially created | The fully qualified URI of the new origin access identity just created. |
### Authors
* Willem van Ketwich (@wilvk)
ansible community.aws.aws_kms – Perform various KMS management tasks. community.aws.aws\_kms – Perform various KMS management tasks.
==============================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_kms`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage role/user access to a KMS key. Not designed for encrypting/decrypting.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.6
* boto
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **alias** string | | An alias for a key. For safety, even though KMS does not require keys to have an alias, this module expects all new keys to be given an alias to make them easier to manage. Existing keys without an alias may be referred to by *key\_id*. Use [community.aws.aws\_kms\_info](aws_kms_info_module) to find key ids. Required if *key\_id* is not given. Note that passing a *key\_id* and *alias* will only cause a new alias to be added, an alias will never be renamed. The 'alias/' prefix is optional.
aliases: key\_alias |
| **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 | | A description of the CMK. Use a description that helps you decide whether the CMK is appropriate for a task. |
| **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 |
| **enable\_key\_rotation** boolean | **Choices:*** no
* yes
| Whether the key should be automatically rotated every year. |
| **enabled** boolean | **Choices:*** no
* **yes** ←
| Whether or not a key is enabled |
| **grants** list / elements=dictionary | | A list of grants to apply to the key. Each item must contain *grantee\_principal*. Each item can optionally contain *retiring\_principal*, *operations*, *constraints*, *name*.
*grantee\_principal* and *retiring\_principal* must be ARNs For full documentation of suboptions see the boto3 documentation: <https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kms.html#KMS.Client.create_grant> |
| | **constraints** dictionary | | Constraints is a dict containing `encryption_context_subset` or `encryption_context_equals`, either or both being a dict specifying an encryption context match. See <https://docs.aws.amazon.com/kms/latest/APIReference/API_GrantConstraints.html> or <https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kms.html#KMS.Client.create_grant>
|
| | **grantee\_principal** string / required | | The full ARN of the principal being granted permissions. |
| | **operations** list / elements=string | **Choices:*** Decrypt
* Encrypt
* GenerateDataKey
* GenerateDataKeyWithoutPlaintext
* ReEncryptFrom
* ReEncryptTo
* CreateGrant
* RetireGrant
* DescribeKey
* Verify
* Sign
| A list of operations that the grantee may perform using the CMK. |
| | **retiring\_principal** string | | The full ARN of the principal permitted to revoke/retire the grant. |
| **key\_id** string | | Key ID or ARN of the key. One of *alias* or *key\_id* are required.
aliases: key\_arn |
| **pending\_window** integer added in 1.4.0 of community.aws | | The number of days between requesting deletion of the CMK and when it will actually be deleted. Only used when *state=absent* and the CMK has not yet been deleted. Valid values are between 7 and 30 (inclusive). See also: <https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html#KMS-ScheduleKeyDeletion-request-PendingWindowInDays>
aliases: deletion\_delay |
| **policy** json | | policy to apply to the KMS key. See <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html>
|
| **policy\_clean\_invalid\_entries** boolean | **Choices:*** no
* **yes** ←
| (deprecated) If adding/removing a role and invalid grantees are found, remove them. These entries will cause an update to fail in all known cases. Only cleans if changes are being made. Used for modifying the Key Policy rather than modifying a grant and only works on the default policy created through the AWS Console. This option has been deprecated, and will be removed in 2.13. Use *policy* instead.
aliases: clean\_invalid\_entries |
| **policy\_grant\_types** list / elements=string | | (deprecated) List of grants to give to user/role. Likely "role,role grant" or "role,role grant,admin". Required when *policy\_mode=grant*. Used for modifying the Key Policy rather than modifying a grant and only works on the default policy created through the AWS Console. This option has been deprecated, and will be removed in 2.13. Use *policy* instead.
aliases: grant\_types |
| **policy\_mode** string | **Choices:*** **grant** ←
* deny
| (deprecated) Grant or deny access. Used for modifying the Key Policy rather than modifying a grant and only works on the default policy created through the AWS Console. This option has been deprecated, and will be removed in 2.13. Use *policy* instead.
aliases: mode |
| **policy\_role\_arn** string | | (deprecated) ARN of role to allow/deny access. One of *policy\_role\_name* or *policy\_role\_arn* are required. Used for modifying the Key Policy rather than modifying a grant and only works on the default policy created through the AWS Console. This option has been deprecated, and will be removed in 2.13. Use *policy* instead.
aliases: role\_arn |
| **policy\_role\_name** string | | (deprecated) Role to allow/deny access. One of *policy\_role\_name* or *policy\_role\_arn* are required. Used for modifying the Key Policy rather than modifying a grant and only works on the default policy created through the AWS Console. This option has been deprecated, and will be removed in 2.13. Use *policy* instead.
aliases: role\_name |
| **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\_grants** boolean | **Choices:*** **no** ←
* yes
| Whether the *grants* argument should cause grants not in the list to be removed |
| **purge\_tags** boolean | **Choices:*** **no** ←
* yes
| Whether the *tags* argument should cause tags not in the list to be removed |
| **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
| Whether a key should be present or absent. Note that making an existing key absent only schedules a key for deletion. Passing a key that is scheduled for deletion with state present will cancel key deletion. |
| **tags** dictionary | | A dictionary of tags to apply to a key. |
| **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
--------
```
# Managing the KMS IAM Policy via policy_mode and policy_grant_types is fragile
# and has been deprecated in favour of the policy option.
- name: grant user-style access to production secrets
community.aws.aws_kms:
args:
alias: "alias/my_production_secrets"
policy_mode: grant
policy_role_name: "prod-appServerRole-1R5AQG2BSEL6L"
policy_grant_types: "role,role grant"
- name: remove access to production secrets from role
community.aws.aws_kms:
args:
alias: "alias/my_production_secrets"
policy_mode: deny
policy_role_name: "prod-appServerRole-1R5AQG2BSEL6L"
# Create a new KMS key
- community.aws.aws_kms:
alias: mykey
tags:
Name: myKey
Purpose: protect_stuff
# Update previous key with more tags
- community.aws.aws_kms:
alias: mykey
tags:
Name: myKey
Purpose: protect_stuff
Owner: security_team
# Update a known key with grants allowing an instance with the billing-prod IAM profile
# to decrypt data encrypted with the environment: production, application: billing
# encryption context
- community.aws.aws_kms:
key_id: abcd1234-abcd-1234-5678-ef1234567890
grants:
- name: billing_prod
grantee_principal: arn:aws:iam::1234567890123:role/billing_prod
constraints:
encryption_context_equals:
environment: production
application: billing
operations:
- Decrypt
- RetireGrant
- name: Update IAM policy on an existing KMS key
community.aws.aws_kms:
alias: my-kms-key
policy: '{"Version": "2012-10-17", "Id": "my-kms-key-permissions", "Statement": [ { <SOME STATEMENT> } ]}'
state: present
- name: Example using lookup for policy json
community.aws.aws_kms:
alias: my-kms-key
policy: "{{ lookup('template', 'kms_iam_policy_template.json.j2') }}"
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 |
| --- | --- | --- |
| **aliases** list / elements=string | always | list of aliases associated with the key **Sample:** ['aws/acm', 'aws/ebs'] |
| **aws\_account\_id** string | always | The AWS Account ID that the key belongs to **Sample:** 1234567890123 |
| **changes\_needed** dictionary | always | grant types that would be changed/were changed. **Sample:** {'role': 'add', 'role grant': 'add'} |
| **creation\_date** string | always | Date of creation of the key **Sample:** 2017-04-18T15:12:08.551000+10:00 |
| **description** string | always | Description of the key **Sample:** My Key for Protecting important stuff |
| **enabled** string | always | Whether the key is enabled. True if `KeyState` is true. |
| **grants** complex | always | list of grants associated with a key |
| | **constraints** dictionary | always | Constraints on the encryption context that the grant allows. See <https://docs.aws.amazon.com/kms/latest/APIReference/API_GrantConstraints.html> for further details **Sample:** {'encryption\_context\_equals': {'aws:lambda:\_function\_arn': 'arn:aws:lambda:ap-southeast-2:012345678912:function:xyz'}} |
| | **creation\_date** string | always | Date of creation of the grant **Sample:** 2017-04-18T15:12:08+10:00 |
| | **grant\_id** string | always | The unique ID for the grant **Sample:** abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234 |
| | **grantee\_principal** string | always | The principal that receives the grant's permissions **Sample:** arn:aws:sts::0123456789012:assumed-role/lambda\_xyz/xyz |
| | **issuing\_account** string | always | The AWS account under which the grant was issued **Sample:** arn:aws:iam::01234567890:root |
| | **key\_id** string | always | The key ARN to which the grant applies. **Sample:** arn:aws:kms:ap-southeast-2:123456789012:key/abcd1234-abcd-1234-5678-ef1234567890 |
| | **name** string | always | The friendly name that identifies the grant **Sample:** xyz |
| | **operations** list / elements=string | always | The list of operations permitted by the grant **Sample:** ['Decrypt', 'RetireGrant'] |
| | **retiring\_principal** string | always | The principal that can retire the grant **Sample:** arn:aws:sts::0123456789012:assumed-role/lambda\_xyz/xyz |
| **had\_invalid\_entries** boolean | always | there are invalid (non-ARN) entries in the KMS entry. These don't count as a change, but will be removed if any changes are being made. |
| **key\_arn** string | always | ARN of key **Sample:** arn:aws:kms:ap-southeast-2:123456789012:key/abcd1234-abcd-1234-5678-ef1234567890 |
| **key\_id** string | always | ID of key **Sample:** abcd1234-abcd-1234-5678-ef1234567890 |
| **key\_state** string | always | The state of the key **Sample:** PendingDeletion |
| **key\_usage** string | always | The cryptographic operations for which you can use the key. **Sample:** ENCRYPT\_DECRYPT |
| **origin** string | always | The source of the key's key material. When this value is `AWS_KMS`, AWS KMS created the key material. When this value is `EXTERNAL`, the key material was imported or the CMK lacks key material. **Sample:** AWS\_KMS |
| **policies** list / elements=string | always | list of policy documents for the keys. Empty when access is denied even if there are policies. **Sample:** {'Id': 'auto-ebs-2', 'Statement': [{'Action': ['kms:Encrypt', 'kms:Decrypt', 'kms:ReEncrypt\*', 'kms:GenerateDataKey\*', 'kms:CreateGrant', 'kms:DescribeKey'], 'Condition': {'StringEquals': {'kms:CallerAccount': '111111111111', 'kms:ViaService': 'ec2.ap-southeast-2.amazonaws.com'}}, 'Effect': 'Allow', 'Principal': {'AWS': '\*'}, 'Resource': '\*', 'Sid': 'Allow access through EBS for all principals in the account that are authorized to use EBS'}, {'Action': ['kms:Describe\*', 'kms:Get\*', 'kms:List\*', 'kms:RevokeGrant'], 'Effect': 'Allow', 'Principal': {'AWS': 'arn:aws:iam::111111111111:root'}, 'Resource': '\*', 'Sid': 'Allow direct access to key metadata to the account'}], 'Version': '2012-10-17'} |
| **tags** dictionary | always | dictionary of tags applied to the key **Sample:** {'Name': 'myKey', 'Purpose': 'protecting\_stuff'} |
### Authors
* Ted Timmons (@tedder)
* Will Thames (@willthames)
* Mark Chappell (@tremble)
| programming_docs |
ansible community.aws.lambda – Manage AWS Lambda functions community.aws.lambda – Manage AWS Lambda functions
==================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.lambda`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for the management of Lambda functions.
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 |
| **dead\_letter\_arn** string | | The parent object that contains the target Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic. |
| **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 | | A short, user-defined function description. Lambda does not use this value. Assign a meaningful description as you see fit. |
| **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 |
| **environment\_variables** dictionary | | A dictionary of environment variables the Lambda function is given. |
| **handler** string | | The function within your code that Lambda calls to begin execution. |
| **memory\_size** integer | **Default:**128 | The amount of memory, in MB, your Lambda function is given. |
| **name** string / required | | The name you want to assign to the function you are uploading. Cannot be changed. |
| **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** string | | The Amazon Resource Name (ARN) of the IAM role that Lambda assumes when it executes your function to access any other Amazon Web Services (AWS) resources. You may use the bare ARN if the role belongs to the same AWS account. Required when *state=present*. |
| **runtime** string | | The runtime environment for the Lambda function you are uploading. Required when creating a function. Uses parameters as described in boto3 docs. Required when *state=present*. For supported list of runtimes, see <https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html>. |
| **s3\_bucket** string | | Amazon S3 bucket name where the .zip file containing your deployment package is stored. If *state=present* then either *zip\_file* or *s3\_bucket* must be present.
*s3\_bucket* and *s3\_key* are required together. |
| **s3\_key** string | | The Amazon S3 object (the deployment package) key name you want to upload.
*s3\_bucket* and *s3\_key* are required together. |
| **s3\_object\_version** string | | The Amazon S3 object (the deployment package) version you want to upload. |
| **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 Lambda function. |
| **tags** dictionary | | tag dict to apply to the function (requires botocore 1.5.40 or above). |
| **timeout** integer | **Default:**3 | The function maximum execution time in seconds after which Lambda should terminate the function. |
| **tracing\_mode** string | **Choices:*** Active
* PassThrough
| Set mode to 'Active' to sample and trace incoming requests with AWS X-Ray. Turned off (set to 'PassThrough') by default. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **vpc\_security\_group\_ids** list / elements=string | | List of VPC security group IDs to associate with the Lambda function. Required when *vpc\_subnet\_ids* is used. |
| **vpc\_subnet\_ids** list / elements=string | | List of subnet IDs to run Lambda function in. Use this option if you need to access resources in your VPC. Leave empty if you don't want to run the function in a VPC. If set, *vpc\_security\_group\_ids* must also be set. |
| **zip\_file** string | | A .zip file containing your deployment package If *state=present* then either *zip\_file* or *s3\_bucket* must be present.
aliases: src |
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
--------
```
# Create Lambda functions
- name: looped creation
community.aws.lambda:
name: '{{ item.name }}'
state: present
zip_file: '{{ item.zip_file }}'
runtime: 'python2.7'
role: 'arn:aws:iam::987654321012:role/lambda_basic_execution'
handler: 'hello_python.my_handler'
vpc_subnet_ids:
- subnet-123abcde
- subnet-edcba321
vpc_security_group_ids:
- sg-123abcde
- sg-edcba321
environment_variables: '{{ item.env_vars }}'
tags:
key1: 'value1'
loop:
- name: HelloWorld
zip_file: hello-code.zip
env_vars:
key1: "first"
key2: "second"
- name: ByeBye
zip_file: bye-code.zip
env_vars:
key1: "1"
key2: "2"
# To remove previously added tags pass an empty dict
- name: remove tags
community.aws.lambda:
name: 'Lambda function'
state: present
zip_file: 'code.zip'
runtime: 'python2.7'
role: 'arn:aws:iam::987654321012:role/lambda_basic_execution'
handler: 'hello_python.my_handler'
tags: {}
# Basic Lambda function deletion
- name: Delete Lambda functions HelloWorld and ByeBye
community.aws.lambda:
name: '{{ item }}'
state: absent
loop:
- HelloWorld
- ByeBye
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **code** dictionary | success | the lambda function location returned by get\_function in boto3 **Sample:** {'location': 'a presigned S3 URL', 'repository\_type': 'S3'} |
| **configuration** dictionary | success | the lambda function metadata returned by get\_function in boto3 **Sample:** {'code\_sha256': 'zOAGfF5JLFuzZoSNirUtOrQp+S341IOA3BcoXXoaIaU=', 'code\_size': 123, 'description': 'My function', 'environment': {'variables': {'key': 'value'}}, 'function\_arn': 'arn:aws:lambda:us-east-1:123456789012:function:myFunction:1', 'function\_name': 'myFunction', 'handler': 'index.handler', 'last\_modified': '2017-08-01T00:00:00.000+0000', 'memory\_size': 128, 'revision\_id': 'a2x9886d-d48a-4a0c-ab64-82abc005x80c', 'role': 'arn:aws:iam::123456789012:role/lambda\_basic\_execution', 'runtime': 'nodejs6.10', 'timeout': 3, 'tracing\_config': {'mode': 'Active'}, 'version': '1', 'vpc\_config': {'security\_group\_ids': [], 'subnet\_ids': [], 'vpc\_id': '123'}} |
### Authors
* Steyn Huizinga (@steynovich)
ansible community.aws.rds_param_group – manage RDS parameter groups community.aws.rds\_param\_group – manage RDS parameter groups
=============================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.rds_param_group`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates, modifies, and deletes RDS parameter 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 | | Database parameter group description. Only set when a new group is added. |
| **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 |
| **engine** string | | The type of database for this group. Please use following command to get list of all supported db engines and their respective versions. # aws rds describe-db-engine-versions --query "DBEngineVersions[].DBParameterGroupFamily" Required for *state=present*. |
| **immediate** boolean | **Choices:*** no
* yes
| Whether to apply the changes immediately, or after the next reboot of any associated instances.
aliases: apply\_immediately |
| **name** string / required | | Database parameter group identifier. |
| **params** dictionary | | Map of parameter names and values. Numeric values may be represented as K for kilo (1024), M for mega (1024^2), G for giga (1024^3), or T for tera (1024^4), and these values will be expanded into the appropriate number before being set in the parameter group.
aliases: parameters |
| **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 / required | **Choices:*** present
* absent
| Specifies whether the group should be present or absent. |
| **tags** dictionary | | Dictionary of tags to attach to the parameter group. |
| **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: Add or change a parameter group, in this case setting auto_increment_increment to 42 * 1024
community.aws.rds_param_group:
state: present
name: norwegian-blue
description: 'My Fancy Ex Parrot Group'
engine: 'mysql5.6'
params:
auto_increment_increment: "42K"
tags:
Environment: production
Application: parrot
- name: Remove a parameter group
community.aws.rds_param_group:
state: absent
name: norwegian-blue
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **db\_parameter\_group\_arn** string | when state is present | ARN of the DB parameter group |
| **db\_parameter\_group\_family** string | when state is present | DB parameter group family that this DB parameter group is compatible with. |
| **db\_parameter\_group\_name** string | when state is present | Name of DB parameter group |
| **description** string | when state is present | description of the DB parameter group |
| **errors** list / elements=string | when state is present | list of errors from attempting to modify parameters that are not modifiable |
| **tags** dictionary | when state is present | dictionary of tags |
### Authors
* Scott Anderson (@tastychutney)
* Will Thames (@willthames)
ansible community.aws.aws_direct_connect_confirm_connection – Confirms the creation of a hosted DirectConnect connection. community.aws.aws\_direct\_connect\_confirm\_connection – Confirms the creation of a hosted DirectConnect connection.
=====================================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_direct_connect_confirm_connection`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Confirms the creation of a hosted DirectConnect, which requires approval before it can be used.
* DirectConnect connections that require approval would be in the ‘ordering’.
* After confirmation, they will move to the ‘pending’ state and finally the ‘available’ state.
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 |
| **connection\_id** string | | The ID of the Direct Connect connection. One of *connection\_id* or *name* must be specified. |
| **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 |
| **name** string | | The name of the Direct Connect connection. One of *connection\_id* or *name* must be specified. |
| **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
--------
```
# confirm a Direct Connect by name
- name: confirm the connection id
aws_direct_connect_confirm_connection:
name: my_host_direct_connect
# confirm a Direct Connect by connection_id
- name: confirm the connection id
aws_direct_connect_confirm_connection:
connection_id: dxcon-xxxxxxxx
```
Return Values
-------------
Common return 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\_state** string | always | The state of the connection. **Sample:** pending |
### Authors
* Matt Traynham (@mtraynham)
| programming_docs |
ansible community.aws.iam_group – Manage AWS IAM groups community.aws.iam\_group – Manage AWS IAM groups
================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.iam_group`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage AWS IAM groups.
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 |
| **managed\_policies** list / elements=string | | A list of managed policy ARNs or friendly names to attach to the role. To embed an inline policy, use [community.aws.iam\_policy](iam_policy_module).
aliases: managed\_policy |
| **name** string / required | | The name of the group to create. |
| **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\_policies** boolean | **Choices:*** **no** ←
* yes
| When *purge\_policies=true* any managed policies not listed in *managed\_policies* will be detatched.
aliases: purge\_policy, purge\_managed\_policies |
| **purge\_users** boolean | **Choices:*** **no** ←
* yes
| When *purge\_users=true* users which are not included in *users* will be detached. |
| **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 / required | **Choices:*** present
* absent
| Create or remove the IAM group. |
| **users** list / elements=string | | A list of existing users to add as members of the group. |
| **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 group
community.aws.iam_group:
name: testgroup1
state: present
- name: Create a group and attach a managed policy using its ARN
community.aws.iam_group:
name: testgroup1
managed_policies:
- arn:aws:iam::aws:policy/AmazonSNSFullAccess
state: present
- name: Create a group with users as members and attach a managed policy using its ARN
community.aws.iam_group:
name: testgroup1
managed_policies:
- arn:aws:iam::aws:policy/AmazonSNSFullAccess
users:
- test_user1
- test_user2
state: present
- name: Remove all managed policies from an existing group with an empty list
community.aws.iam_group:
name: testgroup1
state: present
purge_policies: true
- name: Remove all group members from an existing group
community.aws.iam_group:
name: testgroup1
managed_policies:
- arn:aws:iam::aws:policy/AmazonSNSFullAccess
purge_users: true
state: present
- name: Delete the group
community.aws.iam_group:
name: testgroup1
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 |
| --- | --- | --- |
| **iam\_group** complex | success | dictionary containing all the group information including group membership |
| | **group** complex | success | dictionary containing all the group information |
| | | **arn** string | success | the Amazon Resource Name (ARN) specifying the group **Sample:** arn:aws:iam::1234567890:group/testgroup1 |
| | | **create\_date** string | success | the date and time, in ISO 8601 date-time format, when the group was created **Sample:** 2017-02-08T04:36:28+00:00 |
| | | **group\_id** string | success | the stable and unique string identifying the group **Sample:** AGPAIDBWE12NSFINE55TM |
| | | **group\_name** string | success | the friendly name that identifies the group **Sample:** testgroup1 |
| | | **path** string | success | the path to the group **Sample:** / |
| | **users** complex | success | list containing all the group members |
| | | **arn** string | success | the Amazon Resource Name (ARN) specifying the user **Sample:** arn:aws:iam::1234567890:user/test\_user1 |
| | | **create\_date** string | success | the date and time, in ISO 8601 date-time format, when the user was created **Sample:** 2017-02-08T04:36:28+00:00 |
| | | **path** string | success | the path to the user **Sample:** / |
| | | **user\_id** string | success | the stable and unique string identifying the user **Sample:** AIDAIZTPY123YQRS22YU2 |
| | | **user\_name** string | success | the friendly name that identifies the user **Sample:** testgroup1 |
### Authors
* Nick Aslanidis (@naslanidis)
* Maksym Postument (@infectsoldier)
ansible community.aws.route53 – add or delete entries in Amazons Route 53 DNS service community.aws.route53 – add or delete entries in Amazons Route 53 DNS service
=============================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.route53`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates and deletes DNS records in Amazons Route 53 service.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **alias** boolean | **Choices:*** no
* yes
| Indicates if this is an alias record. Mutually exclusive with *ttl*. Defaults to `false`. |
| **alias\_evaluate\_target\_health** boolean | **Choices:*** **no** ←
* yes
| Whether or not to evaluate an alias target health. Useful for aliases to Elastic Load Balancers. |
| **alias\_hosted\_zone\_id** string | | The hosted zone identifier. |
| **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 |
| **failover** string | **Choices:*** SECONDARY
* PRIMARY
| Failover resource record sets only. Whether this is the primary or secondary resource record set. Allowed values are PRIMARY and SECONDARY Mutually exclusive with *weight* and *region*. |
| **health\_check** string | | Health check to associate with this record |
| **hosted\_zone\_id** string | | The Hosted Zone ID of the DNS zone to modify. This is a required parameter, if parameter *zone* is not supplied. |
| **identifier** string | | Have to be specified for Weighted, latency-based and failover resource record sets only. An identifier that differentiates among multiple resource record sets that have the same combination of DNS name and type. |
| **overwrite** boolean | **Choices:*** no
* yes
| Whether an existing record should be overwritten on create if values do not match. |
| **private\_zone** boolean | **Choices:*** **no** ←
* yes
| If set to `true`, the private zone matching the requested name within the domain will be used if there are both public and private zones. The default is to use the public zone. |
| **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 |
| **record** string / required | | The full DNS record to create or delete. |
| **region** string | | Latency-based resource record sets only Among resource record sets that have the same combination of DNS name and type, a value that determines which region this should be associated with for the latency-based routing Mutually exclusive with *weight* and *failover*. |
| **retry\_interval** integer | **Default:**500 | In the case that Route 53 is still servicing a prior request, this module will wait and try again after this many seconds. If you have many domain names, the default of `500` seconds may be too long. |
| **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:*** present
* absent
* get
* create
* delete
| Specifies the state of the resource record. As of Ansible 2.4, the *command* option has been changed to *state* as default and the choices `present` and `absent` have been added, but *command* still works as well.
aliases: command |
| **ttl** integer | **Default:**3600 | The TTL, in second, to give the new record. Mutually exclusive with *alias*. |
| **type** string / required | **Choices:*** A
* CNAME
* MX
* AAAA
* TXT
* PTR
* SRV
* SPF
* CAA
* NS
* SOA
| The type of DNS record to create. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **value** list / elements=string | | The new value when creating a DNS record. YAML lists or multiple comma-spaced values are allowed for non-alias records. When deleting a record all values for the record must be specified or Route 53 will not delete it. |
| **vpc\_id** string | | When used in conjunction with private\_zone: true, this will only modify records in the private hosted zone attached to this VPC. This allows you to have multiple private hosted zones, all with the same name, attached to different VPCs. |
| **wait** boolean | **Choices:*** **no** ←
* yes
| Wait until the changes have been replicated to all Amazon Route 53 DNS servers. |
| **wait\_timeout** integer | **Default:**300 | How long to wait for the changes to be replicated, in seconds. |
| **weight** integer | | Weighted resource record sets only. Among resource record sets that have the same combination of DNS name and type, a value that determines what portion of traffic for the current resource record set is routed to the associated location. Mutually exclusive with *region* and *failover*. |
| **zone** string | | The DNS zone to modify. This is a required parameter, if parameter *hosted\_zone\_id* is not supplied. |
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: Add new.foo.com as an A record with 3 IPs and wait until the changes have been replicated
community.aws.route53:
state: present
zone: foo.com
record: new.foo.com
type: A
ttl: 7200
value: 1.1.1.1,2.2.2.2,3.3.3.3
wait: yes
- name: Update new.foo.com as an A record with a list of 3 IPs and wait until the changes have been replicated
community.aws.route53:
state: present
zone: foo.com
record: new.foo.com
type: A
ttl: 7200
value:
- 1.1.1.1
- 2.2.2.2
- 3.3.3.3
wait: yes
- name: Retrieve the details for new.foo.com
community.aws.route53:
state: get
zone: foo.com
record: new.foo.com
type: A
register: rec
- name: Delete new.foo.com A record using the results from the get command
community.aws.route53:
state: absent
zone: foo.com
record: "{{ rec.set.record }}"
ttl: "{{ rec.set.ttl }}"
type: "{{ rec.set.type }}"
value: "{{ rec.set.value }}"
# Add an AAAA record. Note that because there are colons in the value
# that the IPv6 address must be quoted. Also shows using the old form command=create.
- name: Add an AAAA record
community.aws.route53:
command: create
zone: foo.com
record: localhost.foo.com
type: AAAA
ttl: 7200
value: "::1"
# For more information on SRV records see:
# https://en.wikipedia.org/wiki/SRV_record
- name: Add a SRV record with multiple fields for a service on port 22222
community.aws.route53:
state: present
zone: foo.com
record: "_example-service._tcp.foo.com"
type: SRV
value: "0 0 22222 host1.foo.com,0 0 22222 host2.foo.com"
# Note that TXT and SPF records must be surrounded
# by quotes when sent to Route 53:
- name: Add a TXT record.
community.aws.route53:
state: present
zone: foo.com
record: localhost.foo.com
type: TXT
ttl: 7200
value: '"bar"'
- name: Add an alias record that points to an Amazon ELB
community.aws.route53:
state: present
zone: foo.com
record: elb.foo.com
type: A
value: "{{ elb_dns_name }}"
alias: True
alias_hosted_zone_id: "{{ elb_zone_id }}"
- name: Retrieve the details for elb.foo.com
community.aws.route53:
state: get
zone: foo.com
record: elb.foo.com
type: A
register: rec
- name: Delete an alias record using the results from the get command
community.aws.route53:
state: absent
zone: foo.com
record: "{{ rec.set.record }}"
ttl: "{{ rec.set.ttl }}"
type: "{{ rec.set.type }}"
value: "{{ rec.set.value }}"
alias: True
alias_hosted_zone_id: "{{ rec.set.alias_hosted_zone_id }}"
- name: Add an alias record that points to an Amazon ELB and evaluates it health
community.aws.route53:
state: present
zone: foo.com
record: elb.foo.com
type: A
value: "{{ elb_dns_name }}"
alias: True
alias_hosted_zone_id: "{{ elb_zone_id }}"
alias_evaluate_target_health: True
- name: Add an AAAA record with Hosted Zone ID
community.aws.route53:
state: present
zone: foo.com
hosted_zone_id: Z2AABBCCDDEEFF
record: localhost.foo.com
type: AAAA
ttl: 7200
value: "::1"
- name: Use a routing policy to distribute traffic
community.aws.route53:
state: present
zone: foo.com
record: www.foo.com
type: CNAME
value: host1.foo.com
ttl: 30
# Routing policy
identifier: "host1@www"
weight: 100
health_check: "d994b780-3150-49fd-9205-356abdd42e75"
- name: Add a CAA record (RFC 6844)
community.aws.route53:
state: present
zone: example.com
record: example.com
type: CAA
value:
- 0 issue "ca.example.net"
- 0 issuewild ";"
- 0 iodef "mailto:[email protected]"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **nameservers** list / elements=string | when state is 'get' | Nameservers associated with the zone. **Sample:** ['ns-1036.awsdns-00.org.', 'ns-516.awsdns-00.net.', 'ns-1504.awsdns-00.co.uk.', 'ns-1.awsdns-00.com.'] |
| **set** complex | when state is 'get' | Info specific to the resource record. |
| | **alias** boolean | always | Whether this is an alias. |
| | **failover** string | always | Whether this is the primary or secondary resource record set. **Sample:** PRIMARY |
| | **health\_check** string | always | health\_check associated with this record. |
| | **identifier** string | always | An identifier that differentiates among multiple resource record sets that have the same combination of DNS name and type. |
| | **record** string | always | Domain name for the record set. **Sample:** new.foo.com. |
| | **region** string | always | Which region this should be associated with for latency-based routing. **Sample:** us-west-2 |
| | **ttl** string | always | Resource record cache TTL. **Sample:** 3600 |
| | **type** string | always | Resource record set type. **Sample:** A |
| | **value** string | always | Record value. **Sample:** 52.43.18.27 |
| | **values** list / elements=string | always | Record Values. **Sample:** ['52.43.18.27'] |
| | **weight** string | always | Weight of the record. **Sample:** 3 |
| | **zone** string | always | Zone this record set belongs to. **Sample:** foo.bar.com. |
### Authors
* Bruce Pennypacker (@bpennypacker)
* Mike Buzzetti (@jimbydamonk)
| programming_docs |
ansible community.aws.aws_waf_info – Retrieve information for WAF ACLs, Rule , Conditions and Filters. community.aws.aws\_waf\_info – Retrieve information for WAF ACLs, Rule , Conditions and Filters.
================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_waf_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Retrieve information for WAF ACLs, Rule , Conditions and Filters.
* This module was called `aws_waf_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 |
| **name** string | | The name of a Web Application Firewall. |
| **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. |
| **waf\_regional** boolean | **Choices:*** **no** ←
* yes
| Whether to use the waf-regional module. |
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: obtain all WAF information
community.aws.aws_waf_info:
- name: obtain all information for a single WAF
community.aws.aws_waf_info:
name: test_waf
- name: obtain all information for a single WAF Regional
community.aws.aws_waf_info:
name: test_waf
waf_regional: 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 |
| --- | --- | --- |
| **wafs** complex | success | The WAFs that match the passed arguments. |
| | **default\_action** integer | always | The action to perform if none of the Rules contained in the WebACL match. **Sample:** BLOCK |
| | **metric\_name** string | always | A friendly name or description for the metrics for this WebACL. **Sample:** test\_waf\_metric |
| | **name** string | always | A friendly name or description of the WebACL. **Sample:** test\_waf |
| | **rules** complex | always | An array that contains the action for each Rule in a WebACL , the priority of the Rule. |
| | | **action** string | always | The action to perform if the Rule matches. **Sample:** BLOCK |
| | | **metric\_name** string | always | A friendly name or description for the metrics for this Rule. **Sample:** ipblockrule |
| | | **name** string | always | A friendly name or description of the Rule. **Sample:** ip\_block\_rule |
| | | **predicates** list / elements=string | always | The Predicates list contains a Predicate for each ByteMatchSet, IPSet, SizeConstraintSet, SqlInjectionMatchSet or XssMatchSet object in a Rule. **Sample:** [{'byte\_match\_set\_id': '47b822b5-abcd-1234-faaf-1234567890', 'byte\_match\_tuples': [{'field\_to\_match': {'type': 'QUERY\_STRING'}, 'positional\_constraint': 'STARTS\_WITH', 'target\_string': 'bobbins', 'text\_transformation': 'NONE'}], 'name': 'bobbins', 'negated': False, 'type': 'ByteMatch'}] |
### Authors
* Mike Mochan (@mmochan)
* Will Thames (@willthames)
ansible community.aws.aws_batch_job_definition – Manage AWS Batch Job Definitions community.aws.aws\_batch\_job\_definition – Manage AWS Batch Job Definitions
============================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_batch_job_definition`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module allows the management of AWS Batch Job Definitions.
* It is idempotent and supports “Check” mode.
* Use module [community.aws.aws\_batch\_compute\_environment](aws_batch_compute_environment_module#ansible-collections-community-aws-aws-batch-compute-environment-module) to manage the compute environment, [community.aws.aws\_batch\_job\_queue](aws_batch_job_queue_module#ansible-collections-community-aws-aws-batch-job-queue-module) to manage job queues, [community.aws.aws\_batch\_job\_definition](#ansible-collections-community-aws-aws-batch-job-definition-module) to manage job definitions.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **attempts** integer | | Retry strategy - The number of times to move a job to the RUNNABLE status. You may specify between 1 and 10 attempts. If attempts is greater than one, the job is retried if it fails until it has moved to RUNNABLE that many times. |
| **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 |
| **command** list / elements=string | | The command that is passed to the container. This parameter maps to Cmd in the Create a container section of the Docker Remote API and the COMMAND parameter to docker run. For more information, see <https://docs.docker.com/engine/reference/builder/#cmd>. |
| **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 |
| **environment** list / elements=dictionary | | The environment variables to pass to a container. This parameter maps to Env in the Create a container section of the Docker Remote API and the --env option to docker run. |
| | **name** string | | The name of the key value pair. For environment variables, this is the name of the environment variable. |
| | **value** string | | The value of the key value pair. For environment variables, this is the value of the environment variable. |
| **image** string / required | | The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with `` repository-url /image <colon>tag ``. Up to 255 letters (uppercase and lowercase), numbers, hyphens, underscores, colons, periods, forward slashes, and number signs are allowed. This parameter maps to Image in the Create a container section of the Docker Remote API and the IMAGE parameter of docker run. |
| **job\_definition\_arn** string | | The ARN for the job definition. |
| **job\_definition\_name** string / required | | The name for the job definition. |
| **job\_role\_arn** string | | The Amazon Resource Name (ARN) of the IAM role that the container can assume for AWS permissions. |
| **memory** integer / required | | The hard limit (in MiB) of memory to present to the container. If your container attempts to exceed the memory specified here, the container is killed. This parameter maps to Memory in the Create a container section of the Docker Remote API and the --memory option to docker run. |
| **mount\_points** list / elements=dictionary | | The mount points for data volumes in your container. This parameter maps to Volumes in the Create a container section of the Docker Remote API and the --volume option to docker run. |
| | **containerPath** string | | The path on the container at which to mount the host volume. |
| | **readOnly** string | | If this value is true , the container has read-only access to the volume; otherwise, the container can write to the volume. The default value is `false`. |
| | **sourceVolume** string | | The name of the volume to mount. |
| **parameters** dictionary | | Default parameter substitution placeholders to set in the job definition. Parameters are specified as a key-value pair mapping. Parameters in a SubmitJob request override any corresponding parameter defaults from the job definition. |
| **privileged** string | | When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user). This parameter maps to Privileged in the Create a container section of the Docker Remote API and the --privileged option to docker run. |
| **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 |
| **readonly\_root\_filesystem** string | | When this parameter is true, the container is given read-only access to its root file system. This parameter maps to ReadonlyRootfs in the Create a container section of the Docker Remote API and the --read-only option to docker run. |
| **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
| Describes the desired state. |
| **type** string / required | | The type of job definition. |
| **ulimits** list / elements=dictionary | | A list of ulimits to set in the container. This parameter maps to Ulimits in the Create a container section of the Docker Remote API and the --ulimit option to docker run. |
| | **hardLimit** string | | The hard limit for the ulimit type. |
| | **name** string | | The type of the ulimit. |
| | **softLimit** string | | The soft limit for the ulimit type. |
| **user** string | | The user name to use inside the container. This parameter maps to User in the Create a container section of the Docker Remote API and the --user option to docker run. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **vcpus** integer / required | | The number of vCPUs reserved for the container. This parameter maps to CpuShares in the Create a container section of the Docker Remote API and the --cpu-shares option to docker run. Each vCPU is equivalent to 1,024 CPU shares. |
| **volumes** list / elements=dictionary | | A list of data volumes used in a job. |
| | **host** string | | The contents of the host parameter determine whether your data volume persists on the host container instance and where it is stored. If the host parameter is empty, then the Docker daemon assigns a host path for your data volume, but the data is not guaranteed to persist after the containers associated with it stop running. This is a dictionary with one property, sourcePath - The path on the host container instance that is presented to the container. If this parameter is empty,then the Docker daemon has assigned a host path for you. If the host parameter contains a sourcePath file location, then the data volume persists at the specified location on the host container instance until you delete it manually. If the sourcePath value does not exist on the host container instance, the Docker daemon creates it. If the location does exist, the contents of the source path folder are exported. |
| | **name** string | | The name of the volume. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. This name is referenced in the sourceVolume parameter of container definition mountPoints. |
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
--------
```
---
- hosts: localhost
gather_facts: no
vars:
state: present
tasks:
- name: My Batch Job Definition
community.aws.aws_batch_job_definition:
job_definition_name: My Batch Job Definition
state: present
type: container
parameters:
Param1: Val1
Param2: Val2
image: <Docker Image URL>
vcpus: 1
memory: 512
command:
- python
- run_my_script.py
- arg1
job_role_arn: <Job Role ARN>
attempts: 3
register: job_definition_create_result
- name: show results
ansible.builtin.debug: var=job_definition_create_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 |
| --- | --- | --- |
| **output** dictionary | always | returns what action was taken, whether something was changed, invocation and response **Sample:** {'aws\_batch\_job\_definition\_action': 'none', 'changed': False, 'response': {'job\_definition\_arn': 'arn:aws:batch:....', 'job\_definition\_name': '<name>', 'status': 'INACTIVE', 'type': 'container'}} |
### Authors
* Jon Meran (@jonmer85)
| programming_docs |
ansible community.aws.ec2_vpc_endpoint_info – Retrieves AWS VPC endpoints details using AWS methods. community.aws.ec2\_vpc\_endpoint\_info – Retrieves AWS VPC endpoints details using AWS methods.
===============================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_vpc_endpoint_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gets various details related to AWS VPC endpoints.
* This module was called `ec2_vpc_endpoint_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_DescribeVpcEndpoints.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 |
| **query** string | **Choices:*** services
* endpoints
| Defaults to `endpoints`. Specifies the query action to take.
*query=endpoints* returns information about AWS VPC endpoints. Retrieving information about services using *query=services* has been deprecated in favour of the M(ec2\_vpc\_endpoint\_service\_info) module. The *query* option has been deprecated and will be removed after 2022-12-01. |
| **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\_endpoint\_ids** list / elements=string | | The IDs of specific endpoints to retrieve the details of. |
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 example of listing all support AWS services for VPC endpoints
- name: List supported AWS endpoint services
community.aws.ec2_vpc_endpoint_info:
query: services
region: ap-southeast-2
register: supported_endpoint_services
- name: Get all endpoints in ap-southeast-2 region
community.aws.ec2_vpc_endpoint_info:
query: endpoints
region: ap-southeast-2
register: existing_endpoints
- name: Get all endpoints with specific filters
community.aws.ec2_vpc_endpoint_info:
query: endpoints
region: ap-southeast-2
filters:
vpc-id:
- vpc-12345678
- vpc-87654321
vpc-endpoint-state:
- available
- pending
register: existing_endpoints
- name: Get details on specific endpoint
community.aws.ec2_vpc_endpoint_info:
query: endpoints
region: ap-southeast-2
vpc_endpoint_ids:
- vpce-12345678
register: endpoint_details
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **service\_names** list / elements=string | *query* is `services` | AWS VPC endpoint service names **Sample:** {'service\_names': ['com.amazonaws.ap-southeast-2.s3']} |
| **vpc\_endpoints** list / elements=string | *query* is `endpoints` | A list of endpoints that match the query. Each endpoint has the keys creation\_timestamp, policy\_document, route\_table\_ids, service\_name, state, vpc\_endpoint\_id, vpc\_id. **Sample:** {'vpc\_endpoints': [{'creation\_timestamp': '2017-02-16T11:06:48+00:00', 'policy\_document': '"{\\"Version\\":\\"2012-10-17\\",\\"Id\\":\\"Policy1450910922815\\", \\"Statement\\":[{\\"Sid\\":\\"Stmt1450910920641\\",\\"Effect\\":\\"Allow\\", \\"Principal\\":\\"\*\\",\\"Action\\":\\"s3:\*\\",\\"Resource\\":[\\"arn:aws:s3:::\*/\*\\",\\"arn:aws:s3:::\*\\"]}]}"\n', 'route\_table\_ids': ['rtb-abcd1234'], 'service\_name': 'com.amazonaws.ap-southeast-2.s3', 'state': 'available', 'vpc\_endpoint\_id': 'vpce-abbad0d0', 'vpc\_id': 'vpc-1111ffff'}]} |
### Authors
* Karen Cheng (@Etherdaemon)
ansible community.aws.ec2_vpc_vgw_info – Gather information about virtual gateways in AWS community.aws.ec2\_vpc\_vgw\_info – Gather information about virtual gateways in AWS
====================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_vpc_vgw_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about virtual gateways in AWS.
* This module was called `ec2_vpc_vgw_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_DescribeVpnGateways.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. |
| **vpn\_gateway\_ids** list / elements=string | | Get details of a specific Virtual Gateway ID. This value should be provided as a list. |
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 virtual gateways for an account or profile
community.aws.ec2_vpc_vgw_info:
region: ap-southeast-2
profile: production
register: vgw_info
- name: Gather information about a filtered list of Virtual Gateways
community.aws.ec2_vpc_vgw_info:
region: ap-southeast-2
profile: production
filters:
"tag:Name": "main-virt-gateway"
register: vgw_info
- name: Gather information about a specific virtual gateway by VpnGatewayIds
community.aws.ec2_vpc_vgw_info:
region: ap-southeast-2
profile: production
vpn_gateway_ids: vgw-c432f6a7
register: vgw_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 virtual gateways succeeds. **Sample:** false |
| **virtual\_gateways** list / elements=string | always | The virtual gateways for the account. **Sample:** [{'state': 'available', 'tags': [{'key': 'Name', 'value': 'TEST-VGW'}], 'type': 'ipsec.1', 'vpc\_attachments': [{'state': 'attached', 'vpc\_id': 'vpc-22a93c74'}], 'vpn\_gateway\_id': 'vgw-23e3d64e'}] |
### Authors
* Nick Aslanidis (@naslanidis)
ansible community.aws.ec2_customer_gateway_info – Gather information about customer gateways in AWS community.aws.ec2\_customer\_gateway\_info – Gather information about customer gateways in AWS
==============================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_customer_gateway_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about customer gateways in AWS.
* This module was called `ec2_customer_gateway_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 |
| **customer\_gateway\_ids** list / elements=string | | Get details of a specific customer gateways using customer gateway ID/IDs. This value should be provided as a list. |
| **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_DescribeCustomerGateways.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 customer gateways
community.aws.ec2_customer_gateway_info:
- name: Gather information about a filtered list of customer gateways, based on tags
community.aws.ec2_customer_gateway_info:
region: ap-southeast-2
filters:
"tag:Name": test-customer-gateway
"tag:AltName": test-customer-gateway-alt
register: cust_gw_info
- name: Gather information about a specific customer gateway by specifying customer gateway ID
community.aws.ec2_customer_gateway_info:
region: ap-southeast-2
customer_gateway_ids:
- 'cgw-48841a09'
- 'cgw-fec021ce'
register: cust_gw_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 |
| --- | --- | --- |
| **customer\_gateways** list / elements=string | always | List of one or more customer gateways. **Sample:** [{'bgp\_asn': '65000', 'customer\_gateway\_id': 'cgw-fec844ce', 'customer\_gateway\_name': 'test-customer-gw', 'ip\_address': '110.112.113.120', 'state': 'available', 'tags': [{'key': 'Name', 'value': 'test-customer-gw'}], 'type': 'ipsec.1'}] |
### Authors
* Madhura Naniwadekar (@Madhura-CSI)
| programming_docs |
ansible community.aws.aws_ssm – execute via AWS Systems Manager community.aws.aws\_ssm – execute via AWS Systems Manager
========================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_ssm`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* This connection plugin allows ansible to execute tasks on an EC2 instance via the aws ssm CLI.
Requirements
------------
The below requirements are needed on the local controller node that executes this connection.
* The remote EC2 instance must be running the AWS Systems Manager Agent (SSM Agent).
* The control machine must have the aws session manager plugin installed.
* The remote EC2 linux instance must have the curl installed.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **access\_key\_id** string added in 1.3.0 of community.aws | | var: ansible\_aws\_ssm\_access\_key\_id | The STS access key to use when connecting via session-manager. |
| **bucket\_name** string | | var: ansible\_aws\_ssm\_bucket\_name | The name of the S3 bucket used for file transfers. |
| **instance\_id** string | | var: ansible\_aws\_ssm\_instance\_id | The EC2 instance ID. |
| **plugin** string | **Default:**"/usr/local/bin/session-manager-plugin" | var: ansible\_aws\_ssm\_plugin | This defines the location of the session-manager-plugin binary. |
| **profile** string added in 1.5.0 of community.aws | | var: ansible\_aws\_ssm\_profile | Sets AWS profile to use. |
| **region** string | **Default:**"us-east-1" | var: ansible\_aws\_ssm\_region | The region the EC2 instance is located. |
| **retries** integer | **Default:**3 | var: ansible\_aws\_ssm\_retries | Number of attempts to connect. |
| **secret\_access\_key** string added in 1.3.0 of community.aws | | var: ansible\_aws\_ssm\_secret\_access\_key | The STS secret key to use when connecting via session-manager. |
| **session\_token** string added in 1.3.0 of community.aws | | var: ansible\_aws\_ssm\_session\_token | The STS session token to use when connecting via session-manager. |
| **ssm\_timeout** integer | **Default:**60 | var: ansible\_aws\_ssm\_timeout | Connection timeout seconds. |
Examples
--------
```
# Stop Spooler Process on Windows Instances
- name: Stop Spooler Service on Windows Instances
vars:
ansible_connection: aws_ssm
ansible_shell_type: powershell
ansible_aws_ssm_bucket_name: nameofthebucket
ansible_aws_ssm_region: us-east-1
tasks:
- name: Stop spooler service
win_service:
name: spooler
state: stopped
# Install a Nginx Package on Linux Instance
- name: Install a Nginx Package
vars:
ansible_connection: aws_ssm
ansible_aws_ssm_bucket_name: nameofthebucket
ansible_aws_ssm_region: us-west-2
tasks:
- name: Install a Nginx Package
yum:
name: nginx
state: present
# Create a directory in Windows Instances
- name: Create a directory in Windows Instance
vars:
ansible_connection: aws_ssm
ansible_shell_type: powershell
ansible_aws_ssm_bucket_name: nameofthebucket
ansible_aws_ssm_region: us-east-1
tasks:
- name: Create a Directory
win_file:
path: C:\Windows\temp
state: directory
# Making use of Dynamic Inventory Plugin
# =======================================
# aws_ec2.yml (Dynamic Inventory - Linux)
# This will return the Instance IDs matching the filter
#plugin: aws_ec2
#regions:
# - us-east-1
#hostnames:
# - instance-id
#filters:
# tag:SSMTag: ssmlinux
# -----------------------
- name: install aws-cli
hosts: all
gather_facts: false
vars:
ansible_connection: aws_ssm
ansible_aws_ssm_bucket_name: nameofthebucket
ansible_aws_ssm_region: us-east-1
tasks:
- name: aws-cli
raw: yum install -y awscli
tags: aws-cli
# Execution: ansible-playbook linux.yaml -i aws_ec2.yml
# The playbook tasks will get executed on the instance ids returned from the dynamic inventory plugin using ssm connection.
# =====================================================
# aws_ec2.yml (Dynamic Inventory - Windows)
#plugin: aws_ec2
#regions:
# - us-east-1
#hostnames:
# - instance-id
#filters:
# tag:SSMTag: ssmwindows
# -----------------------
- name: Create a dir.
hosts: all
gather_facts: false
vars:
ansible_connection: aws_ssm
ansible_shell_type: powershell
ansible_aws_ssm_bucket_name: nameofthebucket
ansible_aws_ssm_region: us-east-1
tasks:
- name: Create the directory
win_file:
path: C:\Temp\SSM_Testing5
state: directory
# Execution: ansible-playbook win_file.yaml -i aws_ec2.yml
# The playbook tasks will get executed on the instance ids returned from the dynamic inventory plugin using ssm connection.
```
### Authors
* Pat Sharkey (@psharkey) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#79090a11180b121c005f5a4a4e425f5a4c4b425f5a4d41421a151c165f5a4d4f421a1614)>
* HanumanthaRao MVL (@hanumantharaomvl) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#0b636a657e666a657f632d28383c302d283e39302d283f33306d677e733c2d283f3d30686466)>
* Gaurav Ashtikar (@gau1991 )<[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#b4d3d5c1c6d5c2929780828fd5c7dcc0dddfd5c6929787838f929781868f9297808c8fd2d8c1cc83929780828fd7dbd9)>
ansible community.aws.ec2_lc_find – Find AWS Autoscaling Launch Configurations community.aws.ec2\_lc\_find – Find AWS Autoscaling Launch Configurations
========================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_lc_find`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Returns list of matching Launch Configurations for a given name, along with other useful information.
* Results can be sorted and sliced.
* It depends on boto.
* Based on the work by Tom Bamford <https://github.com/tombamford>
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 |
| **limit** integer | | How many results to show. Corresponds to Python slice notation like list[:limit]. |
| **name\_regex** string / required | | A Launch Configuration to match. It'll be compiled as regex. |
| **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 |
| **sort\_order** string | **Choices:*** **ascending** ←
* descending
| Order in which to sort results. |
| **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: Search for the Launch Configurations that start with "app"
community.aws.ec2_lc_find:
name_regex: app.*
sort_order: descending
limit: 2
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **arn** string | when Launch Configuration was found | Name of the AMI **Sample:** arn:aws:autoscaling:eu-west-1:12345:launchConfiguration:d82f050e-e315:launchConfigurationName/yourproject |
| **associate\_public\_address** boolean | when Launch Configuration was found | Assign public address or not **Sample:** True |
| **block\_device\_mappings** list / elements=string | when Launch Configuration was found | Launch Configuration block device mappings property |
| **classic\_link\_vpc\_security\_groups** list / elements=string | when Launch Configuration was found | Launch Configuration classic link vpc security groups property |
| **created\_time** string | when Launch Configuration was found | When it was created **Sample:** 2016-06-29T14:59:22.222000+00:00 |
| **ebs\_optimized** boolean | when Launch Configuration was found | Launch Configuration EBS optimized property |
| **image\_id** string | when Launch Configuration was found | AMI id **Sample:** ami-0d75df7e |
| **instance\_monitoring** string | when Launch Configuration was found | Launch Configuration instance monitoring property **Sample:** {'Enabled': False} |
| **instance\_type** string | when Launch Configuration was found | Type of ec2 instance **Sample:** t2.small |
| **kernel\_id** string | when Launch Configuration was found | Launch Configuration kernel to use |
| **keyname** string | when Launch Configuration was found | Launch Configuration ssh key **Sample:** mykey |
| **name** string | when Launch Configuration was found | Name of the Launch Configuration **Sample:** myapp-v123 |
| **ram\_disk\_id** string | when Launch Configuration was found | Launch Configuration ram disk property |
| **security\_groups** list / elements=string | when Launch Configuration was found | Launch Configuration security groups |
| **user\_data** string | when Launch Configuration was found | User data used to start instance **Sample:** ZXhwb3J0IENMT1VE |
### Authors
* Jose Armesto (@fiunchinho)
ansible community.aws.lambda_alias – Creates, updates or deletes AWS Lambda function aliases community.aws.lambda\_alias – Creates, updates or deletes AWS Lambda function aliases
=====================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.lambda_alias`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module allows the management of AWS Lambda functions aliases via the Ansible framework. It is idempotent and supports “Check” mode. Use module [community.aws.lambda](lambda_module#ansible-collections-community-aws-lambda-module) to manage the lambda function itself and [community.aws.lambda\_event](lambda_event_module#ansible-collections-community-aws-lambda-event-module) to manage event source mappings.
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 | | A short, user-defined function alias description. |
| **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 |
| **function\_name** string / required | | The name of the function alias. |
| **function\_version** integer | | Version associated with the Lambda function alias. A value of 0 (or omitted parameter) sets the alias to the $LATEST version.
aliases: version |
| **name** string / required | | Name of the function alias.
aliases: alias\_name |
| **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
| Describes the desired state. |
| **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
--------
```
---
# Simple example to create a lambda function and publish a version
- hosts: localhost
gather_facts: no
vars:
state: present
project_folder: /path/to/deployment/package
deployment_package: lambda.zip
account: 123456789012
production_version: 5
tasks:
- name: AWS Lambda Function
lambda:
state: "{{ state | default('present') }}"
name: myLambdaFunction
publish: True
description: lambda function description
code_s3_bucket: package-bucket
code_s3_key: "lambda/{{ deployment_package }}"
local_path: "{{ project_folder }}/{{ deployment_package }}"
runtime: python2.7
timeout: 5
handler: lambda.handler
memory_size: 128
role: "arn:aws:iam::{{ account }}:role/API2LambdaExecRole"
- name: Get information
lambda_info:
name: myLambdaFunction
register: lambda_info
- name: show results
ansible.builtin.debug:
msg: "{{ lambda_info['lambda_facts'] }}"
# The following will set the Dev alias to the latest version ($LATEST) since version is omitted (or = 0)
- name: "alias 'Dev' for function {{ lambda_info.lambda_facts.FunctionName }} "
community.aws.lambda_alias:
state: "{{ state | default('present') }}"
function_name: "{{ lambda_info.lambda_facts.FunctionName }}"
name: Dev
description: Development is $LATEST version
# The QA alias will only be created when a new version is published (i.e. not = '$LATEST')
- name: "alias 'QA' for function {{ lambda_info.lambda_facts.FunctionName }} "
community.aws.lambda_alias:
state: "{{ state | default('present') }}"
function_name: "{{ lambda_info.lambda_facts.FunctionName }}"
name: QA
version: "{{ lambda_info.lambda_facts.Version }}"
description: "QA is version {{ lambda_info.lambda_facts.Version }}"
when: lambda_info.lambda_facts.Version != "$LATEST"
# The Prod alias will have a fixed version based on a variable
- name: "alias 'Prod' for function {{ lambda_info.lambda_facts.FunctionName }} "
community.aws.lambda_alias:
state: "{{ state | default('present') }}"
function_name: "{{ lambda_info.lambda_facts.FunctionName }}"
name: Prod
version: "{{ production_version }}"
description: "Production is version {{ production_version }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **alias\_arn** string | success | Full ARN of the function, including the alias **Sample:** arn:aws:lambda:us-west-2:123456789012:function:myFunction:dev |
| **description** string | success | A short description of the alias **Sample:** The development stage for my hot new app |
| **function\_version** string | success | The qualifier that the alias refers to **Sample:** $LATEST |
| **name** string | success | The name of the alias assigned **Sample:** dev |
| **revision\_id** string | success | A unique identifier that changes when you update the alias. **Sample:** 12345678-1234-1234-1234-123456789abc |
### Authors
* Pierre Jodouin (@pjodouin), Ryan Scott Brown (@ryansb)
| programming_docs |
ansible community.aws.ec2_snapshot_copy – Copies an EC2 snapshot and returns the new Snapshot ID. community.aws.ec2\_snapshot\_copy – Copies an EC2 snapshot and returns the new Snapshot ID.
===========================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_snapshot_copy`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Copies an EC2 Snapshot from a source region to a destination region.
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 | | An optional human-readable string describing purpose of the new Snapshot. |
| **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
| Whether or not the destination Snapshot should be encrypted. |
| **kms\_key\_id** string | | KMS key id used to encrypt snapshot. If not specified, AWS defaults to `alias/aws/ebs`. |
| **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 |
| **source\_region** string / required | | The source region the Snapshot should be copied from. |
| **source\_snapshot\_id** string / required | | The ID of the Snapshot in source region that should be copied. |
| **tags** dictionary | | A hash/dictionary of tags to add to the new Snapshot; '{"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. |
| **wait** boolean | **Choices:*** **no** ←
* yes
| Wait for the copied Snapshot to be in 'Available' state before returning. |
| **wait\_timeout** integer | **Default:**600 | 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
--------
```
- name: Basic Snapshot Copy
community.aws.ec2_snapshot_copy:
source_region: eu-central-1
region: eu-west-1
source_snapshot_id: snap-xxxxxxx
- name: Copy Snapshot and wait until available
community.aws.ec2_snapshot_copy:
source_region: eu-central-1
region: eu-west-1
source_snapshot_id: snap-xxxxxxx
wait: yes
wait_timeout: 1200 # Default timeout is 600
register: snapshot_id
- name: Tagged Snapshot copy
community.aws.ec2_snapshot_copy:
source_region: eu-central-1
region: eu-west-1
source_snapshot_id: snap-xxxxxxx
tags:
Name: Snapshot-Name
- name: Encrypted Snapshot copy
community.aws.ec2_snapshot_copy:
source_region: eu-central-1
region: eu-west-1
source_snapshot_id: snap-xxxxxxx
encrypted: yes
- name: Encrypted Snapshot copy with specified key
community.aws.ec2_snapshot_copy:
source_region: eu-central-1
region: eu-west-1
source_snapshot_id: snap-xxxxxxx
encrypted: yes
kms_key_id: arn:aws:kms:eu-central-1:XXXXXXXXXXXX:key/746de6ea-50a4-4bcb-8fbc-e3b29f2d367b
```
Return Values
-------------
Common return 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 | when snapshot copy is successful | snapshot id of the newly created snapshot **Sample:** snap-e9095e8c |
### Authors
* Deepak Kothandan (@Deepakkothandan) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#d3b7b6b6a3b2b8f5f0e7e5e8b8b7aaf5f0e0e4e8f5f0e6e1e8f5f0e7ebe8b4beb2babff5f0e7e5e8b0bcbe)>
ansible community.aws.ec2_instance_info – Gather information about ec2 instances in AWS community.aws.ec2\_instance\_info – Gather information about ec2 instances in AWS
=================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_instance_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about ec2 instances in AWS
* This module was called `ec2_instance_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 | **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_DescribeInstances.html> for possible filters. Filter names and values are case sensitive. |
| **instance\_ids** list / elements=string | | If you specify one or more instance IDs, only instances that have the specified IDs are returned. |
| **minimum\_uptime** integer | | Minimum running uptime in minutes of instances. For example if *uptime* is `60` return all instances that have run more than 60 minutes.
aliases: uptime |
| **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 instances
community.aws.ec2_instance_info:
- name: Gather information about all instances in AZ ap-southeast-2a
community.aws.ec2_instance_info:
filters:
availability-zone: ap-southeast-2a
- name: Gather information about a particular instance using ID
community.aws.ec2_instance_info:
instance_ids:
- i-12345678
- name: Gather information about any instance with a tag key Name and value Example
community.aws.ec2_instance_info:
filters:
"tag:Name": Example
- name: Gather information about any instance in states "shutting-down", "stopping", "stopped"
community.aws.ec2_instance_info:
filters:
instance-state-name: [ "shutting-down", "stopping", "stopped" ]
- name: Gather information about any instance with Name beginning with RHEL and an uptime of at least 60 minutes
community.aws.ec2_instance_info:
region: "{{ ec2_region }}"
uptime: 60
filters:
"tag:Name": "RHEL-*"
instance-state-name: [ "running"]
register: ec2_node_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 |
| --- | --- | --- |
| **instances** complex | always | a list of ec2 instances |
| | **ami\_launch\_index** integer | always | The AMI launch index, which can be used to find this instance in the launch group. |
| | **architecture** string | always | The architecture of the image **Sample:** x86\_64 |
| | **block\_device\_mappings** complex | always | Any block device mapping entries for the instance. |
| | | **device\_name** string | always | The device name exposed to the instance (for example, /dev/sdh or xvdh). **Sample:** /dev/sdh |
| | | **ebs** complex | always | Parameters used to automatically set up EBS volumes when the instance is launched. |
| | | | **attach\_time** string | always | The time stamp when the attachment initiated. **Sample:** 2017-03-23T22:51:24+00:00 |
| | | | **delete\_on\_termination** boolean | always | Indicates whether the volume is deleted on instance termination. **Sample:** True |
| | | | **status** string | always | The attachment state. **Sample:** attached |
| | | | **volume\_id** string | always | The ID of the EBS volume **Sample:** vol-12345678 |
| | **client\_token** string | always | The idempotency token you provided when you launched the instance, if applicable. **Sample:** mytoken |
| | **cpu\_options** complex | always if botocore version >= 1.10.16 | The CPU options set for the instance. |
| | | **core\_count** integer | always | The number of CPU cores for the instance. **Sample:** 1 |
| | | **threads\_per\_core** integer | always | The number of threads per CPU core. On supported instance, a value of 1 means Intel Hyper-Threading Technology is disabled. **Sample:** 1 |
| | **ebs\_optimized** boolean | always | Indicates whether the instance is optimized for EBS I/O. |
| | **hypervisor** string | always | The hypervisor type of the instance. **Sample:** xen |
| | **iam\_instance\_profile** complex | always | The IAM instance profile associated with the instance, if applicable. |
| | | **arn** string | always | The Amazon Resource Name (ARN) of the instance profile. **Sample:** arn:aws:iam::000012345678:instance-profile/myprofile |
| | | **id** string | always | The ID of the instance profile **Sample:** JFJ397FDG400FG9FD1N |
| | **image\_id** string | always | The ID of the AMI used to launch the instance. **Sample:** ami-0011223344 |
| | **instance\_id** string | always | The ID of the instance. **Sample:** i-012345678 |
| | **instance\_type** string | always | The instance type size of the running instance. **Sample:** t2.micro |
| | **key\_name** string | always | The name of the key pair, if this instance was launched with an associated key pair. **Sample:** my-key |
| | **launch\_time** string | always | The time the instance was launched. **Sample:** 2017-03-23T22:51:24+00:00 |
| | **monitoring** complex | always | The monitoring for the instance. |
| | | **state** string | always | Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled. **Sample:** disabled |
| | **network\_interfaces** complex | always | One or more network interfaces for the instance. |
| | | **association** complex | always | The association information for an Elastic IPv4 associated with the network interface. |
| | | | **ip\_owner\_id** string | always | The ID of the owner of the Elastic IP address. **Sample:** amazon |
| | | | **public\_dns\_name** string | always | The public DNS name. |
| | | | **public\_ip** string | always | The public IP address or Elastic IP address bound to the network interface. **Sample:** 1.2.3.4 |
| | | **attachment** complex | always | The network interface attachment. |
| | | | **attach\_time** string | always | The time stamp when the attachment initiated. **Sample:** 2017-03-23T22:51:24+00:00 |
| | | | **attachment\_id** string | always | The ID of the network interface attachment. **Sample:** eni-attach-3aff3f |
| | | | **delete\_on\_termination** boolean | always | Indicates whether the network interface is deleted when the instance is terminated. **Sample:** True |
| | | | **device\_index** integer | always | The index of the device on the instance for the network interface attachment. |
| | | | **status** string | always | The attachment state. **Sample:** attached |
| | | **description** string | always | The description. **Sample:** My interface |
| | | **groups** list / elements=dictionary | always | One or more security groups. |
| | | | **group\_id** string | always | The ID of the security group. **Sample:** sg-abcdef12 |
| | | | **group\_name** string | always | The name of the security group. **Sample:** mygroup |
| | | **ipv6\_addresses** list / elements=dictionary | always | One or more IPv6 addresses associated with the network interface. |
| | | | **ipv6\_address** string | always | The IPv6 address. **Sample:** 2001:0db8:85a3:0000:0000:8a2e:0370:7334 |
| | | **mac\_address** string | always | The MAC address. **Sample:** 00:11:22:33:44:55 |
| | | **network\_interface\_id** string | always | The ID of the network interface. **Sample:** eni-01234567 |
| | | **owner\_id** string | always | The AWS account ID of the owner of the network interface. **Sample:** 01234567890 |
| | | **private\_ip\_address** string | always | The IPv4 address of the network interface within the subnet. **Sample:** 10.0.0.1 |
| | | **private\_ip\_addresses** list / elements=dictionary | always | The private IPv4 addresses associated with the network interface. |
| | | | **association** complex | always | The association information for an Elastic IP address (IPv4) associated with the network interface. |
| | | | | **ip\_owner\_id** string | always | The ID of the owner of the Elastic IP address. **Sample:** amazon |
| | | | | **public\_dns\_name** string | always | The public DNS name. |
| | | | | **public\_ip** string | always | The public IP address or Elastic IP address bound to the network interface. **Sample:** 1.2.3.4 |
| | | | **primary** boolean | always | Indicates whether this IPv4 address is the primary private IP address of the network interface. **Sample:** True |
| | | | **private\_ip\_address** string | always | The private IPv4 address of the network interface. **Sample:** 10.0.0.1 |
| | | **source\_dest\_check** boolean | always | Indicates whether source/destination checking is enabled. **Sample:** True |
| | | **status** string | always | The status of the network interface. **Sample:** in-use |
| | | **subnet\_id** string | always | The ID of the subnet for the network interface. **Sample:** subnet-0123456 |
| | | **vpc\_id** string | always | The ID of the VPC for the network interface. **Sample:** vpc-0123456 |
| | **placement** complex | always | The location where the instance launched, if applicable. |
| | | **availability\_zone** string | always | The Availability Zone of the instance. **Sample:** ap-southeast-2a |
| | | **group\_name** string | always | The name of the placement group the instance is in (for cluster compute instances). |
| | | **tenancy** string | always | The tenancy of the instance (if the instance is running in a VPC). **Sample:** default |
| | **private\_dns\_name** string | always | The private DNS name. **Sample:** ip-10-0-0-1.ap-southeast-2.compute.internal |
| | **private\_ip\_address** string | always | The IPv4 address of the network interface within the subnet. **Sample:** 10.0.0.1 |
| | **product\_codes** list / elements=dictionary | always | One or more product codes. |
| | | **product\_code\_id** string | always | The product code. **Sample:** aw0evgkw8ef3n2498gndfgasdfsd5cce |
| | | **product\_code\_type** string | always | The type of product code. **Sample:** marketplace |
| | **public\_dns\_name** string | always | The public DNS name assigned to the instance. |
| | **public\_ip\_address** string | always | The public IPv4 address assigned to the instance **Sample:** 52.0.0.1 |
| | **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 |
| | **security\_groups** list / elements=dictionary | always | One or more security groups for the instance. |
| | | **group\_id** string | always | The ID of the security group. **Sample:** sg-0123456 |
| | | **group\_name** string | always | The name of the security group. **Sample:** my-security-group |
| | **source\_dest\_check** boolean | always | Indicates whether source/destination checking is enabled. **Sample:** True |
| | **state** complex | always | The current state of the instance. |
| | | **code** integer | always | The low byte represents the state. **Sample:** 16 |
| | | **name** string | always | The name of the state. **Sample:** running |
| | **state\_transition\_reason** string | always | The reason for the most recent state transition. |
| | **subnet\_id** string | always | The ID of the subnet in which the instance is running. **Sample:** subnet-00abcdef |
| | **tags** dictionary | always | Any tags assigned to the instance. |
| | **virtualization\_type** string | always | The type of virtualization of the AMI. **Sample:** hvm |
| | **vpc\_id** dictionary | always | The ID of the VPC the instance is in. **Sample:** vpc-0011223344 |
### Authors
* Michael Schuett (@michaeljs1990)
* Rob White (@wimnat)
| programming_docs |
ansible community.aws.aws_inspector_target – Create, Update and Delete Amazon Inspector Assessment Targets community.aws.aws\_inspector\_target – Create, Update and Delete Amazon Inspector Assessment Targets
====================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_inspector_target`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates, updates, or deletes Amazon Inspector Assessment Targets and manages the required Resource Groups.
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 |
| **name** string / required | | The user-defined name that identifies the assessment target. The name must be unique within the AWS account. |
| **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** ←
| The state of the assessment target. |
| **tags** dictionary | | Tags of the EC2 instances to be added to the assessment target. Required if `state=present`. |
| **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: Create my_target Assessment Target
community.aws.aws_inspector_target:
name: my_target
tags:
role: scan_target
- name: Update Existing my_target Assessment Target with Additional Tags
community.aws.aws_inspector_target:
name: my_target
tags:
env: dev
role: scan_target
- name: Delete my_target Assessment Target
community.aws.aws_inspector_target:
name: my_target
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 |
| --- | --- | --- |
| **arn** string | success | The ARN that specifies the Amazon Inspector assessment target. **Sample:** arn:aws:inspector:eu-west-1:123456789012:target/0-O4LnL7n1 |
| **created\_at** string | success | The time at which the assessment target was created. **Sample:** 2018-01-29T13:48:51.958000+00:00 |
| **name** string | success | The name of the Amazon Inspector assessment target. **Sample:** my\_target |
| **resource\_group\_arn** string | success | The ARN that specifies the resource group that is associated with the assessment target. **Sample:** arn:aws:inspector:eu-west-1:123456789012:resourcegroup/0-qY4gDel8 |
| **tags** list / elements=string | success | The tags of the resource group that is associated with the assessment target. **Sample:** {'env': 'dev', 'role': 'scan\_target'} |
| **updated\_at** string | success | The time at which the assessment target was last updated. **Sample:** 2018-01-29T13:48:51.958000+00:00 |
### Authors
* Dennis Conrad (@dennisconrad)
ansible community.aws.elasticache_subnet_group – manage ElastiCache subnet groups community.aws.elasticache\_subnet\_group – manage ElastiCache subnet groups
===========================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.elasticache_subnet_group`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Creates, modifies, and deletes ElastiCache subnet groups. This module has a dependency on python-boto >= 2.5.
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 | | ElastiCache subnet group description. Only set when a new group is added. |
| **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 |
| **name** string / required | | Database subnet group identifier. |
| **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 / required | **Choices:*** present
* absent
| Specifies whether the subnet should be present or absent. |
| **subnets** list / elements=string | | List of subnet IDs that make up the ElastiCache subnet group. |
| **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: Add or change a subnet group
community.aws.elasticache_subnet_group:
state: present
name: norwegian-blue
description: My Fancy Ex Parrot Subnet Group
subnets:
- subnet-aaaaaaaa
- subnet-bbbbbbbb
- name: Remove a subnet group
community.aws.elasticache_subnet_group:
state: absent
name: norwegian-blue
```
### Authors
* Tim Mahoney (@timmahoney)
ansible community.aws.dynamodb_ttl – Set TTL for a given DynamoDB table community.aws.dynamodb\_ttl – Set TTL for a given DynamoDB table
================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.dynamodb_ttl`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Uses boto3 to set TTL.
* Requires botocore version 1.5.24 or higher.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore>=1.5.24
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **attribute\_name** string / required | | The name of the Time To Live attribute used to store the expiration time for items in the table. This appears to be required by the API even when disabling TTL. |
| **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 |
| **state** string | **Choices:*** enable
* disable
| State to set DynamoDB table to. |
| **table\_name** string / required | | Name of the DynamoDB table to work on. |
| **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: enable TTL on my cowfacts table
community.aws.dynamodb_ttl:
state: enable
table_name: cowfacts
attribute_name: cow_deleted_date
- name: disable TTL on my cowfacts table
community.aws.dynamodb_ttl:
state: disable
table_name: cowfacts
attribute_name: cow_deleted_date
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current\_status** dictionary | always | current or new TTL specification. **Sample:** [{'AttributeName': 'deploy\_timestamp', 'TimeToLiveStatus': 'ENABLED'}, {'AttributeName': 'deploy\_timestamp', 'Enabled': True}] |
### Authors
* Ted Timmons (@tedder)
| programming_docs |
ansible community.aws.elb_target_group – Manage a target group for an Application or Network load balancer community.aws.elb\_target\_group – Manage a target group for an Application or Network load balancer
====================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.elb_target_group`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage an AWS Elastic Load Balancer target group. See <https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html> or <https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html> for details.
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. |
| **deregistration\_delay\_timeout** integer | | The amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. |
| **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\_interval** integer | | The approximate amount of time, in seconds, between health checks of an individual target. |
| **health\_check\_path** string | | The ping path that is the destination on the targets for health checks. The path must be defined in order to set a health check. Requires the *health\_check\_protocol* parameter to be set. |
| **health\_check\_port** string | | The port the load balancer uses when performing health checks on targets. Can be set to 'traffic-port' to match target port. When not defined will default to the port on which each target receives traffic from the load balancer. |
| **health\_check\_protocol** string | **Choices:*** http
* https
* tcp
* tls
* udp
* tcp\_udp
* HTTP
* HTTPS
* TCP
* TLS
* UDP
* TCP\_UDP
| The protocol the load balancer uses when performing health checks on targets. |
| **health\_check\_timeout** integer | | The amount of time, in seconds, during which no response from a target means a failed health check. |
| **healthy\_threshold\_count** integer | | The number of consecutive health checks successes required before considering an unhealthy target healthy. |
| **modify\_targets** boolean | **Choices:*** no
* **yes** ←
| Whether or not to alter existing targets in the group to match what is passed with the module |
| **name** string / required | | The name of the target group. |
| **port** integer | | The port on which the targets receive traffic. This port is used unless you specify a port override when registering the target. Required if *state* is `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 |
| **protocol** string | **Choices:*** http
* https
* tcp
* tls
* udp
* tcp\_udp
* HTTP
* HTTPS
* TCP
* TLS
* UDP
* TCP\_UDP
| The protocol to use for routing traffic to the targets. Required when *state* is `present`. |
| **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 tag 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 |
| **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:*** present
* absent
| Create or destroy the target group. |
| **stickiness\_app\_cookie\_duration** integer added in 1.5.0 of community.aws | | The time period, in seconds, during which requests from a client should be routed to the same target. After this time period expires, the application-generated cookie is considered stale. The range is 1 second to 1 week (604800 seconds). |
| **stickiness\_app\_cookie\_name** string added in 1.5.0 of community.aws | | The name of the application cookie. Required if *stickiness\_type=app\_cookie*. |
| **stickiness\_enabled** boolean | **Choices:*** no
* yes
| Indicates whether sticky sessions are enabled. |
| **stickiness\_lb\_cookie\_duration** integer | | The time period, in seconds, during which requests from a client should be routed to the same target. After this time period expires, the load balancer-generated cookie is considered stale. The range is 1 second to 1 week (604800 seconds). |
| **stickiness\_type** string | | The type of sticky sessions. Valid values are `lb_cookie`, `app_cookie` or `source_ip`. If not set AWS will default to `lb_cookie` for Application Load Balancers or `source_ip` for Network Load Balancers. |
| **successful\_response\_codes** string | | The HTTP codes to use when checking for a successful response from a target. Accepts multiple values (for example, "200,202") or a range of values (for example, "200-299"). Requires the *health\_check\_protocol* parameter to be set. |
| **tags** dictionary | | A dictionary of one or more tags to assign to the target group. |
| **target\_type** string | **Choices:*** instance
* ip
* lambda
| The type of target that you must specify when registering targets with this target group. The possible values are `instance` (targets are specified by instance ID), `ip` (targets are specified by IP address) or `lambda` (target is specified by ARN). Note that you can't specify targets for a target group using more than one type. Target type lambda only accept one target. When more than one target is specified, only the first one is used. All additional targets are ignored. If the target type is ip, specify IP addresses from the subnets of the virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP addresses. The default behavior is `instance`. |
| **targets** list / elements=dictionary | | A list of targets to assign to the target group. This parameter defaults to an empty list. Unless you set the 'modify\_targets' parameter then all existing targets will be removed from the group. The list should be an Id and a Port parameter. See the Examples for detail. |
| **unhealthy\_threshold\_count** integer | | The number of consecutive health check failures required before considering a target unhealthy. |
| **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 | | The identifier of the virtual private cloud (VPC). Required when *state* is `present`. |
| **wait** boolean | **Choices:*** **no** ←
* yes
| Whether or not to wait for the target group. |
| **wait\_timeout** integer | **Default:**200 | The time to wait for the target group. |
Notes
-----
Note
* Once a target group has been created, only its health check can then be modified using subsequent calls
* 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 target group with a default health check
community.aws.elb_target_group:
name: mytargetgroup
protocol: http
port: 80
vpc_id: vpc-01234567
state: present
- name: Modify the target group with a custom health check
community.aws.elb_target_group:
name: mytargetgroup
protocol: http
port: 80
vpc_id: vpc-01234567
health_check_protocol: http
health_check_path: /health_check
health_check_port: 80
successful_response_codes: 200
health_check_interval: 15
health_check_timeout: 3
healthy_threshold_count: 4
unhealthy_threshold_count: 3
state: present
- name: Delete a target group
community.aws.elb_target_group:
name: mytargetgroup
state: absent
- name: Create a target group with instance targets
community.aws.elb_target_group:
name: mytargetgroup
protocol: http
port: 81
vpc_id: vpc-01234567
health_check_protocol: http
health_check_path: /
successful_response_codes: "200,250-260"
targets:
- Id: i-01234567
Port: 80
- Id: i-98765432
Port: 80
state: present
wait_timeout: 200
wait: True
- name: Create a target group with IP address targets
community.aws.elb_target_group:
name: mytargetgroup
protocol: http
port: 81
vpc_id: vpc-01234567
health_check_protocol: http
health_check_path: /
successful_response_codes: "200,250-260"
target_type: ip
targets:
- Id: 10.0.0.10
Port: 80
AvailabilityZone: all
- Id: 10.0.0.20
Port: 80
state: present
wait_timeout: 200
wait: True
# Using lambda as targets require that the target group
# itself is allow to invoke the lambda function.
# therefore you need first to create an empty target group
# to receive its arn, second, allow the target group
# to invoke the lambda function and third, add the target
# to the target group
- name: first, create empty target group
community.aws.elb_target_group:
name: my-lambda-targetgroup
target_type: lambda
state: present
modify_targets: False
register: out
- name: second, allow invoke of the lambda
community.aws.lambda_policy:
state: "{{ state | default('present') }}"
function_name: my-lambda-function
statement_id: someID
action: lambda:InvokeFunction
principal: elasticloadbalancing.amazonaws.com
source_arn: "{{ out.target_group_arn }}"
- name: third, add target
community.aws.elb_target_group:
name: my-lambda-targetgroup
target_type: lambda
state: present
targets:
- Id: arn:aws:lambda:eu-central-1:123456789012:function:my-lambda-function
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **deregistration\_delay\_timeout\_seconds** integer | when state present | The amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. **Sample:** 300 |
| **health\_check\_interval\_seconds** integer | when state present | The approximate amount of time, in seconds, between health checks of an individual target. **Sample:** 30 |
| **health\_check\_path** string | when state present | The destination for the health check request. **Sample:** /index.html |
| **health\_check\_port** string | when state present | The port to use to connect with the target. **Sample:** traffic-port |
| **health\_check\_protocol** string | when state present | The protocol to use to connect with the target. **Sample:** HTTP |
| **health\_check\_timeout\_seconds** integer | when state present | The amount of time, in seconds, during which no response means a failed health check. **Sample:** 5 |
| **healthy\_threshold\_count** integer | when state present | The number of consecutive health checks successes required before considering an unhealthy target healthy. **Sample:** 5 |
| **load\_balancer\_arns** list / elements=string | when state present | The Amazon Resource Names (ARN) of the load balancers that route traffic to this target group. |
| **matcher** dictionary | when state present | The HTTP codes to use when checking for a successful response from a target. **Sample:** {'http\_code': '200'} |
| **port** integer | when state present | The port on which the targets are listening. **Sample:** 80 |
| **protocol** string | when state present | The protocol to use for routing traffic to the targets. **Sample:** HTTP |
| **stickiness\_enabled** boolean | when state present | Indicates whether sticky sessions are enabled. **Sample:** True |
| **stickiness\_lb\_cookie\_duration\_seconds** integer | when state present | The time period, in seconds, during which requests from a client should be routed to the same target. **Sample:** 86400 |
| **stickiness\_type** string | when state present | The type of sticky sessions. **Sample:** lb\_cookie |
| **tags** dictionary | when state present | The tags attached to the target group. **Sample:** { 'Tag': 'Example' } |
| **target\_group\_arn** string | when state present | The Amazon Resource Name (ARN) of the target group. **Sample:** arn:aws:elasticloadbalancing:ap-southeast-2:01234567890:targetgroup/mytargetgroup/aabbccddee0044332211 |
| **target\_group\_name** string | when state present | The name of the target group. **Sample:** mytargetgroup |
| **unhealthy\_threshold\_count** integer | when state present | The number of consecutive health check failures required before considering the target unhealthy. **Sample:** 2 |
| **vpc\_id** string | when state present | The ID of the VPC for the targets. **Sample:** vpc-0123456 |
### Authors
* Rob White (@wimnat)
ansible community.aws.ec2_launch_template – Manage EC2 launch templates community.aws.ec2\_launch\_template – Manage EC2 launch templates
=================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_launch_template`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, modify, and delete EC2 Launch Templates, which can be used to create individual instances or with Autoscaling Groups.
* The [community.aws.ec2\_instance](ec2_instance_module#ansible-collections-community-aws-ec2-instance-module) and [community.aws.ec2\_asg](ec2_asg_module#ansible-collections-community-aws-ec2-asg-module) modules can, instead of specifying all parameters on those tasks, be passed a Launch Template which contains settings like instance size, disk type, subnet, and more.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3 >= 1.6.0
* 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 |
| **block\_device\_mappings** list / elements=dictionary | | The block device mapping. Supplying both a snapshot ID and an encryption value as arguments for block-device mapping results in an error. This is because only blank volumes can be encrypted on start, and these are not created from a snapshot. If a snapshot is the basis for the volume, it contains data by definition and its encryption status cannot be changed using this action. |
| | **device\_name** string | | The device name (for example, /dev/sdh or xvdh). |
| | **ebs** dictionary | | Parameters used to automatically set up EBS volumes when the instance is launched. |
| | | **delete\_on\_termination** boolean | **Choices:*** no
* yes
| Indicates whether the EBS volume is deleted on instance termination. |
| | | **encrypted** boolean | **Choices:*** no
* yes
| Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can't specify an encryption value. |
| | | **iops** integer | | The number of I/O operations per second (IOPS) that the volume supports. For io1, this represents the number of IOPS that are provisioned for the volume. For gp2, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information about General Purpose SSD baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide. Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2, st1, sc1, or standard volumes. |
| | | **kms\_key\_id** string | | The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption. |
| | | **snapshot\_id** string | | The ID of the snapshot to create the volume from. |
| | | **volume\_size** integer | | The size of the volume, in GiB. Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size. |
| | | **volume\_type** string | | The volume type |
| | **no\_device** string | | Suppresses the specified device included in the block device mapping of the AMI. |
| | **virtual\_name** string | | The virtual device name (ephemeralN). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1. The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume. |
| **cpu\_options** dictionary | | Choose CPU settings for the EC2 instances that will be created with this template. For more information, see <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html>
|
| | **core\_count** integer | | The number of CPU cores for the instance. |
| | **threads\_per\_core** integer | | The number of threads per CPU core. To disable Intel Hyper-Threading Technology for the instance, specify a value of 1. Otherwise, specify the default value of 2. |
| **credit\_specification** dictionary | | The credit option for CPU usage of the instance. Valid for T2 or T3 instances only. |
| | **cpu\_credits** string | | The credit option for CPU usage of a T2 or T3 instance. Valid values are `standard` and `unlimited`. |
| **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. |
| **default\_version** string | **Default:**"latest" | Which version should be the default when users spin up new instances based on this template? By default, the latest version will be made the default. |
| **disable\_api\_termination** boolean | **Choices:*** no
* yes
| This helps protect instances from accidental termination. If set to true, you can't terminate the instance using the Amazon EC2 console, CLI, or API. To change this attribute to false after launch, use *ModifyInstanceAttribute*. |
| **ebs\_optimized** boolean | **Choices:*** no
* yes
| Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized 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 |
| **elastic\_gpu\_specifications** list / elements=dictionary | | Settings for Elastic GPU attachments. See <https://aws.amazon.com/ec2/elastic-gpus/> for details. |
| | **type** string | | The type of Elastic GPU to attach |
| **iam\_instance\_profile** string | | The name or ARN of an IAM instance profile. Requires permissions to describe existing instance roles to confirm ARN is properly formed. |
| **image\_id** string | | The AMI ID to use for new instances launched with this template. This value is region-dependent since AMIs are not global resources. |
| **instance\_initiated\_shutdown\_behavior** string | **Choices:*** stop
* terminate
| Indicates whether an instance stops or terminates when you initiate shutdown from the instance using the operating system shutdown command. |
| **instance\_market\_options** dictionary | | Options for alternative instance markets, currently only the spot market is supported. |
| | **market\_type** string | | The market type. This should always be 'spot'. |
| | **spot\_options** dictionary | | Spot-market specific settings. |
| | | **block\_duration\_minutes** integer | | The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360). |
| | | **instance\_interruption\_behavior** string | **Choices:*** hibernate
* stop
* terminate
| The behavior when a Spot Instance is interrupted. The default is `terminate`. |
| | | **max\_price** string | | The highest hourly price you're willing to pay for this Spot Instance. |
| | | **spot\_instance\_type** string | **Choices:*** one-time
* persistent
| The request type to send. |
| **instance\_type** string | | The instance type, such as `c5.2xlarge`. For a full list of instance types, see <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html>. |
| **kernel\_id** string | | The ID of the kernel. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html>
|
| **key\_name** string | | The name of the key pair. You can create a key pair using [amazon.aws.ec2\_key](../../amazon/aws/ec2_key_module). If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in. |
| **metadata\_options** dictionary added in 1.5.0 of community.aws | | Configure EC2 Metadata options. For more information see the IMDS documentation <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html>. |
| | **http\_endpoint** string | **Choices:*** **enabled** ←
* disabled
| This parameter enables or disables the HTTP metadata endpoint on your instances. |
| | **http\_put\_response\_hop\_limit** integer | **Default:**1 | The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel. |
| | **http\_tokens** string | **Choices:*** **optional** ←
* required
| The state of token usage for your instance metadata requests. |
| **monitoring** dictionary | | Settings for instance monitoring. |
| | **enabled** boolean | **Choices:*** no
* yes
| Whether to turn on detailed monitoring for new instances. This will incur extra charges. |
| **network\_interfaces** list / elements=dictionary | | One or more network interfaces. |
| | **associate\_public\_ip\_address** boolean | **Choices:*** no
* yes
| Associates a public IPv4 address with eth0 for a new network interface. |
| | **delete\_on\_termination** boolean | **Choices:*** no
* yes
| Indicates whether the network interface is deleted when the instance is terminated. |
| | **description** string | | A description for the network interface. |
| | **device\_index** integer | | The device index for the network interface attachment. |
| | **groups** list / elements=string | | List of security group IDs to include on this instance. |
| | **ipv6\_address\_count** integer | | The number of IPv6 addresses to assign to a network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. You can't use this option if specifying the *ipv6\_addresses* option. |
| | **ipv6\_addresses** list / elements=string | | A list of one or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. You can't use this option if you're specifying the *ipv6\_address\_count* option. |
| | **network\_interface\_id** string | | The eni ID of a network interface to attach. |
| | **private\_ip\_address** string | | The primary private IPv4 address of the network interface. |
| | **subnet\_id** string | | The ID of the subnet for the network interface. |
| **placement** dictionary | | The placement group settings for the instance. |
| | **affinity** string | | The affinity setting for an instance on a Dedicated Host. |
| | **availability\_zone** string | | The Availability Zone for the instance. |
| | **group\_name** string | | The name of the placement group for the instance. |
| | **host\_id** string | | The ID of the Dedicated Host for the instance. |
| | **tenancy** string | | The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. |
| **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 |
| **ram\_disk\_id** string | | The ID of the RAM disk to launch the instance with. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html>
|
| **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\_group\_ids** list / elements=string | | A list of security group IDs (VPC or EC2-Classic) that the new instances will be added to. |
| **security\_groups** list / elements=string | | A list of security group names (Default VPC or EC2-Classic) that the new instances will be added to. For any VPC other than Default, you must use *security\_group\_ids*. |
| **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
| Whether the launch template should exist or not. Deleting specific versions of a launch template is not supported at this time. |
| **tags** dictionary | | A set of key-value pairs to be applied to resources when this Launch Template is used. Tag key constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with *aws:*
Tag value constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters. |
| **template\_id** string | | The ID for the launch template, can be used for all cases except creating a new Launch Template.
aliases: id |
| **template\_name** string | | The template name. This must be unique in the region-account combination you are using.
aliases: name |
| **user\_data** string | | The Base64-encoded user data to make available to the instance. For more information, see the Linux <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html> and Windows <http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-metadata.html#instancedata-add-user-data> documentation on user-data. |
| **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: Create an ec2 launch template
community.aws.ec2_launch_template:
name: "my_template"
image_id: "ami-04b762b4289fba92b"
key_name: my_ssh_key
instance_type: t2.micro
iam_instance_profile: myTestProfile
disable_api_termination: true
- name: >
Create a new version of an existing ec2 launch template with a different instance type,
while leaving an older version as the default version
community.aws.ec2_launch_template:
name: "my_template"
default_version: 1
instance_type: c5.4xlarge
- name: Delete an ec2 launch template
community.aws.ec2_launch_template:
name: "my_template"
state: absent
# This module does not yet allow deletion of specific versions of launch templates
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **default\_version** integer | when state=present | The version that will be used if only the template name is specified. Often this is the same as the latest version, but not always. |
| **latest\_version** integer | when state=present | Latest available version of the launch template |
### Authors
* Ryan Scott Brown (@ryansb)
| programming_docs |
ansible community.aws.rds_snapshot – manage Amazon RDS snapshots. community.aws.rds\_snapshot – manage Amazon RDS snapshots.
==========================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.rds_snapshot`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates or deletes RDS snapshots.
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 |
| **db\_instance\_identifier** string | | Database instance identifier. Required when state is present.
aliases: instance\_id |
| **db\_snapshot\_identifier** string / required | | The snapshot to manage.
aliases: id, snapshot\_id |
| **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 to remove tags not 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 |
| **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
| Specify the desired state of the snapshot. |
| **tags** dictionary | | tags dict to apply to a snapshot. |
| **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
| Whether or not to wait for snapshot creation or deletion. |
| **wait\_timeout** integer | **Default:**300 | 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
--------
```
- name: Create snapshot
community.aws.rds_snapshot:
db_instance_identifier: new-database
db_snapshot_identifier: new-database-snapshot
- name: Delete snapshot
community.aws.rds_snapshot:
db_snapshot_identifier: new-database-snapshot
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 |
| --- | --- | --- |
| **allocated\_storage** integer | always | How much storage is allocated in GB. **Sample:** 20 |
| **availability\_zone** string | always | Availability zone of the database from which the snapshot was created. **Sample:** us-west-2a |
| **db\_instance\_identifier** string | always | Database from which the snapshot was created. **Sample:** ansible-test-16638696 |
| **db\_snapshot\_arn** string | always | Amazon Resource Name for the snapshot. **Sample:** arn:aws:rds:us-west-2:123456789012:snapshot:ansible-test-16638696-test-snapshot |
| **db\_snapshot\_identifier** string | always | Name of the snapshot. **Sample:** ansible-test-16638696-test-snapshot |
| **dbi\_resource\_id** string | always | The identifier for the source DB instance, which can't be changed and which is unique to an AWS Region. **Sample:** db-MM4P2U35RQRAMWD3QDOXWPZP4U |
| **encrypted** boolean | always | Whether the snapshot is encrypted. |
| **engine** string | always | Engine of the database from which the snapshot was created. **Sample:** mariadb |
| **engine\_version** string | always | Version of the database from which the snapshot was created. **Sample:** 10.2.21 |
| **iam\_database\_authentication\_enabled** boolean | always | Whether IAM database authentication is enabled. |
| **instance\_create\_time** string | always | Creation time of the instance from which the snapshot was created. **Sample:** 2019-06-15T10:15:56.221000+00:00 |
| **license\_model** string | always | License model of the database. **Sample:** general-public-license |
| **master\_username** string | always | Master username of the database. **Sample:** test |
| **option\_group\_name** string | always | Option group of the database. **Sample:** default:mariadb-10-2 |
| **percent\_progress** integer | always | How much progress has been made taking the snapshot. Will be 100 for an available snapshot. **Sample:** 100 |
| **port** integer | always | Port on which the database is listening. **Sample:** 3306 |
| **processor\_features** list / elements=string | always | List of processor features of the database. |
| **snapshot\_create\_time** string | always | Creation time of the snapshot. **Sample:** 2019-06-15T10:46:23.776000+00:00 |
| **snapshot\_type** string | always | How the snapshot was created (always manual for this module!). **Sample:** manual |
| **status** string | always | Status of the snapshot. **Sample:** available |
| **storage\_type** string | always | Storage type of the database. **Sample:** gp2 |
| **tags** complex | always | Tags applied to the snapshot. |
| **vpc\_id** string | always | ID of the VPC in which the DB lives. **Sample:** vpc-09ff232e222710ae0 |
### Authors
* Will Thames (@willthames)
* Michael De La Rue (@mikedlr)
ansible community.aws.ec2_vpc_endpoint_service_info – retrieves AWS VPC endpoint service details community.aws.ec2\_vpc\_endpoint\_service\_info – retrieves AWS VPC endpoint service details
============================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_vpc_endpoint_service_info`.
New in version 1.5.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gets details related to AWS VPC Endpoint Services.
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_DescribeVpcEndpointServices.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 |
| **service\_names** list / elements=string | | A list of service names which can be used to narrow the search results. |
| **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
--------
```
# Simple example of listing all supported AWS services for VPC endpoints
- name: List supported AWS endpoint services
community.aws.ec2_vpc_endpoint_service_info:
region: ap-southeast-2
register: supported_endpoint_services
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **service\_details** complex | success | Detailed information about the AWS VPC endpoint services. |
| | **acceptance\_required** boolean | success | Whether VPC endpoint connection requests to the service must be accepted by the service owner. |
| | **availability\_zones** list / elements=string | success | The Availability Zones in which the service is available. |
| | **base\_endpoint\_dns\_names** list / elements=string | success | The DNS names for the service. |
| | **manages\_vpc\_endpoints** boolean | success | Whether the service manages its VPC endpoints. |
| | **owner** string | success | The AWS account ID of the service owner. |
| | **private\_dns\_name** string | success | The private DNS name for the service. |
| | **private\_dns\_name\_verification\_state** string | success | The verification state of the VPC endpoint service. Consumers of an endpoint service cannot use the private name when the state is not `verified`. |
| | **private\_dns\_names** list / elements=string | success | The private DNS names assigned to the VPC endpoint service. |
| | **service\_id** string | success | The ID of the endpoint service. |
| | **service\_name** string | success | The ARN of the endpoint service. |
| | **service\_type** list / elements=string | success | The type of the service |
| | **tags** dictionary | success | A dict of tags associated with the service |
| | **vpc\_endpoint\_policy\_supported** boolean | success | Whether the service supports endpoint policies. |
| **service\_names** list / elements=string | success | List of supported AWS VPC endpoint service names. **Sample:** {'service\_names': ['com.amazonaws.ap-southeast-2.s3']} |
### Authors
* Mark Chappell (@tremble)
ansible community.aws.aws_step_functions_state_machine_execution – Start or stop execution of an AWS Step Functions state machine. community.aws.aws\_step\_functions\_state\_machine\_execution – Start or stop execution of an AWS Step Functions state machine.
===============================================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_step_functions_state_machine_execution`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Start or stop execution of a state machine in AWS Step Functions.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.6
* boto
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **action** string | **Choices:*** **start** ←
* stop
| Desired action (start or stop) for a state machine execution. |
| **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 |
| **cause** string | **Default:**"" | A detailed explanation of the cause for stopping the execution. |
| **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 |
| **error** string | **Default:**"" | The error code of the failure to pass in when stopping the execution. |
| **execution\_arn** string | | The ARN of the execution you wish to stop. |
| **execution\_input** json | **Default:**{} | The JSON input data for the execution. |
| **name** string | | Name of the execution. |
| **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\_machine\_arn** string | | The ARN of the state machine that will be executed. |
| **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: Start an execution of a state machine
community.aws.aws_step_functions_state_machine_execution:
name: an_execution_name
execution_input: '{ "IsHelloWorldExample": true }'
state_machine_arn: "arn:aws:states:us-west-2:682285639423:stateMachine:HelloWorldStateMachine"
- name: Stop an execution of a state machine
community.aws.aws_step_functions_state_machine_execution:
action: stop
execution_arn: "arn:aws:states:us-west-2:682285639423:execution:HelloWorldStateMachineCopy:a1e8e2b5-5dfe-d40e-d9e3-6201061047c8"
cause: "cause of task failure"
error: "error code of the failure"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **execution\_arn** string | if action == start and changed == True | ARN of the AWS Step Functions state machine execution. **Sample:** arn:aws:states:us-west-2:682285639423:execution:HelloWorldStateMachineCopy:a1e8e2b5-5dfe-d40e-d9e3-6201061047c8 |
| **start\_date** string | if action == start and changed == True | The date the execution is started. **Sample:** 2019-11-02T22:39:49.071000-07:00 |
| **stop\_date** string | if action == stop | The date the execution is stopped. **Sample:** 2019-11-02T22:39:49.071000-07:00 |
### Authors
* Prasad Katti (@prasadkatti)
| programming_docs |
ansible community.aws.aws_direct_connect_virtual_interface – Manage Direct Connect virtual interfaces community.aws.aws\_direct\_connect\_virtual\_interface – Manage Direct Connect virtual interfaces
=================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_direct_connect_virtual_interface`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, delete, or modify a Direct Connect public or private virtual interface.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **address\_type** string | | The type of IP address for the BGP peer. |
| **amazon\_address** string | | The amazon address CIDR with which to create the virtual interface. |
| **authentication\_key** string | | The authentication key for BGP configuration. |
| **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 |
| **bgp\_asn** integer | **Default:**65000 | The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration. |
| **cidr** list / elements=string | | A list of route filter prefix CIDRs with which to create the public virtual interface. |
| **customer\_address** string | | The customer address CIDR with which to create the virtual interface. |
| **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. |
| **direct\_connect\_gateway\_id** string | | The direct connect gateway ID for creating a private virtual interface. To create a private virtual interface *virtual\_gateway\_id* or *direct\_connect\_gateway\_id* is required. These options are mutually exclusive. |
| **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 |
| **id\_to\_associate** string / required | | The ID of the link aggregation group or connection to associate with the virtual interface.
aliases: link\_aggregation\_group\_id, connection\_id |
| **name** string | | The name of the virtual interface. |
| **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** boolean | **Choices:*** no
* yes
| The type of virtual interface. |
| **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 / required | **Choices:*** present
* absent
| The desired state of the Direct Connect virtual interface. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **virtual\_gateway\_id** string | | The virtual gateway ID required for creating a private virtual interface. To create a private virtual interface *virtual\_gateway\_id* or *direct\_connect\_gateway\_id* is required. These options are mutually exclusive. |
| **virtual\_interface\_id** string | | The virtual interface ID. |
| **vlan** integer | **Default:**100 | The VLAN ID. |
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: create an association between a LAG and connection
community.aws.aws_direct_connect_virtual_interface:
state: present
name: "{{ name }}"
link_aggregation_group_id: LAG-XXXXXXXX
connection_id: dxcon-XXXXXXXX
- name: remove an association between a connection and virtual interface
community.aws.aws_direct_connect_virtual_interface:
state: absent
connection_id: dxcon-XXXXXXXX
virtual_interface_id: dxv-XXXXXXXX
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **address\_family** string | always | The address family for the BGP peer. **Sample:** ipv4 |
| **amazon\_address** string | always | IP address assigned to the Amazon interface. **Sample:** 169.254.255.1/30 |
| **asn** integer | always | The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration. **Sample:** 65000 |
| **auth\_key** string | always | The authentication key for BGP configuration. **Sample:** 0xZ59Y1JZ2oDOSh6YriIlyRE |
| **bgp\_peers** complex | always | A list of the BGP peers configured on this virtual interface. |
| | **address\_family** string | always | The address family for the BGP peer. **Sample:** ipv4 |
| | **amazon\_address** string | always | IP address assigned to the Amazon interface. **Sample:** 169.254.255.1/30 |
| | **asn** integer | always | The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration. **Sample:** 65000 |
| | **auth\_key** string | always | The authentication key for BGP configuration. **Sample:** 0xZ59Y1JZ2oDOSh6YriIlyRE |
| | **bgp\_peer\_state** string | always | The state of the BGP peer (verifying, pending, available) **Sample:** available |
| | **bgp\_status** string | always | The up/down state of the BGP peer. **Sample:** up |
| | **customer\_address** string | always | IP address assigned to the customer interface. **Sample:** 169.254.255.2/30 |
| **changed** boolean | always | Indicated if the virtual interface has been created/modified/deleted |
| **connection\_id** string | always | The ID of the connection. This field is also used as the ID type for operations that use multiple connection types (LAG, interconnect, and/or connection). **Sample:** dxcon-fgb175av |
| **customer\_address** string | always | IP address assigned to the customer interface. **Sample:** 169.254.255.2/30 |
| **customer\_router\_config** string | always | Information for generating the customer router configuration. |
| **direct\_connect\_gateway\_id** string | when *public=False* | The ID of the Direct Connect gateway. This only applies to private virtual interfaces. **Sample:** f7593767-eded-44e8-926d-a2234175835d |
| **location** string | always | Where the connection is located. **Sample:** EqDC2 |
| **owner\_account** string | always | The AWS account that will own the new virtual interface. **Sample:** 123456789012 |
| **route\_filter\_prefixes** complex | always | A list of routes to be advertised to the AWS network in this region (public virtual interface). |
| | **cidr** string | always | A routes to be advertised to the AWS network in this region. **Sample:** 54.227.92.216/30 |
| **virtual\_gateway\_id** string | when *public=False* | The ID of the virtual private gateway to a VPC. This only applies to private virtual interfaces. **Sample:** vgw-f3ce259a |
| **virtual\_interface\_id** string | always | The ID of the virtual interface. **Sample:** dxvif-fh0w7cex |
| **virtual\_interface\_name** string | always | The name of the virtual interface assigned by the customer. **Sample:** test\_virtual\_interface |
| **virtual\_interface\_state** string | always | State of the virtual interface (confirming, verifying, pending, available, down, rejected). **Sample:** available |
| **virtual\_interface\_type** string | always | The type of virtual interface (private, public). **Sample:** private |
| **vlan** integer | always | The VLAN ID. **Sample:** 100 |
### Authors
* Sloane Hertel (@s-hertel)
ansible community.aws.ec2_vpc_nacl_info – Gather information about Network ACLs in an AWS VPC community.aws.ec2\_vpc\_nacl\_info – Gather information about Network ACLs in an AWS VPC
========================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_vpc_nacl_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about Network ACLs in an AWS VPC
* This module was called `ec2_vpc_nacl_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_DescribeNetworkAcls.html> for possible filters. Filter names and values are case sensitive. |
| **nacl\_ids** list / elements=string | **Default:**[] | A list of Network ACL IDs to retrieve information about.
aliases: nacl\_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
* By default, the module will return all Network ACLs.
* 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 Network ACLs:
- name: Get All NACLs
community.aws.ec2_vpc_nacl_info:
region: us-west-2
register: all_nacls
# Retrieve default Network ACLs:
- name: Get Default NACLs
community.aws.ec2_vpc_nacl_info:
region: us-west-2
filters:
'default': 'true'
register: default_nacls
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **nacls** complex | success | Returns an array of complex objects as described below. |
| | **egress** list / elements=list | always | A list of NACL egress rules with the following format. `[rule no, protocol, allow/deny, v4 or v6 cidr, icmp_type, icmp_code, port from, port to]` **Sample:** [[100, 'all', 'allow', '0.0.0.0/0', None, None, None, None]] |
| | **ingress** list / elements=list | always | A list of NACL ingress rules with the following format. `[rule no, protocol, allow/deny, v4 or v6 cidr, icmp_type, icmp_code, port from, port to]` **Sample:** [[100, 'tcp', 'allow', '0.0.0.0/0', None, None, 22, 22]] |
| | **is\_default** boolean | always | True if the NACL is the default for its VPC. |
| | **nacl\_id** string | always | The ID of the Network Access Control List. |
| | **subnets** list / elements=string | always | A list of subnet IDs that are associated with the NACL. |
| | **tags** dictionary | always | A dict of tags associated with the NACL. |
| | **vpc\_id** string | always | The ID of the VPC that the NACL is attached to. |
### Authors
* Brad Davidson (@brandond)
ansible community.aws.cloudformation_exports_info – Read a value from CloudFormation Exports community.aws.cloudformation\_exports\_info – Read a value from CloudFormation Exports
======================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.cloudformation_exports_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Module retrieves a value from CloudFormation Exports
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3 >= 1.11.15
* 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
--------
```
- name: Get Exports
community.aws.cloudformation_exports_info:
profile: 'my_aws_profile'
region: 'my_region'
register: cf_exports
- ansible.builtin.debug:
msg: "{{ cf_exports }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **export\_items** dictionary | Always | A dictionary of Exports items names and values. |
### Authors
* Michael Moyle (@mmoyle)
| programming_docs |
ansible community.aws.aws_api_gateway – Manage AWS API Gateway APIs community.aws.aws\_api\_gateway – Manage AWS API Gateway APIs
=============================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_api_gateway`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for the management of API Gateway APIs.
* Normally you should give the api\_id since there is no other stable guaranteed unique identifier for the API. If you do not give api\_id then a new API will be created each time this is run.
* Beware that there are very hard limits on the rate that you can call API Gateway’s REST API. You may need to patch your boto. See <https://github.com/boto/boto3/issues/876> and discuss it with your AWS rep.
* swagger\_file and swagger\_text are passed directly on to AWS transparently whilst swagger\_dict is an ansible dict which is converted to JSON before the API definitions are uploaded.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_id** string | | The ID of the API you want to manage. |
| **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 |
| **cache\_enabled** boolean | **Choices:*** **no** ←
* yes
| Enable API GW caching of backend responses. |
| **cache\_size** string | **Choices:*** **0.5** ←
* 1.6
* 6.1
* 13.5
* 28.4
* 58.2
* 118
* 237
| Size in GB of the API GW cache, becomes effective when cache\_enabled is true. |
| **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. |
| **deploy\_desc** string | **Default:**"Automatic deployment by Ansible." | Description of the deployment. Recorded and visible in the AWS console. |
| **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 |
| **endpoint\_type** string | **Choices:*** **EDGE** ←
* REGIONAL
* PRIVATE
| Type of endpoint configuration. Use `EDGE` for an edge optimized API endpoint, `REGIONAL` for just a regional deploy or `PRIVATE` for a private API. This flag will only be used when creating a new API Gateway setup, not for updates. |
| **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 |
| **stage** string | | The name of the stage the API should be deployed to. |
| **stage\_canary\_settings** dictionary | | Canary settings for the deployment of the stage. Dict with following settings:
`percentTraffic`: The percent (0-100) of traffic diverted to a canary deployment.
`deploymentId`: The ID of the canary deployment.
`stageVariableOverrides`: Stage variables overridden for a canary release deployment.
`useStageCache`: A Boolean flag to indicate whether the canary deployment uses the stage cache or not. See docs <https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/apigateway.html#APIGateway.Client.create_stage>
|
| **stage\_variables** dictionary | | ENV variables for the stage. Define a dict of key values pairs for variables. |
| **state** string | **Choices:*** **present** ←
* absent
| Create or delete API Gateway. |
| **swagger\_dict** json | | Swagger definitions API ansible dictionary which will be converted to JSON and uploaded. |
| **swagger\_file** path | | JSON or YAML file containing swagger definitions for API. Exactly one of *swagger\_file*, *swagger\_text* or *swagger\_dict* must be present.
aliases: src, api\_file |
| **swagger\_text** string | | Swagger definitions for API in JSON or YAML as a string direct from playbook. |
| **tracing\_enabled** boolean | **Choices:*** **no** ←
* yes
| Specifies whether active tracing with X-ray is enabled for the API GW stage. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* A future version of this module will probably use tags or another ID so that an API can be created only once.
* As an early work around an intermediate version will probably do the same using a tag embedded in the API name.
* 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: Setup AWS API Gateway setup on AWS and deploy API definition
community.aws.aws_api_gateway:
swagger_file: my_api.yml
stage: production
cache_enabled: true
cache_size: '1.6'
tracing_enabled: true
endpoint_type: EDGE
state: present
- name: Update API definition to deploy new version
community.aws.aws_api_gateway:
api_id: 'abc123321cba'
swagger_file: my_api.yml
deploy_desc: Make auth fix available.
cache_enabled: true
cache_size: '1.6'
endpoint_type: EDGE
state: present
- name: Update API definitions and settings and deploy as canary
community.aws.aws_api_gateway:
api_id: 'abc123321cba'
swagger_file: my_api.yml
cache_enabled: true
cache_size: '6.1'
canary_settings: { percentTraffic: 50.0, deploymentId: '123', useStageCache: True }
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 |
| --- | --- | --- |
| **api\_id** string | success | API id of the API endpoint created **Sample:** 0ln4zq7p86 |
| **configure\_response** dictionary | success | AWS response from the API configure call **Sample:** {'api\_key\_source': 'HEADER', 'created\_at': '2020-01-01T11:37:59+00:00', 'id': '0ln4zq7p86'} |
| **deploy\_response** dictionary | success | AWS response from the API deploy call **Sample:** {'created\_date': '2020-01-01T11:36:59+00:00', 'description': 'Automatic deployment by Ansible.', 'id': 'rptv4b'} |
| **resource\_actions** list / elements=string | always | Actions performed against AWS API **Sample:** ['apigateway:CreateRestApi', 'apigateway:CreateDeployment', 'apigateway:PutRestApi'] |
### Authors
* Michael De La Rue (@mikedlr)
ansible community.aws.elb_classic_lb – Creates or destroys Amazon ELB. community.aws.elb\_classic\_lb – Creates or destroys Amazon ELB.
================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.elb_classic_lb`.
New in version 1.0.0: of community.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 example). |
| **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 example). |
| **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 example). |
| **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 subnets 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 set *wait=true*. |
| **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:*** present
* absent
| Create or destroy the ELB. |
| **stickiness** dictionary | | An associative array of stickiness policy settings. Policy will be applied to all listeners (see example). |
| **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 `false`, 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)
- community.aws.elb_classic_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"
delegate_to: localhost
# Internal ELB example
- community.aws.elb_classic_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
delegate_to: localhost
# Configure a health check and the access logs
- community.aws.elb_classic_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"
delegate_to: localhost
# Ensure ELB is gone
- community.aws.elb_classic_lb:
name: "test-please-delete"
state: absent
delegate_to: localhost
# Ensure ELB is gone and wait for check (for default timeout)
- community.aws.elb_classic_lb:
name: "test-please-delete"
state: absent
wait: yes
delegate_to: localhost
# Ensure ELB is gone and wait for check with timeout value
- community.aws.elb_classic_lb:
name: "test-please-delete"
state: absent
wait: yes
wait_timeout: 600
delegate_to: localhost
# 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
- community.aws.elb_classic_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
delegate_to: localhost
# 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
- community.aws.elb_classic_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
delegate_to: localhost
# Creates a ELB and assigns a list of subnets to it.
- community.aws.elb_classic_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
delegate_to: localhost
# Create an ELB with connection draining, increased idle timeout and cross availability
# zone load balancing
- community.aws.elb_classic_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
delegate_to: localhost
# Create an ELB with load balancer stickiness enabled
- community.aws.elb_classic_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
delegate_to: localhost
# Create an ELB with application stickiness enabled
- community.aws.elb_classic_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
delegate_to: localhost
# Create an ELB and add tags
- community.aws.elb_classic_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"
delegate_to: localhost
# Delete all tags from an ELB
- community.aws.elb_classic_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: {}
delegate_to: localhost
```
### Authors
* Jim Dalton (@jsdalton)
| programming_docs |
ansible community.aws.wafv2_resources_info – wafv2_resources_info community.aws.wafv2\_resources\_info – wafv2\_resources\_info
=============================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.wafv2_resources_info`.
New in version 1.5.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* List web acl resources.
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 |
| **name** string / required | | The name wafv2 acl of interest. |
| **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 |
| **scope** string / required | **Choices:*** CLOUDFRONT
* REGIONAL
| Scope of wafv2 web acl. |
| **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: get web acl
community.aws.wafv2_resources_info:
name: string03
scope: REGIONAL
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **resource\_arns** list / elements=string | Always, as long as the wafv2 exists | Current resources where the wafv2 is applied on **Sample:** ['arn:aws:elasticloadbalancing:eu-central-1:111111111:loadbalancer/app/test03/dd83ea041ba6f933'] |
### Authors
* Markus Bergholz (@markuman)
ansible community.aws.aws_kms_info – Gather information about AWS KMS keys community.aws.aws\_kms\_info – Gather information about AWS KMS keys
====================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_kms_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Gather information about AWS KMS keys including tags and grants
* This module was called `aws_kms_facts` before Ansible 2.9. The usage did not change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python >= 2.6
* boto
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **alias** string added in 1.4.0 of community.aws | | Alias for key. Mutually exclusive with *key\_id* and *filters*.
aliases: key\_alias |
| **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. The filters aren't natively supported by boto3, but are supported to provide similar functionality to other modules. Standard tag filters (`tag-key`, `tag-value` and `tag:tagName`) are available, as are `key-id` and `alias`
Mutually exclusive with *alias* and *key\_id*. |
| **key\_id** string added in 1.4.0 of community.aws | | Key ID or ARN of the key. Mutually exclusive with *alias* and *filters*.
aliases: key\_arn |
| **pending\_deletion** boolean | **Choices:*** **no** ←
* yes
| Whether to get full details (tags, grants etc.) of keys pending deletion |
| **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 KMS keys
- community.aws.aws_kms_info:
# Gather information about all keys with a Name tag
- community.aws.aws_kms_info:
filters:
tag-key: Name
# Gather information about all keys with a specific name
- community.aws.aws_kms_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 |
| --- | --- | --- |
| **keys** complex | always | list of keys |
| | **aliases** list / elements=string | always | list of aliases associated with the key **Sample:** ['aws/acm', 'aws/ebs'] |
| | **aws\_account\_id** string | always | The AWS Account ID that the key belongs to **Sample:** 1234567890123 |
| | **creation\_date** string | always | Date of creation of the key **Sample:** 2017-04-18T15:12:08.551000+10:00 |
| | **description** string | always | Description of the key **Sample:** My Key for Protecting important stuff |
| | **enable\_key\_rotation** boolean | always | Whether the automatically key rotation every year is enabled. Returns None if key rotation status can't be determined. |
| | **enabled** string | always | Whether the key is enabled. True if `KeyState` is true. |
| | **grants** complex | always | list of grants associated with a key |
| | | **constraints** dictionary | always | Constraints on the encryption context that the grant allows. See <https://docs.aws.amazon.com/kms/latest/APIReference/API_GrantConstraints.html> for further details **Sample:** {'encryption\_context\_equals': {'aws:lambda:\_function\_arn': 'arn:aws:lambda:ap-southeast-2:012345678912:function:xyz'}} |
| | | **creation\_date** string | always | Date of creation of the grant **Sample:** 2017-04-18T15:12:08+10:00 |
| | | **grant\_id** string | always | The unique ID for the grant **Sample:** abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234 |
| | | **grantee\_principal** string | always | The principal that receives the grant's permissions **Sample:** arn:aws:sts::0123456789012:assumed-role/lambda\_xyz/xyz |
| | | **issuing\_account** string | always | The AWS account under which the grant was issued **Sample:** arn:aws:iam::01234567890:root |
| | | **key\_id** string | always | The key ARN to which the grant applies. **Sample:** arn:aws:kms:ap-southeast-2:123456789012:key/abcd1234-abcd-1234-5678-ef1234567890 |
| | | **name** string | always | The friendly name that identifies the grant **Sample:** xyz |
| | | **operations** list / elements=string | always | The list of operations permitted by the grant **Sample:** ['Decrypt', 'RetireGrant'] |
| | | **retiring\_principal** string | always | The principal that can retire the grant **Sample:** arn:aws:sts::0123456789012:assumed-role/lambda\_xyz/xyz |
| | **key\_arn** string | always | ARN of key **Sample:** arn:aws:kms:ap-southeast-2:123456789012:key/abcd1234-abcd-1234-5678-ef1234567890 |
| | **key\_id** string | always | ID of key **Sample:** abcd1234-abcd-1234-5678-ef1234567890 |
| | **key\_state** string | always | The state of the key **Sample:** PendingDeletion |
| | **key\_usage** string | always | The cryptographic operations for which you can use the key. **Sample:** ENCRYPT\_DECRYPT |
| | **origin** string | always | The source of the key's key material. When this value is `AWS_KMS`, AWS KMS created the key material. When this value is `EXTERNAL`, the key material was imported or the CMK lacks key material. **Sample:** AWS\_KMS |
| | **policies** list / elements=string | always | list of policy documents for the keys. Empty when access is denied even if there are policies. **Sample:** {'Id': 'auto-ebs-2', 'Statement': [{'Action': ['kms:Encrypt', 'kms:Decrypt', 'kms:ReEncrypt\*', 'kms:GenerateDataKey\*', 'kms:CreateGrant', 'kms:DescribeKey'], 'Condition': {'StringEquals': {'kms:CallerAccount': '111111111111', 'kms:ViaService': 'ec2.ap-southeast-2.amazonaws.com'}}, 'Effect': 'Allow', 'Principal': {'AWS': '\*'}, 'Resource': '\*', 'Sid': 'Allow access through EBS for all principals in the account that are authorized to use EBS'}, {'Action': ['kms:Describe\*', 'kms:Get\*', 'kms:List\*', 'kms:RevokeGrant'], 'Effect': 'Allow', 'Principal': {'AWS': 'arn:aws:iam::111111111111:root'}, 'Resource': '\*', 'Sid': 'Allow direct access to key metadata to the account'}], 'Version': '2012-10-17'} |
| | **tags** dictionary | always | dictionary of tags applied to the key. Empty when access is denied even if there are tags. **Sample:** {'Name': 'myKey', 'Purpose': 'protecting\_stuff'} |
### Authors
* Will Thames (@willthames)
ansible community.aws.aws_direct_connect_link_aggregation_group – Manage Direct Connect LAG bundles community.aws.aws\_direct\_connect\_link\_aggregation\_group – Manage Direct Connect LAG bundles
================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_direct_connect_link_aggregation_group`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, delete, or modify a Direct Connect link aggregation group.
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 |
| **bandwidth** string | | The bandwidth of the link aggregation group. |
| **connection\_id** string | | A connection ID to link with the link aggregation group upon creation. |
| **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\_with\_disassociation** boolean | **Choices:*** **no** ←
* yes
| To be used with *state=absent* to delete connections after disassociating them with the LAG. |
| **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\_delete** boolean | **Choices:*** **no** ←
* yes
| This allows the minimum number of links to be set to 0, any hosted connections disassociated, and any virtual interfaces associated to the LAG deleted. |
| **link\_aggregation\_group\_id** string | | The ID of the Direct Connect link aggregation group. |
| **location** string | | The location of the link aggregation group. |
| **min\_links** integer | | The minimum number of physical connections that must be operational for the LAG itself to be operational. |
| **name** string | | The name of the Direct Connect link aggregation group. |
| **num\_connections** integer | | The number of connections with which to initialize the link aggregation group. |
| **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 / required | **Choices:*** present
* absent
| The state of the Direct Connect link aggregation group. |
| **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
| Whether or not to wait for the operation to complete. May be useful when waiting for virtual interfaces to be deleted. The time to wait can be controlled by setting *wait\_timeout*. |
| **wait\_timeout** integer | **Default:**120 | The duration in seconds to wait if *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
--------
```
# create a Direct Connect connection
- community.aws.aws_direct_connect_link_aggregation_group:
state: present
location: EqDC2
lag_id: dxlag-xxxxxxxx
bandwidth: 1Gbps
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **aws\_device** string | when *state=present* | The AWS Direct Connection endpoint that hosts the LAG. **Sample:** EqSe2-1bwfvazist2k0 |
| **changed** string | always | Whether or not the LAG has changed. |
| **connections** list / elements=string | when *state=present* | A list of connections bundled by this LAG. **Sample:** {'connections': [{'aws\_device': 'EqSe2-1bwfvazist2k0', 'bandwidth': '1Gbps', 'connection\_id': 'dxcon-fgzjah5a', 'connection\_name': 'Requested Connection 1 for Lag dxlag-fgtoh97h', 'connection\_state': 'down', 'lag\_id': 'dxlag-fgnsp4rq', 'location': 'EqSe2', 'owner\_account': '448830907657', 'region': 'us-west-2'}]} |
| **connections\_bandwidth** string | when *state=present* | The individual bandwidth of the physical connections bundled by the LAG. **Sample:** 1Gbps |
| **lag\_id** string | when *state=present* | Unique identifier for the link aggregation group. **Sample:** dxlag-fgnsp4rq |
| **lag\_name** string | when *state=present* | User-provided name for the link aggregation group. |
| **lag\_state** string | when *state=present* | State of the LAG. **Sample:** pending |
| **location** string | when *state=present* | Where the connection is located. **Sample:** EqSe2 |
| **minimum\_links** integer | when *state=present* | The minimum number of physical connections that must be operational for the LAG itself to be operational. |
| **number\_of\_connections** integer | when *state=present* | The number of physical connections bundled by the LAG. |
| **owner\_account** string | when *state=present* | Owner account ID of the LAG. |
| **region** string | when *state=present* | The region in which the LAG exists. |
### Authors
* Sloane Hertel (@s-hertel)
| programming_docs |
ansible community.aws.aws_config_aggregation_authorization – Manage cross-account AWS Config authorizations community.aws.aws\_config\_aggregation\_authorization – Manage cross-account AWS Config authorizations
======================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_config_aggregation_authorization`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Module manages AWS Config resources.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **authorized\_account\_id** string / required | | The 12-digit account ID of the account authorized to aggregate data. |
| **authorized\_aws\_region** string / required | | The region authorized to collect aggregated data. |
| **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 |
| **state** string | **Choices:*** **present** ←
* absent
| Whether the Config rule should be present or 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: Get current account ID
community.aws.aws_caller_info:
register: whoami
- community.aws.aws_config_aggregation_authorization:
state: present
authorized_account_id: '{{ whoami.account }}'
authorized_aws_region: us-east-1
```
### Authors
* Aaron Smith (@slapula)
ansible community.aws.ec2_vpc_peer – create, delete, accept, and reject VPC peering connections between two VPCs. community.aws.ec2\_vpc\_peer – create, delete, accept, and reject VPC peering connections between two VPCs.
===========================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_vpc_peer`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Read the AWS documentation for VPC Peering Connections <https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-peering.html>.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* json
* 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 |
| **peer\_owner\_id** string | | The AWS account number for cross account peering. |
| **peer\_region** string | | Region of the accepting VPC. |
| **peer\_vpc\_id** string | | VPC id of the accepting VPC. |
| **peering\_id** string | | Peering connection 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 |
| **state** string | **Choices:*** **present** ←
* absent
* accept
* reject
| Create, delete, accept, reject a peering connection. |
| **tags** dictionary | | Dictionary of tags to look for and apply when creating a Peering Connection. |
| **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 of the requesting VPC. |
| **wait** boolean | **Choices:*** **no** ←
* yes
| Wait for peering state changes to complete. |
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
--------
```
# Complete example to create and accept a local peering connection.
- name: Create local account VPC peering Connection
community.aws.ec2_vpc_peer:
region: ap-southeast-2
vpc_id: vpc-12345678
peer_vpc_id: vpc-87654321
state: present
tags:
Name: Peering connection for VPC 21 to VPC 22
CostCode: CC1234
Project: phoenix
register: vpc_peer
- name: Accept local VPC peering request
community.aws.ec2_vpc_peer:
region: ap-southeast-2
peering_id: "{{ vpc_peer.peering_id }}"
state: accept
register: action_peer
# Complete example to delete a local peering connection.
- name: Create local account VPC peering Connection
community.aws.ec2_vpc_peer:
region: ap-southeast-2
vpc_id: vpc-12345678
peer_vpc_id: vpc-87654321
state: present
tags:
Name: Peering connection for VPC 21 to VPC 22
CostCode: CC1234
Project: phoenix
register: vpc_peer
- name: delete a local VPC peering Connection
community.aws.ec2_vpc_peer:
region: ap-southeast-2
peering_id: "{{ vpc_peer.peering_id }}"
state: absent
register: vpc_peer
# Complete example to create and accept a cross account peering connection.
- name: Create cross account VPC peering Connection
community.aws.ec2_vpc_peer:
region: ap-southeast-2
vpc_id: vpc-12345678
peer_vpc_id: vpc-12345678
peer_owner_id: 123456789102
state: present
tags:
Name: Peering connection for VPC 21 to VPC 22
CostCode: CC1234
Project: phoenix
register: vpc_peer
- name: Accept peering connection from remote account
community.aws.ec2_vpc_peer:
region: ap-southeast-2
peering_id: "{{ vpc_peer.peering_id }}"
profile: bot03_profile_for_cross_account
state: accept
register: vpc_peer
# Complete example to create and accept an intra-region peering connection.
- name: Create intra-region VPC peering Connection
community.aws.ec2_vpc_peer:
region: us-east-1
vpc_id: vpc-12345678
peer_vpc_id: vpc-87654321
peer_region: us-west-2
state: present
tags:
Name: Peering connection for us-east-1 VPC to us-west-2 VPC
CostCode: CC1234
Project: phoenix
register: vpc_peer
- name: Accept peering connection from peer region
community.aws.ec2_vpc_peer:
region: us-west-2
peering_id: "{{ vpc_peer.peering_id }}"
state: accept
register: vpc_peer
# Complete example to create and reject a local peering connection.
- name: Create local account VPC peering Connection
community.aws.ec2_vpc_peer:
region: ap-southeast-2
vpc_id: vpc-12345678
peer_vpc_id: vpc-87654321
state: present
tags:
Name: Peering connection for VPC 21 to VPC 22
CostCode: CC1234
Project: phoenix
register: vpc_peer
- name: Reject a local VPC peering Connection
community.aws.ec2_vpc_peer:
region: ap-southeast-2
peering_id: "{{ vpc_peer.peering_id }}"
state: reject
# Complete example to create and accept a cross account peering connection.
- name: Create cross account VPC peering Connection
community.aws.ec2_vpc_peer:
region: ap-southeast-2
vpc_id: vpc-12345678
peer_vpc_id: vpc-12345678
peer_owner_id: 123456789102
state: present
tags:
Name: Peering connection for VPC 21 to VPC 22
CostCode: CC1234
Project: phoenix
register: vpc_peer
- name: Accept a cross account VPC peering connection request
community.aws.ec2_vpc_peer:
region: ap-southeast-2
peering_id: "{{ vpc_peer.peering_id }}"
profile: bot03_profile_for_cross_account
state: accept
tags:
Name: Peering connection for VPC 21 to VPC 22
CostCode: CC1234
Project: phoenix
# Complete example to create and reject a cross account peering connection.
- name: Create cross account VPC peering Connection
community.aws.ec2_vpc_peer:
region: ap-southeast-2
vpc_id: vpc-12345678
peer_vpc_id: vpc-12345678
peer_owner_id: 123456789102
state: present
tags:
Name: Peering connection for VPC 21 to VPC 22
CostCode: CC1234
Project: phoenix
register: vpc_peer
- name: Reject a cross account VPC peering Connection
community.aws.ec2_vpc_peer:
region: ap-southeast-2
peering_id: "{{ vpc_peer.peering_id }}"
profile: bot03_profile_for_cross_account
state: reject
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **peering\_id** string | always | The id of the VPC peering connection created/deleted. **Sample:** pcx-034223d7c0aec3cde |
| **vpc\_peering\_connection** complex | success | The details of the VPC peering connection as returned by Boto3 (snake cased). |
| | **accepter\_vpc\_info** complex | success | Information about the VPC which accepted the connection. |
| | | **cidr\_block** string | when connection is in the accepted state. | The primary CIDR for the VPC. **Sample:** 10.10.10.0/23 |
| | | **cidr\_block\_set** complex | when connection is in the accepted state. | A list of all CIDRs for the VPC. |
| | | | **cidr\_block** string | success | A CIDR block used by the VPC. **Sample:** 10.10.10.0/23 |
| | | **owner\_id** string | success | The AWS account that owns the VPC. **Sample:** 012345678901 |
| | | **peering\_options** dictionary | when connection is in the accepted state. | Additional peering configuration. |
| | | | **allow\_dns\_resolution\_from\_remote\_vpc** boolean | success | Indicates whether a VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC. |
| | | | **allow\_egress\_from\_local\_classic\_link\_to\_remote\_vpc** boolean | success | Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection. |
| | | | **allow\_egress\_from\_local\_vpc\_to\_remote\_classic\_link** boolean | success | Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection. |
| | | **region** string | success | The AWS region that the VPC is in. **Sample:** us-east-1 |
| | | **vpc\_id** string | success | The ID of the VPC **Sample:** vpc-0123456789abcdef0 |
| | **requester\_vpc\_info** complex | success | Information about the VPC which requested the connection. |
| | | **cidr\_block** string | when connection is not in the deleted state. | The primary CIDR for the VPC. **Sample:** 10.10.10.0/23 |
| | | **cidr\_block\_set** complex | when connection is not in the deleted state. | A list of all CIDRs for the VPC. |
| | | | **cidr\_block** string | success | A CIDR block used by the VPC **Sample:** 10.10.10.0/23 |
| | | **owner\_id** string | success | The AWS account that owns the VPC. **Sample:** 012345678901 |
| | | **peering\_options** dictionary | when connection is not in the deleted state. | Additional peering configuration. |
| | | | **allow\_dns\_resolution\_from\_remote\_vpc** boolean | success | Indicates whether a VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC. |
| | | | **allow\_egress\_from\_local\_classic\_link\_to\_remote\_vpc** boolean | success | Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection. |
| | | | **allow\_egress\_from\_local\_vpc\_to\_remote\_classic\_link** boolean | success | Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection. |
| | | **region** string | success | The AWS region that the VPC is in. **Sample:** us-east-1 |
| | | **vpc\_id** string | success | The ID of the VPC **Sample:** vpc-0123456789abcdef0 |
| | **status** complex | success | Details of the current status of the connection. |
| | | **code** string | success | A short code describing the status of the connection. **Sample:** active |
| | | **message** string | success | Additional information about the status of the connection. **Sample:** Pending Acceptance by 012345678901 |
| | **tags** dictionary | success | Tags applied to the connection. |
| | **vpc\_peering\_connection\_id** string | success | The ID of the VPC peering connection. **Sample:** pcx-0123456789abcdef0 |
### Authors
* Mike Mochan (@mmochan)
| programming_docs |
ansible community.aws.ec2_vpc_vgw – Create and delete AWS VPN Virtual Gateways. community.aws.ec2\_vpc\_vgw – Create and delete AWS VPN Virtual Gateways.
=========================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_vpc_vgw`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates AWS VPN Virtual Gateways
* Deletes AWS VPN Virtual Gateways
* Attaches Virtual Gateways to VPCs
* Detaches Virtual Gateways from VPCs
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **asn** integer | | the BGP ASN of the amazon side |
| **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 |
| **name** string | | name of the vgw to be created or deleted |
| **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
| present to ensure resource is created. absent to remove resource |
| **tags** dictionary | | dictionary of resource tags
aliases: resource\_tags |
| **type** string | **Choices:*** **ipsec.1** ←
| type of the virtual gateway to be created |
| **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 | | the vpc-id of a vpc to attach or detach |
| **vpn\_gateway\_id** string | | vpn gateway id of an existing virtual gateway |
| **wait\_timeout** integer | **Default:**320 | number of seconds to wait for status during vpc attach and detach |
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: Create a new vgw attached to a specific VPC
community.aws.ec2_vpc_vgw:
state: present
region: ap-southeast-2
profile: personal
vpc_id: vpc-12345678
name: personal-testing
type: ipsec.1
register: created_vgw
- name: Create a new unattached vgw
community.aws.ec2_vpc_vgw:
state: present
region: ap-southeast-2
profile: personal
name: personal-testing
type: ipsec.1
tags:
environment: production
owner: ABC
register: created_vgw
- name: Remove a new vgw using the name
community.aws.ec2_vpc_vgw:
state: absent
region: ap-southeast-2
profile: personal
name: personal-testing
type: ipsec.1
register: deleted_vgw
- name: Remove a new vgw using the vpn_gateway_id
community.aws.ec2_vpc_vgw:
state: absent
region: ap-southeast-2
profile: personal
vpn_gateway_id: vgw-3a9aa123
register: deleted_vgw
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **result** dictionary | success | The result of the create, or delete action. |
### Authors
* Nick Aslanidis (@naslanidis)
ansible community.aws.ec2_vpc_endpoint – Create and delete AWS VPC Endpoints. community.aws.ec2\_vpc\_endpoint – Create and delete AWS VPC Endpoints.
=======================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_vpc_endpoint`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates AWS VPC endpoints.
* Deletes AWS VPC endpoints.
* This module supports check mode.
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 |
| **client\_token** string | | Optional client token to ensure idempotency |
| **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 |
| **policy** json | | A properly formatted json policy as string, see <https://github.com/ansible/ansible/issues/7005#issuecomment-42894813>. Cannot be used with *policy\_file*. Option when creating an endpoint. If not provided AWS will utilise a default policy which provides full access to the service. |
| **policy\_file** path | | The path to the properly json formatted policy file, see <https://github.com/ansible/ansible/issues/7005#issuecomment-42894813> on how to use it properly. Cannot be used with *policy*. Option when creating an endpoint. If not provided AWS will utilise a default policy which provides full access to the service. This option has been deprecated and will be removed after 2022-12-01 to maintain the existing functionality please use the *policy* option and a file lookup.
aliases: policy\_path |
| **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 community.aws | **Choices:*** **no** ←
* yes
| Delete any tags not specified in the task that are on the instance. This means you have to specify all the desired tags on each task affecting an 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 |
| **route\_table\_ids** list / elements=string | | List of one or more route table ids to attach to the endpoint. A route is added to the route table with the destination of the endpoint if provided. |
| **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 |
| **service** string | | An AWS supported vpc endpoint service. Use the [community.aws.ec2\_vpc\_endpoint\_info](ec2_vpc_endpoint_info_module) module to describe the supported endpoint services. Required when creating an endpoint. |
| **state** string | **Choices:*** **present** ←
* absent
| present to ensure resource is created. absent to remove resource |
| **tags** dictionary added in 1.5.0 of community.aws | | A dict of tags to apply to the internet gateway. To remove all tags set *tags={}* and *purge\_tags=true*. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **vpc\_endpoint\_id** string | | One or more vpc endpoint ids to remove from the AWS account |
| **vpc\_endpoint\_type** string added in 1.5.0 of community.aws | **Choices:*** Interface
* **Gateway** ←
* GatewayLoadBalancer
| The type of endpoint. |
| **vpc\_id** string | | Required when creating a VPC endpoint. |
| **wait** boolean | **Choices:*** **no** ←
* yes
| When specified, will wait for either available status for state present. Unfortunately this is ignored for delete actions due to a difference in behaviour from AWS. |
| **wait\_timeout** integer | **Default:**320 | Used in conjunction with wait. Number of seconds to wait for status. Unfortunately this is ignored for delete actions due to a difference in behaviour from AWS. |
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 new vpc endpoint with a json template for policy
community.aws.ec2_vpc_endpoint:
state: present
region: ap-southeast-2
vpc_id: vpc-12345678
service: com.amazonaws.ap-southeast-2.s3
policy: " {{ lookup( 'template', 'endpoint_policy.json.j2') }} "
route_table_ids:
- rtb-12345678
- rtb-87654321
register: new_vpc_endpoint
- name: Create new vpc endpoint with the default policy
community.aws.ec2_vpc_endpoint:
state: present
region: ap-southeast-2
vpc_id: vpc-12345678
service: com.amazonaws.ap-southeast-2.s3
route_table_ids:
- rtb-12345678
- rtb-87654321
register: new_vpc_endpoint
- name: Create new vpc endpoint with json file
community.aws.ec2_vpc_endpoint:
state: present
region: ap-southeast-2
vpc_id: vpc-12345678
service: com.amazonaws.ap-southeast-2.s3
policy_file: "{{ role_path }}/files/endpoint_policy.json"
route_table_ids:
- rtb-12345678
- rtb-87654321
register: new_vpc_endpoint
- name: Delete newly created vpc endpoint
community.aws.ec2_vpc_endpoint:
state: absent
vpc_endpoint_id: "{{ new_vpc_endpoint.result['VpcEndpointId'] }}"
region: ap-southeast-2
```
Return Values
-------------
Common return 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** list / elements=string | success | The resulting endpoints from the module call **Sample:** [{'creation\_timestamp': '2017-02-20T05:04:15+00:00', 'policy\_document': {'Id': 'Policy1450910922815', 'Statement': [{'Action': 's3:\*', 'Effect': 'Allow', 'Principal': '\*', 'Resource': ['arn:aws:s3:::\*/\*', 'arn:aws:s3:::\*'], 'Sid': 'Stmt1450910920641'}], 'Version': '2012-10-17'}, 'route\_table\_ids': ['rtb-abcd1234'], 'service\_name': 'com.amazonaws.ap-southeast-2.s3', 'vpc\_endpoint\_id': 'vpce-a1b2c3d4', 'vpc\_id': 'vpc-abbad0d0'}] |
### Authors
* Karen Cheng (@Etherdaemon)
ansible community.aws.sns – Send Amazon Simple Notification Service messages community.aws.sns – Send Amazon Simple Notification Service messages
====================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.sns`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Sends a notification to a topic on your Amazon SNS account.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **application** string | | Message to send to application subscriptions. |
| **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 |
| **email** string | | Message to send to email subscriptions. |
| **email\_json** string | | Message to send to email-json subscriptions. |
| **http** string | | Message to send to HTTP subscriptions. |
| **https** string | | Message to send to HTTPS subscriptions. |
| **lambda** string | | Message to send to Lambda subscriptions. |
| **message\_attributes** dictionary | | Dictionary of message attributes. These are optional structured data entries to be sent along to the endpoint. This is in AWS's distinct Name/Type/Value format; see example below. |
| **message\_structure** string | **Choices:*** **json** ←
* string
| The payload format to use for the message. This must be 'json' to support protocol-specific messages (`http`, `https`, `email`, `sms`, `sqs`). It must be 'string' to support *message\_attributes*. |
| **msg** string / required | | Default message for subscriptions without a more specific message.
aliases: 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 |
| **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 |
| **sms** string | | Message to send to SMS subscriptions. |
| **sqs** string | | Message to send to SQS subscriptions. |
| **subject** string | | Message subject |
| **topic** string / required | | The name or ARN of the topic to publish to. |
| **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: Send default notification message via SNS
community.aws.sns:
msg: '{{ inventory_hostname }} has completed the play.'
subject: Deploy complete!
topic: deploy
delegate_to: localhost
- name: Send notification messages via SNS with short message for SMS
community.aws.sns:
msg: '{{ inventory_hostname }} has completed the play.'
sms: deployed!
subject: Deploy complete!
topic: deploy
delegate_to: localhost
- name: Send message with message_attributes
community.aws.sns:
topic: "deploy"
msg: "message with extra details!"
message_attributes:
channel:
data_type: String
string_value: "mychannel"
color:
data_type: String
string_value: "green"
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **message\_id** string | when success | The message ID of the submitted message **Sample:** 2f681ef0-6d76-5c94-99b2-4ae3996ce57b |
| **msg** string | always | Human-readable diagnostic information **Sample:** OK |
### Authors
* Michael J. Schultz (@mjschultz)
* Paul Arthur (@flowerysong)
| programming_docs |
ansible community.aws.aws_ssm_parameter_store – Manage key-value pairs in aws parameter store. community.aws.aws\_ssm\_parameter\_store – Manage key-value pairs in aws parameter store.
=========================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_ssm_parameter_store`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage key-value pairs in aws parameter store.
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. |
| **decryption** boolean | **Choices:*** no
* **yes** ←
| Work with SecureString type to get plain text secrets |
| **description** string | | Parameter key description. |
| **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 |
| **key\_id** string | **Default:**"alias/aws/ssm" | AWS KMS key to decrypt the secrets. The default key (`alias/aws/ssm`) is automatically generated the first time it's requested. |
| **name** string / required | | Parameter key name. |
| **overwrite\_value** string | **Choices:*** never
* **changed** ←
* always
| Option to overwrite an existing value if it 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 |
| **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
| Creates or modifies an existing parameter. Deletes a parameter. |
| **string\_type** string | **Choices:*** **String** ←
* StringList
* SecureString
| Parameter String type. |
| **tier** string added in 1.5.0 of community.aws | **Choices:*** **Standard** ←
* Advanced
* Intelligent-Tiering
| Parameter store tier type. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **value** string | | Parameter value. |
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: Create or update key/value pair in aws parameter store
community.aws.aws_ssm_parameter_store:
name: "Hello"
description: "This is your first key"
value: "World"
- name: Delete the key
community.aws.aws_ssm_parameter_store:
name: "Hello"
state: absent
- name: Create or update secure key/value pair with default kms key (aws/ssm)
community.aws.aws_ssm_parameter_store:
name: "Hello"
description: "This is your first key"
string_type: "SecureString"
value: "World"
- name: Create or update secure key/value pair with nominated kms key
community.aws.aws_ssm_parameter_store:
name: "Hello"
description: "This is your first key"
string_type: "SecureString"
key_id: "alias/demo"
value: "World"
- name: Always update a parameter store value and create a new version
community.aws.aws_ssm_parameter_store:
name: "overwrite_example"
description: "This example will always overwrite the value"
string_type: "String"
value: "Test1234"
overwrite_value: "always"
- name: Create or update key/value pair in aws parameter store with tier
community.aws.aws_ssm_parameter_store:
name: "Hello"
description: "This is your first key"
value: "World"
tier: "Advanced"
- name: recommend to use with aws_ssm lookup plugin
ansible.builtin.debug:
msg: "{{ lookup('amazon.aws.aws_ssm', 'hello') }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **delete\_parameter** dictionary | success | Delete a parameter from the system. |
| **put\_parameter** dictionary | success | Add one or more parameters to the system. |
### Authors
* Davinder Pal (@116davinder) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#ef8b9f9c8e8188988e83c9ccdcd8d4c9ccdaddd4c9ccdbd7d488828e8683c9ccdbd9d48c8082)>
* Nathan Webster (@nathanwebsterdotme)
* Bill Wang (@ozbillwang) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#fe91849c979292899f9099d8ddcdc9c5d8ddcbccc5d8ddcac6c599939f9792d8ddcac8c59d9193)>
* Michael De La Rue (@mikedlr)
ansible community.aws.aws_config_aggregator – Manage AWS Config aggregations across multiple accounts community.aws.aws\_config\_aggregator – Manage AWS Config aggregations across multiple accounts
===============================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_config_aggregator`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Module manages AWS Config resources
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **account\_sources** list / elements=dictionary / required | | Provides a list of source accounts and regions to be aggregated. |
| | **account\_ids** list / elements=string | | A list of 12-digit account IDs of accounts being aggregated. |
| | **all\_aws\_regions** boolean | **Choices:*** no
* yes
| If true, aggregate existing AWS Config regions and future regions. |
| | **aws\_regions** list / elements=string | | A list of source regions being aggregated. |
| **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 |
| **name** string / required | | The name of the AWS Config resource. |
| **organization\_source** dictionary / required | | The region authorized to collect aggregated data. |
| | **all\_aws\_regions** boolean | **Choices:*** no
* yes
| If true, aggregate existing AWS Config regions and future regions. |
| | **aws\_regions** list / elements=string | | The source regions being aggregated. |
| | **role\_arn** string | | ARN of the IAM role used to retrieve AWS Organization details associated with the aggregator account. |
| **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
| Whether the Config rule should be present or 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: Create cross-account aggregator
community.aws.aws_config_aggregator:
name: test_config_rule
state: present
account_sources:
account_ids:
- 1234567890
- 0123456789
- 9012345678
all_aws_regions: yes
```
### Authors
* Aaron Smith (@slapula)
ansible community.aws.ec2_win_password – Gets the default administrator password for ec2 windows instances community.aws.ec2\_win\_password – Gets the default administrator password for ec2 windows instances
====================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_win_password`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Gets the default administrator password from any EC2 Windows instance. The instance is referenced by its id (e.g. `i-XXXXXXX`).
* This module has a dependency on python-boto.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* cryptography
* 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 |
| **instance\_id** string / required | | The instance id to get the password data from. |
| **key\_data** string | | The private key (usually stored in vault). Conflicts with *key\_file*, |
| **key\_file** path | | Path to the file containing the key pair used on the instance. Conflicts with *key\_data*. |
| **key\_passphrase** string | | The passphrase for the instance key pair. The key must use DES or 3DES encryption for this module to decrypt it. You can use openssl to convert your password protected keys if they do not use DES or 3DES. ex) `openssl rsa -in current_key -out new_key -des3`. |
| **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. |
| **wait** boolean | **Choices:*** **no** ←
* yes
| Whether or not to wait for the password to be available before returning. |
| **wait\_timeout** integer | **Default:**120 | Number of seconds to wait before giving up. |
Notes
-----
Note
* As of Ansible 2.4, this module requires the python cryptography module rather than the older pycrypto module.
* 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
--------
```
# Example of getting a password
- name: get the Administrator password
community.aws.ec2_win_password:
profile: my-boto-profile
instance_id: i-XXXXXX
region: us-east-1
key_file: "~/aws-creds/my_test_key.pem"
# Example of getting a password using a variable
- name: get the Administrator password
community.aws.ec2_win_password:
profile: my-boto-profile
instance_id: i-XXXXXX
region: us-east-1
key_data: "{{ ec2_private_key }}"
# Example of getting a password with a password protected key
- name: get the Administrator password
community.aws.ec2_win_password:
profile: my-boto-profile
instance_id: i-XXXXXX
region: us-east-1
key_file: "~/aws-creds/my_protected_test_key.pem"
key_passphrase: "secret"
# Example of waiting for a password
- name: get the Administrator password
community.aws.ec2_win_password:
profile: my-boto-profile
instance_id: i-XXXXXX
region: us-east-1
key_file: "~/aws-creds/my_test_key.pem"
wait: yes
wait_timeout: 45
```
### Authors
* Rick Mendes (@rickmendes)
| programming_docs |
ansible community.aws.ecs_attribute – manage ecs attributes community.aws.ecs\_attribute – manage ecs attributes
====================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ecs_attribute`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update or delete ECS container instance attributes.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore
* python >= 2.6
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **attributes** list / elements=dictionary / required | | List of attributes. |
| | **name** string / required | | The name of the attribute. Up to 128 letters (uppercase and lowercase), numbers, hyphens, underscores, and periods are allowed. |
| | **value** string | | The value of the attribute. Up to 128 letters (uppercase and lowercase), numbers, hyphens, underscores, periods, at signs (@), forward slashes, colons, and spaces are allowed. |
| **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 |
| **cluster** string / required | | The short name or full Amazon Resource Name (ARN) of the cluster that contains the resource to apply attributes. |
| **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\_instance\_id** string / required | | EC2 instance ID of ECS cluster container 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 |
| **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
| The desired state of the attributes. |
| **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: Set attributes
community.aws.ecs_attribute:
state: present
cluster: test-cluster
ec2_instance_id: "{{ ec2_id }}"
attributes:
- flavor: test
- migrated
delegate_to: localhost
- name: Delete attributes
community.aws.ecs_attribute:
state: absent
cluster: test-cluster
ec2_instance_id: "{{ ec2_id }}"
attributes:
- flavor: test
- migrated
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **attributes** complex | always | attributes |
| | **attributes** list / elements=dictionary | success | list of attributes |
| | | **name** string | success | name of the attribute |
| | | **value** string | if present | value of the attribute |
| | **cluster** string | success | cluster name |
| | **ec2\_instance\_id** string | success | ec2 instance id of ecs container instance |
### Authors
* Andrej Svenke (@anryko)
ansible community.aws.ecs_tag – create and remove tags on Amazon ECS resources community.aws.ecs\_tag – create and remove tags on Amazon ECS resources
=======================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ecs_tag`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Creates and removes tags for Amazon ECS resources.
* Resources are referenced by their cluster name.
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 |
| **cluster\_name** string / required | | The name of the cluster whose resources we are tagging. |
| **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 | | The ECS resource name. Required unless *resource\_type=cluster*. |
| **resource\_type** string | **Choices:*** **cluster** ←
* task
* service
* task\_definition
* container
| The type of resource. |
| **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
| Whether the tags should be present or absent on the resource. |
| **tags** dictionary | | A dictionary of tags to add or remove from the resource. If the value provided for a tag is null and *state=absent*, the tag will be removed regardless of its current value. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
Notes
-----
Note
* 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
--------
```
- name: Ensure tags are present on a resource
community.aws.ecs_tag:
cluster_name: mycluster
resource_type: cluster
state: present
tags:
Name: ubervol
env: prod
- name: Remove the Env tag
community.aws.ecs_tag:
cluster_name: mycluster
resource_type: cluster
tags:
Env:
state: absent
- name: Remove the Env tag if it's currently 'development'
community.aws.ecs_tag:
cluster_name: mycluster
resource_type: cluster
tags:
Env: development
state: absent
- name: Remove all tags except for Name from a cluster
community.aws.ecs_tag:
cluster_name: mycluster
resource_type: cluster
tags:
Name: foo
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
* Michael Pechner (@mpechner)
ansible community.aws.ec2_ami_copy – copies AMI between AWS regions, return new image id community.aws.ec2\_ami\_copy – copies AMI between AWS regions, return new image id
==================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_ami_copy`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Copies AMI from a source region to a destination region. **Since version 2.3 this module depends on boto3.**
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 | | An optional human-readable string describing the contents and purpose of the new AMI. |
| **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
| Whether or not the destination snapshots of the copied AMI should be encrypted. |
| **kms\_key\_id** string | | KMS key id used to encrypt the image. If not specified, uses default EBS Customer Master Key (CMK) for your account. |
| **name** string | **Default:**"default" | The name of the new AMI to copy. (As of 2.3 the default is `default`, in prior versions it was `null`.) |
| **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 |
| **source\_image\_id** string / required | | The ID of the AMI in source region that should be copied. |
| **source\_region** string / required | | The source region the AMI should be copied from. |
| **tag\_equality** boolean | **Choices:*** **no** ←
* yes
| Whether to use tags if the source AMI already exists in the target region. If this is set, and all tags match in an existing AMI, the AMI will not be copied again. |
| **tags** dictionary | | A hash/dictionary of tags to add to the new copied AMI: `{"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. |
| **wait** boolean | **Choices:*** **no** ←
* yes
| Wait for the copied AMI to be in state `available` before returning. |
| **wait\_timeout** integer | **Default:**600 | How long before wait gives up, in seconds. Prior to 2.3 the default was `1200`. From 2.3-2.5 this option was deprecated in favor of boto3 waiter defaults. This was reenabled in 2.6 to allow timeouts greater than 10 minutes. |
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: Basic AMI Copy
community.aws.ec2_ami_copy:
source_region: us-east-1
region: eu-west-1
source_image_id: ami-xxxxxxx
- name: AMI copy wait until available
community.aws.ec2_ami_copy:
source_region: us-east-1
region: eu-west-1
source_image_id: ami-xxxxxxx
wait: yes
wait_timeout: 1200 # Default timeout is 600
register: image_id
- name: Named AMI copy
community.aws.ec2_ami_copy:
source_region: us-east-1
region: eu-west-1
source_image_id: ami-xxxxxxx
name: My-Awesome-AMI
description: latest patch
- name: Tagged AMI copy (will not copy the same AMI twice)
community.aws.ec2_ami_copy:
source_region: us-east-1
region: eu-west-1
source_image_id: ami-xxxxxxx
tags:
Name: My-Super-AMI
Patch: 1.2.3
tag_equality: yes
- name: Encrypted AMI copy
community.aws.ec2_ami_copy:
source_region: us-east-1
region: eu-west-1
source_image_id: ami-xxxxxxx
encrypted: yes
- name: Encrypted AMI copy with specified key
community.aws.ec2_ami_copy:
source_region: us-east-1
region: eu-west-1
source_image_id: ami-xxxxxxx
encrypted: yes
kms_key_id: arn:aws:kms:us-east-1:XXXXXXXXXXXX:key/746de6ea-50a4-4bcb-8fbc-e3b29f2d367b
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **image\_id** string | always | AMI ID of the copied AMI **Sample:** ami-e689729e |
### Authors
* Amir Moulavi (@amir343) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#b1d0dcd8c3979285878adcdec4ddd0c7d8979282868a979284838a979285898ad6dcd0d8dd979285878ad2dedc)>
* Tim C (@defunctio) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#ef8b8a899a818c9bc9ccdcd8d4c9ccdaddd4c9ccdbd7d48b8a899a818c9bc9ccdbd9d48680)>
| programming_docs |
ansible community.aws.rds_instance_info – obtain information about one or more RDS instances community.aws.rds\_instance\_info – obtain information about one or more RDS instances
======================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.rds_instance_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Obtain information about one or more RDS instances.
* This module was called `rds_instance_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
* python >= 2.7
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 |
| **db\_instance\_identifier** string | | The RDS instance's unique identifier.
aliases: id |
| **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 filter that specifies one or more DB instances to describe. See <https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBInstances.html>
|
| **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
--------
```
- name: Get information about an instance
community.aws.rds_instance_info:
db_instance_identifier: new-database
register: new_database_info
- name: Get all RDS instances
community.aws.rds_instance_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 |
| --- | --- | --- |
| **instances** complex | always | List of RDS instances |
| | **allocated\_storage** integer | always | Gigabytes of storage allocated to the database **Sample:** 10 |
| | **auto\_minor\_version\_upgrade** boolean | always | Whether minor version upgrades happen automatically **Sample:** True |
| | **availability\_zone** string | always | Availability Zone in which the database resides **Sample:** us-west-2b |
| | **backup\_retention\_period** integer | always | Days for which backups are retained **Sample:** 7 |
| | **ca\_certificate\_identifier** string | always | ID for the CA certificate **Sample:** rds-ca-2015 |
| | **copy\_tags\_to\_snapshot** boolean | always | Whether DB tags should be copied to the snapshot |
| | **db\_instance\_arn** string | always | ARN of the database instance **Sample:** arn:aws:rds:us-west-2:111111111111:db:helloworld-rds |
| | **db\_instance\_class** string | always | Instance class of the database instance **Sample:** db.t2.small |
| | **db\_instance\_identifier** string | always | Database instance identifier **Sample:** helloworld-rds |
| | **db\_instance\_port** integer | always | Port used by the database instance |
| | **db\_instance\_status** string | always | Status of the database instance **Sample:** available |
| | **db\_name** string | always | Name of the database **Sample:** management |
| | **db\_parameter\_groups** complex | always | List of database parameter groups |
| | | **db\_parameter\_group\_name** string | always | Name of the database parameter group **Sample:** psql-pg-helloworld |
| | | **parameter\_apply\_status** string | always | Whether the parameter group has been applied **Sample:** in-sync |
| | **db\_security\_groups** list / elements=string | always | List of security groups used by the database instance |
| | **db\_subnet\_group** complex | always | list of subnet groups |
| | | **db\_subnet\_group\_description** string | always | Description of the DB subnet group **Sample:** My database subnet group |
| | | **db\_subnet\_group\_name** string | always | Name of the database subnet group **Sample:** my-subnet-group |
| | | **subnet\_group\_status** string | always | Subnet group status **Sample:** Complete |
| | | **subnets** complex | always | List of subnets in the subnet group |
| | | | **subnet\_availability\_zone** complex | always | Availability zone of the subnet |
| | | | | **name** string | always | Name of the availability zone **Sample:** us-west-2c |
| | | | **subnet\_identifier** string | always | Subnet ID **Sample:** subnet-abcd1234 |
| | | | **subnet\_status** string | always | Subnet status **Sample:** Active |
| | | **vpc\_id** string | always | VPC id of the subnet group **Sample:** vpc-abcd1234 |
| | **dbi\_resource\_id** string | always | AWS Region-unique, immutable identifier for the DB instance **Sample:** db-AAAAAAAAAAAAAAAAAAAAAAAAAA |
| | **domain\_memberships** list / elements=string | always | List of domain memberships |
| | **endpoint** complex | always | Database endpoint |
| | | **address** string | always | Database endpoint address **Sample:** helloworld-rds.ctrqpe3so1sf.us-west-2.rds.amazonaws.com |
| | | **hosted\_zone\_id** string | always | Route53 hosted zone ID **Sample:** Z1PABCD0000000 |
| | | **port** integer | always | Database endpoint port **Sample:** 5432 |
| | **engine** string | always | Database engine **Sample:** postgres |
| | **engine\_version** string | always | Database engine version **Sample:** 9.5.10 |
| | **iam\_database\_authentication\_enabled** boolean | always | Whether database authentication through IAM is enabled |
| | **instance\_create\_time** string | always | Date and time the instance was created **Sample:** 2017-10-10T04:00:07.434000+00:00 |
| | **kms\_key\_id** string | always | KMS Key ID **Sample:** arn:aws:kms:us-west-2:111111111111:key/abcd1234-0000-abcd-1111-0123456789ab |
| | **latest\_restorable\_time** string | always | Latest time to which a database can be restored with point-in-time restore **Sample:** 2018-05-17T00:03:56+00:00 |
| | **license\_model** string | always | License model **Sample:** postgresql-license |
| | **master\_username** string | always | Database master username **Sample:** dbadmin |
| | **monitoring\_interval** integer | always | Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance |
| | **multi\_az** boolean | always | Whether Multi-AZ is on |
| | **option\_group\_memberships** complex | always | List of option groups |
| | | **option\_group\_name** string | always | Option group name **Sample:** default:postgres-9-5 |
| | | **status** string | always | Status of option group **Sample:** in-sync |
| | **pending\_modified\_values** complex | always | Modified values pending application |
| | **performance\_insights\_enabled** boolean | always | Whether performance insights are enabled |
| | **preferred\_backup\_window** string | always | Preferred backup window **Sample:** 04:00-05:00 |
| | **preferred\_maintenance\_window** string | always | Preferred maintenance window **Sample:** mon:05:00-mon:05:30 |
| | **publicly\_accessible** boolean | always | Whether the DB is publicly accessible |
| | **read\_replica\_db\_instance\_identifiers** list / elements=string | always | List of database instance read replicas |
| | **storage\_encrypted** boolean | always | Whether the storage is encrypted **Sample:** True |
| | **storage\_type** string | always | Storage type of the Database instance **Sample:** gp2 |
| | **tags** complex | always | Tags used by the database instance |
| | **vpc\_security\_groups** complex | always | List of VPC security groups |
| | | **status** string | always | Status of the VPC security group **Sample:** active |
| | | **vpc\_security\_group\_id** string | always | VPC Security Group ID **Sample:** sg-abcd1234 |
### Authors
* Will Thames (@willthames)
* Michael De La Rue (@mikedlr)
ansible community.aws.aws_waf_condition – Create and delete WAF Conditions community.aws.aws\_waf\_condition – Create and delete WAF Conditions
====================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_waf_condition`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Read the AWS documentation for WAF <https://aws.amazon.com/documentation/waf/>
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. |
| **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** list / elements=dictionary | | A list of the filters against which to match. For *type=byte*, valid keys are *field\_to\_match*, *position*, *header*, *transformation* and *target\_string*. For *type=geo*, the only valid key is *country*. For *type=ip*, the only valid key is *ip\_address*. For *type=regex*, valid keys are *field\_to\_match*, *transformation* and *regex\_pattern*. For *type=size*, valid keys are *field\_to\_match*, *transformation*, *comparison* and *size*. For *type=sql*, valid keys are *field\_to\_match* and *transformation*. For *type=xss*, valid keys are *field\_to\_match* and *transformation*. Required when *state=present*. |
| | **comparison** string | **Choices:*** EQ
* NE
* LE
* LT
* GE
* GT
| What type of comparison to perform. Only valid key when *type=size*. |
| | **country** string | | Value of geo constraint (typically a two letter country code). The only valid key when *type=geo*. |
| | **field\_to\_match** string | **Choices:*** uri
* query\_string
* header
* method
* body
| The field upon which to perform the match. Valid when *type=byte*, *type=regex*, *type=sql* or *type=xss*. |
| | **header** string | | Which specific header should be matched. Required when *field\_to\_match=header*. Valid when *type=byte*. |
| | **ip\_address** string | | An IP Address or CIDR to match. The only valid key when *type=ip*. |
| | **position** string | **Choices:*** exactly
* starts\_with
* ends\_with
* contains
* contains\_word
| Where in the field the match needs to occur. Only valid when *type=byte*. |
| | **regex\_pattern** dictionary | | A dict describing the regular expressions used to perform the match. Only valid when *type=regex*. |
| | | **name** string | | A name to describe the set of patterns. |
| | | **regex\_strings** list / elements=string | | A list of regular expressions to match. |
| | **size** integer | | The size of the field (in bytes). Only valid key when *type=size*. |
| | **target\_string** string | | The string to search for. May be up to 50 bytes. Valid when *type=byte*. |
| | **transformation** string | **Choices:*** none
* compress\_white\_space
* html\_entity\_decode
* lowercase
* cmd\_line
* url\_decode
| A transform to apply on the field prior to performing the match. Valid when *type=byte*, *type=regex*, *type=sql* or *type=xss*. |
| **name** string / required | | Name of the Web Application Firewall condition to manage. |
| **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\_filters** boolean | **Choices:*** **no** ←
* yes
| Whether to remove existing filters from a condition if not passed in *filters*. |
| **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
| Whether the condition should be `present` or `absent`. |
| **type** string / required | **Choices:*** byte
* geo
* ip
* regex
* size
* sql
* xss
| The type of matching to perform. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** ←
| When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. |
| **waf\_regional** boolean | **Choices:*** **no** ←
* yes
| Whether to use waf-regional module. |
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: create WAF byte condition
community.aws.aws_waf_condition:
name: my_byte_condition
filters:
- field_to_match: header
position: STARTS_WITH
target_string: Hello
header: Content-type
type: byte
- name: create WAF geo condition
community.aws.aws_waf_condition:
name: my_geo_condition
filters:
- country: US
- country: AU
- country: AT
type: geo
- name: create IP address condition
community.aws.aws_waf_condition:
name: "{{ resource_prefix }}_ip_condition"
filters:
- ip_address: "10.0.0.0/8"
- ip_address: "192.168.0.0/24"
type: ip
- name: create WAF regex condition
community.aws.aws_waf_condition:
name: my_regex_condition
filters:
- field_to_match: query_string
regex_pattern:
name: greetings
regex_strings:
- '[hH]ello'
- '^Hi there'
- '.*Good Day to You'
type: regex
- name: create WAF size condition
community.aws.aws_waf_condition:
name: my_size_condition
filters:
- field_to_match: query_string
size: 300
comparison: GT
type: size
- name: create WAF sql injection condition
community.aws.aws_waf_condition:
name: my_sql_condition
filters:
- field_to_match: query_string
transformation: url_decode
type: sql
- name: create WAF xss condition
community.aws.aws_waf_condition:
name: my_xss_condition
filters:
- field_to_match: query_string
transformation: url_decode
type: xss
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **condition** complex | always | Condition returned by operation. |
| | **byte\_match\_set\_id** string | always | ID for byte match set. **Sample:** c4882c96-837b-44a2-a762-4ea87dbf812b |
| | **byte\_match\_tuples** complex | always | List of byte match tuples. |
| | | **field\_to\_match** complex | always | Field to match. |
| | | | **data** string | success | Which specific header (if type is header). **Sample:** content-type |
| | | | **type** string | success | Type of field **Sample:** HEADER |
| | | **positional\_constraint** string | success | Position in the field to match. **Sample:** STARTS\_WITH |
| | | **target\_string** string | success | String to look for. **Sample:** Hello |
| | | **text\_transformation** string | success | Transformation to apply to the field before matching. **Sample:** NONE |
| | **condition\_id** string | when state is present | Type-agnostic ID for the condition. **Sample:** dd74b1ff-8c06-4a4f-897a-6b23605de413 |
| | **geo\_match\_constraints** complex | when type is geo and state is present | List of geographical constraints. |
| | | **type** string | success | Type of geo constraint. **Sample:** Country |
| | | **value** string | success | Value of geo constraint (typically a country code). **Sample:** AT |
| | **geo\_match\_set\_id** string | when type is geo and state is present | ID of the geo match set. **Sample:** dd74b1ff-8c06-4a4f-897a-6b23605de413 |
| | **ip\_set\_descriptors** complex | when type is ip and state is present | list of IP address filters |
| | | **type** string | always | Type of IP address (IPV4 or IPV6). **Sample:** IPV4 |
| | | **value** string | always | IP address. **Sample:** 10.0.0.0/8 |
| | **ip\_set\_id** string | when type is ip and state is present | ID of condition. **Sample:** 78ad334a-3535-4036-85e6-8e11e745217b |
| | **name** string | when state is present | Name of condition. **Sample:** my\_waf\_condition |
| | **regex\_match\_set\_id** string | when type is regex and state is present | ID of the regex match set. **Sample:** 5ea3f6a8-3cd3-488b-b637-17b79ce7089c |
| | **regex\_match\_tuples** complex | when type is regex and state is present | List of regex matches. |
| | | **field\_to\_match** complex | success | Field on which the regex match is applied. |
| | | | **type** string | when type is regex and state is present | The field name. **Sample:** QUERY\_STRING |
| | | **regex\_pattern\_set\_id** string | success | ID of the regex pattern. **Sample:** 6fdf7f2d-9091-445c-aef2-98f3c051ac9e |
| | | **text\_transformation** string | success | transformation applied to the text before matching **Sample:** NONE |
| | **size\_constraint\_set\_id** string | when type is size and state is present | ID of the size constraint set. **Sample:** de84b4b3-578b-447e-a9a0-0db35c995656 |
| | **size\_constraints** complex | when type is size and state is present | List of size constraints to apply. |
| | | **comparison\_operator** string | success | Comparison operator to apply. **Sample:** GT |
| | | **field\_to\_match** complex | success | Field on which the size constraint is applied. |
| | | | **type** string | success | Field name. **Sample:** QUERY\_STRING |
| | | **size** integer | success | Size to compare against the field. **Sample:** 300 |
| | | **text\_transformation** string | success | Transformation applied to the text before matching. **Sample:** NONE |
| | **sql\_injection\_match\_set\_id** string | when type is sql and state is present | ID of the SQL injection match set. **Sample:** de84b4b3-578b-447e-a9a0-0db35c995656 |
| | **sql\_injection\_match\_tuples** complex | when type is sql and state is present | List of SQL injection match sets. |
| | | **field\_to\_match** complex | success | Field on which the SQL injection match is applied. |
| | | | **type** string | success | Field name. **Sample:** QUERY\_STRING |
| | | **text\_transformation** string | success | Transformation applied to the text before matching. **Sample:** URL\_DECODE |
| | **xss\_match\_set\_id** string | when type is xss and state is present | ID of the XSS match set. **Sample:** de84b4b3-578b-447e-a9a0-0db35c995656 |
| | **xss\_match\_tuples** complex | when type is xss and state is present | List of XSS match sets. |
| | | **field\_to\_match** complex | success | Field on which the XSS match is applied. |
| | | | **type** string | success | Field name **Sample:** QUERY\_STRING |
| | | **text\_transformation** string | success | transformation applied to the text before matching. **Sample:** URL\_DECODE |
### Authors
* Will Thames (@willthames)
* Mike Mochan (@mmochan)
| programming_docs |
ansible community.aws.ec2_eip_info – List EC2 EIP details community.aws.ec2\_eip\_info – List EC2 EIP details
===================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.ec2_eip_info`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* List details of EC2 Elastic IP addresses.
* This module was called `ec2_eip_facts` before Ansible 2.9. The usage did not change.
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. |
| **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 filter value. See <https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-addresses.html#options> for possible filters. Filter names and values are case sensitive. |
| **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 or the AWS region,
# see the AWS Guide for details.
- name: List all EIP addresses in the current region.
community.aws.ec2_eip_info:
register: regional_eip_addresses
- name: List all EIP addresses for a VM.
community.aws.ec2_eip_info:
filters:
instance-id: i-123456789
register: my_vm_eips
- ansible.builtin.debug:
msg: "{{ my_vm_eips.addresses | json_query(\"[?private_ip_address=='10.0.0.5']\") }}"
- name: List all EIP addresses for several VMs.
community.aws.ec2_eip_info:
filters:
instance-id:
- i-123456789
- i-987654321
register: my_vms_eips
- name: List all EIP addresses using the 'Name' tag as a filter.
community.aws.ec2_eip_info:
filters:
tag:Name: www.example.com
register: my_vms_eips
- name: List all EIP addresses using the Allocation-id as a filter
community.aws.ec2_eip_info:
filters:
allocation-id: eipalloc-64de1b01
register: my_vms_eips
# Set the variable eip_alloc to the value of the first allocation_id
# and set the variable my_pub_ip to the value of the first public_ip
- ansible.builtin.set_fact:
eip_alloc: my_vms_eips.addresses[0].allocation_id
my_pub_ip: my_vms_eips.addresses[0].public_ip
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **addresses** list / elements=string | on success | Properties of all Elastic IP addresses matching the provided filters. Each element is a dict with all the information related to an EIP. **Sample:** [{'allocation\_id': 'eipalloc-64de1b01', 'association\_id': 'eipassoc-0fe9ce90d6e983e97', 'domain': 'vpc', 'instance\_id': 'i-01020cfeb25b0c84f', 'network\_interface\_id': 'eni-02fdeadfd4beef9323b', 'network\_interface\_owner\_id': '0123456789', 'private\_ip\_address': '10.0.0.1', 'public\_ip': '54.81.104.1', 'tags': {'Name': 'test-vm-54.81.104.1'}}] |
### Authors
* Brad Macpherson (@iiibrad)
ansible community.aws.s3_bucket_notification – Creates, updates or deletes S3 Bucket notification for lambda community.aws.s3\_bucket\_notification – Creates, updates or deletes S3 Bucket notification for lambda
======================================================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.s3_bucket_notification`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module allows the management of AWS Lambda function bucket event mappings via the Ansible framework. Use module [community.aws.lambda](lambda_module#ansible-collections-community-aws-lambda-module) to manage the lambda function itself, [community.aws.lambda\_alias](lambda_alias_module#ansible-collections-community-aws-lambda-alias-module) to manage function aliases and [community.aws.lambda\_policy](lambda_policy_module#ansible-collections-community-aws-lambda-policy-module) to modify lambda permissions.
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 |
| **bucket\_name** string / required | | S3 bucket name. |
| **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 |
| **event\_name** string / required | | Unique name for event notification on bucket. |
| **events** list / elements=string | **Choices:*** s3:ObjectCreated:\*
* s3:ObjectCreated:Put
* s3:ObjectCreated:Post
* s3:ObjectCreated:Copy
* s3:ObjectCreated:CompleteMultipartUpload
* s3:ObjectRemoved:\*
* s3:ObjectRemoved:Delete
* s3:ObjectRemoved:DeleteMarkerCreated
* s3:ObjectRestore:Post
* s3:ObjectRestore:Completed
* s3:ReducedRedundancyLostObject
| Events that you want to be triggering notifications. You can select multiple events to send to the same destination, you can set up different events to send to different destinations, and you can set up a prefix or suffix for an event. However, for each bucket, individual events cannot have multiple configurations with overlapping prefixes or suffixes that could match the same object key. Required when *state=present*. |
| **lambda\_alias** string | | Name of the Lambda function alias. Mutually exclusive with *lambda\_version*. |
| **lambda\_function\_arn** string | | The ARN of the lambda function.
aliases: function\_arn |
| **lambda\_version** integer | | Version of the Lambda function. Mutually exclusive with *lambda\_alias*. |
| **prefix** string | | Optional prefix to limit the notifications to objects with keys that start with matching characters. |
| **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
| Describes the desired state. |
| **suffix** string | | Optional suffix to limit the notifications to objects with keys that end with matching characters. |
| **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 heavily depends on [community.aws.lambda\_policy](lambda_policy_module#ansible-collections-community-aws-lambda-policy-module) as you need to allow `lambda:InvokeFunction` permission for your lambda function.
* 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
--------
```
---
# Example that creates a lambda event notification for a bucket
- name: Process jpg image
community.aws.s3_bucket_notification:
state: present
event_name: on_file_add_or_remove
bucket_name: test-bucket
function_name: arn:aws:lambda:us-east-2:526810320200:function:test-lambda
events: ["s3:ObjectCreated:*", "s3:ObjectRemoved:*"]
prefix: images/
suffix: .jpg
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **notification\_configuration** list / elements=string | success | list of currently applied notifications |
### Authors
* XLAB d.o.o. (@xlab-si)
* Aljaz Kosir (@aljazkosir)
* Miha Plesko (@miha-plesko)
ansible community.aws.aws_secret – Manage secrets stored in AWS Secrets Manager. community.aws.aws\_secret – Manage secrets stored in AWS Secrets Manager.
=========================================================================
Note
This plugin is part of the [community.aws collection](https://galaxy.ansible.com/community/aws) (version 1.5.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 community.aws`.
To use it in a playbook, specify: `community.aws.aws_secret`.
New in version 1.0.0: of community.aws
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update, and delete secrets stored in AWS Secrets Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* boto
* boto3
* botocore>=1.10.0
* 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 | | Specifies a user-provided description of the secret. |
| **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 |
| **kms\_key\_id** string | | Specifies the ARN or alias of the AWS KMS customer master key (CMK) to be used to encrypt the `secret\_string` or `secret\_binary` values in the versions stored in this secret. |
| **name** string / required | | Friendly name for the secret you are creating. |
| **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 |
| **recovery\_window** integer | **Default:**30 | Only used if state is absent. Specifies the number of days that Secrets Manager waits before it can delete the secret. If set to 0, the deletion is forced without recovery. |
| **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 |
| **rotation\_interval** integer | **Default:**30 | Specifies the number of days between automatic scheduled rotations of the secret. |
| **rotation\_lambda** string | | Specifies the ARN of the Lambda function that can rotate the secret. |
| **secret** string | **Default:**"" | Specifies string or binary data that you want to encrypt and store in the new version of the secret. |
| **secret\_type** string | **Choices:*** binary
* **string** ←
| Specifies the type of data that you want to encrypt. |
| **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
| Whether the secret should be exist or not. |
| **tags** dictionary | | Specifies a list of user-defined tags that are attached to the secret. |
| **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: Add string to AWS Secrets Manager
community.aws.aws_secret:
name: 'test_secret_string'
state: present
secret_type: 'string'
secret: "{{ super_secret_string }}"
- name: remove string from AWS Secrets Manager
community.aws.aws_secret:
name: 'test_secret_string'
state: absent
secret_type: 'string'
secret: "{{ super_secret_string }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **secret** complex | always | The secret information |
| | **arn** string | always | The ARN of the secret **Sample:** arn:aws:secretsmanager:eu-west-1:xxxxxxxxxx:secret:xxxxxxxxxxx |
| | **last\_accessed\_date** string | always | The date the secret was last accessed **Sample:** 2018-11-20T01:00:00+01:00 |
| | **last\_changed\_date** string | always | The date the secret was last modified. **Sample:** 2018-11-20T12:16:38.433000+01:00 |
| | **name** string | always | The secret name. **Sample:** my\_secret |
| | **rotation\_enabled** boolean | always | The secret rotation status. |
| | **version\_ids\_to\_stages** dictionary | always | Provide the secret version ids and the associated secret stage. **Sample:** {'dc1ed59b-6d8e-4450-8b41-536dfe4600a9': ['AWSCURRENT']} |
### Authors
* REY Remi (@rrey)
| 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.