Skip to content

Commit

Permalink
Install solr as the vagrant user
Browse files Browse the repository at this point in the history
  • Loading branch information
agentrickard committed Feb 12, 2020
1 parent a5ffbd1 commit 0e6117e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
9 changes: 1 addition & 8 deletions drupalbox/drupalbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,10 @@
"galaxy_file": "drupalbox/requirements.yml",
"inventory_groups": "drupalbox,all"
},
{
"type": "shell",
"script": "script/reboot.sh",
"execute_command": "echo '{{ user `ssh_password` }}' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
"expect_disconnect": true
},
{
"type": "file",
"source": "tests",
"destination": "/tmp",
"pause_before": "60s"
"destination": "/tmp"
},
{
"type": "file",
Expand Down
1 change: 1 addition & 0 deletions drupalbox/drupalbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
role: geerlingguy.solr,
solr_version: "7.7.2",
solr_cores: ['example'],
solr_user: vagrant,
become: yes
}
- {
Expand Down
4 changes: 2 additions & 2 deletions drupalbox/tests/solr_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

describe file("/var/solr/logs/solr.log") do
it { should be_file }
it { should be_owned_by 'solr' }
it { should be_grouped_into 'solr' }
it { should be_owned_by 'vagrant' }
it { should be_grouped_into 'vagrant' }
end

describe service('solr') do
Expand Down
9 changes: 2 additions & 7 deletions provisioning/roles/solr-configuration/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---

- name: Solr Configuration | Grant the vagrant user access to Solr configs
user:
name: vagrant
groups: solr

- name: Solr Configuration | Copy Solr config
copy:
src: templates/
Expand All @@ -15,12 +10,12 @@
cmd: /opt/solr/bin/solr create_core -c drupal8 -d /tmp/solr_7.x_config-drupal8
creates: /var/solr/data/drupal8
become: yes
become_user: solr
become_user: vagrant

# Drupal 7 support requires different Lucene configuration.
- name: Solr Configuration | Install 'drupal7' Solr core
command:
cmd: /opt/solr/bin/solr create_core -c drupal7 -d /tmp/solr_7.x_config-drupal7
creates: /var/solr/data/drupal7
become: yes
become_user: solr
become_user: vagrant

0 comments on commit 0e6117e

Please sign in to comment.