knife-tidy 1.2.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore DELETED
@@ -1,52 +0,0 @@
1
- *.rbc
2
- .config
3
- coverage
4
- InstalledFiles
5
- lib/bundler/man
6
- pkg
7
- rdoc
8
- spec/reports
9
- test/tmp
10
- test/version_tmp
11
- tmp
12
- _Store
13
- reports/
14
- conf/*.json
15
- *~
16
- *#
17
- .#*
18
- \#*#
19
- .*.sw[a-z]
20
- *.un~
21
- *.tmp
22
- *.bk
23
- *.bkup
24
-
25
- # ruby/bundler files
26
- .ruby-version
27
- .ruby-gemset
28
- .rvmrc
29
- Gemfile.lock
30
- .bundle
31
- *.gem
32
-
33
- # YARD artifacts
34
- .yardoc
35
- _yardoc
36
- doc/
37
- .idea
38
-
39
- # chef stuff
40
- Berksfile.lock
41
- .kitchen
42
- .kitchen.local.yml
43
- vendor/
44
- .coverage/
45
- .zero-knife.rb
46
- Policyfile.lock.json
47
- .chef/
48
-
49
- # vagrant stuff
50
- .vagrant/
51
- .vagrant.d/
52
- .kitchen/
@@ -1,26 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- dist: trusty
4
- sudo: false
5
-
6
- # Early warning system to catch if Rubygems breaks something
7
- before_install:
8
- - gem update --system
9
- - gem uninstall bundler -a -x
10
- - gem install bundler
11
- - rm -f .bundle/config
12
-
13
- rvm:
14
- - 2.3.5
15
- - 2.4.2
16
- - ruby-head
17
-
18
- matrix:
19
- allow_failures:
20
- - rvm: ruby-head
21
-
22
- script: bundle exec rake spec
23
-
24
- branches:
25
- only:
26
- - master
@@ -1,246 +0,0 @@
1
- # Change Log
2
-
3
- ## [1.2.0](https://github.com/chef-customers/knife-tidy/tree/1.2.0) (2018-05-17)
4
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/1.1.0...1.2.0)
5
-
6
- **Closed issues:**
7
-
8
- - notifications fail for chef orgs containing an underscore [\#77](https://github.com/chef-customers/knife-tidy/issues/77)
9
- - Add option to attach raw JSON report files to the email notification [\#75](https://github.com/chef-customers/knife-tidy/issues/75)
10
-
11
- **Merged pull requests:**
12
-
13
- - bump to 1.2.0 [\#85](https://github.com/chef-customers/knife-tidy/pull/85) ([jeremymv2](https://github.com/jeremymv2))
14
- - fix empty clients group [\#84](https://github.com/chef-customers/knife-tidy/pull/84) ([jeremymv2](https://github.com/jeremymv2))
15
-
16
- ## [1.1.0](https://github.com/chef-customers/knife-tidy/tree/1.1.0) (2018-01-11)
17
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/1.0.1...1.1.0)
18
-
19
- **Closed issues:**
20
-
21
- - the backup-path should default to current working directory [\#79](https://github.com/chef-customers/knife-tidy/issues/79)
22
-
23
- **Merged pull requests:**
24
-
25
- - Jjh/fix notification reports [\#80](https://github.com/chef-customers/knife-tidy/pull/80) ([itmustbejj](https://github.com/itmustbejj))
26
-
27
- ## [1.0.1](https://github.com/chef-customers/knife-tidy/tree/1.0.1) (2017-12-12)
28
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/1.0.0...1.0.1)
29
-
30
- **Closed issues:**
31
-
32
- - Clean up references to tidy methods [\#68](https://github.com/chef-customers/knife-tidy/issues/68)
33
- - A stale search index can generate inaccurate tidy reports [\#62](https://github.com/chef-customers/knife-tidy/issues/62)
34
-
35
- **Merged pull requests:**
36
-
37
- - Fix validate\_user\_acls and default\_user\_acl methods [\#73](https://github.com/chef-customers/knife-tidy/pull/73) ([itmustbejj](https://github.com/itmustbejj))
38
-
39
- ## [1.0.0](https://github.com/chef-customers/knife-tidy/tree/1.0.0) (2017-12-04)
40
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.7.0...1.0.0)
41
-
42
- **Merged pull requests:**
43
-
44
- - Enabled cookbook deletion [\#71](https://github.com/chef-customers/knife-tidy/pull/71) ([itmustbejj](https://github.com/itmustbejj))
45
- - Add option for backup path to server clean [\#70](https://github.com/chef-customers/knife-tidy/pull/70) ([TheLunaticScripter](https://github.com/TheLunaticScripter))
46
- - Warn the user if there are nodes created in the last hour that haven'… [\#67](https://github.com/chef-customers/knife-tidy/pull/67) ([itmustbejj](https://github.com/itmustbejj))
47
- - Add guard to skip generating org reports if the search index is not u… [\#66](https://github.com/chef-customers/knife-tidy/pull/66) ([itmustbejj](https://github.com/itmustbejj))
48
- - Enable server clean command and clarify confirmation dialogue [\#31](https://github.com/chef-customers/knife-tidy/pull/31) ([jonlives](https://github.com/jonlives))
49
-
50
- ## [0.7.0](https://github.com/chef-customers/knife-tidy/tree/0.7.0) (2017-11-29)
51
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.6.1...0.7.0)
52
-
53
- **Closed issues:**
54
-
55
- - Users/clients from backups older than CS 12.5 may be missing read acls on clients [\#63](https://github.com/chef-customers/knife-tidy/issues/63)
56
- - notify subcommand ignores --orgs option [\#59](https://github.com/chef-customers/knife-tidy/issues/59)
57
-
58
- **Merged pull requests:**
59
-
60
- - release 0.7.0 [\#65](https://github.com/chef-customers/knife-tidy/pull/65) ([jeremymv2](https://github.com/jeremymv2))
61
- - Add admins/users groups to the read acl for clients from \< CS 12.5 [\#64](https://github.com/chef-customers/knife-tidy/pull/64) ([itmustbejj](https://github.com/itmustbejj))
62
- - Restore acls for ::server-admins and org read access groups if they a… [\#61](https://github.com/chef-customers/knife-tidy/pull/61) ([itmustbejj](https://github.com/itmustbejj))
63
- - Filter email notifications on org\_list config option. [\#60](https://github.com/chef-customers/knife-tidy/pull/60) ([itmustbejj](https://github.com/itmustbejj))
64
- - Set default encoding to utf-8 to properly handle non-ascii in backups. [\#58](https://github.com/chef-customers/knife-tidy/pull/58) ([itmustbejj](https://github.com/itmustbejj))
65
- - Add check for pre-12.3 nodes to report generation… [\#57](https://github.com/chef-customers/knife-tidy/pull/57) ([jonlives](https://github.com/jonlives))
66
- - bump path to 0.6.1 [\#55](https://github.com/chef-customers/knife-tidy/pull/55) ([jeremymv2](https://github.com/jeremymv2))
67
-
68
- ## [0.6.1](https://github.com/chef-customers/knife-tidy/tree/0.6.1) (2017-10-26)
69
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.6.0...0.6.1)
70
-
71
- **Closed issues:**
72
-
73
- - knife tidy server clean - org names with \_ [\#53](https://github.com/chef-customers/knife-tidy/issues/53)
74
-
75
- **Merged pull requests:**
76
-
77
- - fixing orgs with underscores [\#54](https://github.com/chef-customers/knife-tidy/pull/54) ([jeremymv2](https://github.com/jeremymv2))
78
- - Jeremymv2/release 0 6 0 [\#52](https://github.com/chef-customers/knife-tidy/pull/52) ([jeremymv2](https://github.com/jeremymv2))
79
-
80
- ## [0.6.0](https://github.com/chef-customers/knife-tidy/tree/0.6.0) (2017-10-23)
81
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.5.2...0.6.0)
82
-
83
- **Merged pull requests:**
84
-
85
- - fix travis [\#51](https://github.com/chef-customers/knife-tidy/pull/51) ([jeremymv2](https://github.com/jeremymv2))
86
- - Add knife tidy notify command [\#50](https://github.com/chef-customers/knife-tidy/pull/50) ([jonlives](https://github.com/jonlives))
87
- - bump to 0.5.2 [\#49](https://github.com/chef-customers/knife-tidy/pull/49) ([jeremymv2](https://github.com/jeremymv2))
88
-
89
- ## [0.5.2](https://github.com/chef-customers/knife-tidy/tree/0.5.2) (2017-10-20)
90
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.5.1...0.5.2)
91
-
92
- **Merged pull requests:**
93
-
94
- - fixing regex for whitespace [\#48](https://github.com/chef-customers/knife-tidy/pull/48) ([jeremymv2](https://github.com/jeremymv2))
95
- - bump patch to 0.5.1 [\#47](https://github.com/chef-customers/knife-tidy/pull/47) ([jeremymv2](https://github.com/jeremymv2))
96
-
97
- ## [0.5.1](https://github.com/chef-customers/knife-tidy/tree/0.5.1) (2017-10-19)
98
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.5.0...0.5.1)
99
-
100
- **Merged pull requests:**
101
-
102
- - Add node\_count to stale node json output. [\#46](https://github.com/chef-customers/knife-tidy/pull/46) ([MarkGibbons](https://github.com/MarkGibbons))
103
- - bump to 0.5.0 [\#45](https://github.com/chef-customers/knife-tidy/pull/45) ([jeremymv2](https://github.com/jeremymv2))
104
-
105
- ## [0.5.0](https://github.com/chef-customers/knife-tidy/tree/0.5.0) (2017-10-06)
106
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.4.1...0.5.0)
107
-
108
- **Closed issues:**
109
-
110
- - Supermarket.chef.io [\#37](https://github.com/chef-customers/knife-tidy/issues/37)
111
-
112
- **Merged pull requests:**
113
-
114
- - enabling deletion of stale nodes [\#44](https://github.com/chef-customers/knife-tidy/pull/44) ([jeremymv2](https://github.com/jeremymv2))
115
- - better warning message before confirmation [\#43](https://github.com/chef-customers/knife-tidy/pull/43) ([jeremymv2](https://github.com/jeremymv2))
116
- - Jeremymv2/chef sugar fix default [\#42](https://github.com/chef-customers/knife-tidy/pull/42) ([jeremymv2](https://github.com/jeremymv2))
117
- - deleting nodes also deletes client [\#41](https://github.com/chef-customers/knife-tidy/pull/41) ([jeremymv2](https://github.com/jeremymv2))
118
- - Change nodes\_list method to get all nodes [\#40](https://github.com/chef-customers/knife-tidy/pull/40) ([nsdavidson](https://github.com/nsdavidson))
119
- - bump version to 0.4.1 [\#39](https://github.com/chef-customers/knife-tidy/pull/39) ([jeremymv2](https://github.com/jeremymv2))
120
-
121
- ## [0.4.1](https://github.com/chef-customers/knife-tidy/tree/0.4.1) (2017-09-27)
122
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.4.0...0.4.1)
123
-
124
- **Merged pull requests:**
125
-
126
- - fixing corrupt invitations and invalid platform names with commas in … [\#38](https://github.com/chef-customers/knife-tidy/pull/38) ([jeremymv2](https://github.com/jeremymv2))
127
- - bump to 0.4.0 [\#36](https://github.com/chef-customers/knife-tidy/pull/36) ([jeremymv2](https://github.com/jeremymv2))
128
-
129
- ## [0.4.0](https://github.com/chef-customers/knife-tidy/tree/0.4.0) (2017-09-26)
130
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.3.6...0.4.0)
131
-
132
- **Merged pull requests:**
133
-
134
- - fix NilClass on env\_run\_lists [\#35](https://github.com/chef-customers/knife-tidy/pull/35) ([jeremymv2](https://github.com/jeremymv2))
135
- - fix merge conflict from rebase [\#34](https://github.com/chef-customers/knife-tidy/pull/34) ([jeremymv2](https://github.com/jeremymv2))
136
- - Simple feature to clean up EC11 org objects which don't load into CS12 [\#33](https://github.com/chef-customers/knife-tidy/pull/33) ([irvingpop](https://github.com/irvingpop))
137
- - role run\_list clean up and metadata name regex simplification [\#32](https://github.com/chef-customers/knife-tidy/pull/32) ([jeremymv2](https://github.com/jeremymv2))
138
- - bump to 0.3.6 [\#30](https://github.com/chef-customers/knife-tidy/pull/30) ([jeremymv2](https://github.com/jeremymv2))
139
-
140
- ## [0.3.6](https://github.com/chef-customers/knife-tidy/tree/0.3.6) (2017-09-25)
141
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.3.5...0.3.6)
142
-
143
- **Merged pull requests:**
144
-
145
- - first check if the\_user.has\_key?\('email'\) [\#29](https://github.com/chef-customers/knife-tidy/pull/29) ([jeremymv2](https://github.com/jeremymv2))
146
- - bump to 0.3.5 [\#28](https://github.com/chef-customers/knife-tidy/pull/28) ([jeremymv2](https://github.com/jeremymv2))
147
-
148
- ## [0.3.5](https://github.com/chef-customers/knife-tidy/tree/0.3.5) (2017-09-20)
149
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.3.4...0.3.5)
150
-
151
- **Merged pull requests:**
152
-
153
- - Catch pins with no cookbooks [\#27](https://github.com/chef-customers/knife-tidy/pull/27) ([nsdavidson](https://github.com/nsdavidson))
154
-
155
- ## [0.3.4](https://github.com/chef-customers/knife-tidy/tree/0.3.4) (2017-09-16)
156
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.3.3...0.3.4)
157
-
158
- **Merged pull requests:**
159
-
160
- - check if metadata.has\_key?\('platforms'\) [\#26](https://github.com/chef-customers/knife-tidy/pull/26) ([jeremymv2](https://github.com/jeremymv2))
161
-
162
- ## [0.3.3](https://github.com/chef-customers/knife-tidy/tree/0.3.3) (2017-09-15)
163
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.3.2...0.3.3)
164
-
165
- **Merged pull requests:**
166
-
167
- - boiler plate gsub file now works [\#25](https://github.com/chef-customers/knife-tidy/pull/25) ([jeremymv2](https://github.com/jeremymv2))
168
- - fixing null values and emtpy arrays in metadata.json [\#24](https://github.com/chef-customers/knife-tidy/pull/24) ([jeremymv2](https://github.com/jeremymv2))
169
- - Jeremyv2/action needed notification [\#23](https://github.com/chef-customers/knife-tidy/pull/23) ([jeremymv2](https://github.com/jeremymv2))
170
-
171
- ## [0.3.2](https://github.com/chef-customers/knife-tidy/tree/0.3.2) (2017-09-14)
172
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.3.1...0.3.2)
173
-
174
- **Merged pull requests:**
175
-
176
- - fixed name mismatch in metadata.json [\#22](https://github.com/chef-customers/knife-tidy/pull/22) ([jeremymv2](https://github.com/jeremymv2))
177
-
178
- ## [0.3.1](https://github.com/chef-customers/knife-tidy/tree/0.3.1) (2017-09-14)
179
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.3.0...0.3.1)
180
-
181
- **Merged pull requests:**
182
-
183
- - generate a metadata.rb if needed [\#21](https://github.com/chef-customers/knife-tidy/pull/21) ([jeremymv2](https://github.com/jeremymv2))
184
- - newline for action needed messages [\#20](https://github.com/chef-customers/knife-tidy/pull/20) ([jeremymv2](https://github.com/jeremymv2))
185
-
186
- ## [0.3.0](https://github.com/chef-customers/knife-tidy/tree/0.3.0) (2017-09-14)
187
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.2.4...0.3.0)
188
-
189
- **Closed issues:**
190
-
191
- - FATAL: Cannot find subcommand for: 'tidy backup clean' [\#12](https://github.com/chef-customers/knife-tidy/issues/12)
192
-
193
- **Merged pull requests:**
194
-
195
- - bump to 0.3.0 [\#19](https://github.com/chef-customers/knife-tidy/pull/19) ([jeremymv2](https://github.com/jeremymv2))
196
- - added dry-run to server clean [\#18](https://github.com/chef-customers/knife-tidy/pull/18) ([jeremymv2](https://github.com/jeremymv2))
197
-
198
- ## [0.2.4](https://github.com/chef-customers/knife-tidy/tree/0.2.4) (2017-09-12)
199
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.2.3...0.2.4)
200
-
201
- **Merged pull requests:**
202
-
203
- - disable server clean [\#17](https://github.com/chef-customers/knife-tidy/pull/17) ([jeremymv2](https://github.com/jeremymv2))
204
- - bump patch to 0.2.4 [\#16](https://github.com/chef-customers/knife-tidy/pull/16) ([jeremymv2](https://github.com/jeremymv2))
205
- - correct any cookbook metadata name issues [\#15](https://github.com/chef-customers/knife-tidy/pull/15) ([jeremymv2](https://github.com/jeremymv2))
206
-
207
- ## [0.2.3](https://github.com/chef-customers/knife-tidy/tree/0.2.3) (2017-09-11)
208
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.2.2...0.2.3)
209
-
210
- **Merged pull requests:**
211
-
212
- - setting required ruby to \>= 2.0.0 [\#14](https://github.com/chef-customers/knife-tidy/pull/14) ([jeremymv2](https://github.com/jeremymv2))
213
-
214
- ## [0.2.2](https://github.com/chef-customers/knife-tidy/tree/0.2.2) (2017-09-11)
215
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.2.1...0.2.2)
216
-
217
- **Merged pull requests:**
218
-
219
- - Jeremymv2/fix to i [\#13](https://github.com/chef-customers/knife-tidy/pull/13) ([jeremymv2](https://github.com/jeremymv2))
220
- - release 0.2.1 [\#11](https://github.com/chef-customers/knife-tidy/pull/11) ([jeremymv2](https://github.com/jeremymv2))
221
-
222
- ## [0.2.1](https://github.com/chef-customers/knife-tidy/tree/0.2.1) (2017-09-01)
223
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.2.0...0.2.1)
224
-
225
- **Merged pull requests:**
226
-
227
- - first round of tests [\#10](https://github.com/chef-customers/knife-tidy/pull/10) ([jeremymv2](https://github.com/jeremymv2))
228
- - Add environment checking for unused cookbook list [\#9](https://github.com/chef-customers/knife-tidy/pull/9) ([nsdavidson](https://github.com/nsdavidson))
229
- - disable [\#8](https://github.com/chef-customers/knife-tidy/pull/8) ([jeremymv2](https://github.com/jeremymv2))
230
- - server object deletion [\#7](https://github.com/chef-customers/knife-tidy/pull/7) ([jeremymv2](https://github.com/jeremymv2))
231
- - bump version to 0.2.0 [\#6](https://github.com/chef-customers/knife-tidy/pull/6) ([jeremymv2](https://github.com/jeremymv2))
232
-
233
- ## [0.2.0](https://github.com/chef-customers/knife-tidy/tree/0.2.0) (2017-08-16)
234
- [Full Changelog](https://github.com/chef-customers/knife-tidy/compare/0.1.1...0.2.0)
235
-
236
- **Merged pull requests:**
237
-
238
- - moved all common functions to tidy\_common.rb [\#5](https://github.com/chef-customers/knife-tidy/pull/5) ([jeremymv2](https://github.com/jeremymv2))
239
- - Jeremymv2/acl items [\#4](https://github.com/chef-customers/knife-tidy/pull/4) ([jeremymv2](https://github.com/jeremymv2))
240
- - updated changelog [\#3](https://github.com/chef-customers/knife-tidy/pull/3) ([jeremymv2](https://github.com/jeremymv2))
241
- - bump version to 0.1.1 [\#2](https://github.com/chef-customers/knife-tidy/pull/2) ([jeremymv2](https://github.com/jeremymv2))
242
-
243
-
244
-
245
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
246
-
data/Gemfile DELETED
@@ -1,38 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
4
-
5
- if vsn = ENV['TRAVIS_CHEF_VERSION']
6
- if m = /branch:(?<branch>.*)$/.match(vsn)
7
- gem 'chef', git: 'https://github.com/chef/chef', branch: m[:branch]
8
- else
9
- gem 'chef', vsn
10
- end
11
- end
12
-
13
- group :development do
14
- gem 'rspec'
15
- gem 'rake'
16
- gem 'simplecov'
17
- gem 'fakefs'
18
- gem "chefstyle", git: "https://github.com/chef/chefstyle.git"
19
- gem "chef-zero"
20
- end
21
-
22
- group :changelog do
23
- gem "github_changelog_generator", git: "https://github.com/chef/github-changelog-generator"
24
- end
25
-
26
- # This is here instead of gemspec so that we can
27
- # override which Chef gem to use when we do testing
28
- # Possibilities in the future include using environmental
29
- # variables, thus allowing us to to have Travis support
30
-
31
- # Examples you can use in Gemfile.local
32
- # gem 'chef', '~> 10.28'
33
- # gem 'chef' # latest
34
- # gem 'chef', git: 'git://github.com/mal/chef.git', branch: 'CHEF-3307'
35
-
36
- # If you want to load debugging tools into the bundle exec sandbox,
37
- # # add these additional dependencies into Gemfile.local
38
- eval(IO.read(__FILE__ + '.local'), binding) if File.exists?(__FILE__ + '.local')
data/README.md DELETED
@@ -1,165 +0,0 @@
1
- # knife tidy
2
-
3
- # Summary
4
-
5
- NOTE: If you're a first-time or inexperienced knife-tidy user, we recommend you read through this blogpost before proceeding with the rest of this documentation: https://blog.chef.io/2017/10/16/migrating-chef-server-knife-ec-backup-knife-tidy/
6
-
7
- This Chef Knife plugin provides:
8
- * Reports on the state of Chef Server objects that can be tidied up
9
- * Removal of stale nodes (and associated clients and ACLs) identified by the above Reports
10
- * A [knife-ec-backup](https://github.com/chef/knife-ec-backup) companion tool that will clean up data integrity issues in an object backup
11
-
12
- # Requirements
13
-
14
- A current Chef Client. Can easily be installed via [Chef DK](https://github.com/chef/chef-dk#installation)
15
-
16
- # Installation
17
-
18
- Via Rubygems
19
- ```bash
20
- gem install knife-tidy
21
- ```
22
-
23
- Via Source
24
- ```bash
25
- git clone https://github.com/chef-customers/knife-tidy.git
26
- cd knife-tidy
27
- gem build knife-tidy.gemspec && gem install knife-tidy-*.gem --no-ri --no-rdoc
28
- ```
29
-
30
- ## Common Options
31
-
32
- The following options are supported across all subcommands:
33
-
34
- * `--orgs ORG1,ORG2`:
35
- Only apply to objects in the named organizations (default: all orgs)
36
-
37
- ## $ knife tidy server report --help
38
-
39
- Cookbooks and nodes account for the largest objects in your Chef Server.
40
- If you want to keep it lean and mean and easy to port the object data, you must
41
- tidy these unused objects up!
42
-
43
- ## Options
44
-
45
- * `--node-threshold NUM_DAYS`
46
- Maximum number of days since last checkin before node is considered stale (default: 30)
47
-
48
- Example:
49
- ```bash
50
- knife tidy server report --orgs brewinc,acmeinc --node-threshold 50
51
- ```
52
-
53
- ## Notes
54
- `server report` generates json reports as such:
55
-
56
- File Name | Contents
57
- --- | ---
58
- org_threshold_numdays_stale_nodes.json | Nodes in that org that have not checked in for the number of days specified.
59
- org_cookbook_count.json | Number of cookbook versions for each cookbook that that org.
60
- org_unused_cookbooks.json | List of cookbooks and versions that do not appear to be in-use for that org. This is determined by checking the versioned run list of each of the nodes in the org.
61
-
62
- ## $ knife tidy server clean --help
63
- Remove stale nodes that haven't checked-in to the Chef Server as defined by the `--node-threshold NUM_DAYS` option when the reports were generated.. The associated client and ACLs are also removed.
64
-
65
- ## Options
66
-
67
- * `--backup-path /path/to/an-ec-backup`
68
- The location to the last backup of the target Chef Server. It is not recommended to run the clean command without first taking a current backup using [knife-ec-backup](https://github.com/chef/knife-ec-backup)
69
-
70
- * `--only-cookbooks`
71
- Only deletes the unused cookbooks from the target Chef Server. NOTE: Cannot be specified if `--only-nodes` is already specified
72
-
73
- * `--only-nodes`
74
- Only deltes the stale nodes, associated clients, and ACLs from the target Chef Server. NOTE: Cannot be specified if `--only-cookbooks` is already specified
75
-
76
- * `--dry-run`
77
- Do not perform any actual deletion, only report on what would have been deleted.
78
-
79
- Example:
80
- ```bash
81
- knife tidy server clean --orgs brewinc,acmeinc
82
- ```
83
-
84
- ## $ knife tidy backup clean --help
85
-
86
- ## Options
87
-
88
- * `--backup-path /path/to/an-ec-backup`:
89
- The Chef Repo to tidy up (such as one created from a [knife-ec-backup](https://github.com/chef/knife-ec-backup)
90
-
91
- * `--gsub-file /path/to/gsub/file`:
92
- The path to the file used for substitutions. If non-existant, a boiler plate one will be created.
93
-
94
- Run the following example before attempting the `knife ec backup restore` operation:
95
- ```bash
96
- knife tidy backup clean --gen-gsub
97
- INFO: Creating boiler plate gsub file: 'substitutions.json'
98
- knife tidy backup clean --backup-path backups/ --gsub-file substitutions.json
99
- ```
100
-
101
- ## Notes
102
-
103
- Global file substitutions can be performed when `--gsub-file` option is used. Several known issues are corrected
104
- and others can be added with search/replace pairings. The following boiler plate file is created for you when `--gen-gsub` is used:
105
-
106
- ```json
107
- {
108
- "io-read-version-and-readme.md":{
109
- "organizations/*/cookbooks/*/metadata.rb":[
110
- {
111
- "pattern":"^version +IO.read.* 'VERSION'.*",
112
- "replace":"version !COOKBOOK_VERSION!"
113
- },
114
- {
115
- "pattern":"^long_description +IO.read.* 'README.md'.*",
116
- "replace":"#long_description \"A Long Description..\""
117
- }
118
- ]
119
- }
120
- }
121
- ```
122
-
123
- ## $ knife tidy notify
124
-
125
- The ```knife tidy notify```command is used to send a summary of the reports generated by ```knife tidy server report``` to your organisation admins.
126
-
127
- When run from the directory containing your reports, it will iterate through the reports for each organisation in turn, and query the Chef server specified in your ```knife.rb``` for all admins of that organisation.
128
-
129
- It will then generate a summary email from your knife tidy reports, and email it to all admins for that organisation.
130
-
131
- This command assumes you have access to an SMTP server you can use for sending outgoing emails.
132
-
133
- ## Options
134
-
135
- * `--smtp_server `:
136
- The SMTP Server to use (defaults to localhost)
137
- * `--smtp_port `:
138
- The SMTP Port to be used (defaults to 25)
139
- * `--smtp_username `:
140
- The SMTP Username to be used
141
- * `--smtp_password `:
142
- The SMTP Password to be used
143
- * `--smtp_from `:
144
- The From email address to be used when sending email reports
145
- * `--smtp_enable_tls `:
146
- Whether or not to enable TLS when sending reports via SMTP (defaults to false)
147
- * `--smtp_helo `:
148
- The SMTP HELO to be used (defaults to localhost)
149
-
150
- Run the following example before attempting the `knife ec backup restore` operation:
151
- ```bash
152
- $> knife tidy notify --smtp_server smtp.myserver.com --smtp_port 587 --smtp_from myuser@myserver.com --smtp_username myuser --smtp_password mypassword --smtp_use_tls
153
-
154
- Reading from /home/myuser/knife_tidy/reports directory
155
- Fetching report data for organisation mytestorg
156
- Parsing file /home/myuser/knife_tidy/reports/mytestorg_unused_cookbooks.json
157
- Parsing file /home/myuser/knife_tidy/reports/mytestorg_cookbook_count.json
158
- Parsing file /home/myuser/knife_tidy/reports/mytestorg_stale_nodes.json
159
- Fetching admins users for organisation mytestorg
160
- Sending email reports for organisation mytestorg
161
- ```
162
-
163
- ## Summary and Credits
164
-
165
- * Server Report was ported from Nolan Davidson's [chef-cleanup](https://github.com/nsdavidson/chef-cleanup)