1

I want to create a user and a directory in his HOME directory.

Unfortunately the HOME directory is not allways directly under /home. On some minions it is under /localhome and some use /users/.

guettli
  • 3,113
  • 14
  • 59
  • 110
  • Related question: https://stackoverflow.com/questions/23144324/how-to-i-retrieve-the-home-directory-of-a-user – guettli Jan 31 '19 at 11:54

1 Answers1

2

You can use the ~USER/ syntax:

fred:
  user.present

dir_in_home:
  file.directory:
    - name: ~fred/foo
guettli
  • 3,113
  • 14
  • 59
  • 110