cookbook 'idempotent-export-node', '= 1.0.6'
idempotent-export-node
(19) Versions
1.0.6
-
Follow0
Exports node attributes to a json file
cookbook 'idempotent-export-node', '= 1.0.6', :supermarket
knife supermarket install idempotent-export-node
knife supermarket download idempotent-export-node
export-node
Fork of export-node made to be compatible with force_idempotency kitchen provisionner's configuration.
idempotent-export-node exports node attributes to a json file so that it can be retrieved from a kitchen test.
Usage
Add the export-node cookbook to the end of the runlist in your kitchen suites:
suites: - name: my-suite run_list: - recipe[cookbook-under-test] - recipe[idempotent-export-node]
Now your tests can access any node attribute by parsing the file's json to a hash:
if os.family == 'debian' # Get current local path current_path = File.dirname(__FILE__) # Get chef node informations node = json('/tmp/kitchen/chef_node.json') # Check templated sources.list describe file('/etc/apt/sources.list') do # Create a local variable to store codename let(:codename) { node['default']['base']['codename'] } it { should be_file } its('owner') { should eq 'root' } its('content') { should eq File.read("#{current_path}/files/#{codename}.list") } end end
Windows instances will store the node data in %TEMP%\kitchen\chef_node.json
and other platforms will store the node data in /tmp/kitchen/chef_node.json
.
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
1.0.6 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.0.6 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.0.6 failed this metric
FC047: Attribute assignment does not specify precedence: idempotent-export-node/templates/default/chef_node.json.erb:6
FC047: Attribute assignment does not specify precedence: idempotent-export-node/templates/default/chef_node.json.erb:18
FC047: Attribute assignment does not specify precedence: idempotent-export-node/templates/default/chef_node.json.erb:24
FC064: Ensure issues_url is set in metadata: idempotent-export-node/metadata.rb:1
FC065: Ensure source_url is set in metadata: idempotent-export-node/metadata.rb:1
FC066: Ensure chef_version is set in metadata: idempotent-export-node/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: idempotent-export-node/metadata.rb:1
FC069: Ensure standardized license defined in metadata: idempotent-export-node/metadata.rb:1
Run with Foodcritic Version 13.1.1 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.0.6 passed this metric
Testing File Metric
1.0.6 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.6 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.6 failed this metric
1.0.6 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.0.6 failed this metric
FC047: Attribute assignment does not specify precedence: idempotent-export-node/templates/default/chef_node.json.erb:6
FC047: Attribute assignment does not specify precedence: idempotent-export-node/templates/default/chef_node.json.erb:18
FC047: Attribute assignment does not specify precedence: idempotent-export-node/templates/default/chef_node.json.erb:24
FC064: Ensure issues_url is set in metadata: idempotent-export-node/metadata.rb:1
FC065: Ensure source_url is set in metadata: idempotent-export-node/metadata.rb:1
FC066: Ensure chef_version is set in metadata: idempotent-export-node/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: idempotent-export-node/metadata.rb:1
FC069: Ensure standardized license defined in metadata: idempotent-export-node/metadata.rb:1
Run with Foodcritic Version 13.1.1 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.0.6 passed this metric
Testing File Metric
1.0.6 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.6 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.6 failed this metric
FC047: Attribute assignment does not specify precedence: idempotent-export-node/templates/default/chef_node.json.erb:18
FC047: Attribute assignment does not specify precedence: idempotent-export-node/templates/default/chef_node.json.erb:24
FC064: Ensure issues_url is set in metadata: idempotent-export-node/metadata.rb:1
FC065: Ensure source_url is set in metadata: idempotent-export-node/metadata.rb:1
FC066: Ensure chef_version is set in metadata: idempotent-export-node/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: idempotent-export-node/metadata.rb:1
FC069: Ensure standardized license defined in metadata: idempotent-export-node/metadata.rb:1
Run with Foodcritic Version 13.1.1 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
1.0.6 passed this metric
Testing File Metric
1.0.6 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.6 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.6 failed this metric
1.0.6 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number