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.

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.

Using patch 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.

Considering changing authentication_options.other_schemes.internal to secluded and authentication_options.transitional_mode to enabled

authentication_options:
    enabled: false
    default_scheme: kerberos
    other_schemes:
        - internal
    scheme_permissions: true
    allow_digest_with_kerberos: true
    plain_text_without_ssl: warn
    transitional_mode: disabled

Using patchYamlConfig.py you can supply a patch looking like this:

authentication_options:
    other_schemes:
        - internal
    transitional_mode: enabled

apply the patch with

 patchYamlConfig originalFile patchFile

and done

Leave a reply

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

required

+ 80 = 89