catfish 0.0.2 → 0.0.3

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: b63b69165aada8de23e53e4022a6acf0b3500093
4
- data.tar.gz: 34bd5c4600e0d32a6ef1be3ab07426041093b921
3
+ metadata.gz: 74963910c0c501a10a4eb5c44ad4de8c95d25be9
4
+ data.tar.gz: 1041ab59f8293a410d06cd0b868085b839b9bfdf
5
5
  SHA512:
6
- metadata.gz: 19103395e52ac6776a15947222b5f5323b71bea9e30baf17589388069b5f1869bfb6d998e1df4e4a2a70f140c491515c7bb6de113f2331dab623495300c50c5d
7
- data.tar.gz: cb8bb9b8117ea866d22594496486e559c24764514a55e35cc22348bdcd44d24585ded1c0c38a7589dfdc69fc5c686e65a7033904b2a4a410523251e2d6e0a261
6
+ metadata.gz: f26cc28d1d4b64ed91237f95f9c4397efd660796139e4fddf91e4f6eee007c1cd706881a504f4eff8ce9bd9374945b9749cccb07102cf17f3ea23649200bd87f
7
+ data.tar.gz: deb1cac85cd409ab9cae112b973daaaad7ad8d8fa991f2a9b1539b91bfc4f0e97a695ae5a2a21cdc747f0b6110d42b9f1a73271e18561149da6d338f3e911949
@@ -0,0 +1 @@
1
+ 10.52.100.79
@@ -0,0 +1 @@
1
+ 43c409ec41664be6a0323efe51fadc38
@@ -0,0 +1 @@
1
+ 10.52.101.106
@@ -0,0 +1 @@
1
+ 64a8ed314d0748a9b5567f5e122dad48
data/README.md CHANGED
@@ -56,7 +56,6 @@ And you can even run the provisioning in parallel
56
56
 
57
57
  ## TODO
58
58
 
59
- - Perform resolve as part of provision to simplify the flow
60
59
  - Puppet provisioner support
61
60
  - Vagrant plugin support in Catfishfile
62
61
  - WinRM support
data/Rakefile CHANGED
@@ -1,4 +1,7 @@
1
1
  require 'bundler/gem_tasks'
2
2
  require 'rubocop/rake_task'
3
+ require 'rake/clean'
4
+
5
+ CLEAN.include('Catfishfile', 'Catfishfile.lock', 'Vagrantfile')
3
6
 
4
7
  RuboCop::RakeTask.new
@@ -17,10 +17,14 @@ 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',
23
+ winrm_username: options['winrm-username'] || '{{YOUR_WINRM_USERNAME}}',
24
+ winrm_password: options['winrm-password'] || '{{YOUR_WINRM_PASSWORD}}',
20
25
  ssh_username: options['ssh-username'] || '{{YOUR_SSH_USERNAME}}',
21
26
  ssh_private_key_path: options['ssh-private-key-path'] || '{{PATH_TO_YOUR_SSH_PRIVATE_KEY}}',
22
- provisioners: options[:provisioners] || [],
23
- shell_paths: options['shell-paths'] || ['{{PATH_TO_YOUR_SCRIPT}}']
27
+ servers: options['servers'] || []
24
28
  }
25
29
 
26
30
  templates.each do |src, dst|
data/lib/catfish/cli.rb CHANGED
@@ -31,9 +31,13 @@ module Catfish
31
31
  TODO: Long description
32
32
  D
33
33
  method_option 'provisioners', type: :array, banner: 'A list of vagrant provisiners to use'
34
+ method_option 'communicator', type: :string, banner: 'The communicator. ssh (default) or winrm'
35
+ method_option 'winrm-username', type: :string, banner: 'Username for winrm. Used with --communicator=winrm'
36
+ method_option 'winrm-password', type: :string, banner: 'Password for winrm. Used with --communicator=winrm'
34
37
  method_option 'shell-paths', type: :array, banner: 'A list of paths to use if shell provisioning is selected'
35
38
  method_option 'ssh-username', type: :string, banner: 'SSH username'
36
39
  method_option 'ssh-private-key-path', type: :string, banner: 'Path to SSH private key'
40
+ method_option 'servers', type: :array, banner: 'Initial list of servers to include in Catfishfile'
37
41
  def init
38
42
  require 'catfish/cli/init'
39
43
  Init.new(options.dup, self).run
@@ -1,3 +1,6 @@
1
1
  # A sample Catfishfile
2
2
 
3
3
  # server 'myserver.mydomain.com'
4
+ <% config[:servers].each do |server| -%>
5
+ server '<%= server %>'
6
+ <% end %>
@@ -3,24 +3,31 @@
3
3
 
4
4
  Vagrant.configure("2") do |config|
5
5
 
6
- config.vm.box = "tknerr/managed-server-dummy"
6
+ config.vm.box = "tknerr/managed-server-dummy"
7
7
  <% config[:provisioners].each do |provisioner| -%>
8
8
  <% if provisioner == 'shell' -%>
9
9
  <% config[:shell_paths].each do |path| -%>
10
- config.vm.provision 'shell', path: '<%= path %>'
10
+ config.vm.provision 'shell', path: '<%= path %>'
11
11
  <% end -%>
12
12
  <% end -%>
13
13
  <% end -%>
14
14
 
15
- instances = File.readlines('Catfishfile.lock').map(&:chomp)
16
- instances.each do |instance|
17
- next if instance.start_with? '#'
18
- config.vm.define "#{instance}" do |box|
19
- box.vm.provider :managed do |managed, override|
20
- managed.server = instance
21
- override.ssh.username = '<%= config[:ssh_username] %>'
22
- override.ssh.private_key_path = '<%= config[:ssh_private_key_path] %>'
23
- end
24
- end
25
- end
15
+ <% if config[:communicator] == 'winrm' -%>
16
+ config.vm.communicator = '<%= config[:communicator] %>'
17
+ config.vm.winrm.username = '<%= config[:winrm_username] %>'
18
+ config.vm.winrm.password = '<%= config[:winrm_password] %>'
19
+ <% end -%>
20
+
21
+ instances = File.readlines('Catfishfile.lock').map(&:chomp)
22
+ instances.each do |instance|
23
+ config.vm.define "#{instance}" do |box|
24
+ box.vm.provider :managed do |managed, override|
25
+ managed.server = instance
26
+ <% if config[:communicator] == 'ssh' -%>
27
+ override.ssh.username = '<%= config[:ssh_username] %>'
28
+ override.ssh.private_key_path = '<%= config[:ssh_private_key_path] %>'
29
+ <% end -%>
30
+ end
31
+ end
32
+ end
26
33
  end
@@ -1,3 +1,3 @@
1
1
  module Catfish
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
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.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Baldauf
@@ -76,6 +76,10 @@ 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
79
83
  - Gemfile
80
84
  - LICENSE
81
85
  - README.md