Menu

We wrote mode 755 in an Ansible task and our manifest script would only run for root
📰

We wrote mode 755 in an Ansible task and our manifest script would only run for root

DEV Community: ansible·Sergey Shinder·16 days ago
#yGNtIM2V
#devtoansible#devto#dev#script#ansible
Long article (388 words) — no AI summary yet.
Reading 0:00
15s threshold

Every evening at half past six a script on our integration server sends the day's parcel manifest to one of our carriers. Without it, their hub has parcels it cannot match to anything. The script runs from cron as the integration user, and in October we moved it into an Ansible role with a template task: owner integration, mode: 755.

The next morning the carrier rang. Four hundred and twelve parcels had arrived at their hub overnight with no manifest and were being held. Cron had run the script on time and it had failed with Permission denied. The error went to the integration user's local mailbox, which nobody reads.

ls -l showed the file as --wxrw--wt. Ansible had done exactly what we asked. In YAML 755 is the integer seven hundred and fifty five, and the file module treats an integer mode as a number, not as octal digits. Seven hundred and fifty five in octal is 1363: the sticky bit, write and execute for the owner, read and write for the group, write and execute for everyone else.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.