-
Notifications
You must be signed in to change notification settings - Fork 124
Support repeatable "node_json" and "node_yaml" options #351
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
Support repeatable "node_json" and "node_yaml" options #351
Conversation
Like this: itamae ssh --node-yaml foo.yaml --node-yaml bar.yml recipes.rb
Explicit unlink is not needed for Tempfile in tests anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's good. After merging this, we should increment minor version, don't we? @sue445
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ineu repeatable
option is available since thor v1.0.0+.
https://github.com/rails/thor/releases/tag/v1.0.0
Could you add >= 1.0.0
to https://github.com/itamae-kitchen/itamae/blob/v1.12.6/itamae.gemspec#L29 ?
e.g.
spec.add_runtime_dependency "thor", ">= 1.0.0"
Other changes are LGTM
Good point, I'll fix it. Btw, should Ruby 2.3 still be supported? It has been deprecated for 6 years by now: https://endoflife.date/ruby |
@ineu It's a sharp and interesting question for us. related #292 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thor supports two ways to pass mutiple values to a flag: via the :array type or via the "repeatable" option. This PR adds the latter.
It allows to pass multiple
node_yaml
andnode_json
files that will all be read and applied to a node.The logic is as follows:
A common use case for this feature is applying vars to a group of nodes (compare to Ansible's
group_vars
andhost_vars
).Example: