--- volume_mount_options_incl_empty: - "{{ 'uid=' ~ volume_uid if volume_uid | length > 0 else '' }}" - "{{ 'gid=' ~ volume_gid if volume_gid | length > 0 else '' }}" volume_mount_options: "{{ volume_mount_options_incl_empty | select('!=', '') | list }}" volume_options: "{{ ['o=' ~ volume_mount_options | join(',')] if volume_mount_options | length > 0 else [] }}"