The peer CLI commands (peer channel, peer lifecycle, etc) have a flag --connTimeout which sets the timeout to connect to the peer (or orderer, when getting the channel configuration). It defaults to 3 seconds (see https://hyperledger-fabric.readthedocs.io/en/latest/commands/peercommand.html). Unfortunately there are situations where this is not enough. The Ansible playbook currently provides no way to change it. We also tried setting the environment variable CORE_PEER_CLIENT_CONN_TIMEOUT but it did not affect the timeout.
It could be resolved by adding a configuration parameter to the ansible modules to allow the user to override the connTimeout. Or perhaps alternatively to let the user add arbitrary parameters to the peer commands.