{"id":20072377,"url":"https://github.com/markolson/knife-node-attributes","last_synced_at":"2025-06-21T22:36:11.177Z","repository":{"id":12438447,"uuid":"15095875","full_name":"markolson/knife-node-attributes","owner":"markolson","description":"A Knife plugin that outputs converged node attributes in JSON.","archived":false,"fork":false,"pushed_at":"2013-12-11T02:55:48.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T00:22:01.444Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markolson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-11T02:25:06.000Z","updated_at":"2014-08-14T01:35:33.000Z","dependencies_parsed_at":"2022-09-23T07:02:10.922Z","dependency_job_id":null,"html_url":"https://github.com/markolson/knife-node-attributes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markolson%2Fknife-node-attributes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markolson%2Fknife-node-attributes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markolson%2Fknife-node-attributes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markolson%2Fknife-node-attributes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markolson","download_url":"https://codeload.github.com/markolson/knife-node-attributes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241503032,"owners_count":19972971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T14:39:45.748Z","updated_at":"2025-03-02T12:18:25.729Z","avatar_url":"https://github.com/markolson.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Knife::Node::Attributes\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'knife-node-attributes', git: 'http://github.com/lookingglass/knife-node-attributes'\n\nand run `bundle install`\n\n## Usage\n\nWhen using Chef-Solo and Knife-Solo, you cannot fetch the node attributes from a last run. \nInstead, this takes a crack at generating them ourselves based on what's in the run_list, environment, role,\nand cookbooks..\n\nGiven `nodes/staging_web1.json` and a `environments/staging.{rb,json}`\n\n\n    { \"run_list\":[\"role[webapp]\"], \"environment\": \"staging\" }\n\nYou can run `knife node attributes -E staging -N web1 -j nodes/staging_web1.json` to get the attributes that the `Chef::Node` has before the recipes in the cookbooks are run. This means that if you're setting any attributes in the recipes themselves, they will not appear here.\n\nBecause the output is sent to STDOUT by default, you can pipe it into other scripts to process it more.\nGiven a script `versions.rb`:\n\n    #!/usr/bin/env ruby\n    require 'json'\n    JSON.parse($stdin.read).each {|k,v|\n      print %Q(\"#{k}\", \"#{v['version']}\"\\n) if v.is_a?(Hash) \u0026\u0026 v.has_key?('version')\n    }\n\nYou can get a CSV of the versions of everything (with a `version` attribute, at least) that may be on that node by\nrunning `knife node attributes -E staging -N web1 -j nodes/staging_web1.json | ./versions.rb`\n\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkolson%2Fknife-node-attributes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkolson%2Fknife-node-attributes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkolson%2Fknife-node-attributes/lists"}