glebm said about 7 years ago on Managing Servers with Ansible :

If you're looking to not run the deployment as root / a passwordless sudoer, have a look at these playbooks: https://github.com/thredded/thredded-ansible

I built them to deploy a Rails app with Thredded but it should work for any Rails app.