You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide tooling to scaffold out the basic python structure for all plugin types including:
cache
callback
test
filter
inventory
lookup
connection
action
module (including but not restricted to generic module, generic resource module, network resource module, security resource module)
vars
This would include the main plugin file for the specific plugin, as well as examples files in the respective utils directory
What's the approach?
The user would populate a manifest file that would include things such as plugin name, plugin type, collection specifics, doc string, examples. The playbook and corresponding collection would scaffold the python source files, with placeholders and/or examples code that the user would need to modify.
In the case of an action/module, additional information may be required such as: Can the plugin run on the control node? Will the plugin hit a REST API, Will the plugin use a 3rd party python package for logic and connection.
The additional information can be used to steer the user toward the appropriate plugin type (action/module)
The intent is that ansible.plugin_builder be a living tools that improves over time based on a community and user feedback loop. Additionally, less well known approaches can be incorporated such as the use of the persistent connection framework, deriving the argspec from the doc string at runtime, common code bases for filter and lookup, doc string for all plugin types, return value validation outbound, etc.
This should avoid the photocopy issue of plugins being built from other plugins, instead provide a starting point that incorporates good practices and techniques.
The work will start small, as a POC, and be iterated on over time.
Summary
The proposal is to add an Ansible collection that scaffolds a variety of plugin types based on user provided criteria.
This has already been committed to and initial work has been added to this repository. Please have a look at https://github.com/ansible-collections/ansible.plugin_builder/README.md for more details.
What's the opportunity?
Provide tooling to scaffold out the basic python structure for all plugin types including:
This would include the main plugin file for the specific plugin, as well as examples files in the respective utils directory
What's the approach?
The user would populate a manifest file that would include things such as plugin name, plugin type, collection specifics, doc string, examples. The playbook and corresponding collection would scaffold the python source files, with placeholders and/or examples code that the user would need to modify.
In the case of an action/module, additional information may be required such as: Can the plugin run on the control node? Will the plugin hit a REST API, Will the plugin use a 3rd party python package for logic and connection.
The additional information can be used to steer the user toward the appropriate plugin type (action/module)
The intent is that
ansible.plugin_builder
be a living tools that improves over time based on a community and user feedback loop. Additionally, less well known approaches can be incorporated such as the use of the persistent connection framework, deriving the argspec from the doc string at runtime, common code bases for filter and lookup, doc string for all plugin types, return value validation outbound, etc.This should avoid the photocopy issue of plugins being built from other plugins, instead provide a starting point that incorporates good practices and techniques.
The work will start small, as a POC, and be iterated on over time.
Reference: Although this is very specific to network resource modules, the workflow and product may serve as a good example https://github.com/ansible-network/cli_rm_builder
The text was updated successfully, but these errors were encountered: