As of now there is no easy our automated way to import/export roles in Ranger-CDP.
However, we can automate it using a simple python script. You can find the script on following url:-
https://github.com/patilajinkya/ranger_automate/blob/main/roles_exporter.py
Note:- Please read roles_exportes_README.txt
before executing the script and let me know if you face any issues. I have tested this on one my test clusters and all looks good.
One thing to keep in mind is, all users and groups from source cluster needs to be available in destination cluster and no duplicate roles should exist in destination cluster.
If you have any suggestions to improve the script, let me know in the comments.