Ansible 2.9+ seems to treat local_action slightly differently and will default to using the connection type for the overall playbook, which in most cases is ssh. That means that it tries to SSH to localhost and that fails in Cloud Build (and probably many other reasonable environments). Setting connection: local on those tasks forces it to stick to just running the task locally.
Ansible 2.9+ seems to treat
local_action
slightly differently and will default to using the connection type for the overall playbook, which in most cases isssh
. That means that it tries to SSH tolocalhost
and that fails in Cloud Build (and probably many other reasonable environments). Settingconnection: local
on those tasks forces it to stick to just running the task locally.