Class: Subspace::Commands::Bootstrap

Inherits:
Base
  • Object
show all
Defined in:
lib/subspace/commands/bootstrap.rb

Instance Method Summary collapse

Methods inherited from Base

#confirm_overwrite, #copy, #dest_dir, #gem_path, #inventory, #pass_through_params, #playbook_dir, #project_name, #project_path, #require_configuration, #set_subspace_version, #template, #template!, #template_dir

Methods included from Ansible

#ansible_command, #ansible_playbook

Constructor Details

#initialize(args, options) ⇒ Bootstrap

Returns a new instance of Bootstrap.



3
4
5
6
7
8
9
# File 'lib/subspace/commands/bootstrap.rb', line 3

def initialize(args, options)
  @host_spec = args.first
  @options = options
  @ask_pass = options.password
  @yum = options.yum
  run
end

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/subspace/commands/bootstrap.rb', line 11

def run
  # ansible atlanta -m copy -a "src=/etc/hosts dest=/tmp/hosts"
  hosts = inventory.find_hosts!(@host_spec)
  update_ansible_cfg
  hosts.each do |host|
    say "Bootstapping #{host.vars["hostname"]}..."
    learn_host(host)
    install_python(host)
  end
end