ansible-module

Example:

# Run the 'debug' module.
- ansible-module:
    module_vars:
      var: ansible_env.USER

Description

This is a generic task to execute any of the officially supported, available Ansible modules.

Currently only a few basic metadata keys are supported: become &become_user. The other ones will be added shortly.

Variables

Name Type Default Description

name

string --

The module name. Required

become

boolean --

Whether to become another user.

become_user

string --

The user to become.

module_vars

dict ordereddict()

The parameters for the module.

Examples

Example 1

Run the 'debug' module.

Code
- ansible-module:
    module_vars:
      var: ansible_env.USER
Description

Executes the Ansible debug module, to print an (Ansible-internal) variable value, in this case the username that runs the current playbook. This is useful for debugging.

Command-line

frecklecute ansible-module --help

Usage: frecklecute ansible-module [OPTIONS] NAME

  This is a generic task to execute any of the officially supported,
  [available Ansible modules](https://docs.ansible.com/ansible/latest/module
  s/list_of_all_modules.html).

  Currently only a few basic metadata keys are supported: ``become``
  &``become_user``. The other ones will be added shortly.

Options:
  --become / --no-become     Whether to become another user.
  --become-user BECOME_USER  The user to become.
  --module-vars MODULE_VARS  The parameters for the module.  [default:
                             ordereddict()]
  --help                     Show this message and exit.