July 2017
Intermediate to advanced
266 pages
6h 36m
English
In this section, we will take a look at action plugins and you will learn what action plugins do and some basic code examples on how to create new actions that are available within the Ansible subsystems. In Ansible, action_plugins are a special type of module that provide additional functionality to an existing module. As we mentioned earlier, action_plugins run on the master instead of on the target.
For example, an action plugin represented via an Ansible playbook would look like the following:
- name: Special Action to be run on the master action: myaction foo=bar
The code for such an action plugin might look something like the following:
#!/usr/bin/python# Import the Ansible Runner return data lib from ansible.runner.return_data ...
Read now
Unlock full access