8

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> }}
...
nthiebaud
  • 214
  • 2
  • 6

1 Answers1

9

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

dead10ck
  • 75
  • 1
  • 9
nthiebaud
  • 214
  • 2
  • 6