Ansible modules

From wikieduonline
Revision as of 07:06, 20 January 2020 by Welcome (talk | contribs)
Jump to navigation Jump to search

Ansible modules[1] add new capabilities to Ansible and is a core component of the software, as of September 2019 there are more than 2.800 modules available: ansible-doc --list. For example you can manage AWS infrastructure using Ansible, execute commands with shell module or collect information using setup[2] module.

  • ansible -m setup SERVER_NAME will collect information from your system
  • ansible -m setup SERVER_NAME -a 'filter=ansible_distribution'. Collect just OS.

Other common useful modules include:

Modules

Examples of execution modules

  • ansible -m raw DESTINATION_HOSTNAME -a uptime
  • ansible -m shell DESTINATION_HOSTNAME -a uptime
  • ansible -m command DESTINATION_HOSTNAME -a uptime

See also

Advertising: