Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several modules should support an array of arguments #71

Closed
skx opened this issue Jan 8, 2022 · 2 comments · Fixed by #73
Closed

Several modules should support an array of arguments #71

skx opened this issue Jan 8, 2022 · 2 comments · Fixed by #73
Labels
good first issue Good for newcomers modules

Comments

@skx
Copy link
Owner

skx commented Jan 8, 2022

When working on #66 I had to write:

directory {
          target => "${archive}",
          state  => "present",
}
directory {
          target => "${install}/go-${version}",
          state  => "present",
}

This would have been nicer:

directory {
          target => [ "${archive}", "${install}/go-${version}", ]
          state  => "present",
}

To be honest many of our modules should accept arrays rather than just strings, but it was easier to write them in the way that felt natural - so package installation supports arrays, for example, because I do use that a lot. But log, fail, etc, etc, do not because I didn't need them to do so initially.

@skx skx added good first issue Good for newcomers modules labels Jan 8, 2022
@skx
Copy link
Owner Author

skx commented Jan 8, 2022

Definitely fix this, and also the shell module.

@skx skx changed the title Directory module should support an array of paths Several modules should support an array of arguments Jan 8, 2022
@skx
Copy link
Owner Author

skx commented Jan 8, 2022

Checked the other modules and non really make sense to update - except for "log" or "fail" which aren't huge priorities.

Files can't because the content/type needs to vary. Same argument for symlinks.

Git repositories need a per-repo destination. Users can have different args too.

@skx skx mentioned this issue Jan 8, 2022
@skx skx closed this as completed in #73 Jan 8, 2022
skx added a commit that referenced this issue Jan 8, 2022
This pull-request updates a couple of modules to allow parameters to be specified as arrays, rather than strings:

* directory
* shell

Once those changes were made the examples were updated to take advantage of that fact, to simplify them, and the README.md file was updated too.

This closes #71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers modules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant