
{"id":222,"date":"2016-08-17T09:12:08","date_gmt":"2016-08-16T23:12:08","guid":{"rendered":"https:\/\/mnm.at\/markus\/?p=222"},"modified":"2016-08-17T09:12:08","modified_gmt":"2016-08-16T23:12:08","slug":"patch-yaml-configs","status":"publish","type":"post","link":"https:\/\/mnm.at\/markus\/2016\/08\/17\/patch-yaml-configs\/","title":{"rendered":"Patch YAML configs"},"content":{"rendered":"<p>While watching the first season of True Detective, I decided to check out how to patch yaml configuration files as part of packer AMI creations.<\/p>\n<p>E.g. you want to install some package that uses yaml for its configuration files and in thousand lines of yaml configuration you have a few settings that you want to change.<\/p>\n<p>Using <code>patch<\/code> is a pain whenever you get a new version of these files and the patch is being rejected. using something like sed is painful, since you have to refer to some key that might be 5 lines up and three layers deep.<\/p>\n<p>Considering changing <code>authentication_options.other_schemes.internal<\/code> to <code>secluded<\/code> and <code>authentication_options.transitional_mode<\/code> to <code>enabled<\/code><\/p>\n<pre><code>authentication_options:\n    enabled: false\n    default_scheme: kerberos\n    other_schemes:\n        - internal\n    scheme_permissions: true\n    allow_digest_with_kerberos: true\n    plain_text_without_ssl: warn\n    transitional_mode: disabled\n<\/code><\/pre>\n<p>Using <a href=\"https:\/\/gist.github.com\/markus-mnm\/767fa5bc9463515170c33447046bbfd8\">patchYamlConfig.py<\/a> you can supply a patch looking like this:<\/p>\n<pre><code>authentication_options:\n    other_schemes:\n        - internal\n    transitional_mode: enabled\n<\/code><\/pre>\n<p>apply the patch with<\/p>\n<pre><code> patchYamlConfig originalFile patchFile\n<\/code><\/pre>\n<p>and done<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A way to patch yaml configuration files<\/p>\n<p> [1]: https:\/\/gist.github.com\/markus-mnm\/767fa5bc9463515170c33447046bbfd8 <a href=\"https:\/\/mnm.at\/markus\/2016\/08\/17\/patch-yaml-configs\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-222","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/mnm.at\/markus\/wp-json\/wp\/v2\/posts\/222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mnm.at\/markus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mnm.at\/markus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mnm.at\/markus\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/mnm.at\/markus\/wp-json\/wp\/v2\/comments?post=222"}],"version-history":[{"count":1,"href":"https:\/\/mnm.at\/markus\/wp-json\/wp\/v2\/posts\/222\/revisions"}],"predecessor-version":[{"id":223,"href":"https:\/\/mnm.at\/markus\/wp-json\/wp\/v2\/posts\/222\/revisions\/223"}],"wp:attachment":[{"href":"https:\/\/mnm.at\/markus\/wp-json\/wp\/v2\/media?parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mnm.at\/markus\/wp-json\/wp\/v2\/categories?post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mnm.at\/markus\/wp-json\/wp\/v2\/tags?post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}