ruby IF question
Good morning,
Im working on a chef plugin, that i did not write, and I realize that it needs an IF statement. Pseduo: If user root, then home is /root/ else home is /home/$user Im not a programmer at all so im not sure how much code to include, but this seems like the important section. Any takers for fixing this snippet for me? Code:
user = params[:name] |
Quote:
Although note that if you're only dealing with the current user, you should normally just use ENV['HOME'] as their home directory, as that will (i) be easier for you and (ii) cover weird/unusual configurations, and (iii) be nil/the empty string (not sure which) if the user has no home directory configured. |
excellent. thank you for the input.
https://github.com/skalar-cookbooks/authorized_keys I got the plugin from this place. So i dont understand what its actually doing - except that its automatically assuming roots home folder is /home/root. I've since found the chef documentation that explains how to distribute ssh keys without plugins here: https://opscode.app.box.com/shared/b0lmhnhn09 If anyone finds this thread looking for ssh key distribution in chef, this is the guide you will need. |
All times are GMT -5. The time now is 01:09 AM. |