oxidized 0.14.1 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +24 -0
- data/lib/oxidized/model/comware.rb +2 -0
- data/lib/oxidized/model/procurve.rb +1 -1
- data/lib/oxidized/output/git.rb +16 -3
- data/lib/oxidized/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61ca595b5255672ffc615530ca8913fd9e370181
|
4
|
+
data.tar.gz: 3c3a7756a3854b1b38882297d44e2d516a5b562b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20b6bac43a2aa14815322182e6a85d960b2a78c1c7b77dac850a9a392fe981acecf93a41336b8ed90262bdeba4001ac62027c8a28a10f0106cd787de5a86360b
|
7
|
+
data.tar.gz: 63f76ee63596e77e28a9d76991105df5272e73438099793a347f3ca7679362a8189f32fb7a84747a403007685b3fd0c29cb661f846dcf7ab3dd7bb67b45cc45e
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -292,6 +292,30 @@ vars:
|
|
292
292
|
enable: S3cre7
|
293
293
|
```
|
294
294
|
|
295
|
+
### Removing secrets
|
296
|
+
|
297
|
+
To strip out secrets from configurations before storing them, Oxidized needs the the remove_secrets flag. You can globally enable this by adding the following snippet to the global sections of the configuration file.
|
298
|
+
|
299
|
+
```
|
300
|
+
vars:
|
301
|
+
remove_secret: true
|
302
|
+
```
|
303
|
+
|
304
|
+
Device models can contain substitution filters to remove potentially sensitive data from configs.
|
305
|
+
|
306
|
+
As a partial example from ios.rb:
|
307
|
+
|
308
|
+
```
|
309
|
+
cmd :secret do |cfg|
|
310
|
+
cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
|
311
|
+
(...)
|
312
|
+
cfg
|
313
|
+
end
|
314
|
+
```
|
315
|
+
The above strips out snmp community strings from your saved configs.
|
316
|
+
|
317
|
+
**NOTE:** Removing secrets reduces the usefulness as a full configuration backup, but it may make sharing configs easier.
|
318
|
+
|
295
319
|
### Source: CSV
|
296
320
|
|
297
321
|
One line per device, colon seperated.
|
data/lib/oxidized/output/git.rb
CHANGED
@@ -21,7 +21,14 @@ class Git < Output
|
|
21
21
|
Oxidized.asetus.save :user
|
22
22
|
raise NoConfig, 'no output git config, edit ~/.config/oxidized/config'
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
|
+
if @cfg.repo.respond_to?(:each)
|
26
|
+
@cfg.repo.each do |group, repo|
|
27
|
+
@cfg.repo["#{group}="] = File.expand_path repo
|
28
|
+
end
|
29
|
+
else
|
30
|
+
@cfg.repo = File.expand_path @cfg.repo
|
31
|
+
end
|
25
32
|
end
|
26
33
|
|
27
34
|
def store file, outputs, opt={}
|
@@ -105,7 +112,7 @@ class Git < Output
|
|
105
112
|
repo = @cfg.repo
|
106
113
|
if group && group != '' && !@cfg.single_repo?
|
107
114
|
repo = File.join File.dirname(repo), group + '.git'
|
108
|
-
elsif group
|
115
|
+
elsif group && group != ''
|
109
116
|
node = File.join group, node
|
110
117
|
end
|
111
118
|
repo = Rugged::Repository.new repo
|
@@ -152,13 +159,19 @@ class Git < Output
|
|
152
159
|
|
153
160
|
def update repo, file, data
|
154
161
|
return if data.empty?
|
162
|
+
|
155
163
|
if @opt[:group]
|
156
164
|
if @cfg.single_repo?
|
157
165
|
file = File.join @opt[:group], file
|
158
166
|
else
|
159
|
-
repo =
|
167
|
+
repo = if repo.is_a?(String)
|
168
|
+
File.join File.dirname(repo), @opt[:group] + '.git'
|
169
|
+
else
|
170
|
+
repo[@opt[:group]]
|
171
|
+
end
|
160
172
|
end
|
161
173
|
end
|
174
|
+
|
162
175
|
begin
|
163
176
|
repo = Rugged::Repository.new repo
|
164
177
|
update_repo repo, file, data, @msg, @user, @email
|
data/lib/oxidized/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oxidized
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saku Ytti
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-05-
|
13
|
+
date: 2016-05-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: asetus
|