If you’re getting started with Ansible you’ll notice it can be slow on servers running CentOS (or Red Hat). The reason for this is that CentOS systems have Kerberos authentication for SSH enabled by default. If you set GSSAPIAuthentication to no in /etc/ssh/sshd_config then things will speed up. And since you’re editing the configuration file, also set the UseDNS value to nu to save another DNS-lookup. You shot notice Ansible isn’t as slow as before.

You can also set this configuration for the Ansible user in the ~/.ssh/config file of the ansible user in case you are using an IPA server and/or Kerberos authentication in your environment.

[ansible@ansible-server ~]$ cat ~/.ssh/config 
Host * 
    GSSAPIAuthentication no