chef-validation 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 96f68557aac3836d187ceb87181e923a4eea0ec2
4
- data.tar.gz: baa308339adda3b01a64db18f191118bd3e33be3
3
+ metadata.gz: d0844bcbcca288ca5407207912b1febc255f8b11
4
+ data.tar.gz: de5b5cd82b7ee5b3a379b52b0273d558fdcad500
5
5
  SHA512:
6
- metadata.gz: 7f10c83d480434bd1f190591da5179f9b16d5a4d634209aaf3b652425c2b88a8a38d5c942fbf0f318b1963185414120704da8c19df81a999992398a38613297e
7
- data.tar.gz: 33c7d07a5af966cdeaf29675df67067b397c9a1b0a8899a01c51616cd00b748e181860559b61e6ff767d3eea6d8350166298b02d1dfb7a00dfa6e3a021ee8a22
6
+ metadata.gz: b440d9f5f0b19a4136c139a8fd7e5db0d5ca9fccf5bf4ee9602fd05a36620369d764784103482efecef4379c920ae0c30e888332a4a6387877c91c392a072c78
7
+ data.tar.gz: e01810ecc8163971e38e918ff12b4b5daa4ff45c646446f9ec42f2fb9df43f779fda53aedfc26b3afb4f4416b88daecbcdf6258f3299feeab3bd018fa0dbe638
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.1.1
2
+
3
+ * Bug Fixes
4
+ * 0.1.0 cookbook package was uploaded incorrectly, sigh.
5
+
1
6
  # 0.1.0
2
7
 
3
8
  Initial release of validation
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # validation-cookbook
1
+ # chef-validation
2
2
 
3
3
  Perform validation on your node's attributes from a Cookbook's attribute metadata definitions.
4
4
 
@@ -9,7 +9,7 @@ Perform validation on your node's attributes from a Cookbook's attribute metadat
9
9
 
10
10
  ## Usage
11
11
 
12
- Add the validation cookbook to your cookbook's metadata
12
+ Add the validation cookbook to your cookbook's metadata and define your attribute rules:
13
13
 
14
14
  ```
15
15
  name "my_app"
@@ -21,14 +21,34 @@ long_description "Installs/Configures my_app"
21
21
  version "0.1.0"
22
22
 
23
23
  depends "validation"
24
+
25
+ grouping "my_app",
26
+ title: "My Application"
27
+ attribute "my_app/log_level",
28
+ required: "required",
29
+ default: "debug",
30
+ choices: [
31
+ "debug",
32
+ "fatal",
33
+ "warn",
34
+ "info"
35
+ ]
36
+ attribute "my_app/cookie",
37
+ required: "required",
38
+ default: "",
39
+ type: "string"
24
40
  ```
25
41
 
26
- Now leverage the `validate_attributes` definition provided by the validation cookbook by placing it in one of your cookbook's recipes.
42
+ Attribute rules are already part of Chef metadata. However, they are not used at all by the Chef client application itself. You'll need to ensure that you still initialize attributes to their supposedly default value in an attributes file or a recipe.
43
+
44
+ Since Chef client doesn't do anything with these attribute definitions we need to leverage the `validate_attributes` definition provided by this cookbook. Place a line like this in one of your cookbook's recipes.
27
45
 
28
46
  ```
29
47
  validate_attributes "my_app"
30
48
  ```
31
49
 
50
+ I recommend placing this in the top of your "default" recipe for each cookbook that you maintain.
51
+
32
52
  ### Compile time validation
33
53
 
34
54
  By default, attribute validation will occur at convergence time but this can be switched to compile time by setting an attribute on the `validate_attributes` definition.
@@ -1,4 +1,4 @@
1
1
  class Chef; end;
2
2
  module Chef::Validation
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-validation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Winsor