Are the global values not set, or are they set but not used? Wondering if --system would be more appropriate than --global. If you use --global, then it will set the values for whatever user Ansible is connecting as. This may or may not be the right user for later git usage.
–local is per- repository, --global is per-user (but may be overridden by --local), and --system is for everyone (but may be overridden by --global or --local).
You should be able to find out what is being set by inspecting the local, global and system locations after Ansible runs. I don’t know what they are in Windows, but for Linux they would be <repodir>/.git/config, ~/.gitconfig, and /etc/gitconfig respectively.