Monday, March 21, 2016

What are Ansible Raw modules? Where and when they are used?


Ansible’s raw modules are generally used to executing commands on managed machines which does not have basic requirements for Ansible on it. 

For e.g., Running Ansible requires Python 2.4 with python-simplejson on the remote machine. If none of these are available on remote machines then how would you run Ansible on those hosts? The solution is to use Ansible’s Raw module to first install python and python-simplejson on the managed machine and then you can use all other Ansible modules/features.

Example of running a Raw module:

ansible myhost --sudo -m raw -a "yum install -y python2 python-simplejson"


No comments:

Post a Comment