Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

106 module outputs - #107

Merged
skx merged 9 commits into
masterfrom
106-module-outputs
Feb 20, 2022
Merged

skx merged 9 commits into
masterfrom
106-module-outputs

Conversation

@skx

@skx skx commented Feb 20, 2022

Copy link
Copy Markdown
Owner

This pull-request makes it possible for modules to create "outputs".

Outputs are nothing more than variables set in the environment, as the rules are processed.

  • The shell-module now sets outputs:
    • stdout + stderr containing the appropriate text.
  • The http-module now sets outputs:
    • The HTTP-status code, response-line, and body received.

This closes #106.

skx added 9 commits February 20, 2022 12:49
The interface is intentionally naive; we only allow returning
a map of strings (key->value), which can later be set in the
environment.
This commit makes the API which we defined in the module-API be
usable, to set variables in the environment as modules are executed.
As seen in this example:

```
file {  name => "file", target => "/tmp/foo", source_url => "https://example.com/" }

log { message => "${file.changed}"}
```
@skx
skx merged commit 99329e7 into master Feb 20, 2022
@skx
skx deleted the 106-module-outputs branch February 20, 2022 11:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow modules to setup output variables

1 participant

⌂ 换网址