Often we install software in a directory with their version number, then add a link with just the name. e.g.:
cd /opt
ls -l
httpd-2.0.64
httpd-2.2.23
httpd-2.4.3
httpd -> httpd-2.4.3
Unfortunately the file module only takes full paths, so I'd end up with something like:
httpd -> /opt/httpd-2.4.3
Could we solve that by adding a chdir option to the file module?
Wouldn't it be better to just make the destination not require an
absolute path in that case?
No. It is nice to have an entire system self-contain inside a directory, so that you can move the top directory and everything still works, so being able to create relative links instead of full is needed.
Another option for file would be to remove an old one if existing. In some case, we want that, we want that the creation of the new link removes the old one, but sometimes we want the creation to fail if there is already an existing link.