Skip to content

Added module: command-dispatcher, allows shell commands to be run#126

Open
SimonThalvorsen wants to merge 1 commit intocfengine:masterfrom
SimonThalvorsen:CFE-4627
Open

Added module: command-dispatcher, allows shell commands to be run#126
SimonThalvorsen wants to merge 1 commit intocfengine:masterfrom
SimonThalvorsen:CFE-4627

Conversation

@SimonThalvorsen
Copy link
Contributor

Ticket: CFE-4627

Copy link
Contributor

@larsewi larsewi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check (if you have not already) how the README.md of other modules are written and try to make it consistent. You can use this module as a template https://github.com/cfengine/modules/blob/master/promise-types/git/README.md

Comment on lines +3 to +4
Internally these commands are ran using the `"useshell"`-promise based
on the `condition`-variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Internally these commands are ran using the `"useshell"`-promise based
on the `condition`-variable.
Internally these commands are ran using the `"useshell"`-promise based on the `condition`-variable.


`command` - The command to run

`condition` - Condition for running e.g `linux`, `debian`, etc. Defaults to `"any"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`condition` - Condition for running e.g `linux`, `debian`, etc. Defaults to `"any"`
`condition` - Condition for running. Use a class expression (e.g., `linux|bsd`). Defaults to `"any"`


`condition` - Condition for running e.g `linux`, `debian`, etc. Defaults to `"any"`

`ifelapsed` - Number of minutes between assessments. Defaults to 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`ifelapsed` - Number of minutes between assessments. Defaults to 5
`ifelapsed` - Number of minutes between assessments. Defaults to 5 minutes.

Comment on lines +17 to +25
```
...
{
"command": "echo \"Hello World\"",
"condition": "linux",
"ifelapsed": "5"
},
...
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
...
{
"command": "echo \"Hello World\"",
"condition": "linux",
"ifelapsed": "5"
},
...
```
```json
...
{
"command": "echo \"Hello World\"",
"condition": "linux",
"ifelapsed": "5"
},
...

Comment on lines +26 to +27
Would echo "Hello world" on every linux devices in 5 minute intervals.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Would echo "Hello world" on every linux devices in 5 minute intervals.
Would echo "Hello world" on every linux devices in 5 minute intervals.

@larsewi
Copy link
Contributor

larsewi commented Mar 2, 2026

@SimonThalvorsen SimonThalvorsen force-pushed the CFE-4627 branch 2 times, most recently from 6b3a82e to cd19946 Compare March 2, 2026 15:18
Ticket: CFE-4627

Signed-off-by: Simon Halvorsen <simon.halvorsen@northern.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants