One other question on this: How can I use a variable as the third parameter? I'm hoping to pass in a user name and match that in the check, but I'm getting an error when I run it.
vars:
- user_to_remove: 'user1'
The fact is now set as: "{{ fs.files | selectattr('pw_name','equalto',{{ user_to_remove }}) | list }}"
The error is: template error while templating string: expected token ':', got '}'
Any ideas?
Harry