In our playbooks we have multiple different paths which needs to have the same permissions.
I'm looking for a way how to change permissions for every folder in path so i.e. for /opt/this/is/just/an/example
I need to change permissions for 5 folders (this
, is
, just
, an
, example
). Only opt
will be not changed.
The problem is that the paths can have different lenghts so there might be /opt/something/else
in the future. These folders can contain other folders, not specified in our playbooks or files for which we cannot change permissions.
Do you know how can I do this?