Closed alanorth closed 9 years ago
I guess it's just a matter of coming up with default values for the variables defined in host_vars
.
Or skipping the task if it's not defined...
On Thu, Jun 18, 2015, 14:42 James Oguya notifications@github.com wrote:
I guess it's just a matter of coming up with default values for the variables defined in host_vars.
— Reply to this email directly or view it on GitHub https://github.com/ilri/rmg-ansible-public/issues/7#issuecomment-113126199 .
For apt_mirror
it makes sense to have a default. But for private things like the maven repo credentials there is no sensible default. So we either skip it (and fail during DSpace build) or make it a private group var.
Definitely private/vars/$GROUP
. Remember, we're also interested in uncluttering host_vars
.
True, perhaps we could use private/vars/$group
and also only run the task
if that variable exists, then we kinda get the benefit of both approaches.
I guess that pattern would become common -- tasks depending on private
variables would generally become optional. Then anyone using our playbooks
would still be able to deploy them without stumbling on privates...
On Thu, Jun 18, 2015 at 6:46 PM James Oguya notifications@github.com wrote:
Definitely private/vars/$GROUP. Remember, we're also interested in uncluttering host_vars.
— Reply to this email directly or view it on GitHub https://github.com/ilri/rmg-ansible-public/issues/7#issuecomment-113197818 .
Ok, I've created a new branch -- dspace -- where we'll make all the necessary changes & if all is well, merge to master.
After adding the following variables to defaults/main.yml
, I was able to successfully run the dspace role with only ansible_ssh_host
in host_vars
:
dspace webapps
dspace_webapps:
- { name: 'ROOT', app_path: '/home/{{ nginx_server_name }}/webapps/xmlui', context_path: '/etc/tomcat7/Catalina/localhost/ROOT.xml' }
- { name: 'jspui', app_path: '/home/{{ nginx_server_name }}/webapps/jspui', context_path: '/etc/tomcat7/Catalina/localhost/jspui.xml' }
- { name: 'oai', app_path: '/home/{{ nginx_server_name }}/webapps/oai', context_path: '/etc/tomcat7/Catalina/localhost/oai.xml' }
- { name: 'solr', app_path: '/home/{{ nginx_server_name }}/webapps/solr', context_path: '/etc/tomcat7/Catalina/localhost/solr.xml' }
- { name: 'rest', app_path: '/home/{{ nginx_server_name }}/webapps/rest', context_path: '/etc/tomcat7/Catalina/localhost/rest.xml' }
postgresql dspace db credentials
dspace_db_name: dspace
dspace_db_user: dspace
dspace_db_password: e\`aJ+C4wMUY;2R-
nginx server name & document root
nginx_server_name: localhost
nginx_root: /home/{{ nginx_server_name }}/webapps/xmlui
Merged and updated a lot of your code, for example I added dspace_root
. Also, I updated the host_vars for the DSpace hosts to use the new variable and exclude the ones defined in defaults.
Need to test a clean DSpace machine to see if it can deploy without all of our settings, but this was good work, we caught a few things and made the role more robust and simple.
There are at least a few critical variables (atmire!) which need to be defined or else the playbook will fail. It's better to let the playbook deploy successfully (so all notifies fire, for example) but have the application not fully configured, than to have the deploy die!