Title
#fleet
t

Tilman Bender

03/02/2022, 3:17 PM
I have just purchesd Fleet Premium and created groups for my windows-clients and my servers. I already configured some policies (back when I did not have the Teams feature). How can I move those policies to a specific team?
Lucas Rodriguez

Lucas Rodriguez

03/02/2022, 4:39 PM
Hi Tilman! Fleet currently doesn't support changing a policy's team.
4:49 PM
An option I can think of in case we are talking about too many policies to move manually (*): You could use
fleetctl
to fetch the global policies, edit the yaml to set
team_id
and then apply such config via
fleetctl apply
. (*) move manually would mean copy/paste policy fields and delete the original global one.
t

Tilman Bender

03/03/2022, 8:26 AM
Thank you Lucas, that sounds like the right path to go 🙂
8:27 AM
btw. is there a way to tell the API to return YAML?
8:27 AM
otherwise I would have to first retrieve the policies as JSON and then transform them into an importable YAML
9:30 AM
You mean "use fleet API" to fetch the global policies, right? From what I know fleetctl does not support getting the policies yet. Anyway I tried suggestion, but unfortunatley the team_id seems to be ignored. My policies always end up as global
Lucas Rodriguez

Lucas Rodriguez

03/03/2022, 3:02 PM
Ah yes, this would require you also edit their name, e.g. add a suffix or something. Once that's done and it's all good, you would remove the global ones. (This is sort of a "first copy then remove original" approach.)
t

Tilman Bender

03/06/2022, 6:11 PM
I basically settled on an "import,move,rename" approach: • import using fleetctl -> policies end up as global (i.e. team_id is NULL) • move the policies by updating team_id directly in the DB • update the names directly in the DB prefixing them (e.g. "Windows: Run LSA as PPL" becomes "Virtual Windows: ..." ) Sitll a bit thedious bit it will work until the import starts repsecting the team_id or until you can bulk move them via the UI.
Lucas Rodriguez

Lucas Rodriguez

03/17/2022, 1:45 PM
OK, sorry for all the trouble this has caused you. Hopefully we'll implement this soon in #4426