question on remote '~' #259

Closed
opened 2021-11-20 15:22:44 +00:00 by ungleich-gitea · 1 comment

Created by: agreif

Hi,
I just begun to use cdist and like it a lot!
I have a general question on the remote user homes:
I want to to iterate over some users names and for example deploy there a .emacs file.
I cannot figure out how to use the ~ shortcut on the remote side

the following does not work:

for user in root user1 user2; do
ownergroup="--owner $user --group $user"
__file ~home/.emacs --state present
--source "$__manifest/files/_emacs"
$ownergroup
done

this workaround without '~' does work but is not so nice:

for userhome in /root /home/user1 /home/user2; do
user=basename $userhome
ownergroup="--owner $user --group $user"
__file $userhome/.emacs --state present
--source "$__manifest/files/_emacs"
$ownergroup
done

Thanks for any ideas
ALex.

*Created by: agreif* Hi, I just begun to use cdist and like it a lot! I have a general question on the remote user homes: I want to to iterate over some users names and for example deploy there a .emacs file. I cannot figure out how to use the ~<username> shortcut on the remote side the following does not work: for user in root user1 user2; do ownergroup="--owner $user --group $user" __file ~home/.emacs --state present \ --source "$__manifest/files/_emacs" \ $ownergroup done this workaround without '~' does work but is not so nice: for userhome in /root /home/user1 /home/user2; do user=`basename $userhome` ownergroup="--owner $user --group $user" __file $userhome/.emacs --state present \ --source "$__manifest/files/_emacs" \ $ownergroup done Thanks for any ideas ALex.
Author
Owner

Created by: agreif

you can ignore and close this issue, because I opened it, I misunderstood the cdist principles. Now I examined some other types, and refactored my own code.

thanks,
ALex.

*Created by: agreif* you can ignore and close this issue, because I opened it, I misunderstood the cdist principles. Now I examined some other types, and refactored my own code. thanks, ALex.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#259
No description provided.