{"id":147,"date":"2014-11-19T18:37:30","date_gmt":"2014-11-19T18:37:30","guid":{"rendered":"http:\/\/192.168.1.102\/?p=147"},"modified":"2014-11-19T18:45:55","modified_gmt":"2014-11-19T18:45:55","slug":"chef-change-attributes-node-level-java-cookbook","status":"publish","type":"post","link":"https:\/\/digitalsos.net\/?p=147","title":{"rendered":"Chef change attributes node level Java cookbook"},"content":{"rendered":"<p>How do you change the attributes at the node level.\u00a0 I just went through this recently with some Scala servers that required Oracle Java 7.\u00a0 The defaults for the Java cookbook at the marketplace: <a href=\"https:\/\/supermarket.getchef.com\/cookbooks\/java#readme\" target=\"_blank\">https:\/\/supermarket.getchef.com\/cookbooks\/java#readme<\/a> are openJDK 6.\u00a0 To replace them you need to:<\/p>\n<p><code>knife node edit &lt;NODE_NAME&gt;<\/code><\/p>\n<p>In the editor that pops up add the java section under normal.\u00a0 In the precidence order normal will overwrite the attributes in the java file.<\/p>\n<p><code>{<br \/>\n\"name\": \"AWSSERVER-UE1T\",<br \/>\n\"chef_environment\": \"TEST\",<br \/>\n\"normal\": {<br \/>\n\"java\": {<br \/>\n\"install_flavor\": \"oracle\",<br \/>\n\"jdk_version\": \"7\",<br \/>\n\"oracle\": {<br \/>\n\"accept_oracle_download_terms\": true<br \/>\n}<br \/>\n},<br \/>\n\"set_fqdn\": \"AWSSERVER-UE1T.aws.test.local\",<br \/>\n\"agency\": \"VIV\",<br \/>\n\"tags\": [<\/p>\n<p>]<br \/>\n},<br \/>\n\"run_list\": [<br \/>\n\"role[linux_base]\",<br \/>\n\"recipe[ubuntu_xfce_rdp]\",<br \/>\n\"recipe[scala]\"<br \/>\n]<br \/>\n}<\/code><\/p>\n<p>Now with that said after running chef-client locally on the server it didn&#8217;t pickup the changes.\u00a0 But you will see the change in the json attributes on the chef server.<\/p>\n<p>Amazon has a good atricle on overriding attributes here: <a href=\"http:\/\/docs.aws.amazon.com\/opsworks\/latest\/userguide\/workingcookbook-json-override.html\" target=\"_blank\">http:\/\/docs.aws.amazon.com\/opsworks\/latest\/userguide\/workingcookbook-json-override.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How do you change the attributes at the node level.\u00a0 I just went through this recently with some Scala servers that required Oracle Java 7.\u00a0 The defaults for the Java cookbook at the marketplace: https:\/\/supermarket.getchef.com\/cookbooks\/java#readme are openJDK 6.\u00a0 To replace them you need to: knife node edit &lt;NODE_NAME&gt; In the editor that pops up add<\/p>\n<div class=\"read-more-wrapper\"><a class=\"read-more\" href=\"https:\/\/digitalsos.net\/?p=147\" title=\"Read More\"> <span class=\"button \">Read More<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2,3],"tags":[],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-chef","category-devops"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pgxmGV-2n","_links":{"self":[{"href":"https:\/\/digitalsos.net\/index.php?rest_route=\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalsos.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalsos.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalsos.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalsos.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=147"}],"version-history":[{"count":6,"href":"https:\/\/digitalsos.net\/index.php?rest_route=\/wp\/v2\/posts\/147\/revisions"}],"predecessor-version":[{"id":153,"href":"https:\/\/digitalsos.net\/index.php?rest_route=\/wp\/v2\/posts\/147\/revisions\/153"}],"wp:attachment":[{"href":"https:\/\/digitalsos.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalsos.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalsos.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}