Skip to content

Instantly share code, notes, and snippets.

@AndrewWCarson
Created November 30, 2022 05:12
Show Gist options
  • Save AndrewWCarson/9758763ad94b3e366138b86487e00475 to your computer and use it in GitHub Desktop.
Save AndrewWCarson/9758763ad94b3e366138b86487e00475 to your computer and use it in GitHub Desktop.
An example Custom Fact for Addigy to report the packages file size in human readable format.
#!/bin/zsh
packagesDir="/Library/Addigy/ansible/packages"
if [ ! -d "${packagesDir}" ]; then
echo "0B"
else
/usr/bin/du -h -d 0 /Library/Addigy/ansible/packages | awk '{print $1}'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment