Created
April 6, 2018 15:48
-
-
Save bgstack15/356b7f1013bfe306590567e4c9a2f438 to your computer and use it in GitHub Desktop.
Script that enforces ansible ownership of ansible files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ansibleown_version="2018-04-04a" | |
tu=ansible | |
tg="$( id -ng "${tu}" )" | |
for word in $@ ; | |
do | |
# set group accessible | |
find ${word} -exec chown "${tu}:${tg}" {} \; -exec chmod g+rwX {} \; | |
# set setgid and sticky bits | |
find ${word} -type d -exec chmod g+s,o+t {} \; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment