Skip to content

Commit

Permalink
@ teracyhq#227 | configurator stub is ready to be implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
hoatle committed Jul 19, 2018
1 parent 9cf2c55 commit e49e262
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ require "rubygems"

require_relative 'lib/utility'
require_relative 'lib/settings_processor'
require_relative 'lib/configurator'

# teracy-dev version
VERSION='0.6.0-a1-SNAPSHOT'
Expand Down Expand Up @@ -50,7 +51,7 @@ Vagrant.configure("2") do |config|
primary = node_config["primary"] ||= false
autostart = node_config["autostart"] === false ? false : true
config.vm.define node_config["name"], primary: primary, autostart: autostart do |node|
# node settings here
configure(node_config, node)
end
end
# postload-ext list here
Expand Down
74 changes: 74 additions & 0 deletions lib/configurator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# configure for node with all options from https://www.vagrantup.com/docs/

require_relative 'utility'

$logger = get_logger()


# https://www.vagrantup.com/docs/vagrantfile/machine_settings.html
def _configure_vm(vm_config, node)
# TODO: implement this
$logger.debug("_configure_vm: #{vm_config}")
end

# https://www.vagrantup.com/docs/vagrantfile/ssh_settings.html
def _configure_ssh(ssh_config, node)
# TODO: implement this
$logger.debug("_configure_ssh: #{ssh_config}")
end


# https://www.vagrantup.com/docs/vagrantfile/winrm_settings.html
def _configure_winrm(winrm_config, node)
# TODO: implement this
$logger.debug("_configure_winrm: #{winrm_config}")
end

# https://www.vagrantup.com/docs/vagrantfile/winssh_settings.html
def _configure_winssh(winssh_config, node)
# TODO: implemet this
$logger.debug("_configure_winssh: #{winssh_config}")
end

# https://www.vagrantup.com/docs/vagrantfile/vagrant_settings.html
def _configure_vagrant(vagrant_config, node)
# TODO: implement this
$logger.debug("_configure_vagrant: #{vagrant_config}")
end

# https://www.vagrantup.com/docs/provisioning/
def _configure_provisioners(provisoners_config, node)
# TODO: implement this
$logger.debug("_configure_provisioners: #{provisoners_config}")
end

# https://www.vagrantup.com/docs/networking/
def _configure_networks(networks_config, node)
# TODO: implement this
$logger.debug("_configure_networks: #{networks_config}")
end

# https://www.vagrantup.com/docs/synced-folders/
def _configure_sync_folders(sync_folders_config, node)
# TODO: implement this
$logger.debug("_configure_sync_folders: #{sync_folders_config}")
end

# https://www.vagrantup.com/docs/providers/
def _configure_providers(providers_config, node)
# TODO: implement this
$logger.debug("_configure_providers: #{providers_config}")
end


def configure(node_config, node)
_configure_vm(node_config["vm"], node)
_configure_ssh(node_config["ssh"], node)
_configure_winrm(node_config["winrm"], node)
_configure_winssh(node_config["winssh"], node)
_configure_vagrant(node_config["vagrant"], node)
_configure_provisioners(node_config["provisoners"], node)
_configure_networks(node_config["networks"], node)
_configure_sync_folders(node_config["synced-folders"], node)
_configure_provisioners(node_config["providers"], node)
end

0 comments on commit e49e262

Please sign in to comment.