Class: Spaux::CLI
- Inherits:
-
Thor
- Object
- Thor
- Spaux::CLI
- Defined in:
- lib/spaux/cli.rb,
lib/spaux/cli/ssh_subcommand.rb
Defined Under Namespace
Classes: SSHSubcommand
Instance Method Summary collapse
Instance Method Details
#converge ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/spaux/cli.rb', line 17 def converge work_dir = get_work_dir() FileUtils.mkdir_p work_dir begin chef_config = parse_config_file([:config]) if [:config] spaux_config = parse_config_file([:spaux_config]) if [:spaux_config] client = Spaux::Chef::Client.new(work_dir, chef_config, spaux_config) client.run rescue Errno::ENOENT => e = 'error: You need to create a ssh keypair' STDERR.puts if e..match(/id_rsa/) end end |
#knife(*args) ⇒ Object
45 46 47 48 49 |
# File 'lib/spaux/cli.rb', line 45 def knife(*args) work_dir = get_work_dir() knife = Spaux::Chef::Knife.new(work_dir, args) knife.run end |
#savekey ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/spaux/cli.rb', line 33 def savekey key = Spaux::Chef::Key.new.raw_key if ![:file] puts key else ::File.write([:file], key) end end |
#ssh(nodename) ⇒ Object
51 52 53 54 |
# File 'lib/spaux/cli.rb', line 51 def ssh(nodename) ssh_cmd = Spaux::CLI::SSHSubcommand.new ssh_cmd.run(nodename, ) end |