Now supporting vagrant 1.2. Simplified config class. SSH not working
[vagrant-dotfiles.git] / lib / copy_my_conf / provisioner.rb
1 module CopyMyConf
2 class Provisioner < Vagrant.plugin("2", :provisioner)
3
4 def configure(root_config)
5 `rm -rf /tmp/copy_my_conf`
6 @to_be_copied = []
7 config.all_enabled_attributes.each do |conf|
8 @to_be_copied << conf
9 conf.prepare root_config.vm, tmp_root
10 end
11 end
12
13 def provision
14 channel = @machine.communicate
15 @to_be_copied.each do |conf|
16 conf.provision channel, user_home, tmp_root
17 end
18 end
19
20 def self.config_class
21 Config
22 end
23
24 private
25
26 def tmp_root
27 "/tmp/copy_my_conf"
28 end
29
30 def user_home
31 config.user_home || "/home/vagrant"
32 end
33 end
34 end
35