We suggest you read this page along with the Ansible 4 Changelog to understand what updates you may need to make.
jinja2_native setting now does not affect the template module which implicitly returns strings. For the template lookup there is a new argument jinja2_native (off by default) to control that functionality. The rest of the Jinja2 expressions still operate based on the jinja2_native setting.ansible-galaxy login command has been removed, as the underlying API it used for GitHub auth has been shut down. Publishing roles or collections to Galaxy with ansible-galaxy now requires that a Galaxy API token be passed to the CLI using a token file (default location ~/.ansible/galaxy_token) or (insecurely) with the --token argument to ansible-galaxy.The constant ansible.module_utils.basic._CHECK_ARGUMENT_TYPES_DISPATCHER is deprecated. Use ansible.module_utils.common.parameters.DEFAULT_TYPE_VALIDATORS instead.
AnsibleModule
With the move to ArgumentSpecValidator for performing argument spec validation, the following private methods in AnsibleModule have been removed:
_check_argument_types()_check_argument_values()_check_arguments()_check_mutually_exclusive() –> ansible.module_utils.common.validation.check_mutually_exclusive()
_check_required_arguments() –> ansible.module_utils.common.validation.check_required_arguments()
_check_required_by() –> ansible.module_utils.common.validation.check_required_by()
_check_required_if() –> ansible.module_utils.common.validation.check_required_if()
_check_required_one_of() –> ansible.module_utils.common.validation.check_required_one_of()
_check_required_together() –> ansible.module_utils.common.validation.check_required_together()
_check_type_bits() –> ansible.module_utils.common.validation.check_type_bits()
_check_type_bool() –> ansible.module_utils.common.validation.check_type_bool()
_check_type_bytes() –> ansible.module_utils.common.validation.check_type_bytes()
_check_type_dict() –> ansible.module_utils.common.validation.check_type_dict()
_check_type_float() –> ansible.module_utils.common.validation.check_type_float()
_check_type_int() –> ansible.module_utils.common.validation.check_type_int()
_check_type_jsonarg() –> ansible.module_utils.common.validation.check_type_jsonarg()
_check_type_list() –> ansible.module_utils.common.validation.check_type_list()
_check_type_path() –> ansible.module_utils.common.validation.check_type_path()
_check_type_raw() –> ansible.module_utils.common.validation.check_type_raw()
_check_type_str() –> ansible.module_utils.common.validation.check_type_str()
_count_terms() –> ansible.module_utils.common.validation.count_terms()
_get_wanted_type()_handle_aliases()_handle_no_log_values()_handle_options()_set_defaults()_set_fallbacks()Modules or plugins using these private methods should use the public functions in ansible.module_utils.common.validation or ArgumentSpecValidator.validate() if no public function was listed above.
ansible.module_utils.common.parameters
The following functions in ansible.module_utils.common.parameters are now private and should not be used directly. Use ArgumentSpecValidator.validate() instead.
list_no_log_valueslist_deprecationshandle_aliasesansible < 2.10 or from ansible-base and using pip, you must pip uninstall ansible or pip uninstall ansible-base before installing ansible-core to avoid conflicts.ansible-core 2.11 still works with the same versions of Python that ansible-base 2.10 worked with, however 2.11 emits a warning when running on a controller node with a Python version less than 3.8. This warning can be disabled by setting ANSIBLE_CONTROLLER_PYTHON_WARNING=False in your environment. ansible-core 2.12 will require Python 3.8 or greater.choices field, so any settings that violate it and were ignored in 2.10 cause an error in 2.11. For example, ANSIBLE_COLLECTIONS_ON_ANSIBLE_VERSION_MISMATCH=0 now causes an error (valid choices are ignore, warn or error).ansible-galaxy command now uses resolvelib for resolving dependencies. In most cases this should not make a user-facing difference beyond being more performant, but we note it here for posterity and completeness.module_utils into any modules you maintain, you may now mark the import as optional during the module payload build by wrapping the import statement in a try or if block. This allows modules to use module_utils that may not be present in all versions of Ansible or a collection, and to perform arbitrary recovery or fallback actions during module runtime.apt_key module has explicitly defined file as mutually exclusive with data, keyserver and url. They cannot be used together anymore.meta module now supports tags for user-defined tasks. Set the task’s tags to ‘always’ to maintain the previous behavior. Internal meta tasks continue to always run.The following modules no longer exist:
No notable changes
ansible_virtualization_type now tries to report a more accurate result than xen when virtualized and not running on Xen.virtualization_tech_guest and virtualization_tech_host keys. These are lists of virtualization technologies that a guest is a part of, or that a host provides, respectively. As an example, if you set up a host to provide both KVM and VirtualBox, both values are included in virtualization_tech_host. Similarly, a podman container running on a VM powered by KVM has a virtualization_tech_guest of ["kvm", "podman", "container"].filter type is changed from string to list in the setup module in order to use more than one filter. Previous behavior (using a string) still remains and works as a single filter.CachePluginAdjudicator.flush() now calls the underlying cache plugin’s flush() instead of only deleting keys that it knows about. Inventory plugins should use delete() to remove any specific keys. As a user, this means that when an inventory plugin calls its clear_cache() method, facts could also be flushed from the cache. To work around this, users can configure inventory plugins to use a cache backend that is independent of the facts cache.meta task execution is now sent to v2_playbook_on_task_start like any other task. By default, only explicit meta tasks are sent there. Callback plugins can opt-in to receiving internal, implicitly created tasks to act on those as well, as noted in the plugin development documentation.choices are now validated, so plugins that were using incorrect or incomplete choices issue an error in 2.11 if the value provided does not match. This has a simple fix: update the entries in choices to match reality.No notable changes
fortios_monitor_fact and fortios_log_fact.[lookup_hashi_vault] section in the ansible.cfg file is deprecated and will be removed in collection version 3.0.0. Instead, the section [hashi_vault_collection] can be used, which will apply to all plugins in the collection going forward (https://github.com/ansible-collections/community.hashi_vault/pull/144).nxos_ntp, nxos_ntp_options, nxos_ntp_auth modules.look_for_keys was set automatically based on the values of the password and private_key_file options passed to network_cli. This option can now be set explicitly, and the automatic setting of look_for_keys will be removed after 2024-01-01 (https://github.com/ansible-collections/ansible.netcommon/pull/271).unable to perform the import or export operation because there are pending attribute changes or a configuration job is in progress. Wait for the job to complete and run the task again.command_handling’s default value, compatibility, is deprecated and will change to correct in community.docker 3.0.0. A deprecation warning is emitted by the module in cases where the behavior will change. Please note that ansible-core will output a deprecation warning only once, so if it is shown for an earlier task, there could be more tasks with this warning where it is not shown (https://github.com/ansible-collections/community.docker/pull/186).2.0.0 of community.hashi_vault (https://github.com/ansible-collections/community.hashi_vault/issues/81).unable to perform the import or export operation because there are pending attribute changes or a configuration job is in progress. Wait for the job to complete and run the task again.community.kubernetes., please update them to kubernetes.core. now. Note that kubernetes.core has been included in Ansible since Ansible 3.0.0 (https://github.com/ansible-community/community-topics/issues/22).filtered_reason return value for each filtered up in favour of filtered_reasons. This has been done to show all the reasons why an update was filtered and not just the first reason.use_scheduled_task option as it is no longer used.whitelist and blacklist options in favour of accept_list and reject_list respectively to conform to the new standards used in Ansible for these types of options.availability_zone and instance_names (https://github.com/ansible-collections/community.general/issues/2429).functions because it was not used in the code (https://github.com/ansible-collections/community.general/pull/2845).2.0.0 of community.hashi_vault (https://github.com/ansible-collections/community.hashi_vault/issues/81).unable to perform the import or export operation because there are pending attribute changes or a configuration job is in progress. Wait for the job to complete and run the task again.as_single_query option will be changed to yes in community.postgresql 2.0.0 (https://github.com/ansible-collections/community.postgresql/issues/85).fortios_configuration_fact to use multiple selectors concurrently.check_mode in all cofigurationAPI-based modules.fortios_configuration_fact and fortios_monitor_fact.firewall_central_snat_map.shutdown_timeout and shutdown_timeout_sec which has not done anything since Ansible 2.5.ignore_errors: True, this ability will be removed in a future version. Use ignore_unreachable: True to ignore unreachable hosts instead. - https://github.com/ansible-collections/ansible.windows/issues/62
docker_swarm connection plugin and docker_compose and docker_stack*` modules - the current default ``localhost for tls_hostname is deprecated. In community.docker 2.0.0 it will be computed from docker_host instead (https://github.com/ansible-collections/community.docker/pull/134).ipaddress will be removed in community.general 4.0.0. Please switch to ipaddress from the Python 3 standard library, or from pypi, if your code relies on the vendored version of ipaddress (https://github.com/ansible-collections/community.general/pull/2459).backupsenabled is deprecated and will be removed in community.general 5.0.0 (https://github.com/ansible-collections/community.general/pull/2410).ipaddress installed when used with Python 2 from community.general 4.0.0 on. ipaddress is part of the Python 3 standard library, but can be installed for Python 2 from pypi (https://github.com/ansible-collections/community.general/pull/2459).ipaddress installed when used with Python 2 from community.general 4.0.0 on. ipaddress is part of the Python 3 standard library, but can be installed for Python 2 from pypi (https://github.com/ansible-collections/community.general/pull/2459).pylint sanity test no longer correctly detects “bad” variable names for non-constants. See issue 3701 for additional details.unable to perform the import or export operation because there are pending attribute changes or a configuration job is in progress. Wait for the job to complete and run the task again.unable to process the request because an error occurred. If the issue persists, report it to the system administrator.--force being present.ansible_virtualization_type) now returns a more accurate value by checking the value of the machdep.hypervisor sysctl key. This change is breaking because in some cases previously, we would erroneously report xen even when the target is not running on Xen. This prevents that behavior in most cases. (https://github.com/ansible/ansible/issues/69352)resolvelib. (https://github.com/ansible/ansible/issues/71784)meta module now supports tags for user-defined tasks. Internal meta tasks continue to always run. (https://github.com/ansible/ansible/issues/64558)join_token is specified, a returned join token with the same value will be replaced by VALUE_SPECIFIED_IN_NO_LOG_PARAMETER. Make sure that you do not blindly use the join tokens from the return value of this module when the module is invoked with join_token specified! This breaking change appears in a minor release since it is necessary to fix a security issue (https://github.com/ansible-collections/community.docker/pull/103).If you use Ansible 2.9 and these plugins or modules from this collection, community.general 3.0.0 results in errors when trying to use the DellEMC content by FQCN, like community.general.idrac_firmware. Since Ansible 2.9 is not able to use redirections, you will have to adjust your playbooks and roles manually to use the new FQCNs (dellemc.openmanage.idrac_firmware for the previous example) and to make sure that you have dellemc.openmanage installed.
If you use ansible-base 2.10 or newer and did not install Ansible 4.0.0, but installed (and/or upgraded) community.general manually, you need to make sure to also install the dellemc.openmanage collection if you are using any of these plugins or modules. While ansible-base 2.10 or newer can use the redirects that community.general 3.0.0 adds, the collection they point to (such as dellemc.openmanage) must be installed for them to work.
frontend_cookie_secret return value now contains a placeholder string instead of the module’s frontend_cookie_secret parameter (https://github.com/ansible-collections/community.general/pull/1736).foreman_ to avoid clashes with similarly named variables from roles outside this collection.--force flag. The collection’s dependencies will also be updated if necessary with the new requirements. Use --upgrade to force transitive dependency updates.ArgumentSpecValidator class for validating argument spec and remove private methods related to argument spec validation. Any modules using private methods should now use the ArgumentSpecValidator class or the appropriate validation function.resolvelib >= 0.5.3, < 0.6.0 a direct dependency of ansible-core. Refs: - https://github.com/sarugaku/resolvelib - https://pypi.org/p/resolvelib - https://pradyunsg.me/blog/2020/03/27/pip-resolver-testing
--upgrade option with ansible-galaxy collection install.ArgumentSpecValidator class for validating parameters against an argument spec outside of AnsibleModule (https://github.com/ansible/ansible/pull/73335)centos6 and default test containers now use a PyPI proxy container to access PyPI when Python 2.6 is used. This allows tests running under Python 2.6 to continue functioning even though PyPI is discontinuing support for non-SNI capable clients.ansible_network_single_user_mode and ansible_network_import_modules - Please refer to ansible.netcommon changelog for more details.changelog <https://github.com/ansible-collections/ansible.netcommon/blob/main/changelogs/CHANGELOG.rst#ansible-netcommon-collection-release-notes> for more details.ansible_network_single_user_mode and ansible_network_import_modules.ansible_network_single_user_mode and ansible_network_import_modules.ansible_network_single_user_mode and ansible_network_import_modules.ansible_network_single_user_mode and ansible_network_import_modules.Is_Slave and Is_Master return values will be replaced with Is_Primary and Is_Replica in community.mysql 3.0.0 (https://github.com/ansible-collections/community.mysql/pull/147).state option containing master will be finally replaced with the alternative primary choices in community.mysql 3.0.0, add deprecation warnings (https://github.com/ansible-collections/community.mysql/pull/150).getslave, startslave, stopslave, resetslave, resetslaveall` and the master_use_gtid option ``slave_pos are deprecated (see the alternative values) and will be removed in community.mysql 3.0.0 (https://github.com/ansible-collections/community.mysql/pull/97).Is_Slave and Is_Master will be replaced with Is_Replica and Is_Primary in community.mysql 3.0.0 (https://github.com/ansible-collections/community.mysql/issues/145).SLAVE in messages returned by the module will be changed to REPLICA in community.mysql 2.0.0 (https://github.com/ansible-collections/community.mysql/issues/98).master in messages returned by the module will be replaced with primary in community.mysql 3.0.0 (https://github.com/ansible-collections/community.mysql/issues/145).slave in messages returned by the module replaced with replica (https://github.com/ansible-collections/community.mysql/issues/98).REQUIRESSL is an alias for the ssl key in the tls_requires option in community.mysql 2.0.0 and support will be dropped altogether in community.mysql 3.0.0 (https://github.com/ansible-collections/community.mysql/issues/121).ansible_network_single_user_mode and ansible_network_import_modules.ansible_network_single_user_mode and ansible_network_import_modules
SharedPluginLoaderObj class from ansible.plugins.strategy. It was deprecated in favor of using the standard plugin loader._get_item() alias from callback plugin base class which had been deprecated in favor of _get_item_label().ansible.constants.BECOME_METHODS has been removed.ansible.constants.get_config() has been removed.ansible.constants.mk_boolean() has been removed.with_* loops are no longer optimized for modules whose name parameters can take lists (mostly package managers). Use name instead of looping over individual names with with_items and friends.The ome_device_info, idrac_firmware and idrac_server_config_profile modules have now been migrated from community.general to the dellemc.openmanage Ansible collection. If you use ansible-base 2.10 or newer, redirections have been provided.
If you use Ansible 2.9 and installed this collection, you need to adjust the FQCNs (community.general.idrac_firmware → dellemc.openmanage.idrac_firmware) and make sure to install the dellemc.openmanage collection.
token parameter. Use project_id and project_key instead (https://github.com/ansible-collections/community.general/pull/1926).message has been removed. Use deployment_message instead (https://github.com/ansible-collections/community.general/pull/1926).message has been removed. Use msg instead (https://github.com/ansible-collections/community.general/pull/1926).wait parameter has been removed. It did not have any effect (https://github.com/ansible-collections/community.general/pull/1926).message has been removed. Use notification_message instead (https://github.com/ansible-collections/community.general/pull/1926).liveserver has been removed (https://github.com/ansible-collections/community.general/pull/1926).manager_attribute_name and manager_attribute_value have been removed. Use manager_attributes instead (https://github.com/ansible-collections/community.general/pull/1926).thirsty has been removed. Use force instead (https://github.com/ansible-collections/community.general/pull/1926).params parameter is now completely removed. Using it already triggered an error since community.general 0.1.2 (https://github.com/ansible-collections/community.general/pull/2257).feed_client_cert parameter no longer defaults to the value of the client_cert parameter (https://github.com/ansible-collections/community.general/pull/1926).feed_client_key parameter no longer defaults to the value of the client_key parameter (https://github.com/ansible-collections/community.general/pull/1926).ca_cert has been removed. Use feed_ca_cert instead (https://github.com/ansible-collections/community.general/pull/1926).service removed (https://github.com/ansible-collections/community.general/pull/2020).resource_id option to specify the target ID (https://github.com/ansible-collections/community.general/pull/1926).bios_attribute_name and bios_attribute_value have been removed. Use bios_attributes instead (https://github.com/ansible-collections/community.general/pull/1926).apply parameter has been removed. This is the default mode, so simply removing it will not change the behavior (https://github.com/ansible-collections/community.general/pull/1926).force parameter has been removed. It did not have any effect (https://github.com/ansible-collections/community.general/pull/1926).community.network.ce_sflow parameters: rate_limit, rate_limit_slot, and forward_enp_slot have been removed (https://github.com/ansible-collections/community.network/pull/255).community.network.sros netconf plugin has been removed. Use nokia.sros.md instead (https://github.com/ansible-collections/community.network/pull/255).warn parameter to these modules is now deprecated and defaults to False. Similarly, the COMMAND_WARNINGS configuration option is also deprecated and defaults to False. These will be removed and their presence will become an error in 2.14.key does not have any effect, has been deprecated and will be removed in ansible-core version 2.14 (https://github.com/ansible/ansible/pull/70319).pypsrp to 0.4.0.server_uuids and server_uuid of the servers parameter in the volume module will be removed in version 3.0.0.instance_id alias for device_id (https://github.com/ansible-collections/community.aws/pull/349).query option has been deprecated and will be removed after 2022-12-01 (https://github.com/ansible-collections/community.aws/pull/346). The ec2_vpc_endpoint_info now defaults to listing information about endpoints. The ability to search for information about available services has been moved to the dedicated module ec2_vpc_endpoint_service_info.acme module_utils (ansible_collections.community.crypto.plugins.module_utils.acme) is deprecated and will be removed in community.crypto 2.0.0. Use the new Python modules in the acme package instead (ansible_collections.community.crypto.plugins.module_utils.acme.xxx) (https://github.com/ansible-collections/community.crypto/pull/184).retrieve_orders=url_list, orders will no longer be returned in community.crypto 2.0.0. Use order_uris instead (https://github.com/ansible-collections/community.crypto/pull/178).update-cache, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).working-dir, global-command, prefer-source, prefer-dist, no-dev, no-scripts, no-plugins, optimize-autoloader, classmap-authoritative, apcu-autoloader, ignore-platform-reqs, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).system_lib deprecated in favor of using become (https://github.com/ansible-collections/community.general/pull/2218).2fa_token, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).message will be removed in community.general 4.0.0. Use the new option message_content instead (https://github.com/ansible-collections/community.general/pull/1929).update-brew, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).update-brew, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).update-cache, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).update-cache, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).show_diff, will be removed in 7.0.0. (https://github.com/ansible-collections/community.general/pull/1927).dist marked for deprecation (https://github.com/ansible-collections/community.general/pull/1830).update-cache, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).update-cache and no-recommends, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).update-cache, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).disable_facts option (https://github.com/ansible-collections/community.general/pull/1747).
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_4.html