Title
#fleet
z

Zach Zeid

11/17/2021, 4:59 PM
Is there a way to take an old json config and convert it to yaml using
fleetctl
?
Lucas Rodriguez

Lucas Rodriguez

11/17/2021, 5:00 PM
Hi Zach! I'll check with the team and get back to you.
5:18 PM
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.
5:28 PM
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

Zach Zeid

11/17/2021, 5:42 PM
🤔 whoa, that makes my life easier, I'll give it a shot, thanks!
zwass

zwass

11/17/2021, 6:43 PM
You probably want that JSON to be under the
config
key in the yaml.