Do you think IIT Guwahati certified course can help you in your career?
No
Introduction🎯
Ansibleis a well-known term these days in the technical domain.
In this blog, we will primarily discuss the Ansible 4 porting guide. We will start with discussing Ansible and related concepts and then finally proceed to learn about the Ansible 4 porting guide. Let us dive deep into the topic now.😎
Ansible💻
Before proceeding to the Ansible 4 porting guide, let us first discuss Ansible. Ansible is a simple IT automation tool. It automates provisioning, application deployment, configuration management, and orchestration. It is an agentless tool by Red Hat. It works on nearly all operating systems like windows, linux, and macOS. Now that we have a basic idea about Ansible let's discuss the Ansible 4 porting guide.
Playbook⭕
The playbook in Ansible refers to a list containing tasks used to execute against hosts automatically. The setting jinja2_native does not affect the template module used to return strings. The jinja2_native, which is off by default, is now used for this purpose.
Command Line
The ansible-galaxy login command is no longer in use. The reason for this is its deprecation of the GitHub API. If you want to publish roles to Galaxy using the ansible-galaxy command, you simply have to pass a GalaxyAPI token to the CLI(Command Line Interface) with the help of a token file.
Deprecated📌
The ansible.module_utils.basic._CHECK_ARGUMENT_TYPES_DISPATCHER is now deprecated. Now, ansible.module_utils.common.parameters.DEFAULT_TYPE_VALIDATORS has taken its place.
Breaking Changes
Let us now look at some of the changes in the AnsibleModule. The list below shows the modules that have been removed now.
_check_argument_types()
_check_arguments()
_check_argument_values()
_check_required_if()
_check_required_by()
_check_type_bool()
_check_type_bits()
_check_type_int()
_check_type_bytes()
_check_type_list()
_check_type_float()
The list of functions below, are the ones that are now private in the ansible.module_utils.common.parameters.
handle_aliases
list_deprecationsl
list_no_log_values
Some Important Points⭕
Moving ahead with the Ansible 4 porting guide, let us look at some crucial points.
⭕You have to use the resolvelib in the ansible-galaxy command to resolve dependencies.
⭕If you want to upgrade ansible which is less than 2.10 or is ansible-base, you must first uninstall them using pip uninstall ansible or pip uninstall ansible-base and then install ansible-core.
⭕The choices field is now validated in the configuration system.
⭕In the apt_key module, you cannot use the file, data, URL, and keyserver together now.
⭕The tasks that are user-defined are now supported in the meta module.
⭕The type of the filter parameter is changed to list from string in the setup module.
Plugins🎯
📌Callback plugins
The execution of the meta task is sent to v2_playbook_on_task_start. You cannot send implicit meta tasks by default.
📌Inventory plugins
To remove any particular keys make use of delete() in the inventory plugins. When the clear_cache() method is called, facts are also deleted from the cache.
📌Choices field
As we have already mentioned that now the choices field is also validated, hence plugins that did not use proper choices now result in an error.
Ansible 4 Porting Guide - v4.10.0
Major Changes
containers.podman
✅Add driver opts support.
✅Add secrets driver.
✅Add podman_tag module.
Deprecated Features🚫
cisco.nxos
🚫Deprecated nxos_snmp_traps module.
🚫Deprecated nxos_snmp_user module.
🚫Deprecated nxos_snmp_host module.
🚫Deprecated nxos_snmp_location module.
🚫Deprecated nxos_snmp_community module.
🚫Deprecated nxos_snmp_contact nodule.
junipernetworks.junos
The router_id options are now deprecated from junos_ospf_interfaces, junos_ospfv2, and junos_ospvf3 modules.
Ansible 4 Porting Guide - v4.9.0
Issues
purestorage.flashblade
The field mac_address is not populated in the response in the purefb_lag.
Major Changes
fortinet.fortios
📌Selectors feature support in fortios_log_fact and fortios_monitor_fact.
📌FortiOS 7.0.1 support.
📌Delete or add member support on an object having members.
📌 Real-world use cases addition in some configuration modules.
Ansible 4 Porting Guide - v4.8.0
Breaking Changes
community.zabbix
Ansible 2.10 is the minimum requirement for support for all roles now.
Deprecated Features🚫
community.azure
🚫community.azure.azure_rm_virtualmachine_scaleset and community.azure.azure_rm_virtualmachinescaleset are now deprecated. You are supposed to use the azure.azcollection.azure_rm_virtualmachinescaleset now.
🚫All the modules in the community.azure.azure_rm_<resource>_facts are now deprecated.
🚫All the modules in the community.azure.azure_rm_<resource>_info are now deprecated.
🚫community.azure.azure_rm_managed_disk and community.azure.azure_rm_manageddisk are now deprecated.
🚫community.azure.azure_rm_virtualmachine_extension and community.azure.azure_rm_virtualmachineextension are now deprecated.
community.hashi_vault
The lookup_hashi_vault in the ansible.cfg is now deprecated. Now you can use the hashi_vault_collection.
Ansible 4 Porting Guide - v4.7.0
Major Changes✅
openvswitch.openvswitch
Version 2.0.1 is released.
Deprecated Features🚫
cisco.ios
The ios_ntp modules are deprecated.
cisco.nxos
The nxos_ntp_auth, nxos_ntp and nxos_ntp_options modules are now deprecated.
community.vmware
The VNC server is removed.
junipernetworks.junos
The router_id from ospfv2 module is deprecated.
Ansible 4 Porting Guide - v4.6.0
Major Changes✅
gluster.gluster
Before starting the gluster volume, do not forget to enable the client.ssl and server.ssl.
containers.podman
⭕Systemd generation for pods is to be added.
⭕Systemd service files are to be generated for containers.
Deprecated Features🚫
community.grafana
An API key with a destroyed version is not accepted.
Ansible 4 Porting Guide - v4.5.0
Major Changes✅
ovirt.ovirt
The role for removing stale LUN is to be added.
hetzner.hcloud
Has introduced placement groups.
Deprecated Features🚫
cisco.ios
🚫The ios_bgp is deprecated.
🚫The testing with the provider for ansible-test integration jobs is to be removed.
ansible.netcommon
You can now set the value of the paramiko_ssh setting explicitly.
junipernetworks.junos
The router_id from the ospfv3 module is deprecated.
Ansible 4 Porting Guide - v4.4.0
Issues
dellemc.openmanage
The idrac_user module may give an error due to some pending attributes. In this case, you are advised to run the task again.
Deprecated Features🚫
cisco.nxos
The module nxos_logging has been deprecated.
cisco.iosxr
The module iosxr_logging has been replaced by the iosxr_logging_global resource module.
vyos.vyos
The module vyos_logging has been replaced by the vyos_logging_global resource module.
junipernetworks.junos
The module junos_logging has been replaced by the junos_logging_global resource module.
community.docker
The default value of command_handling, compatibility is now replaced with correct.
Ansible 4 Porting Guide - v4.3.0
Major Changes✅
netapp.cloudmanager
The stage environment is to be added to all the modules in the cloudmanager.
Deprecated Features🚫
community.hashi_vault
The Python 3.5 support will not be available in the 2.0.0 version of community.hashi_vault.
Ansible 4 Porting Guide - v4.2.0
Issues
dellemc.openmanage
📍The idrac_user module may result in an error. In this case, re-run the task.
📍You cannot create an uplink with the same name in the ome_smart_fabric_uplink module.
Major Changes✅
fortinet.fortios
Fortios 7.0 support.
Log APIs support.
A module fortios_monitor_fact is added.
community.vmware
A new module is added in vmware_object_custom_attributes_info.
Deprecated Features🚫
📌The community.kubernetes collection is now called the kubernetes.core.
ansible.windows
🚫The filtered_reason return value is replaced by filtered_reasons.
🚫The use_scheduled_task is now deprecated.
🚫The whitelist and blacklist options are now deprecated. These are now replaced by accept_list and reject_list.
community.general
🚫The availability_zone and instance_names are deprecated.
🚫The function's parameter in serverless is deprecated.
community.hashi_vault
It no longer supports Python 2 in the 2.0.0 version of the community.hashi_vault
Ansible 4 Porting Guide - v4.1.0
Issues
dellemc.openmanage
The idrac_user may give an error. In this case, re-run the task and wait.
Major Changes✅
fortinet.fortios
The firewall_central_snat_map has support for moving policy.
The fortios_configuration_fact needs improvement.
The check_mode has support for all configuration API-based modules.
cloudscale_ch.cloud
The custom_image module is to be added.
community.postgresql
The value of as_single_query is now yes in postgresql_query.
dellemc.openmanage
The check mode is now supported in the ome_firmware_baseline module and in the ome_firmware_catalog module.
netbox.netbox
The python package packages are now mandatory.
Removed Features⭕
ansible.windows
The shutdown_timeout and shutdown_timeout_sec have now been removed from the win_reboot.
Deprecated Features🚫
ansible.windows
The ignore_errors: True is now deprecated. Instead use the ignore_unreachable: True feature.
community.docker
All the modules and plugins of Docker except the docker_swarm, and docker_compose are deprecated.
community.general
🚫The copy of ipaddress which is vendored is deprecated.
🚫The vault scripts will be removed from the community.general.
🚫In linode, the parameter backupsenabled is deprecated.
inspur.sm
Below is a list of all the features deprecated.
add_ad_group
add_ldap_group
add_user
add_user_group
del_ad_group
del_ldap_group
del_user
del_user_group
edit_ad_group
edit_ldap_group
edit_user
edit_user_group
Ansible 4 Porting Guide - v4.0.0
Issues
Ansible-core
In the ansible-test, the pylint does not detect the ‘bad’ variables now.
fortinet.fortios
The monitor API modules do not have a version.
dellemc.openmanage
The idrac-user may result in an error.
You cannot create uplinks of the same name in the ome_smart_fabric_uplink module.
Breaking Changes🎯
Ansible-core
📌The tags for user-defined tasks are now supported in the meta module.
📌Even if –force is present you can still install the Made SCM collections.
📌The ansible-galaxy login command is no longer accepted.
community.docker
In the docker_swarm module, when you specify the join_token parameter, VALUE_SPECIFIED_IN_NO_LOG_PARAMETER will replace the returned join token.
ansible.netcommon
The ipaddress that is vendored is no longer available.
fortinet.fortios
The FOS module issues a request with Ansible in the generic FortiOS module.
The fortios will have FOS platforms.
theforeman.foreman
The variables in foreman now have foreman_ in beginning.
servicenow.servicenow
The auth field can do anything but not the basic authentication.
community.general
The python-oca is not used now in one-image. It has been replaced with pyone.
A placeholder string is now present in the returned value from the frontend_cookie_secret
Major Changes
Ansible-core
✅Now you can use the ansible-galaxy collections –upgrade option to upgrade Ansible collections from Galaxy.
✅A PyPI proxy container is now used by the test containers, centos6, and default.
✅If you want to install the Ansible collections from local folders, you can do it.
✅The ArgumentSpecValidator should be used for private methods in the modules.
✅The resolvelib >=0.5.3 and < 0.6.0 is now a dependency.
ansible.netcommon
The netconf_config should not have any deprecated connection arguments.
cisco.iosxr
The ansible.netcommon does not have the ipaddress now.
community.grafana
The skip_version_check option is now there.
community.mysql
The Is_Slave and Is_Master are now replaced by Is_Replica and Is_Primary.
The support for REQUIRESSL will no longer be there.
The options getslave, startslave, stopslave and resetslave are all deprecated now.
The slave word is no longer used, it is replaced by replica.
netapp.ontap
The REST support is added to the module.
fortinet.fortios
The modules mentioned below are added.
fortios_configuration_fact
fortios_json_generic
fortios_monitor
fortios_monitor_fact
vyos.vyos
The ansible.netcommon no longer contains the ipaddress.
servicenow.servicenow
It now supports the bearer tokens for the purpose of authentication.
The OpenID Connect authentication protocol is now supported.
Removed Features
Ansible-core
The ansible.constants.getconfig() is removed.
The ansible.constants.BECOME_METHODS is removed.
The ansible.constants.mk_boolean() is removed.
The SharedPluginLoaderObj class is removed.
community.general
The idrac_firmware, ome_device_info, and idrac_server_config_profile modules are now a part of the dellemc.openmanage.
The ali_instance_facts is removed.
The gluster_volume module is removed.
The gluster_peer module is removed.
The helm module is removed.
The gluster_heal_info module is removed.
The ovirt_vm_facts module is removed.
The ovirt_template_facts module is removed.
The ovirt_tag_facts module is removed.
** There are more modules that are removed.
community.network
The parameters rate_limit, forward_enp_slot have been removed.
The community.network.sros netconf plugin is no longer available.
fortinet.fortios
The list of modules deprecated are listed below.
fortios_facts
fortios_registration_forticare
fortios_registration_vdom
fortios_system_config_backup_restore
fortios_system_vmlicense
Deprecated Features🚫
Ansible-core
In the apt_key, the key parameter has been deprecated.
Version 0.4.0 should be the minimum version of pypsrp.
ansible.netcommon
The cli_parse module is deprecated.
cloudscale_ch.cloud
The server_uuid and server_uuids is removed in the volume module.
cisco.nxos
The nxos_bgp_af and nxos_bgp_neighbor are deprecated.
community.crypto
The module utils acme is deprecated.
The retrieve_orders=url_list, orders are no longer available.
community.general
In runit, the parameter dist is deprecated.
The no-recommends and update-cache in the urpmi are deprecated.
The update-brew in homebrew_cask is deprecated.
In puppet, the show_diff is deprecated.
** There are other parameters also that are deprecated.
f5networks.f5_modules
In this, the support for versions of Python before 3.5 is deprecated.
We hope you are now familiar with the Ansible 4 porting guide concept.✅
Frequently Asked Questions
Is Ansible open-source?
Yes, Ansible is open-source software.
On what language is Ansible built?
Ansible is written in python. However, you can use it without the knowledge of python.
What is the advantage of using Ansible?
Ansible makes DevOps a lot easier. You do not have to perform a particular task manually every time instead you can just automate it.
How does Ansible declare the configuration?
Ansible uses the YAML( Yet Another Markup Language) to declare the state of devices and the configuration.
Why do we use the Ansible command module?
We use the Ansible command module to run the commands or scripts in the target machine.
Conclusion
In this blog, we discussed about the Ansible 4 porting guide. We started with a discussion on Ansible. We also discussed about the playbook, command line and deprecated features. We then finally explored the Ansible 4 porting guide in detail.
You can also refer to the official documentation of Ansible for more information.