Difference between revisions of "Ansible modules"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
Line 19: Line 19:
 
* <code>[[ansible -m raw]] DESTINATION_HOSTNAME -a uptime</code>
 
* <code>[[ansible -m raw]] DESTINATION_HOSTNAME -a uptime</code>
 
* <code>[[ansible -m shell]] DESTINATION_HOSTNAME -a uptime</code>
 
* <code>[[ansible -m shell]] DESTINATION_HOSTNAME -a uptime</code>
* <code>[[ansible -m command]] DESTINATION_HOSTNAME -a uptime</code>
+
* <code>[[ansible -m command]] DESTINATION_HOSTNAME -a uptime</code> (Do not support some characters as: "|")
  
 
== See also ==
 
== See also ==

Revision as of 07:38, 27 August 2020

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.


Modules

Examples of execution modules

See also

  • https://docs.ansible.com/ansible/latest/modules/modules_by_category.html
  • https://docs.ansible.com/ansible/latest/modules/setup_module.html
  • https://www.unixarena.com/2018/07/ansible-command-vs-shell-vs-raw-modules.html/
  • https://docs.ansible.com/ansible/2.6/modules/docker_module.html
  • https://docs.ansible.com/ansible/latest/modules/docker_compose_module.html
  • https://medium.com/@tcij1013/ten-useful-ansible-modules-83fb6fb2d45e
  • Advertising: