saltstack-formulas/users-formula

196 views
Skip to first unread message

John Hubbard

unread,
Feb 28, 2018, 3:27:28 PM2/28/18
to Salt-users
I found a formula for managing users on the saltstack-formulas github [1] and I'm having problems figuring out how to use it for managing user files within subdirectories. The pillar.example (see excerpt below) shows that by placing files in the appropriate directory they will be managed by salt and present in the given user's home directory.  This all appears to work as expected.  However I was hoping to be able to use this state to manage the contents of a directory within a user's home directory; specifically I wanted to populated ~/.bin with scripts.  It does not appear that creating a salt://users/files/user/<username>/.bin directory will cause a ~/.bin directory (and the files therin) to be managed.  

Am I correct in the limitations of this formula?
Does anyone have a sense of how hard this would be to implement and would you point me in the correct direction to modify the formula to manage arbitrary directories?
Can anyone suggest another approach to doing something similar?  

Thanks

...
    user_files
:
      enabled
: True
     
# 'source' allows you to define an arbitrary directory to sync, useful to use for default files.
     
# should be a salt fileserver path either with or without 'salt://'
     
# if not present, it defaults to 'salt://users/files/user/<username>
      source
: users/files/default
     
template: jinja
     
# You can specify octal mode for files and symlinks that will be copied. Since version 2016.11.0
     
# it's possible to use 'keep' for file_mode, to preserve file original mode, thus you can save
     
# execution bit for example.
      file_mode
: keep
      sym_mode
: 640

Dafydd Jones (techneg.it)

unread,
Feb 28, 2018, 4:29:13 PM2/28/18
to salt-...@googlegroups.com
Hi,

can you show the pillar and exact file hierarchy you are using to test this?

Regards,
Dafydd

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/23989c6a-ce56-48d0-967f-65b7950341de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Hubbard

unread,
Feb 28, 2018, 5:14:47 PM2/28/18
to Salt-users
Well heck.  Now it seems to be working.  Sorry to have bothered you.

The formula now contains: /srv/salt/users/files/user/jhubbard/.bin/foo


To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages