I second every suggestions about Libreoffice. It’s free, open source and works in Windows, MacOS and Linux.
The problems lies in the different rendering engine. If you have table of contents, floating image and anything that impact text flow; it will be rendered differently between the two apps.
I still use Libreoffice as my primary editor, but if I need to send docs to other people, I will export it to PDF. But if I really need to send docx or pptx, I will format it in WPS office before sending the docs to others.
Using ansible will help you on your 2nd, 3rd , nth install.
But getting ansible to do what you want (plus testing) for the first time would takes 10x longer than manual install.
I think there’s xkcd about that.