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> }}
...
(1) A storage folder that contains the user's personal files. Starting with Windows Vista, the Windows home directory is \user\username. In prior Windows versions, it was \Documents and Settings\username. In the Mac, the home directory is /users/username, and in most Linux/Unix systems, it is /home/username.
String userHome = System. getProperty( "user. home" ); to get the home directory of the user on any platform.
By default, all non-root user home directories are located in a directory named "home", below the / (root) directory - in the path of /home. For example, for a Linux user named cwest, the home directory is in the path of /home/cwest. The home directory for the bbest user is in the path of /home/bbest.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With