ansible-role-yedit icon indicating copy to clipboard operation
ansible-role-yedit copied to clipboard

Replaces empty values with the string "null"

Open jwarkentin opened this issue 5 years ago • 1 comments

If I have a file like the following, the password value will actually be changed to null.

This:

db:
  host: example.com
  user: test
  password:

Becomes:

db:
  host: example.com
  password: null
  user: test

This happens even when editing totally unrelated values in other parts of the config which should obviously not be happening.

jwarkentin avatar Sep 26 '18 18:09 jwarkentin

Noticed a similar issue - I guess it's related - where the value becomes None when it's left blank. If you set the value to ~ (the YAML character for null), it also ends up as None.

I've got around this in a particular implementation by just setting the value to an empty array [], but whether or not that works probably depends on what's parsing the YAML in the end.

tdmalone avatar Sep 03 '19 06:09 tdmalone