FreeKB - command module (invoking a command)
Ansible - command module (invoking a command)

This assumes you have installed Ansible and are familiar with the ansible-playbook command and have created a playbook.

In your playbook.yml file, the "command" option can be used to run a command on the target servers. In this example, the ps command will be invoked on the Linux target servers.

- hosts: linux
  remote_user: root
    - name: ps command
      command: ps


The playbook can then be executed using this command.

ansible-playbook playbook.yml -i inventory.yml


The following should be produced.

PLAY [all]

TASK [Gathering Facts]
ok: []

TASK [ps command]
changed: []

PLAY RECAP : ok=2  changed=1  unreacable=0  failed=0


By default, no stdout is printed. The - debug option can be used to print output to the console.

Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

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