Support for scripts

This commit is contained in:
Dale McDiarmid 2015-11-25 17:13:45 +00:00
parent d25fc792b6
commit bdb9ee6a4a
13 changed files with 53 additions and 14 deletions

View file

@ -4,7 +4,7 @@
hosts: localhost
roles:
#expand to all available parameters
- { role: elasticsearch, es_instance_name: "node1", es_config: {node.name: "node1", cluster.name: "custom-cluster", discovery.zen.ping.unicast.hosts: "localhost:9301", http.port: 9201, transport.tcp.port: 9301, node.data: false, node.master: true, bootstrap.mlockall: true, discovery.zen.ping.multicast.enabled: false } }
- { role: elasticsearch, es_instance_name: "node1", es_data_dir: "/opt/elasticsearch/data", es_log_dir: "/opt/elasticsearch/logs", es_work_dir: "/opt/elasticsearch/temp", es_config: {node.name: "node1", cluster.name: "custom-cluster", discovery.zen.ping.unicast.hosts: "localhost:9301", http.port: 9201, transport.tcp.port: 9301, node.data: false, node.master: true, bootstrap.mlockall: true, discovery.zen.ping.multicast.enabled: false } }
vars:
es_scripts: false
es_templates: false

View file

@ -30,9 +30,34 @@ context "basic tests" do
it { should contain 'bootstrap.mlockall: true' }
it { should contain 'discovery.zen.ping.unicast.hosts: localhost:9301' }
it { should contain 'path.conf: /etc/elasticsearch/node1' }
it { should contain 'path.data: /var/lib/elasticsearch/localhost-node1' }
it { should contain 'path.work: /tmp/elasticsearch/localhost-node1' }
it { should contain 'path.logs: /var/log/elasticsearch/localhost-node1' }
it { should contain 'path.data: /opt/elasticsearch/data/localhost-node1' }
it { should contain 'path.work: /opt/elasticsearch/temp/localhost-node1' }
it { should contain 'path.logs: /opt/elasticsearch/logs/localhost-node1' }
end
#test directories exist
describe file('/etc/elasticsearch/node1') do
it { should be_directory }
it { should be_owned_by 'elasticsearch' }
end
describe file('/opt/elasticsearch/data/localhost-node1') do
it { should be_directory }
it { should be_owned_by 'elasticsearch' }
end
describe file('/opt/elasticsearch/logs/localhost-node1') do
it { should be_directory }
it { should be_owned_by 'elasticsearch' }
end
describe file('/opt/elasticsearch/temp/localhost-node1') do
it { should be_directory }
it { should be_owned_by 'elasticsearch' }
end
describe file('/etc/init.d/node1_elasticsearch') do
it { should be_file }
end
#test we started on the correct port was used

View file

@ -3,4 +3,5 @@
hosts: localhost
roles:
- { role: elasticsearch, es_config: { "discovery.zen.ping.multicast.enabled": true }, es_instance_name: "node1" }
vars:
vars:
es_scripts: true

View file

@ -0,0 +1 @@
log(_score * 2) + my_modifier

View file

@ -20,7 +20,7 @@ context "basic tests" do
describe file('/etc/elasticsearch/node1/elasticsearch.yml') do
it { should contain 'node.name: localhost-node1' }
it { should contain 'cluster.name: "elasticsearch"' }
it { should contain 'cluster.name: elasticsearch' }
it { should contain 'path.conf: /etc/elasticsearch/node1' }
it { should contain 'path.data: /var/lib/elasticsearch/localhost-node1' }
it { should contain 'path.work: /tmp/elasticsearch/localhost-node1' }