diff --git a/.kitchen.yml b/.kitchen.yml index 044a77a..1a97586 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -20,7 +20,8 @@ platforms: privileged: true provision_command: - apt-get update && apt-get install -y software-properties-common && add-apt-repository -y ppa:ansible/ansible - - apt-get update && apt-get -y -q install python-apt python-pycurl + - apt-get update && apt-get -y -q install python-apt python-pycurl python-pip + - pip install jmespath use_sudo: false volume: <%=ENV['ES_XPACK_LICENSE_FILE']%>:/tmp/license.json - name: ubuntu-16.04 @@ -30,7 +31,8 @@ platforms: provision_command: - apt-get update && apt-get install -y software-properties-common && add-apt-repository -y ppa:ansible/ansible - apt-get install -y -q net-tools - - apt-get update && apt-get -y -q install python-apt python-pycurl + - apt-get update && apt-get -y -q install python-apt python-pycurl python-pip + - pip install jmespath use_sudo: false volume: <%=ENV['ES_XPACK_LICENSE_FILE']%>:/tmp/license.json run_command: "/sbin/init" @@ -45,6 +47,7 @@ platforms: - sed -ri 's/^#?PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config - sed -ri 's/^#?PasswordAuthentication .*/PasswordAuthentication yes/' /etc/ssh/sshd_config - sed -ri 's/^#?UsePAM .*/UsePAM no/' /etc/ssh/sshd_config + - pip install jmespath volume: <%=ENV['ES_XPACK_LICENSE_FILE']%>:/tmp/license.json use_sudo: false run_command: "/sbin/init" @@ -58,6 +61,7 @@ platforms: - rm /etc/yum.repos.d/epel*repo /etc/yum.repos.d/puppetlabs-pc1.repo - yum -y install initscripts - yum clean all + - pip install jmespath volume: <%=ENV['ES_XPACK_LICENSE_FILE']%>:/tmp/license.json run_command: "/usr/sbin/init" privileged: true @@ -83,9 +87,6 @@ suites: - name: multi-5x run_list: attributes: - extra_vars: - es_plugins: - - plugin: ingest-geoip provisioner: playbook: test/integration/multi.yml idempotency_test: true diff --git a/tasks/elasticsearch-plugins.yml b/tasks/elasticsearch-plugins.yml index 5957783..8ec9e25 100644 --- a/tasks/elasticsearch-plugins.yml +++ b/tasks/elasticsearch-plugins.yml @@ -25,7 +25,7 @@ when: es_plugins_reinstall #if the plugins listed are different than those requested, we remove those installed but not listed in the config -- set_fact: plugins_to_remove="{{ installed_plugins.stdout_lines | difference(es_plugins | json_query('es_plugins[*].plugin')) | default([]) }}" +- set_fact: plugins_to_remove="{{ installed_plugins.stdout_lines | difference(es_plugins | json_query('[*].plugin')) | default([]) }}" when: not es_plugins_reinstall # This removes any currently installed plugins (to prevent errors when reinstalling) diff --git a/test/integration/multi.yml b/test/integration/multi.yml index 1d191f5..702b11f 100644 --- a/test/integration/multi.yml +++ b/test/integration/multi.yml @@ -7,6 +7,8 @@ es_templates: true es_heap_size: "1g" es_api_port: 9200 + es_plugins: + - plugin: ingest-geoip roles: - { role: elasticsearch, es_instance_name: "master", es_data_dirs: ["/opt/elasticsearch/master"], es_config: { discovery.zen.ping.unicast.hosts: "localhost:9300", http.port: 9200, transport.tcp.port: 9300, node.data: false, node.master: true, bootstrap.memory_lock: true } } @@ -17,6 +19,8 @@ es_templates: true es_heap_size: "1g" es_api_port: 9201 + es_plugins: + - plugin: ingest-geoip roles: - { role: elasticsearch, es_instance_name: "node1", es_data_dirs: "/opt/elasticsearch/data-1,/opt/elasticsearch/data-2", es_config: { discovery.zen.ping.unicast.hosts: "localhost:9300", http.port: 9201, transport.tcp.port: 9301, node.data: true, node.master: false } } #Plugins installed for this test are specified in .kitchen.yml under suite diff --git a/test/integration/standard.yml b/test/integration/standard.yml index dc05fac..7d8e6cc 100644 --- a/test/integration/standard.yml +++ b/test/integration/standard.yml @@ -6,5 +6,7 @@ vars: es_use_repository: "true" es_heap_size: "1g" + es_plugins: + - plugin: ingest-geoip #Do not add tests here. This test is run twice and confirms idempotency. \ No newline at end of file