Bootstrap FreeKB - Ansible - Run a command using the raw module
Ansible - Run a command using the raw module

Updated:   |  Ansible articles

If you are not familiar with modules, check out Ansible - Getting Started with Modules.

Typically, the shellcommand, or script modules are used to invoke a command on a managed node (e.g. target systems).

Python (e.g. /usr/bin/python) needs to exist on the managed node to use these modules.

Python is not needed to use these modules. 

---
- hosts: all
  tasks:
  - name: install Python using raw
    raw: yum -y install python
...

 

If changed is displayed, this means that Python was successfully installed on the control node (e.g. the target host).

TASK [install Python using raw]
changed: [server1.example.com]

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 192090 in the box below so that we can be sure you are a human.