How to Install Ansible on Ubuntu Linux

How to Install Ansible on Ubuntu Linux. Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates. Ansible’s main goals are simplicity and ease-of-use. It also has a strong focus on security and reliability, featuring a minimum of moving parts, usage of OpenSSH for transport (with an accelerated socket mode and pull modes as alternatives), and a language that is designed around auditability by humans–even those not familiar with the program.

Ansible 2.4.1 “Dancing Days” – TBD

  • Security fix for CVE-2017-7550 the jenkins_plugin module was logging the jenkins server password if the url_password was passed via the params field:
  • Update openssl* module documentation to show openssl-0.16 is the minimum version
  • Fix openssl_certificate’s csr handling
  • Python-3 fixes
    • Fix openssl_certificate parameter assertion on Python3
    • Fix for python3 and nonascii strings in inventory plugins (
    • Fix missing urllib in iam_policy
    • Fix crypttab module for bytes<=>text string mismatch ( )
    • Fix lxc_container module combining bytes with text ( )
    • Fix map doesn’t return a list on python3 in ec2_snapshot_facts module (
    • Fix uri (and other url retrieving) modules when used with a proxy. (
    • Fix azure_rm dynamic inventory script ConfigParser usage.
  • Fix for win_file to respect check mode when deleting directories
  • Fix for Ansible.ModuleUtils.Legacy.psm1 to return list params correctly
  • Fix for a proper logout in the module ovirt_vms
  • Fixed docs for ‘password’ lookup
  • Corrected and added missing feature and porting docs for 2.4
  • Fix for Ansible.ModuleUtils.CamelConversion to handle empty lists and lists with one entry
  • Fix nxos terminal regex to parse username correctly.
  • Fix colors for selective callback
  • Fix for ‘New password’ prompt on ‘ansible-vault edit’ (
  • Fix for ‘ansible-vault encrypt’ with vault_password_file in config and –ask-vault-pass cli (
  • updated porting guide with notes for callbacks and config
  • Added backwards compatiblity shim for callbacks that do not inherit from CallbackBase
  • Corrected issue with configuration and multiple ini entries being overwriten even when not set.
  • backported fix for doc generation (plugin_formatter)
  • Fix ec2_lc module for an unknown parameter name (
  • Change configuration of defaults to use standard jinja2 instead of custom eval() for using variables in the default field of config (
  • added missing entry in chlog deprecation
  • Fixed precedence and values for become flags and executable settings
  • Fix for win_domain_membership to throw more helpful error messages and check/fix when calling WMI function after changing workgroup
  • Fix for win_power_plan to compare the OS version’s correctly and work on Windows 10/Server 2016
  • Fix module doc for typo in telnet command option
  • Fix OpenBSD pkg_mgr fact (
  • Fix encoding error when there are nonascii values in the path to the ssh binary
  • removed YAML inventory group name validation, broke existing setups and should be global in any case, and configurable
  • performance improvment for inventory, had slown down considerably from 2.3
  • Fix cpu facts on sparc64 (
  • Fix ansible_distribution fact for Arch linux (
  • remove print statements from play_context/become
  • Fix vault errors after ‘ansible-vault edit’ (
  • updated api doc example to match api changes
  • corrected issues with slack callback plugin
  • it is import_playbook .. not import_plays .. docs now reflect this
  • fixed typo and missed include/import conversion in import_tasks docs
  • updated porting docs with note about inventory_dir
  • removed extension requirement for yaml inventory plugin to restore previous behaviour
  • fixed ansible-pull to now correctly deal with inventory
  • corrected dig lookup docs
  • fix type handling for sensu_silence so the module works
  • added fix for win_iis_webapppool to correctly handle array elements
  • Fix bugs caused by lack of collector ordering like service_mgr being incorrect (
  • Fix os_image when the id parameter is not set in the task. ( )
  • Fix for the winrm connection to use proper task vars
  • removed typo from dig lookup docs
  • Updated win_chocolatey example to be clearer around what should be used with become
  • Fix for copy module when permissions are changed but the file contents are not ( )
  • corrected YAML_FILENAME_EXTENSIONS ini setter as key/section were swapped
  • Better error message when a yaml inventory is invalid
  • avoid include_Xs conflating vars with options
  • Fix for win_msg to document and show error when message is greater than 255 characters
  • Fix for win_dotnet_ngen to work after recent regression
  • fixed backwards compat method for config
  • removed docs for prematurely added ssh specific pipelining settings
  • fixed redis cache typo
  • Fix AttributeError during inventory group deserialization (
  • Fix ‘ansible-vault encrypt –output=-‘ (
  • restore pre 2.4 pipeline configuration options (env and ini)
  • Fix win_copy regression: handling of vault-encrypted source files (
  • Updated return values for win_reg_stat to correctly show what is being returned (
  • reduced normal error redundancy and verbosity, display on increased and when needed
  • Give an informative error instead of a traceback if include_vars dir is file instead of directory (
  • Fix monit module’s version check for color support (
  • Fix for become on Windows to handle ignored errors (
  • Fix removal of newlines when writing SELinux config (
  • clarified extension requirement for constructed inv plugin
  • really turn off inventory caching, toggle will be added in 2.5
  • for inventory sources, dont follow symlinks to calculate base directory, used for group/host_vars
  • Port the example script to the new inventory API.
  • inventory_file variable again returns full path, not just basename
  • added info about cwd group/host vars to porting guide
  • Fix name parsing out of envra in the yum module
  • give user friendly error on badly formatted yaml inventory source
  • Fix any_errors_fatal setting in playbooks.
  • Fix setting of ssh-extra-args from the cli (
  • Change SELinux fact behavior to always return a dictionary. (
  • Revert a fix for using non /bin/sh shells for modules’ running commands as this was causing output from commands to change, thus breaking playbooks. See the original bug for details and links to the eventual fix:
  • Fix rpm_key taking the wrong 8 chars from the keyid (
  • chown errors now more informative
  • Fix for win_copy to copy a source file that has invalid windows characters in the filename, the dest still must be have valid windows characters (
  • Fix systemd module to not run daemon-reload in check mode.
  • fixed some parsing and selection issues with inventory manager, fixed minor bugs in yaml and constructed plugins
  • Fix the ping module documentation to reference win_ping instead of itself:
  • Fix for ec2_win_password to allow blank key_passphrase again (
  • added toggle for vars_plugin behaviour to execute relative to playbook, set default to revert to previous way.
  • Fix for win_copy to not remove destination file on change when in check mode (
  • Fix include_role usage of role_name (
  • Fix service and package forcing a second run of the setup module to function (
  • Better error message when attempting to use include or import with /usr/bin/ansible (
  • Fix for ec2_group to avoid trying to iterate over None (
  • Fix for ec2_group for a possible KeyError bug (
  • Fix for the rpm_key module when importing the first gpg key on a system (
  • Fix for aws_s3 metadata to use the correct parameters when uploading a file (
  • Fix for the yum module when installing from file/url crashes (
  • Improved error messaging for Windows become/runas when username is bogus (
  • Fix rollback feature in junos_config to now allow configuration rollback on device (
  • Remove command executed log from ansible-connection (
  • Fix relative paths to be relative to config file when there is no playbook available (
  • Fix Inventory plugins to use the configured inventory plugin path (
  • Fix include task to be dynamic (
  • A couple fixes to the test process to account for new testing resources in our ci system and an upstream cryptography update that didn’t work with pip-8.x
  • Document backup_path in a few dellos modules and vyos_config (
  • Fix for vmware_vm_facts with dangling inaccessible VM which don’t have MAC addresses (
  • Fix for win_regedit sending extra data that could confuse ansible’s result parsing (
  • Fix git module to correctly cleanup temporary dirs (
  • Fix for modules which use atomic_move() to rename files raising an exception if a file could not be opened. Fix will return a nice error message instead:
  • Fix ansible-doc and ansible-console module-path option (
  • Fix for hostname module on RHEL 7.5 (

Install Ansible

Run the following commands in terminal to install the latest version of Ansible on Ubuntu Linux:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt install ansible

Once installed, run the following command to check the version of installed package:

$ ansible --version

How to Install Ansible on Ubuntu Linux originally posted on Source Digit – Latest Technology, Gadgets & Gizmos.