Skip to content

Instantly share code, notes, and snippets.

@Atalanta
Created December 22, 2010 07:42
Show Gist options
  • Save Atalanta/751231 to your computer and use it in GitHub Desktop.
Save Atalanta/751231 to your computer and use it in GitHub Desktop.
def apply_apt_repo_role
@vagrant = Vagrant::Environment.new
status = %x[vagrant status].split("\n")[4]
if status.start_with?("The VM is powered off")
puts ' Firing up remote VM for apt repo'
@vagrant.cli('up')
end
Vagrant::Config.run do |config|
config.chef.add_role("apt_repo")
end
@vagrant.cli('provision')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment