marionetta 0.4.7.1 → 0.4.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -177,7 +177,6 @@ staging.manipulate_each_server(:deployer, :rollback)
177
177
  - Add ability to define permissions with Manipulators::Deployer
178
178
  - Change :before_script and :after_script to :before_scripts and :after_scripts
179
179
  that take an array
180
- - Use same technique for transfering puppet files as used by deployer
181
180
 
182
181
  ## Author
183
182
 
data/lib/marionetta.rb CHANGED
@@ -27,7 +27,7 @@
27
27
  #
28
28
  module Marionetta
29
29
 
30
- VERSION = '0.4.7.1'
30
+ VERSION = '0.4.8'
31
31
 
32
32
  ### Defining Servers
33
33
 
@@ -4,7 +4,7 @@ module Marionetta
4
4
  class DirectorySync
5
5
  include Commandable
6
6
 
7
- def self.sync(server, from, to, options)
7
+ def self.sync(server, from, to, options = {})
8
8
  new(server).sync(from, to, options)
9
9
  end
10
10
 
@@ -12,9 +12,16 @@ module Marionetta
12
12
  @server = server
13
13
  end
14
14
 
15
- def sync(from, to, options)
15
+ def sync(from, to, options = {})
16
16
  create_dir(to)
17
- sync_dir(from, to, options[:exclude])
17
+
18
+ if options.has_key?(:exclude)
19
+ excludes = options[:exclude]
20
+ else
21
+ excludes = []
22
+ end
23
+
24
+ sync_dir(from, to, excludes)
18
25
  end
19
26
 
20
27
  private
@@ -16,7 +16,7 @@ module Marionetta
16
16
  #
17
17
  require_relative 'manipulators/deployer'
18
18
  require_relative 'manipulators/debloyer'
19
- require_relative 'manipulators/puppet_manipulator'
19
+ require_relative 'manipulators/puppet'
20
20
 
21
21
  # A hash of all the manipulators.
22
22
  #
@@ -8,6 +8,7 @@
8
8
  # nodes them this class maybe what you're looking for.
9
9
  #
10
10
  require 'marionetta/commandable'
11
+ require 'marionetta/directory_sync'
11
12
 
12
13
  module Marionetta
13
14
  module Manipulators
@@ -71,9 +72,8 @@ module Marionetta
71
72
  #
72
73
  def update()
73
74
  install unless installed?
74
- archive_files
75
- send_archive
76
- apply_archive
75
+ send_puppet_files
76
+ apply_puppet_files
77
77
  end
78
78
 
79
79
  private
@@ -109,36 +109,27 @@ module Marionetta
109
109
  "/tmp/puppet_#{server[:hostname]}"
110
110
  end
111
111
 
112
- def archive_files()
113
- cmds = [
114
- "rm -rf #{puppet_tmp}",
115
- "mkdir #{puppet_tmp}",
116
- "cp #{server[:puppet][:manifest]} #{puppet_tmp}/manifest.pp",
117
- ]
112
+ def send_puppet_files()
113
+ from = [server[:puppet][:manifest]]
118
114
 
119
115
  if server[:puppet].has_key?(:modules)
120
- cmds << "cp -r #{server[:puppet][:modules]} #{puppet_tmp}/modules"
116
+ from << server[:puppet][:modules]
121
117
  end
122
118
 
123
- cmd.system(cmds.join(' && '))
124
- cmd.archive(puppet_tmp)
119
+ cmd.put(from, puppet_tmp)
125
120
  end
126
121
 
127
- def send_archive()
128
- cmd.put("#{puppet_tmp}.tar.gz")
129
- end
130
-
131
- def apply_archive()
132
- cmd.ssh_extract("#{puppet_tmp}.tar.gz")
122
+ def apply_puppet_files()
133
123
  cmds = ["cd #{puppet_tmp}"]
134
124
 
135
125
  puppet_cmd = ['sudo puppet apply']
136
126
 
137
127
  if server[:puppet].has_key?(:modules)
138
- puppet_cmd << "--modulepath=#{puppet_tmp}/modules"
128
+ module_basename = File.basename(server[:puppet][:modules])
129
+ puppet_cmd << "--modulepath=#{puppet_tmp}/#{module_basename}"
139
130
  end
140
131
 
141
- puppet_cmd << 'manifest.pp'
132
+ puppet_cmd << File.basename(server[:puppet][:manifest])
142
133
 
143
134
  if server[:puppet].has_key?(:flags)
144
135
  puppet_cmd << server[:puppet][:flags]
@@ -1,5 +1,5 @@
1
1
  require 'spec_helper'
2
- require_relative '../lib/marionetta/manipulators/puppet_manipulator'
2
+ require_relative '../lib/marionetta/manipulators/puppet'
3
3
 
4
4
  describe Marionetta::Manipulators::Puppet do
5
5
  it 'should manipulate one server map' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marionetta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7.1
4
+ version: 0.4.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -146,7 +146,7 @@ files:
146
146
  - lib/marionetta/manipulators.rb
147
147
  - lib/marionetta/manipulators/debloyer.rb
148
148
  - lib/marionetta/manipulators/deployer.rb
149
- - lib/marionetta/manipulators/puppet_manipulator.rb
149
+ - lib/marionetta/manipulators/puppet.rb
150
150
  - lib/marionetta/rake_helper.rb
151
151
  - marionetta.gemspec
152
152
  - spec/app/after
@@ -179,7 +179,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
179
179
  version: '0'
180
180
  segments:
181
181
  - 0
182
- hash: -1088105927365004280
182
+ hash: 3588169205023904270
183
183
  required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  none: false
185
185
  requirements:
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  version: '0'
189
189
  segments:
190
190
  - 0
191
- hash: -1088105927365004280
191
+ hash: 3588169205023904270
192
192
  requirements: []
193
193
  rubyforge_project:
194
194
  rubygems_version: 1.8.24