Ansible Quick Start Guide
上QQ阅读APP看书,第一时间看更新

Ansible Linux modules

We will start by exploring the Linux modules. These are a selection of the most commonly used modules to manage the operating systems, packages, applications, and services running on the Linux environment. We will be covering the two big Linux families, Debian and Red Hat. In this section, we will give a brief overview of the module and its useful functionalities and features. We will also look at a sample of a playbook of one of the interesting uses of this module.

We will not be covering all of the available modules that are supported in the Ansible releases. You can find full documentation for these either by running the ansible-doc command or on the official Ansible documentation in the modules index section. In this book, we will try to cover some of the community and galaxy modules that are needed to perform some tasks.

Some modules require some specific technologies to be installed on the remote hosts. Most of those requirements are usually preinstalled as basic system utilities, while you can work around others by using another tool that can do a similar job. For example, when you are using the apt module, the hosts are required to have aptitude installed on the remote Debian. Ansible will use apt-get to execute the job with a warning message to the user stating the unavailability of aptitude. In case the requirements are not met, Ansible will be sure to inform the user.

Before using a new module, be sure to read its documentation carefully and check if all its requirements have been met, to be on the safe side.