rash icon indicating copy to clipboard operation
rash copied to clipboard

Dynamic modules

Open pando85 opened this issue 3 years ago • 0 comments

Create new modules written in Rash.

This modules will need at least some metadata and a function to execute.

metadata schema

name:
  type: string
params:
  type: object
  additional_properties:
    type:
      - string
      - number
      - object
      - array
      - boolean

function definition

  • SHOULD verify params.
  • MUST do the job.
  • SHOULD implement dry-run mode.
  • MUST return if something changed (boolean).
  • COULD return some output or extra.
  • COULD return two strings to show diff.

module file structure

{{ module_name }}/
    main.yml
    meta.yml

implementation

ModuleKind: Dynamic

  • Must be lazy_load when required. E.g.: if module not found in exiting names, load all names until one matches
  • Structure:
    • name
    • ModuleKind::Special::Include with variables as arguments: module_name.{{ param_name }}

pando85 avatar Dec 03 '21 05:12 pando85