master_manipulator 1.2.6 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDZjYzhmMTQ2OGU3OTdhYWI3OWI3NzRkOWE0NzliZTZiY2NmNDdlOQ==
4
+ NzVhNzRiNjAxNDU5YmJlMzZhZTM3YWU3Zjg5MzQyZjc3ZmE3ZGM1ZA==
5
5
  data.tar.gz: !binary |-
6
- NjU0MjQ0NTQzMjNhYzM1NzE0MzljN2QwNjI1YTlmMDY2ODAzMWUwNA==
6
+ NGEwYjc1YTIxN2RkZWE4M2UwNjJlZTQ2MmRlOTQ2ODE3N2M5MjE1Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTZlNDBkZTk3ZjJkYWZkNGQwNTUwYmJmMzYxOTk0ZGM0NjJhNDM1ZThkNjc5
10
- YmE0ZDhjY2ZiZGMwYWM3ZGYxYjFiZTYzMWI4OGIxODc3YTc4OGVhMmI1NzNk
11
- OTZiNzkyOWUwMmU2YTYzNWZlNWVmNDk1YjZhODMwZTNjNjk2OTE=
9
+ Y2FiZmI2MWI5MzdkMTBhNzZhMTYyNTM4ODQzNDMwNGEzZmU2N2ZiMTAwZDM3
10
+ ODE2ZTkxYmEyYjhjOGM3MDA3YzcwNDhiMGIxMDRmYWNmOTFhYWY2MmE1YmEz
11
+ MGNiMzU4YTFiMTYwNjc2MzliZTY4OGY2Yjg0MDJmZTc1MjRhMDM=
12
12
  data.tar.gz: !binary |-
13
- MjcxMzIxZDgzYzk1NzJiOTA1MzQyYjhkMTFiNDE5NmRjMjU1ODRhNTcyNzA0
14
- NjRmOTQ1YTlhOTcyYWM2MzUwMDkzYjg3NzU1NDI1YWI1MmY2MTgyOGE5YmVk
15
- MDRjYTU0OTdhNDk5YTVkZDhiNjYwYjE5NzRiNjcxNmEzZGY3ZDk=
13
+ YWY0OGNmMzBmZDZmZDBjMzUzYjMzNzc1YTcxZGRlMjkzN2M1OTIzYmI3N2Nh
14
+ OTNlYzdmMmQ3ZjNhNTNhYTZjY2JmZDkwYmUxNzIyYzg5ODY1Y2RhZjhmMDA3
15
+ ODU1MzYxMDEyMTcxOTk0ZDFlNjQwMzI4NzdmMzUzMzQ5MzU5NGY=
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
- # default - History
1
+ # worker - History
2
2
  ## Tags
3
- * [LATEST - 10 Jan, 2017 (e3ff6153)](#LATEST)
3
+ * [LATEST - 8 Mar, 2017 (325436d0)](#LATEST)
4
+ * [1.2.6 - 10 Jan, 2017 (866a03cb)](#1.2.6)
4
5
  * [1.2.4 - 27 Sep, 2016 (48017488)](#1.2.4)
5
6
  * [1.2.3 - 20 Nov, 2015 (f31e884e)](#1.2.3)
6
7
  * [1.2.2 - 30 Oct, 2015 (31450d3c)](#1.2.2)
@@ -13,7 +14,23 @@
13
14
  * [1.0.0 - 6 May, 2015 (8ae50d90)](#1.0.0)
14
15
 
15
16
  ## Details
16
- ### <a name = "LATEST">LATEST - 10 Jan, 2017 (e3ff6153)
17
+ ### <a name = "LATEST">LATEST - 8 Mar, 2017 (325436d0)
18
+
19
+ * (GEM) update master_manipulator version to 1.2.7 (325436d0)
20
+
21
+ * Merge pull request #27 from RandellP/QA-2827 (90ddd470)
22
+
23
+
24
+ ```
25
+ Merge pull request #27 from RandellP/QA-2827
26
+
27
+ (QA-2827) added log rotation in a new module called log
28
+ ```
29
+ * added log rotation in a new module called log (517159da)
30
+
31
+ ### <a name = "1.2.6">1.2.6 - 10 Jan, 2017 (866a03cb)
32
+
33
+ * (HISTORY) update master_manipulator history for gem release 1.2.6 (866a03cb)
17
34
 
18
35
  * (GEM) update master_manipulator version to 1.2.6 (e3ff6153)
19
36
 
@@ -3,11 +3,12 @@ require 'beaker'
3
3
 
4
4
  module Beaker
5
5
  class TestCase
6
- %w( config service site ).each do |lib|
6
+ %w( config service site log ).each do |lib|
7
7
  require "master_manipulator/#{lib}"
8
8
  end
9
9
  include MasterManipulator::Config
10
10
  include MasterManipulator::Service
11
11
  include MasterManipulator::Site
12
+ include MasterManipulator::Log
12
13
  end
13
14
  end
@@ -0,0 +1,45 @@
1
+
2
+ module MasterManipulator
3
+ module Log
4
+
5
+ #<fileNamePattern>/var/log/puppetlabs/puppetserver/puppetserver-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
6
+
7
+ # Rollover the puppetserver log file the same way logback would
8
+ # @param [Beaker::Host] master_host The host to manipulate.
9
+ # @return nil
10
+ # @example Rollover the puppetserver log on a PE master
11
+ # rotate_puppet_server_log(master)
12
+ def rotate_puppet_server_log(master_host)
13
+
14
+ log_dir = on(master_host, "puppet config print logdir").stdout.chomp
15
+ #this is ugly, rev 2 should parse the logback.xml, doesn't seem to be another way
16
+ log_file = log_dir + "server/puppetserver.log"
17
+
18
+ date_str = on(master_host, "date +%Y-%m-%d").stdout.chomp
19
+ backup_log_file = log_file.sub(/\log$/,date_str)
20
+
21
+ if ( on(master_host, "test -f #{log_file}",:accept_all_exit_codes => true).exit_code != 0 ) then
22
+ raise("Puppetserver log file missing: #{log_file}")
23
+ end
24
+
25
+ i = 0
26
+ max = 100
27
+ while (i < max) do
28
+ if ( on(master_host, "test -f #{backup_log_file}.#{i}.log",:accept_all_exit_codes => true).exit_code == 1 ) then
29
+ backup_log_file = "#{backup_log_file}.#{i}.log"
30
+ break
31
+ end
32
+ i += 1
33
+ end
34
+ if ( i == max ) then
35
+ raise("Looks like #{max} puppetserver log rotations in one minute, more likely a code issue")
36
+ end
37
+ if ( on(master_host, "cp #{log_file} #{backup_log_file}; cat /dev/null > #{log_file}",:accept_all_exit_codes => true).exit_code != 0 ) then
38
+ raise("The copy truncate operation failed: cp #{log_file} #{backup_log_file}; cat /dev/null > #{log_file}");
39
+ end
40
+
41
+ end
42
+
43
+ end
44
+ end
45
+
@@ -1,5 +1,5 @@
1
1
  module MasterManipulator
2
2
  module Version
3
- STRING = '1.2.6'
3
+ STRING = '1.2.7'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: master_manipulator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-10 00:00:00.000000000 Z
11
+ date: 2017-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -151,6 +151,7 @@ files:
151
151
  - Rakefile
152
152
  - lib/master_manipulator.rb
153
153
  - lib/master_manipulator/config.rb
154
+ - lib/master_manipulator/log.rb
154
155
  - lib/master_manipulator/service.rb
155
156
  - lib/master_manipulator/site.rb
156
157
  - lib/master_manipulator/version.rb