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