How to I retrieve the home directory of a user

salt-stack

Solution

Trial and error got me there:

{% set my_user = ..get your pillar user or default to a sane value.. %}

{{ salt['user.info'](my_user).home }}

resolves to the user's home directory

Problem

let's say I have a service that has a pillar-configured user associated with it now I want to fetch a tar.gz and put it in this user home directory... how do I do that... user.info return a bunch of data including the home directory.. but how do I get only that ? iow ``` foo: archive: - extracted - name {{ <get the user home directory here> }} ... ```

Original source