Hey guys, I was wondering how do you do automatic ...
# fleet
s
Hey guys, I was wondering how do you do automatic backup of the Fleet configs to like Gitlab/Github for versioning?
z
You can use
fleetctl get packs --with-queries
and
fleetctl get options
to get most of this.
You can also use
fleetctl apply
in a CI pipeline so that all the changes flow from your repo to Fleet.
s
Ow yes that is an option, I was thinking more like if you also want to get the hosts how you could do that and put that in version control.
n
@SK you would like to be able to create a config file with your hosts in Fleet so you can commit that to a version control system?
s
I was more like thinking
fleetctl get hosts --json
to have a view of the hosts for like when they go MIA and get removed from fleet you can have a list that you can use later to debug hosts that disappear but are still on and automatically create this and push to like a repo.
z
You're in luck!
fleetctl get hosts --json
already exists 🙂
s
Yes I know 😉 but was more thinking best practices on how to ship it to a repo
z
Rather than shipping it to a repo, what about setting the host expiration to a longer duration (or off) and then hitting the API/fleetctl for that list of hosts to look into?
s
Hey @zwass I just started using the expiration to declutter the db 😄 I think probably hitting the API every other day might be enough to get a list indeed and putting it somewhere just to have a list of systems we might be missing