ilri / rmg-ansible-public

Ansible playbooks for ILRI research-computing infrastructure
GNU General Public License v3.0
8 stars 2 forks source link

Allow DSpace role to deploy by default #7

Closed alanorth closed 9 years ago

alanorth commented 9 years ago

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!

oguya commented 9 years ago

I guess it's just a matter of coming up with default values for the variables defined in host_vars.

alanorth commented 9 years ago

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 .

alanorth commented 9 years ago

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.

oguya commented 9 years ago

Definitely private/vars/$GROUP. Remember, we're also interested in uncluttering host_vars.

alanorth commented 9 years ago

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 .

oguya commented 9 years ago

Ok, I've created a new branch -- dspace -- where we'll make all the necessary changes & if all is well, merge to master.

oguya commented 9 years ago

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:

  1. 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' }
  2. postgresql dspace db credentials

    dspace_db_name: dspace
    dspace_db_user: dspace
    dspace_db_password: e\`aJ+C4wMUY;2R-
  3. nginx server name & document root

    nginx_server_name: localhost
    nginx_root: /home/{{ nginx_server_name }}/webapps/xmlui
alanorth commented 9 years ago

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.