Did you roughly follow the instructions here, particularly the part about installing Xcode:
https://valdhaus.co/writings/ansible-mac-osx/