I like my roles to be as turnkey as possible. Consequently, I configure 
them to download the software components they need using a combination of 
local_action: get_url and run_once=yes.  

 - name: "download archiva if we don't already have it in the files 
directory"
   local_action: get_url url={{ archiva_url }} force=no 
dest=./roles/archiva/files/archiva.war 
   sudo: false
   run_once: true

I could just as easily download these components to the target machine:

 - name: "download archiva if we don't already have it on the remote 
machine"
   get_url: url={{ archiva_url }} force=no 
dest=/opt/tomcat/archiva/archiva.war

Or, I could simply tell the user to place the archiva.war file in 
/roles/archiva/files ahead of time which would be much easier but less 
snazzy. Downloading them locally means that my local box can act as a 
distribution point if I'm running my playbook against multiple systems. 
Downloading remotely seems to be the intended methodology however it means 
that every box must download the file for itself which could be a lot of 
bandwidth if we are talking about many target machines. 

Which of these methods would you use when writing a role for public 
consumption? Have I missed something obvious?

Thanks in advance!
-Alex Speaks

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4db4929c-1da5-4a1e-98a9-17365403f48c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to