Ansible 2.10 Porting Guide¶
This section discusses the behavioral changes between Ansible 2.9 and Ansible 2.10.
It is intended to assist in updating your playbooks, plugins and other parts of your Ansible infrastructure so they will work with this version of Ansible.
We suggest you read this page along with Ansible Changelog for 2.10 to understand what updates you may need to make.
This document is part of a collection on porting. The complete list of porting guides can be found at porting guides.
Topics
Command Line¶
No notable changes
Deprecated¶
- Windows Server 2008 and 2008 R2 will no longer be supported or tested in the next Ansible release, see Are Server 2008, 2008 R2 and Windows 7 supported?.
- The win_stat module has removed the deprecated
get_md55option andmd5return value. - The win_psexec module has removed the deprecated
extra_optsoption.
Modules¶
Deprecation notices¶
The following modules will be removed in Ansible 2.14. Please update your playbooks accordingly.
- ldap_attr use ldap_attrs instead.
- vyos_static_route use vyos_static_routes instead.
The following functionality will be removed in Ansible 2.14. Please update update your playbooks accordingly.
- The openssl_csr module’s option
versionno longer supports values other than1(the current only standardized CSR version). - docker_container: the
trust_image_contentoption will be removed. It has always been ignored by the module. - iam_managed_policy: the
fail_on_deleteoption will be removed. It has always been ignored by the module. - s3_lifecycle: the
requester_paysoption will be removed. It has always been ignored by the module. - s3_sync: the
retriesoption will be removed. It has always been ignored by the module. - The return values
errandoutof docker_stack have been deprecated. Usestdoutandstderrfrom now on instead. - cloudformation: the
template_formatoption will be removed. It has been ignored by the module since Ansible 2.3. - data_pipeline: the
versionoption will be removed. It has always been ignored by the module. - ec2_eip: the
wait_timeoutoption will be removed. It has had no effect since Ansible 2.3. - ec2_key: the
waitoption will be removed. It has had no effect since Ansible 2.5. - ec2_key: the
wait_timeoutoption will be removed. It has had no effect since Ansible 2.5. - ec2_lc: the
associate_public_ip_addressoption will be removed. It has always been ignored by the module. - ec2_tag: Support for
listas a state has been deprecated. Theec2_tag_infocan be used to fetch the tags on an EC2 resource. - iam_policy: the
policy_documentoption will be removed. To maintain the existing behavior use thepolicy_jsonoption and read the file with thelookupplugin. - redfish_config: the
bios_attribute_nameandbios_attribute_valueoptions will be removed. To maintain the existing behavior use thebios_attributesoption instead. - clc_aa_policy: the
waitparameter will be removed. It has always been ignored by the module. - redfish_config, redfish_command: the behavior to select the first System, Manager, or Chassis resource to modify when multiple are present will be removed. Use the new
resource_idoption to specify target resource to modify. - win_domain_controller: the
log_pathoption will be removed. This was undocumented and only related to debugging information for module development. - win_package: the
usernameandpasswordoptions will be removed. The same functionality can be done by usingbecome: yesandbecome_flags: logon_type=new_credentials logon_flags=netcredentials_onlyon the task. - win_package: the
ensurealias for thestateoption will be removed. Please usestateinstead ofensure. - win_package: the
productidalias for theproduct_idoption will be removed. Please useproduct_idinstead ofproductid.
The following functionality will change in Ansible 2.14. Please update update your playbooks accordingly.
- The docker_container module has a new option,
container_default_behavior, whose default value will change fromcompatibilitytono_defaults. Set to an explicit value to avoid deprecation warnings. - The docker_container module’s
network_modeoption will be set by default to the name of the first network innetworksif at least one network is given andnetworks_cli_compatibleistrue(will be default from Ansible 2.12 on). Set to an explicit value to avoid deprecation warnings if you specify networks and setnetworks_cli_compatibletotrue. The current default (not specifying it) is equivalent to the valuedefault. - ec2: the
groupandgroup_idoptions will become mutually exclusive. Currentlygroup_idis ignored if you pass both. - iam_policy: the default value for the
skip_duplicatesoption will change fromtruetofalse. To maintain the existing behavior explicitly set it totrue. - iam_role: the
purge_policiesoption (also know aspurge_policy) default value will change fromtruetofalse - elb_network_lb: the default behaviour for the
stateoption will change fromabsenttopresent. To maintain the existing behavior explicitly set state toabsent. - vmware_tag_info: the module will not return
tag_factssince it does not return multiple tags with the same name and different category id. To maintain the existing behavior usetag_infowhich is a list of tag metadata.
The following modules will be removed in Ansible 2.14. Please update your playbooks accordingly.
vmware_dns_configuse vmware_host_dns instead.
Noteworthy module changes¶
- The
datacenteroption has been removed from vmware_guest_find - The options
ip_addressandsubnet_maskhave been removed from vmware_vmkernel; use the suboptionsip_addressandsubnet_maskof thenetworkoption instead. - Ansible modules created with
add_file_common_args=Trueadded a number of undocumented arguments which were mostly there to ease implementing certain action plugins. The undocumented argumentssrc,follow,force,content,backup,remote_src,regexp,delimiter, anddirectory_modeare now no longer added. Modules relying on these options to be added need to specify them by themselves. - The
AWSRetrydecorator no longer catchesNotFoundexceptions by default.NotFoundexceptions need to be explicitly added usingcatch_extra_error_codes. Some AWS modules may see an increase in transient failures due to AWS’s eventual consistency model. - vmware_datastore_maintenancemode now returns
datastore_statusinstead of Ansible internal keyresults. - vmware_host_kernel_manager now returns
host_kernel_statusinstead of Ansible internal keyresults. - vmware_host_ntp now returns
host_ntp_statusinstead of Ansible internal keyresults. - vmware_host_service_manager now returns
host_service_statusinstead of Ansible internal keyresults. - vmware_tag now returns
tag_statusinstead of Ansible internal keyresults. - The deprecated
recurseoption in pacman module has been removed, you should useextra_args=--recursiveinstead. - vmware_guest_custom_attributes module does not require VM name which was a required parameter for releases prior to Ansible 2.10.
- zabbix_action no longer requires
esc_periodandevent_sourcearguments whenstate=absent. - zabbix_proxy deprecates
interfacesub-optionstypeandmainwhen proxy type is set to passive viastatus=passive. Make sure these suboptions are removed from your playbook as they were never supported by Zabbix in the first place. - gitlab_user no longer requires
name,emailandpasswordarguments whenstate=absent. - win_pester no longer runs all
*.ps1file in the directory specified due to it executing potentially unknown scripts. It will follow the default behaviour of only running tests for files that are like*.tests.ps1which is built into Pester itself - win_find has been refactored to better match the behaviour of the
findmodule. Here is what has changed: - When the directory specified by
pathsdoes not exist or is a file, it will no longer fail and will just warn the user - Junction points are no longer reported as
islnk, useisjunctionto properly report these files. This behaviour matches the win_stat - Directories no longer return a
size, this matches thestatandfindbehaviour and has been removed due to the difficulties in correctly reporting the size of a directory
- When the directory specified by
- win_find has been refactored to better match the behaviour of the
- docker_container no longer passes information on non-anonymous volumes or binds as
Volumesto the Docker daemon. This increases compatibility with thedockerCLI program. Note that if you specifyvolumes: strictincomparisons, this could cause existing containers created with docker_container from Ansible 2.9 or earlier to restart. - docker_container’s support for port ranges was adjusted to be more compatible to the
dockercommand line utility: a one-port container range combined with a multiple-port host range will no longer result in only the first host port be used, but the whole range being passed to Docker so that a free port in that range will be used. - purefb_fs no longer supports the deprecated
nfsoption. This has been superceeded bynfsv3. - nxos_igmp_interface no longer supports the deprecated
oif_prefixandoif_sourceoptions. These have been superceeded byoif_ps. - aws_s3 can now delete versioned buckets even when they are not empty - set mode to delete to delete a versioned bucket and everything in it.
- The parameter
messagein grafana_dashboard module is renamed tocommit_messagesincemessageis used by Ansible Core engine internally. - The parameter
messagein datadog_monitor module is renamed tonotification_messagesincemessageis used by Ansible Core engine internally. - The parameter
messagein bigpanda module is renamed todeployment_messagesincemessageis used by Ansible Core engine internally.
Plugins¶
Lookup plugin names case-sensitivity¶
- Prior to Ansible
2.10lookup plugin names passed in as an argument to thelookup()function were treated as case-insensitive as opposed to lookups invoked viawith_<lookup_name>.2.10brings consistency tolookup()andwith_to be both case-sensitive.
Noteworthy plugin changes¶
- The
hashi_vaultlookup plugin now returns the latest version when using the KV v2 secrets engine. Previously, it returned all versions of the secret which required additional steps to extract and filter the desired version. - Some undocumented arguments from
FILE_COMMON_ARGUMENTShave been removed; plugins using these, in particular action plugins, need to be adjusted. The undocumented arguments which were removed aresrc,follow,force,content,backup,remote_src,regexp,delimiter, anddirectory_mode.
Porting custom scripts¶
No notable changes
Networking¶
No notable changes