Re: [ansible-project] Installation task that requires feedback from the install

203 views
Skip to first unread message

Michael DeHaan

unread,
May 23, 2013, 11:06:01 AM5/23/13
to ansible...@googlegroups.com


On Thu, May 23, 2013 at 10:15 AM, James Jelinek <jel...@gmail.com> wrote:
I'm new to Ansible and so far I love it.  I had a question regarding installation of a package that requires feedback from the user.

ie.  The passenger-install-nginx-module that installs phusion passenger for Rails and nginx in one bundle.


Here are the commands I would enter if I were doing it manually on the machine.  Note: This relies on Ruby already being installed which is another process I'm tackling since Ruby from source/RVM is best compared to a packaged version that might be outdated.

sudo gem install passenger
sudo passenger-install-nginx-module

From there I am prompted to install Nginx and configure passenger.  All of the default dirs/options are fine but they require input from the end-user.

I've been able to install nginx-full via apt on ansible then do a service check to make sure nginx is running which is great.  But what if I wanted to install the passenger-install-nginx-module?  What options do I have to push this out to all 3 of my VMs and deal with the user interaction?

Thanks in advance!
-James
@jamesjelinek

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Michael DeHaan <mic...@ansibleworks.com>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

James Jelinek

unread,
May 23, 2013, 11:08:30 AM5/23/13
to ansible...@googlegroups.com
Michael,

Thanks for the quick reply.  I think the passenger-install-nginx-module was a poor example.  What if there was an install or package that required interactive answers but did not have a headless option?  How would one handle that in Ansible?

Btw, so far I'm loving it.  It's much easier to get things done than in Chef/Puppet.  So far I don't see any limitations but again I'm just getting started.

Thanks for all your help.

-James
@jamesjelinek

Brian Coca

unread,
May 23, 2013, 11:09:19 AM5/23/13
to ansible...@googlegroups.com
from my rails install playbook

    - name: Build nginx w passenger 
      shell: passenger-install-nginx-module --auto --auto-download --prefix=/opt/nginx creates=/opt/nginx



--
Brian Coca
Stultorum infinitus est numerus
0110000101110010011001010110111000100111011101000010000001111001011011110111010100100000011100110110110101100001011100100111010000100001
Pedo mellon a minno

James Jelinek

unread,
May 23, 2013, 11:11:49 AM5/23/13
to ansible...@googlegroups.com
Awesome, thanks!

Would you mind sharing your full rails install playbook with me?  You can email me directly if you like.

Thanks!
-James

Brian Coca

unread,
May 23, 2013, 11:16:25 AM5/23/13
to ansible...@googlegroups.com
this is it, i have a few  more tasks but they have to do with custom stuff for our apps

http://pastebin.com/3aUU8gLY

James Jelinek

unread,
May 23, 2013, 11:21:04 AM5/23/13
to ansible...@googlegroups.com
This is great, I'm going to bookmark it.  Thanks Brian!

Brian Coca

unread,
May 23, 2013, 11:25:25 AM5/23/13
to ansible...@googlegroups.com
I need to cleanup, but i'll add this and more to my github ansible-pb repo.

Michael DeHaan

unread,
May 23, 2013, 11:26:38 AM5/23/13
to ansible...@googlegroups.com
If something goes interactive and can only be done that way, you would probably have to use expect.




James Jelinek

unread,
May 23, 2013, 11:28:05 AM5/23/13
to ansible...@googlegroups.com
That's what I figured, luckily most packages have headless installs and options.

Thanks again, Michael.
Reply all
Reply to author
Forward
0 new messages