Skip to content

Instantly share code, notes, and snippets.

@garthk
Last active December 11, 2015 14:48
Show Gist options
  • Save garthk/4616247 to your computer and use it in GitHub Desktop.
Save garthk/4616247 to your computer and use it in GitHub Desktop.
Trouble testing modules with Puppet 3.0 under Vagrant
root@lsserver:/tmp/vagrant-puppet/manifests# puppet --version
2.7.19
root@lsserver:/tmp/vagrant-puppet/manifests# which puppet
/usr/bin/puppet
root@lsserver:/tmp/vagrant-puppet/manifests# `which puppet` --version
3.0.2
root@lsserver:/tmp/vagrant-puppet/manifests# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/vagrant_ruby/bin:/opt/vagrant_ruby/bin
root@lsserver:/tmp/vagrant-puppet/manifests# alias
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls --color=auto'
@garthk
Copy link
Author

garthk commented Jan 24, 2013

My question here is: if which puppet tells me I'm running /usr/bin/puppet, and /usr/bin/puppet --version tells me it's 3.0.2, why does puppet --version tell me I'm running 2.7.19? I don't have any aliases. What's going on?

@garthk
Copy link
Author

garthk commented Jan 24, 2013

While still having no idea why it's acting this way, this solved the problem:

/opt/vagrant_ruby/bin/gem update puppet --no-ri

You can perform this during vagrant up by inserting this before your existing config.vm.provision:

config.vm.provision :shell do |shell|
  shell.inline = "/opt/vagrant_ruby/bin/gem update puppet --no-ri"
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment