Directory permissions not set recursively
maunzCache opened this issue · 0 comments
My coworker noticed a special case when reusing a consul installation done by this role, which we would like to be fixed/supported.
Imagine the following setup:
- Existing consul installation on /opt/ partition on host
- Unmount /opt/
- Reset OS and apply basic configuration via ansible
- (Re)Mount /opt/
- Run this role
Consul startup will now file due to missing permissions.
What happened is that the previous existing "consul" user used for the installation has now a new uid on a unix system which is not compatible with the "old" one on the mounted /opt partition. This is usually fixed by renewing file permissions which this role does in dirs.yml i think. The very first file task does set file permissions but not recursively. Thus the directories have fixed user and group ids but not the files or subdirectories of consul.
The proposed fix is to add the "recurse: yes" parameter for all directory related permission tasks.