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

Support meta-args for shell provisioner #229

Merged
merged 2 commits into from
Aug 10, 2015
Merged

Support meta-args for shell provisioner #229

merged 2 commits into from
Aug 10, 2015

Conversation

ggiamarchi
Copy link
Owner

Fix #205

To-do List

  • Implement feature
  • Unit tests

Summary

It adds the ability to use what i call a "meta-arg" with the shell provisioner. At this point, the only one supported meta-arg is ssh_ip. It corresponds to the IP address vagrant uses to SSH into the machine.

Usage example

config.vm.provision "shell", inline: 'echo "$1 : $2" > ~/provision', args: ['IP', '@@ssh_ip@@']

Technical consideration

  • Initially, i wanted to use symbols to represent meta-args in the args attribute of the shell provisioner but args can only contain strings (restriction done by the shell provisioner itself). This is why i introduced the @@ marker the recognize meta-args.
  • Curently the implementation is a bit specific to the ssh_ip meta-arg. It will change to be more generic if we add more meta-args.

/cc @kphonik @tacoben For comments, to confirm this match your requierements

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.94%) to 91.67% when pulling ec608bf on issue#205 into ef09748 on master.

@0x1b-xyz
Copy link

@ggiamarchi Looks good that should be enough for me to pull the value into the puppet session!

julienvey added a commit that referenced this pull request Aug 10, 2015
👍 Support meta-args for shell provisioner
@julienvey julienvey merged commit 92d8687 into master Aug 10, 2015
@artem-sidorenko
Copy link
Contributor

@ggiamarchi @julienvey this PR probably breaks some other vagrant plugins which rely on provision hooks. See #248

@ggiamarchi ggiamarchi deleted the issue#205 branch February 19, 2016 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Access to obtained floating IP from provisioner phase.
5 participants