class Subspace::Commands::Configure

Public Class Methods

new(args, options) click to toggle source
# File lib/subspace/commands/configure.rb, line 2
def initialize(args, options)
  require_configuration
  run
end

Public Instance Methods

run() click to toggle source
# File lib/subspace/commands/configure.rb, line 7
def run
  Subspace.config.hosts.each do |host|
    update_host_configuration(host)
  end
  Subspace.config.groups.each do |group|
    update_group_configuration(group)
  end
end

Private Instance Methods

update_group_configuration(group) click to toggle source
# File lib/subspace/commands/configure.rb, line 23
def update_group_configuration(group)
  say "Generating config/provisiong/group_vars/#{group}"
  template "group_vars/template", "group_vars/#{group}", Subspace.config.binding_for(group: group)
end
update_host_configuration(host) click to toggle source
# File lib/subspace/commands/configure.rb, line 18
def update_host_configuration(host)
  say "Generating config/provisiong/host_vars/#{host}"
  template "host_vars/template", "host_vars/#{host}", Subspace.config.binding_for(host: host)
end