I’m using a user call “sam” that has sudo rights on remote servers. How can I deploy templates to say the “/etc/httpd” folder on the remote servers?
template = ERB.new(File.read('templates/UI/httpd.conf.erb'))
result = template.result(binding)
put(result, "/etc/httpd/httpd.conf")
put() command can’t be used with sudo, as it uses SFTP. It will have to be a 2-step process, upload the file to a location you can write to as a user “sam”, and then sudo mv it to /etc/httpd.