I have a dictionary that defines AWS mounts based on IP address aws_efs_mount: - 10.22.100.1: aws_mount_10_22_100_1 - 10.22.100.2: aws_mount_10_22_100_2
Now I want a task that creates an entry in /etc/fstab # The idea is the src value resolves to src=aws_mount_10_22_100_1 for a IP of 10.22.100.1 - name: Add entry in /etc/fstab mount: name=/mt/mount_path src="{{ aws_efs_mount.{{ ansible_default_ipv4.address }} }}" I get TASK [elasticsearch-elk : Add entry in /etc/fstab ***** fatal: [10.22.x.x]: FAILED! => {"failed": true, "msg": "plate error while templating string: expected name or number. String: {{ aws_efs_mount.{{ ansible_default_ipv4.address }} }}"} How can I achieve this? I can't use a template since there are values in the /etc/fstab file. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0e7c5ec6-1918-4fc4-bd4d-fd5be7910fd7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.