ansible.posix.mount fails to resolve DNS when using variables

I have a test playbook to mount different types of mounts. It works when I don’t use variables for the values, however fails DNS resolution when I do. I’m unsure why this is:

Playbook:

---
- hosts: all
  become: true
  gather_facts: yes
  vars:
    shares:
      - environments:
        - environment: test 
          mounts:
             - dest: '/mnt/cifs/share2'
               src: //windows.example.com/share2
               opts: 'x-systemd.automount,rw,vers=2.1,sec=krb5i,[email protected],uid=test,gid=test,file_mode=0770,dir_mode=0770,rsize=32768,wsize=32768'
               type: 'cifs'
             - dest: /mnt/efs/share2
               src: fs-0e7af4f4f58ff4dcd.efs.us-east-2.amazonaws.com
               type: efs
               opts: 'x-systemd.automount,_netdev,tls,accesspoint=fsap-0395b37eaf8cbbf9e'
  tasks:
    - name: Mount CIFS Share
      ansible.posix.mount:
        src: fs-0e7af4f4f58ff4dcd.efs.us-east-2.amazonaws.com 
        path: /mnt/efs/share1
        fstype: efs 
        opts: 'x-systemd.automount,_netdev,tls,accesspoint=fsap-e9fbbc8ae74b5930'
        state: mounted

    - name: Mount EFS Share 
      ansible.posix.mount:
        src: //windows.example.com/share1
        path: /mnt/cifs/share1
        fstype: cifs
        opts: 'x-systemd.automount,rw,vers=2.1,sec=krb5i,[email protected],uid=test,gid=test,file_mode=0770,dir_mode=0770,rsize=32768,wsize=32768'
        state: mounted

    - name: Mount Shares
      ansible.posix.mount:
        src: |-
          {%- if item.1.type == "cifs" -%}
          \ "{{item.1.src}}"
          {%- else -%}
          "{{item.1.src}}"
          {%- endif -%}
        path: "{{item.1.dest}}"
        fstype: "{{item.1.type}}"  
        opts: "{{item.1.opts}}"  
        state: mounted
      with_subelements:
        - "{{ shares | map(attribute='environments') | list | sum(start=[]) }}"
        - mounts
      when: item.0.environment == 'test'
...

Result

[mose@lab ~/ansible]$ ansible-playbook -Ki hosts test-mounts.yml 
BECOME password: 

PLAY [all] ***********************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************************************************************************************************************************
ok: [server.example.com]

TASK [Mount CIFS Share] **********************************************************************************************************************************************************************************************************************
ok: [server.example.com]

TASK [Mount EFS Share] ***********************************************************************************************************************************************************************************************************************
ok: [server.example.com]

TASK [Mount Shares] **************************************************************************************************************************************************************************************************************************
failed: [server.example.com] (item=[{'environment': 'test'}, {'dest': '/mnt/cifs/share2', 'src': 'server.example.com/mnt/cifs/share2', 'opts': 'x-systemd.automount,rw,vers=2.1,sec=krb5i,[email protected],uid=test,gid=test,file_mode=0770,dir_mode=0770,rsize=32768,wsize=32768', 'type': 'cifs'}]) => {"ansible_loop_var": "item", "changed": false, "item": [{"environment": "test"}, {"dest": "/mnt/cifs/share2", "opts": "x-systemd.automount,rw,vers=2.1,sec=krb5i,[email protected],uid=test,gid=test,file_mode=0770,dir_mode=0770,rsize=32768,wsize=32768", "src": "server.example.com/mnt/cifs/share2", "type": "cifs"}], "msg": "Error mounting /mnt/cifs/share2: mount error: could not resolve address for  "server.example.com: Unknown errorn"}
failed: [server.example.com] (item=[{'environment': 'test'}, {'dest': '/mnt/efs/share2', 'src': 'fs-0e7af4f4f58ff4dcd.efs.us-east-2.amazonaws.com', 'type': 'efs', 'opts': 'x-systemd.automount,_netdev,tls,accesspoint=fsap-e9fbbc8fae73b5930'}]) => {"ansible_loop_var": "item", "changed": false, "item": [{"environment": "test"}, {"dest": "/mnt/efs/share2", "opts": "x-systemd.automount,_netdev,tls,accesspoint=fsap-e9fbbc8fae73b5930", "src": "fs-0e7af4f4f58ff4dcd.efs.us-east-2.amazonaws.com", "type": "efs"}], "msg": "Error mounting /mnt/efs/share2: Failed to resolve ""fs-0e7af4f4f58ff4dcd.efs.us-east-2.amazonaws.com"" - check that the specified DNS name is a CNAME record resolving to a valid EFS DNS namen"}

PLAY RECAP ***********************************************************************************************************************************************************************************************************************************
server.example.com   : ok=3    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Note, content is sanitized; in my actual example the values for each of the NFS/CIFS shares are precisely the same. Both client and server are running the same OS/ansible version:

[mose@lab ~/ansible]$ ansible --version
ansible [core 2.14.14]
  config file = /home/mose/ansible/ansible.cfg
  configured module search path = ['/home/mose/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /home/mose/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.18 (main, Jan 24 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
[mose@lab ~/ansible]$ cat /etc/redhat-release 
Red Hat Enterprise Linux release 9.4 (Plow)

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật