Bookmark this page

Installing Ansible

Objectives

After completing this section, you should be able to:

  • Install Red Hat Ansible Engine.

  • List the programs installed with Ansible.

Sample Installation Procedure

This is an example of how to install Red Hat Ansible Engine on a Red Hat Enterprise Linux control node.

[root@host ~]# subscription-manager repos --enable=rhel-7-server-ansible-2-rpms
[root@host ~]# yum install ansible
  • Any Red Hat Enterprise Linux subscription can use this to install Ansible, with limited support scope.

  • If you have an official Red Hat Ansible Engine support subscription, use subscription-manager to attach the control node to the pool containing it. See https://access.redhat.com/articles/3174981

Learning About Installed Plug-ins

Plug-ins are pieces of code that augment the core functionality of Ansible.

The ansible-doc tool displays information about installed Ansible plug-ins.

[user@host ~]$ ansible-doc [-l|-s] [options] [-t <plugin type>] [plugin]

Use the list option (-l) in conjunction with -t TYPE to list plug-ins of a given type. When -l is used without a type, it defaults to type module. Valid types are cache, callback, connection, inventory, lookup, shell, module, strategy, and vars.

[user@host ~]$ ansible-doc -t connection -l

To find information about a plug-in that is not of type module, you must give its type.

[user@host ~]$ ansible-doc -t connection network_cli

Ansible Program Files

These Ansible command line programs provide important functionality.

ansible

Run ad hoc Ansible commands.

ansible-config

View, edit, and manage Ansible configuration.

ansible-doc

Ansible plug-in documentation.

ansible-inventory

Display or dump the configured inventory.

ansible-playbook

Run an Ansible Playbook, executing tasks on targeted hosts.

Revision: do457-2.5-4693601