catfish 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 74963910c0c501a10a4eb5c44ad4de8c95d25be9
4
- data.tar.gz: 1041ab59f8293a410d06cd0b868085b839b9bfdf
3
+ metadata.gz: 6b209bc38fa7845bde7d77a923adbc95afde6e6a
4
+ data.tar.gz: 730626a1fde2ec8806945bfae9ae629133695b80
5
5
  SHA512:
6
- metadata.gz: f26cc28d1d4b64ed91237f95f9c4397efd660796139e4fddf91e4f6eee007c1cd706881a504f4eff8ce9bd9374945b9749cccb07102cf17f3ea23649200bd87f
7
- data.tar.gz: deb1cac85cd409ab9cae112b973daaaad7ad8d8fa991f2a9b1539b91bfc4f0e97a695ae5a2a21cdc747f0b6110d42b9f1a73271e18561149da6d338f3e911949
6
+ metadata.gz: 532e16b65a907c6b86cb9e780d429b75991988cf815d644cab49b248235f9209c7161b8f759fd71d1171c36f82cba39cefa563c82ee9b9650fb1d4ea74b8d178
7
+ data.tar.gz: eae765e3a7a0ae3f15c1d8b6f087cb67238f270dee1d14f8b126b2635305573ab0ae9b60d68922f69312947bf20db4b9250a7382c07bd3a314cc3d6fac9d82ce
data/.gitignore CHANGED
@@ -32,3 +32,6 @@ build/
32
32
 
33
33
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
34
  .rvmrc
35
+
36
+ # vagrant
37
+ .vagrant
data/README.md CHANGED
@@ -58,7 +58,6 @@ And you can even run the provisioning in parallel
58
58
 
59
59
  - Puppet provisioner support
60
60
  - Vagrant plugin support in Catfishfile
61
- - WinRM support
62
61
 
63
62
  ## Contributing
64
63
 
data/lib/catfish/cli.rb CHANGED
@@ -38,6 +38,7 @@ module Catfish
38
38
  method_option 'ssh-username', type: :string, banner: 'SSH username'
39
39
  method_option 'ssh-private-key-path', type: :string, banner: 'Path to SSH private key'
40
40
  method_option 'servers', type: :array, banner: 'Initial list of servers to include in Catfishfile'
41
+ method_option 'plugins', type: :array, banner: 'Vagrant plugins to be installed'
41
42
  def init
42
43
  require 'catfish/cli/init'
43
44
  Init.new(options.dup, self).run
@@ -46,7 +47,13 @@ module Catfish
46
47
  desc 'resolve [OPTIONS]', 'Resolves the servers listed in Catfishfile to .lock'
47
48
  def resolve
48
49
  require 'catfish/cli/resolve'
49
- Resolve.new(options.dup, self).run
50
+ Resolve.new(options.dup).run
51
+ end
52
+
53
+ desc 'plugin', 'Install plugins defined in Catfishfile'
54
+ def plugin
55
+ require 'catfish/cli/plugin'
56
+ Plugin.new(options.dup).run
50
57
  end
51
58
 
52
59
  desc 'provision [OPTIONS]', 'Provision to the servers specified in Catfishfile.lock'
@@ -54,6 +61,7 @@ module Catfish
54
61
  method_option 'parallel', type: :boolean, default: 'false', banner: 'Run provisioning in parallel'
55
62
  def provision
56
63
  invoke :resolve
64
+ invoke :plugin
57
65
  require 'catfish/cli/provision'
58
66
  Provision.new(options.dup).run
59
67
  end
@@ -17,14 +17,15 @@ module Catfish
17
17
  }
18
18
 
19
19
  opts = {
20
- provisioners: options[:provisioners] || [],
21
- shell_paths: options['shell-paths'] || ['{{PATH_TO_YOUR_SCRIPT}}'],
22
- communicator: options[:communicator] || 'ssh',
20
+ provisioners: options[:provisioners] || [],
21
+ shell_paths: options['shell-paths'] || ['{{PATH_TO_YOUR_SCRIPT}}'],
22
+ communicator: options[:communicator] || 'ssh',
23
23
  winrm_username: options['winrm-username'] || '{{YOUR_WINRM_USERNAME}}',
24
24
  winrm_password: options['winrm-password'] || '{{YOUR_WINRM_PASSWORD}}',
25
- ssh_username: options['ssh-username'] || '{{YOUR_SSH_USERNAME}}',
25
+ ssh_username: options['ssh-username'] || '{{YOUR_SSH_USERNAME}}',
26
26
  ssh_private_key_path: options['ssh-private-key-path'] || '{{PATH_TO_YOUR_SSH_PRIVATE_KEY}}',
27
- servers: options['servers'] || []
27
+ servers: options['servers'] || [],
28
+ plugins: options['plugins'] || []
28
29
  }
