2015-05-28 11:32:57 +02:00
|
|
|
---
|
|
|
|
- name: Ensure that the solr data directory exists
|
|
|
|
file: path={{ solr_data_dir }}/{{ item }} state=directory mode=0775 owner={{ solr_user }} group={{ solr_user }}
|
|
|
|
with_items:
|
|
|
|
- data/solr
|
|
|
|
- webapps
|
|
|
|
- zoo_data
|
2016-07-13 19:04:28 +02:00
|
|
|
- collection_data
|
|
|
|
tags: solr
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Create the link from the tomcat instance for solr to the solr data directory
|
|
|
|
file: src={{ solr_data_dir }}/data/solr dest={{ solr_tomcat_instance_dir }}/solr state=link
|
|
|
|
when: solr_outside_tomcat_dir
|
2016-07-13 19:04:28 +02:00
|
|
|
tags: solr
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Solr needs some additional packages
|
|
|
|
apt: pkg={{ item }} state={{ pkg_state }}
|
|
|
|
with_items:
|
|
|
|
- libslf4j-java
|
|
|
|
- libcommons-logging-java
|
2016-07-13 19:04:28 +02:00
|
|
|
tags: [ solr, tomcat ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Let the additional packages jar files visible to tomcat
|
|
|
|
file: src=/usr/share/java/{{ item }} dest={{ tomcat_catalina_home_dir }}/lib/{{ item }} state=link
|
|
|
|
with_items:
|
|
|
|
- slf4j-api.jar
|
|
|
|
- slf4j-log4j12.jar
|
|
|
|
- jul-to-slf4j.jar
|
|
|
|
- jcl-over-slf4j.jar
|
|
|
|
- commons-logging.jar
|
|
|
|
notify: tomcat solr restart
|
2016-07-13 19:04:28 +02:00
|
|
|
tags: [ solr, tomcat ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
2016-06-21 18:49:24 +02:00
|
|
|
- name: Install the solr webapp under <solr_data_mountpoint>/webapps
|
2015-05-28 11:32:57 +02:00
|
|
|
copy: src=solr-{{ solr_version }}.war dest={{ solr_data_dir }}/webapps/solr-{{ solr_version }}.war owner={{ solr_user }} group={{ solr_user }} mode=0644
|
|
|
|
register: solr_war_installed
|
|
|
|
notify: tomcat solr restart
|
2016-07-13 19:04:28 +02:00
|
|
|
tags: [ solr, tomcat ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Install the solr catalina definition
|
|
|
|
template: src=catalina-{{ item }}.j2 dest={{ solr_tomcat_instance_dir }}/conf/Catalina/localhost/{{ item }} owner=root group=root mode=0444
|
|
|
|
with_items:
|
|
|
|
- solr.xml
|
|
|
|
notify: tomcat solr restart
|
2016-07-13 19:04:28 +02:00
|
|
|
tags: [ solr, tomcat ]
|
|
|
|
|
|
|
|
- name: Copy the solr collection1 and solr_core_base archives on the target machine
|
|
|
|
copy: src={{ item }} dest={{ solr_data_dir }}/collection_data owner={{ solr_user }} group={{ solr_user }}
|
|
|
|
with_items:
|
|
|
|
- collection1.tar.gz
|
|
|
|
- solr_core_base.tar.gz
|
2016-09-20 15:53:44 +02:00
|
|
|
tags: [ solr, tomcat, solr_core ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Install the solr collection1 example
|
2016-07-13 19:04:28 +02:00
|
|
|
unarchive: src={{ solr_data_dir }}/collection_data/collection1.tar.gz dest={{ solr_collections_base_dir }} copy=no
|
2015-05-28 11:32:57 +02:00
|
|
|
args:
|
2016-07-13 19:04:28 +02:00
|
|
|
creates: '{{ solr_data_dir }}/data/solr/collection1/conf/solrconfig.xml'
|
2015-05-28 11:32:57 +02:00
|
|
|
when: solr_install_collection1
|
|
|
|
notify: tomcat solr restart
|
2016-09-20 15:53:44 +02:00
|
|
|
tags: [ solr, tomcat, solr_core ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
2016-07-13 19:04:28 +02:00
|
|
|
- name: Create the solr cores data directories
|
|
|
|
file: dest={{ solr_collections_base_dir }}/{{ item }} state=directory owner={{ solr_user }} group={{ solr_user }}
|
|
|
|
with_items: '{{ solr_cores }}'
|
|
|
|
when: solr_multicore is defined and solr_multicore
|
2016-09-20 15:53:44 +02:00
|
|
|
tags: [ solr, tomcat, solr_core ]
|
2016-07-13 19:04:28 +02:00
|
|
|
|
|
|
|
- name: Install the solr cores data on a multicore system
|
|
|
|
unarchive: src={{ solr_data_dir }}/collection_data/solr_core_base.tar.gz dest={{ solr_data_dir }}/data/solr/{{ item }} copy=no
|
|
|
|
args:
|
|
|
|
creates: '{{ solr_data_dir }}/data/solr/{{ item }}/conf/solrconfig.xml'
|
|
|
|
with_items: '{{ solr_cores }}'
|
|
|
|
when: solr_multicore is defined and solr_multicore
|
|
|
|
notify: tomcat solr restart
|
2016-09-20 15:53:44 +02:00
|
|
|
tags: [ solr, tomcat, solr_core ]
|
2016-07-13 19:04:28 +02:00
|
|
|
|
|
|
|
- name: Fix the cores permissions
|
|
|
|
file: path={{ solr_collections_base_dir }} owner={{ solr_user }} group={{ solr_user }} recurse=yes
|
2016-09-20 15:53:44 +02:00
|
|
|
tags: [ solr, tomcat, solr_core ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Install the tomcat.local default file
|
|
|
|
template: src={{ item }}.j2 dest=/etc/default/tomcat-instance-{{ solr_http_port }}.local owner=root group={{ solr_user }} mode=0440
|
|
|
|
with_items:
|
|
|
|
- tomcat.local
|
|
|
|
notify: tomcat solr restart
|
2016-07-13 19:04:28 +02:00
|
|
|
tags: [ solr, tomcat ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Install the solr.xml and zookeeper conf files
|
|
|
|
template: src={{ item }}.j2 dest={{ solr_data_dir }}/data/solr/{{ item }} owner=root group={{ solr_user }} mode=0440
|
|
|
|
with_items:
|
|
|
|
- solr.xml
|
|
|
|
- zoo.cfg
|
|
|
|
notify: tomcat solr restart
|
2016-09-20 15:53:44 +02:00
|
|
|
tags: [ solr, tomcat, solr_core ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|