Had to do this weird shell magic due to chef not supporting login of execute commands.

Seems like a design choice
http://serverfault.com/questions/352811/chef-bash-resource-not-executing-as-specified-user
http://serverfault.com/questions/402881/execute-as-vagrant-user-not-root-with-chef-solo