Filter out a single host

Hey All,

I know i’m probably missing something obvious but what is the best way to filter out a single host? Then run a task on the single host.

My script has it so you can either pass in a group name or host name. No issues filtering on the group name.

I am using the Ansible inventory plugin.

Have you tried using the F filter?

from nornir.core.filter import F
device = nr.filter(F(name=“YourHostName”))

That did it. I was trying to use hostname and hosts to filter but was coming up empty.

I knew it was something easy.