Skip to content

Commit

Permalink
Create core directories and config.
Browse files Browse the repository at this point in the history
  • Loading branch information
becw committed Apr 5, 2018
1 parent 2ce727b commit 6fdde98
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 9 deletions.
7 changes: 7 additions & 0 deletions drupalbox/drupalbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
rvm1_install_path: /home/vagrant/.rvm
php_xdebug_enabled: true
php_ini_sendmail_path: "/usr/local/bin/mhsendmail"
solr_cores:
- name: drupal7
module: search_api_solr-7.x-1.12
subdir: solr-conf/4.x
- name: drupal8
module: search_api_solr-8.x-1.2
subdir: solr-conf/4.x
vars_files:
- vars/default/common.yml
- vars/dev/mysql.yml
Expand Down
51 changes: 51 additions & 0 deletions provisioning/roles/geerlingguy.solr-cleanup/tasks/cores.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---

- name: Solr | Create core directories
file:
path: "/var/solr/{{ item.name }}"
state: directory
owner: solr
group: solr
with_items: "{{ solr_cores }}"

- name: Solr | Create data directories
file:
path: "/var/solr/{{ item.name }}/data"
state: directory
owner: solr
group: solr
with_items: "{{ solr_cores }}"

- name: Solr | Create core.properties
template:
src: core.properties.j2
dest: "/var/solr/{{ item.name }}/core.properties"
owner: solr
group: solr
with_items: "{{ solr_cores }}"

- name: Solr | Download Drupal Solr configuration
get_url:
url: "https://ftp.drupal.org/files/projects/{{ item.module }}.tar.gz"
dest: "/var/solr/{{ item.name }}/{{ item.module }}.tar.gz"
with_items: "{{ solr_cores }}"

- name: Solr | Unarchive Drupal Solr configuration
unarchive:
remote_src: yes
src: "/var/solr/{{ item.name }}/{{ item.module }}.tar.gz"
dest: "/var/solr/{{ item.name }}/"
with_items: "{{ solr_cores }}"

- name: Solr | Copy Drupal Solr conf directory into place
command: "cp -r /var/solr/{{ item.name }}/search_api_solr/{{ item.subdir }} /var/solr/{{ item.name }}/conf"
with_items: "{{ solr_cores }}"

- name: Solr | Chmod Solr conf directory
file:
path: "/var/solr/{{ item.name }}/conf"
state: directory
owner: solr
group: solr
recurse: yes
with_items: "{{ solr_cores }}"
10 changes: 1 addition & 9 deletions provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,4 @@
name: solr
enabled: yes

- name: Solr Cleanup | Download Solr configuration for Drupal 7
get_url:
url: https://ftp.drupal.org/files/projects/search_api_solr-7.x-1.12.tar.gz
dest: /tmp/search_api_solr-7.x-1.12.tar.gz

- name: Solr Cleanup | Download Solr configuration for Drupal 8
get_url:
url: https://ftp.drupal.org/files/projects/search_api_solr-8.x-1.2.tar.gz
dest: /tmp/search_api_solr-8.x-1.2.tar.gz
- include: cores.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name={{ item.name }}

0 comments on commit 6fdde98

Please sign in to comment.