Ansible 2.9.10 group_vars and delegate_to

So, my playbooks are finally totally messed up after upgrading to Ansible version 2.9.10. I used a task with delegation inside the playbook to get the hostkey of a network device connection through a bastion host. But this does not work anymore. I learned, that this is due to the removement of a bug and should never had been working. Changing the connection for the single task in the playbook to ssh resolves the problem, and tries to delegate the task to the bastion host, however group_vars get lost by changing the connection type and I am not able to use definitions for the bastion host out of the group_vars definition.

This is quite bad, for I need more and more group_variables, for we are working on a customer-based approach, were everything is defined inside a box. So I have three group_vars files for each customer. One with the general variables, let’s say “cust.yml”:

ansible_user: theansbibleuser
bastion_host: bastion1.cust.notsoacme.net
bastion_port: 2202
bastion_user: thebastionuser
ansible_ssh_common_args: ‘-o ProxyCommand=“ssh -W %h:%p -q -p {{ bastion_port }} {{ bastion_user }}@{{ bastion_host }}”’
ansible_ssh_private_key_file: ‘~/.ssh/id_cust.rsa’
customer_short_name: CUST
config_repo: “{{ config_repo_path }}/{{ customer_short_name }}”
snmp_host: 1.2.3.5
snmp_community: myfavouritesnmpv2community
customer_nameserver:

  • 1.2.3.8
  • 1.2.4.8

For setup purposes there are two other group_vars files, depending on the type of the networkdevice which is to be preprovisioned. For example this one, let’s say “cust_SGs_newhosts.yml”: