Skip to content

Commit

Permalink
add drupal solr related tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Natkeeran committed Nov 23, 2017
1 parent c080155 commit 3cccf93
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
3 changes: 3 additions & 0 deletions inventory/vagrant/group_vars/webserver/drupal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ drupal_enable_modules:
- search_api
- carapace
- islandora_image
- search_api_solr
- search_api_solr_defaults
- facets
drupal_trusted_hosts:
- ^localhost$
drupal_trusted_hosts_file: "{{ drupal_core_path }}/sites/default/settings.php"
Expand Down
2 changes: 1 addition & 1 deletion playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
tags:
- bootstrap
- include: database.yml
- include: solr.yml
- include: webserver.yml
- include: tomcat.yml
- include: solr.yml
- include: crayfish.yml
- include: karaf.yml
4 changes: 4 additions & 0 deletions roles/internal/webserver-app/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ webserver_app_jwt_config_path: /home/ubuntu/configs/jwt
webserver_app_drupal_config_path: /home/ubuntu/configs/drupal

webserver_app_user: ubuntu
solr_user: solr
solr_instance_conf_path: /var/solr/data/CLAW/conf

webserver_document_root: /var/www/html
3 changes: 3 additions & 0 deletions roles/internal/webserver-app/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
dependencies:
- role: solr
23 changes: 23 additions & 0 deletions roles/internal/webserver-app/tasks/drupal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,26 @@
(drupal_filehash_settings.changed is defined and drupal_filehash_settings.changed) or
(drupal_node_rest.changed is defined and drupal_node_rest.changed) or
(drupal_media_rest.changed is defined and drupal_media_rest.changed)

- name: Set default solr server to point to CLAW core
command: drush -y config-set search_api.server.default_solr_server backend_config.connector_config.core CLAW
args:
chdir: "{{ drupal_core_path }}"
register: set_search_api_config
changed_when: "'Do you want to update' in set_search_api_config.stdout"

- name: Get solr config files to copy
command: "find {{ webserver_document_root }}/drupal/web/modules/contrib/search_api_solr/solr-conf/6.x -type f"
register: files_to_copy
changed_when: false

- name: Copy solr config files
copy:
src: "{{ item }}"
dest: "{{ solr_instance_conf_path }}"
owner: "{{ solr_user }}"
group: "{{ solr_user }}"
remote_src: True
with_items:
- "{{ files_to_copy.stdout_lines }}"
notify: restart solr

0 comments on commit 3cccf93

Please sign in to comment.