don't use {{ }} in when, its already implied, you'll get weird results, also if present is not a var, it should be quoted, again, double interpolation does not work.when: hostvars[inventory_hostname][item|basename]['user']['state'] == "present"
or you can use the 'getent' module to list the users on the machine.
On 2016-04-27 17:25, Jameson wrote:
> On Wed, Apr 27, 2016 at 11:22 AM Brian Coca <bc...@ansible.com> wrote:
>> or you can use the 'getent' module to list the users on the machine.
> The issue with going that route is these machines are members of an AD
> domain with over 10000 users, but only users who have actually logged in
> will have a home directory to deploy the SSH key to. Thanks.
Why deploy the key to a home directory at all?