Class: Souffle::Provider::Vagrant
- Defined in:
- lib/souffle/provider/vagrant.rb
Overview
The Vagrant souffle provider.
Instance Attribute Summary collapse
-
#vagrant_dir ⇒ Object
readonly
Returns the value of attribute vagrant_dir.
Attributes inherited from Base
Instance Method Summary collapse
-
#create_new_vm_group ⇒ Object
Creates a new virtualmachine group.
-
#create_node(node, tag = nil) ⇒ Object
Takes a node definition and begins the provisioning process.
-
#create_raid ⇒ Object
Noop.
-
#create_system(system, tag_prefix = nil) ⇒ Object
Creates a system using vagrant as the provider.
-
#current_folder_has_souffle_config? ⇒ Boolean
Checks if the current folder has the souffle configuration object.
-
#generate_vagrant_config ⇒ Object
Generates the multi-vm configuration.
-
#initialize ⇒ Vagrant
constructor
Setup the internal Vagrant configuration and object.
Methods inherited from Base
#boot, #cookbook_paths, #create_cookbooks_tarball, #create_ssh_dir_if_missing, #generate_chef_json, #name, #role_paths, #rsync_file, #ssh_block, #ssh_key, #ssh_key_exists?, #ssh_key_path, update_status, #wait_for_boot
Constructor Details
#initialize ⇒ Vagrant
Setup the internal Vagrant configuration and object.
9 10 11 12 13 14 |
# File 'lib/souffle/provider/vagrant.rb', line 9 def initialize super() @vagrant_dir = @system.try_opt(:vagrant_dir) create_new_vm_group unless current_folder_has_souffle_config? generate_vagrant_config end |
Instance Attribute Details
#vagrant_dir ⇒ Object (readonly)
Returns the value of attribute vagrant_dir.
6 7 8 |
# File 'lib/souffle/provider/vagrant.rb', line 6 def vagrant_dir @vagrant_dir end |
Instance Method Details
#create_new_vm_group ⇒ Object
Creates a new virtualmachine group.
41 42 |
# File 'lib/souffle/provider/vagrant.rb', line 41 def create_new_vm_group end |
#create_node(node, tag = nil) ⇒ Object
Takes a node definition and begins the provisioning process.
27 28 |
# File 'lib/souffle/provider/vagrant.rb', line 27 def create_node(node, tag=nil) end |
#create_raid ⇒ Object
Noop.
31 |
# File 'lib/souffle/provider/vagrant.rb', line 31 def create_raid; end |
#create_system(system, tag_prefix = nil) ⇒ Object
Creates a system using vagrant as the provider.
20 21 |
# File 'lib/souffle/provider/vagrant.rb', line 20 def create_system(system, tag_prefix=nil) end |
#current_folder_has_souffle_config? ⇒ Boolean
Checks if the current folder has the souffle configuration object.
36 37 38 |
# File 'lib/souffle/provider/vagrant.rb', line 36 def current_folder_has_souffle_config? File.exists? "#{Dir.pwd}/souffle.json" end |
#generate_vagrant_config ⇒ Object
Generates the multi-vm configuration.
45 46 47 48 49 50 51 |
# File 'lib/souffle/provider/vagrant.rb', line 45 def generate_vagrant_config template = Souffle::Template.new('Vagrantfile.erb') temp_binding = OpenStruct.new temp_binding.version = Souffle::VERSION template.render(temp_binding) end |