Hi everyone,
new to ansible and loving it so far, trying to get yaml files for my standard rails deployments built and I’m very close.
The last piece of the puzzle is figuring out how to use rbenv-sudo from ansible to install nginx, a hack of a plugin that sets/allows the user to use their own rbenv environment while acting with privilege, https://github.com/dcarley/rbenv-sudo. I know environmental variables tend to be a reoccuring question around here.
Currently my tasks look like:
vars:
user: deployer
nginx_prefix: /opt/nginx
tasks:
-
name: initialize rbenv
action: shell bash /home/$user/.bashrc -
name: installing nginx
action: shell /home/$user/.rbenv/bin/rbenv sudo passenger-install-nginx-module --auto --auto-download --extra-configure-flags=none --prefix=$nginx_prefix
No luck though. I’ve also tried calling things more explicitly with PATH set manually (and messily I know), such as:
action: shell PATH=/home/$user/.rbenv/bin:$PATH /home/deployer/.rbenv/bin/rbenv sudo passenger-install-nginx-module --auto --auto-download --extra-configure-flags=no --prefix=$nginx_prefix
Without any luck.
Thanks,