ansible-roles/library/roles/solr-tomcat-core-conf/tasks/main.yml

48 lines
1.6 KiB
YAML
Raw Normal View History

---
- name: Set the tomcat version for ubuntu Trusy
set_fact:
tomcat_version: 7
when:
- ansible_distribution_major_version <= '16'
- tomcat_fixed_version is not defined
tags: [ solr, tomcat, solr_core ]
- name: Set the tomcat version for Ubuntu bionic
set_fact:
tomcat_version: 8
when:
- ansible_distribution_major_version == '18'
- tomcat_fixed_version is not defined
tags: [ solr, tomcat, solr_core ]
- name: Impose a tomcat version
set_fact:
tomcat_version: '{{ tomcat_fixed_version }}'
when: tomcat_fixed_version is defined
tags: [ solr, tomcat, solr_core ]
- block:
- 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 }}'
- 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_global_cores }}'
notify: tomcat solr restart
- name: Install the solr.xml file
template: src={{ item }}.j2 dest={{ solr_data_dir }}/data/solr/{{ item }} owner=root group={{ solr_user }} mode=0440
with_items:
- solr.xml
notify: tomcat solr restart
- name: Fix the cores permissions
file: path={{ solr_collections_base_dir }} owner={{ solr_user }} group={{ solr_user }} recurse=yes
when: solr_multicore is defined and solr_multicore
tags: [ solr, tomcat, solr_core ]