29
30
 
30
31
  templates.each do |src, dst|
@@ -0,0 +1,19 @@
1
+ module Catfish
2
+ class CLI::Plugin
3
+ attr_reader :options
4
+
5
+ def initialize(options)
6
+ @options = options
7
+ end
8
+
9
+ def run
10
+ puts 'Installing plugins'
11
+ builder = Dsl.new
12
+ builder.eval_catfishfile
13
+
14
+ builder.plugins.each do |plugin|
15
+ system("vagrant plugin install #{plugin}") unless `vagrant plugin list`.include? plugin
16
+ end
17
+ end
18
+ end
19
+ end
@@ -9,7 +9,6 @@ module Catfish
9
9
  def run
10
10
  p 'Provisioning to servers using Catfishfile.lock'
11
11
  vagrant_version
12
- vagrant_plugins
13
12
  begin
14
13
  # Connect to the servers. The --provider=managed is the key here.
15
14
  system("vagrant up --provider=#{options[:provider]}")
@@ -37,14 +36,6 @@ module Catfish
37
36
  fail "#{vagrant_version} or greater is a prerequisite" unless `vagrant --version`.include? vagrant_version
38
37
  end
39
38
 
40
- def vagrant_plugins
41
- # Make sure that the vagrant-managed-servers plugin is installed
42
- plugins = ['vagrant-managed-servers']
43
- plugins.each do |plugin|
44
- system("vagrant plugin install #{plugin}") unless `vagrant plugin list`.include? plugin
45
- end
46
- end
47
-
48
39
  def provision
49
40
  if options[:parallel]
50
41
  machines = status.split("\n").collect do |line|
@@ -1,10 +1,9 @@
1
1
  module Catfish
2
2
  class CLI::Resolve
3
- attr_reader :options, :thor
3
+ attr_reader :options
4
4
 
5
- def initialize(options, thor)
5
+ def initialize(options)
6
6
  @options = options
7
- @thor = thor
8
7
  end
9
8
 
10
9
  def run
data/lib/catfish/dsl.rb CHANGED
@@ -5,10 +5,11 @@ module Catfish
5
5
  builder.eval_catfishfile
6
6
  end
7
7
 
8
- attr_accessor :servers
8
+ attr_accessor :servers, :plugins
9
9
 
10
10
  def initialize
11
11
  @servers = []
12
+ @plugins = ['vagrant-managed-servers']
12
13
  end
13
14
 
14
15
  def eval_catfishfile
@@ -20,5 +21,9 @@ module Catfish
20
21
  def server(name, *_args)
21
22
  servers << name
22
23
  end
24
+
25
+ def plugin(name, *_args)
26
+ plugins << name
27
+ end
23
28
  end
24
29
  end
@@ -4,3 +4,7 @@
4
4
  <% config[:servers].each do |server| -%>
5
5
  server '<%= server %>'
6
6
  <% end %>
7
+
8
+ <%config[:plugins].each do |plugin| -%>
9
+ plugin '<%= plugin %>'
10
+ <% end %>
@@ -11,7 +11,6 @@ Vagrant.configure("2") do |config|
11
11
  <% end -%>
12
12
  <% end -%>
13
13
  <% end -%>
14
-
15
14
  <% if config[:communicator] == 'winrm' -%>
16
15
  config.vm.communicator = '<%= config[:communicator] %>'
17
16
  config.vm.winrm.username = '<%= config[:winrm_username] %>'
@@ -1,3 +1,3 @@
1
1
  module Catfish
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: catfish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Baldauf
@@ -76,10 +76,6 @@ extra_rdoc_files: []
76
76
  files:
77
77
  - .gitignore
78
78
  - .rubocop.yml
79
- - .vagrant/machines/10.52.100.79/managed/id
80
- - .vagrant/machines/10.52.100.79/managed/index_uuid
81
- - .vagrant/machines/10.52.101.106/managed/id
82
- - .vagrant/machines/10.52.101.106/managed/index_uuid
83
79
  - Gemfile
84
80
  - LICENSE
85
81
  - README.md
@@ -89,6 +85,7 @@ files:
89
85
  - lib/catfish.rb
90
86
  - lib/catfish/cli.rb
91
87
  - lib/catfish/cli/init.rb
88
+ - lib/catfish/cli/plugin.rb
92
89
  - lib/catfish/cli/provision.rb
93
90
  - lib/catfish/cli/resolve.rb
94
91
  - lib/catfish/dsl.rb
@@ -1 +0,0 @@
1
- 10.52.100.79
@@ -1 +0,0 @@
1
- 43c409ec41664be6a0323efe51fadc38
@@ -1 +0,0 @@
1
- 10.52.101.106
@@ -1 +0,0 @@
1
- 64a8ed314d0748a9b5567f5e122dad48