How would you?...

70 views
Skip to first unread message

Adam Morris

unread,
May 29, 2014, 4:29:28 PM5/29/14
to ansible...@googlegroups.com
Greetings,

I have been asked to automate a software installation task, and the actual installation is relatively simple so I'm not having any problems there...

Manual steps...
mount an nfs directory on the client
run a shell script from within the nfs directory (vendor provided installation script, with options)
unmount the nfs directory.

I can automate all of these steps easily, and even make the shell script dependent on whether a file exists (it creates several files, so that's easy...)

The question I have is whether there is a better way to deal with the mount/unmount so it's only done if the software needs to be installed? 

Any thoughts?

Thanks,

Adam

Adam Morris

unread,
May 29, 2014, 4:37:05 PM5/29/14
to ansible...@googlegroups.com


On Thursday, May 29, 2014 1:29:28 PM UTC-7, Adam Morris wrote:
I can automate all of these steps easily, and even make the shell script dependent on whether a file exists (it creates several files, so that's easy...)

The question I have is whether there is a better way to deal with the mount/unmount so it's only done if the software needs to be installed? 

 
Alternatively if you have any suggestions for how to conditionally skip a role?  I can assert, or fail which will error out, but I can't find a "skip", "step", "next", or similar that would allow me to skip an entire role based on some condition...

Adam

Gonzalo Servat

unread,
May 29, 2014, 5:23:00 PM5/29/14
to ansible-project

The condition you set for whether the software needs to be installed is up to you and easy enough, but for the auto mounting you might want to look into autofs.

- Gonzalo

Barry Morrison

unread,
May 29, 2014, 7:22:01 PM5/29/14
to ansible...@googlegroups.com
Maybe with one of these http://docs.ansible.com/playbooks_conditionals.html on the condition that the software doesn't exist. 


On Thursday, May 29, 2014 1:29:28 PM UTC-7, Adam Morris wrote:

Nathan Howell

unread,
May 29, 2014, 7:54:47 PM5/29/14
to ansible...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages