Is there a way to take an old json config and conv...
# fleet
z
Is there a way to take an old json config and convert it to yaml using
fleetctl
?
l
Hi Zach! I'll check with the team and get back to you.
👍 1
Currently,
fleetctl
does not have any conversion tool. PS: I've just verified and you could use a tool like `yq`: https://mikefarah.gitbook.io/yq/v/v4.x/usage/convert 1. Get config as JSON, with my version of fleetctl (v4.5.0) it's:
fleetctl get config --json > source.json
. 2. Convert to YAML:
yq eval -P config.json > config.yaml
Let me know if this works for you.
More information from the team: To my surprise, JSON files are valid YAML 🙂 , so you could apply a JSON file
fleetctl apply -f config.json
and then you could get it in YAML format with
fleetctl get config --yaml
.
z
🤔 whoa, that makes my life easier, I'll give it a shot, thanks!
z
You probably want that JSON to be under the
config
key in the yaml.