0

My ansible controller is on a rocky linux 8 server. I have roles that edit files in /etc/ on a variety of target systems, all of which work fine.

Having just updated my Mac to one using Apple Silicon, I now have an issue with ansible editing at least one of these files. Other files like /etc/motd can be updated fine, but the one causing issues is /etc/auto_master. When using lineinfile or copy I get

- lineinfile:
    path:   /etc/auto_master
    regexp: '/smb '
    line:   '/smb  auto_smb'
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: PermissionError: [Errno 1] Operation not permitted: b'/private/etc/.ansible_tmpddn15h8_auto_master' -> b'/private/etc/auto_master'
fatal: [bones]: FAILED! => {"changed": false, "msg": "Unable to make /var/root/.ansible/tmp/ansible-moduletmp-1716236197.813452-yh6r0une/tmpt6jgaqzr into to /private/etc/auto_master, failed final rename from b'/private/etc/.ansible_tmpddn15h8_auto_master': [Errno 1] Operation not permitted: b'/private/etc/.ansible_tmpddn15h8_auto_master' -> b'/private/etc/auto_master'"}
I find this strange as I can manually edit the file, and also that this works fine on my previous Intel Mac running on the same version of macOS.

One thing that is different about automount is that it has the ability to create links in /, which I cannot do as it claims it is read-only. Perhaps this is why this file is better protected, but does not explain much since I can manually make changes to the file, and the automation works fine on Intel...

I have given python3 (and a few other things) full disk access, but this was not previously required, and makes no difference.

There do not appear to be any extra acls on the file, and the directory has the same as other Macs

root# ls -led@ /etc /private /private/etc /etc/auto_master
lrwxr-xr-x@   1 root  wheel    11  7 May 08:01 /etc -> private/etc
    com.apple.rootless     0
-rw-r--r--    1 root  wheel   229 20 May 01:18 /etc/auto_master
drwxr-xr-x    6 root  wheel   192 14 May 01:29 /private
drwxr-xr-x  127 root  wheel  4064 20 May 22:09 /private/etc

Any thoughts on this?

0

You must log in to answer this question.

Browse other questions tagged .