diff options
author | Stonewall Jackson <stonewall@sacredheartsc.com> | 2023-02-04 01:23:43 -0500 |
---|---|---|
committer | Stonewall Jackson <stonewall@sacredheartsc.com> | 2023-02-04 01:52:13 -0500 |
commit | 0261e875679f1bf63c8d689da7fc7e014597885d (patch) | |
tree | 3f19cd74a0c1070944f75437f30b098d6ef2ffcb /roles/solr/tasks | |
download | selfhosted-0261e875679f1bf63c8d689da7fc7e014597885d.tar.gz selfhosted-0261e875679f1bf63c8d689da7fc7e014597885d.zip |
initial commit
Diffstat (limited to 'roles/solr/tasks')
-rw-r--r-- | roles/solr/tasks/main.yml | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/roles/solr/tasks/main.yml b/roles/solr/tasks/main.yml new file mode 100644 index 0000000..0538a2a --- /dev/null +++ b/roles/solr/tasks/main.yml @@ -0,0 +1,77 @@ +- name: install java + dnf: + name: java-17-openjdk-headless + state: present + +- name: create installation directory + file: + path: '{{ solr_install_dir }}' + state: directory + +- name: unpack solr tarball + unarchive: + src: '{{ solr_url }}' + remote_src: yes + dest: '{{ solr_install_dir }}' + extra_opts: + - '--strip-components=1' + notify: restart solr + +- name: add local user + user: + name: solr + system: yes + home: '{{ solr_data_dir }}' + shell: /sbin/nologin + create_home: no + +- name: create data directory + file: + path: '{{ solr_data_dir }}' + state: directory + owner: solr + group: solr + mode: 0770 + +- name: create systemd unit + template: + src: etc/systemd/system/solr.service.j2 + dest: /etc/systemd/system/solr.service + register: solr_unit + +- name: reload systemd units + systemd: + daemon_reload: yes + when: solr_unit.changed + +- name: create config directory + file: + path: /etc/solr + state: directory + +- name: create EnvironmentFile + template: + src: etc/sysconfig/solr.j2 + dest: /etc/sysconfig/solr + notify: restart solr + +- name: create config files + template: + src: etc/solr/{{ item }}.j2 + dest: /etc/solr/{{ item }} + loop: + - log4j2.xml + - solrconfig.xml + notify: restart solr + +- name: copy default solr configuration + copy: + src: '{{ solr_install_dir }}/server/solr/solr.xml' + dest: '{{ solr_data_dir }}/solr.xml' + remote_src: yes + +- name: start solr + systemd: + name: solr + enabled: yes + state: started |