官术网_书友最值得收藏!

  • Ansible Quick Start Guide
  • Mohamed Alibi
  • 252字
  • 2021-07-23 16:37:46

Ansible modules overview

When installing Ansible, the user will also receive a very handy set of modules. This set is called a module library. It is a list of predefined functions and actions to be called when using Ansible, either via ad hoc commands or by running playbooks. An Ansible user is not limited to the predefined Ansible modules; they can easily write their own using Python and JSON scripting. The modules that come with the installation of Ansible might be referred to as task plugins or library plugins, but do not mistake these for the actual Ansible plugins, which are the scripts that allow Ansible to interact with other systems, a subject for another chapter.

The Ansible module library comes with its own machine library. Use the ansible-doc command followed by the name of the module to find out more about how it is used and what its output variables are:

ansible-doc apt

To list all the available modules, use the -l option:

ansible-doc -l

Using modules is very simple. You need to identify the name of the module, then input its arguments if required. Not all modules require argument input (the ping module, for example, doesn't require this) but most do. For other modules, inputting arguments is optional and might allow you to personalize the action, such as in the case of the Windows reboot module. As an example, let's look at executing modules in both ad hoc and playbook mode.

主站蜘蛛池模板: 江都市| 新丰县| 宜兰市| 新和县| 安新县| 池州市| 菏泽市| 伊金霍洛旗| 襄城县| 白朗县| 花莲县| 铜鼓县| 隆德县| 阿拉善左旗| 类乌齐县| 隆子县| 五台县| 原平市| 开远市| 杨浦区| 石林| 仁化县| 洪江市| 拉萨市| 汪清县| 盐城市| 朔州市| 那曲县| 沙洋县| 河津市| 安国市| 克东县| 渑池县| 霍林郭勒市| 扶风县| 开封县| 文安县| 中西区| 湟源县| 南漳县| 广灵县|