puppet-lint-legacy_facts-check 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -6
- data/lib/puppet-lint/plugins/legacy_facts.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 547155b0b69aa2fe3a40ac14b997b483920dd7f5b0edd4eef7f9b8e7899d550c
|
4
|
+
data.tar.gz: 5eba4749445125868c94ee5b191d22f47da29cd0d5750988c356635860245768
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 936988827ee762d8e9206f0393be011e9dbd1162db5301f65fa06e8621b058f27f3850b313829be32da5a9f2ab4af3530829b84a1d53653d79597f67d3702c41
|
7
|
+
data.tar.gz: 054b6a7e1cc0ef472444a25090ce4f1c5a01d869aa24d1a51b62b216132a7f3657714cd5fb63e0b566a4afa9b6c75a41ed30624061397657a5df111207eca2ca
|
data/README.md
CHANGED
@@ -5,9 +5,19 @@
|
|
5
5
|
|
6
6
|
## Overview
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
Puppet 3.5 [optionally added structured
|
9
|
+
facts](https://github.com/puppetlabs/docs-archive/blob/master/puppet/3.5/release_notes.markdown#structured-facts-early-version)
|
10
|
+
as well as the [global facts
|
11
|
+
hash](https://github.com/puppetlabs/docs-archive/blob/master/puppet/3.5/release_notes.markdown#global-facts-hash). They
|
12
|
+
were both turned on by default in puppet 4.
|
13
|
+
|
14
|
+
This linter will convert from legacy facts like `$::operatingsystem` or legacy
|
15
|
+
hashed facts like `$facts['operatingsystem']` to the new structured facts like
|
16
|
+
`$facts['os']['name']`.
|
17
|
+
|
18
|
+
If you only want to convert from facts like `$::operatingsystem` to the facts
|
19
|
+
hash like `$facts['operatingsystem']`, you want the [top scope facts
|
20
|
+
linter](https://github.com/mmckinst/puppet-lint-top_scope_facts-check).
|
11
21
|
|
12
22
|
## Installing
|
13
23
|
|
@@ -66,12 +76,21 @@ insert the following line to your `Rakefile`.
|
|
66
76
|
PuppetLint.configuration.send('disable_legacy_facts')
|
67
77
|
```
|
68
78
|
|
79
|
+
Alternatively, you can disable it directly in your puppet manifest.
|
80
|
+
|
81
|
+
```puppet
|
82
|
+
# lint:ignore:lint-legacy_facts
|
83
|
+
$package_name = $facts['operatingsystem'] {
|
84
|
+
'CentOS' => 'httpd',
|
85
|
+
'Debian' => 'apache2',
|
86
|
+
}
|
87
|
+
# lint:endignore
|
88
|
+
```
|
89
|
+
|
69
90
|
## Limitations
|
70
91
|
|
71
92
|
The linter will only find and work on top scope facts like `$::osfamily`,
|
72
|
-
non-top scope facts like `$osfamily` will not be found or fixed.
|
73
|
-
[top_scope_facts-check ](https://github.com/mmckinst/puppet-lint-top_scope_facts-check)
|
74
|
-
puppet linter can be used to fix that problem
|
93
|
+
non-top scope facts like `$osfamily` will not be found or fixed.
|
75
94
|
|
76
95
|
Some facts have no equivalent in the structured fact list:
|
77
96
|
|
@@ -11,7 +11,7 @@ PuppetLint.new_check(:legacy_facts) do
|
|
11
11
|
# These facts will depend on how a system is set up and can't just be
|
12
12
|
# enumerated like the EASY_FACTS below.
|
13
13
|
#
|
14
|
-
# For example a
|
14
|
+
# For example a server might have two block devices named 'sda' and 'sdb' so
|
15
15
|
# there would be a $blockdeivce_sda_vendor and $blockdeivce_sdb_vendor fact
|
16
16
|
# for each device. Or it could have 26 block devices going all the way up to
|
17
17
|
# 'sdz'. There is no way to know what the possibilities are so we have to use
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-lint-legacy_facts-check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark McKinstry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puppet-lint
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.3.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.3.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: '0'
|
143
143
|
requirements: []
|
144
|
-
rubygems_version: 3.
|
144
|
+
rubygems_version: 3.1.2
|
145
145
|
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: A puppet-lint plugin to check you are not using legacy facts like $::operatingsystem
|