-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsolr.yml
36 lines (30 loc) · 1.33 KB
/
solr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
- hosts: chronam-servers
vars:
SOLR_VERSION: 4.10.4
SOLR_HOME: "/usr/share/jetty8"
tasks:
#assumes that jetty8 has already been installed at this point
- name: download solr {{SOLR_VERSION}}
get_url: dest=/tmp/solr-{{SOLR_VERSION}}.tgz url=http://archive.apache.org/dist/lucene/solr/{{SOLR_VERSION}}/solr-{{SOLR_VERSION}}.tgz
- name: untar solr {{SOLR_VERSION}}
unarchive: src=/tmp/solr-{{SOLR_VERSION}}.tgz dest=/tmp creates=/tmp/solr-{{SOLR_VERSION}}
- name: copy example directory to {{SOLR_HOME}}
synchronize: dest={{SOLR_HOME}} src=/tmp/solr-{{SOLR_VERSION}}/example/ recursive=yes rsync_opts=--ignore-existing
delegate_to: "{{inventory_hostname}}"
become: yes
- name: Copy chronam config files
copy: dest={{item.dest}} src={{item.src}}
with_items:
- { src: 'conf/schema.xml', dest: "{{SOLR_HOME}}/solr/collection1/conf/schema.xml" }
- { src: 'conf/solrconfig.xml', dest: "{{SOLR_HOME}}/solr/collection1/conf/solrconfig.xml" }
become: yes
- name: enable jetty to start
lineinfile: dest=/etc/default/jetty8 line=NO_START=0 regexp='.*NO_START.*=.*1.*'
become: yes
- name: change /usr/share/jetty8 to be owned by jetty
file: path=/usr/share/jetty8 recurse=yes owner=jetty
become: yes
- name: (re)start solr
service: name=jetty8 state=restarted
become: yes