How would you?...

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

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

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

Maybe with one of these http://docs.ansible.com/playbooks_conditionals.html on the condition that the software doesn’t exist.

I think you want this: http://docs.ansible.com/playbooks_conditionals.html#applying-when-to-roles-and-includes

Nathan