From 151468703499711037995946bc489498c5b2f97f Mon Sep 17 00:00:00 2001 From: Dale McDiarmid Date: Mon, 4 Apr 2016 18:29:06 +0100 Subject: [PATCH 1/4] Cluster Name documentation was wrong - es_cluster_name is not supported. Use config map --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 98a24d0..fdafe1f 100644 --- a/README.md +++ b/README.md @@ -137,12 +137,11 @@ recommended in any multi node cluster configuration. ``` - hosts: master_nodes roles: - - { role: elasticsearch, es_instance_name: "node1", es_heap_size: "1g", es_config: { "discovery.zen.ping.multicast.enabled": false, discovery.zen.ping.unicast.hosts: "elastic02:9300", http.port: 9200, transport.tcp.port: 9300, node.data: false, node.master: true, bootstrap.mlockall: false, discovery.zen.ping.multicast.enabled: false } } + - { role: elasticsearch, es_instance_name: "node1", es_heap_size: "1g", es_config: {cluster.name: "test-cluster", "discovery.zen.ping.multicast.enabled": false, discovery.zen.ping.unicast.hosts: "elastic02:9300", http.port: 9200, transport.tcp.port: 9300, node.data: false, node.master: true, bootstrap.mlockall: false, discovery.zen.ping.multicast.enabled: false } } vars: es_scripts: false es_templates: false es_version_lock: false - es_cluster_name: test-cluster ansible_user: ansible es_plugins: - plugin: elasticsearch/license @@ -159,6 +158,7 @@ recommended in any multi node cluster configuration. node.data: true, node.master: false, bootstrap.mlockall: false, + cluster.name: "test-cluster", discovery.zen.ping.multicast.enabled: false } } - { role: elasticsearch, es_instance_name: "node2", @@ -170,13 +170,13 @@ recommended in any multi node cluster configuration. node.data: true, node.master: false, bootstrap.mlockall: false, + cluster.name: "test-cluster", discovery.zen.ping.multicast.enabled: false } } vars: es_scripts: false es_templates: false es_version_lock: false - es_cluster_name: test-cluster ansible_user: ansible es_plugins: - plugin: elasticsearch/license From 53f5d61fe536a595b3d98a8f579e77996d22d490 Mon Sep 17 00:00:00 2001 From: Dale McDiarmid Date: Fri, 15 Apr 2016 17:04:31 +0100 Subject: [PATCH 2/4] Gem lock + standard images --- .gitignore | 1 - .kitchen.yml | 6 +++--- Gemfile.lock | 42 ++++++++++++++++++++++++++++++++++++++++++ handlers/main.yml | 2 +- 4 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 Gemfile.lock diff --git a/.gitignore b/.gitignore index dca2467..7a4be3e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .kitchen/ -*.lock *.pyc .vendor .bundle diff --git a/.kitchen.yml b/.kitchen.yml index 0728b01..f0d6ad1 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -15,7 +15,7 @@ provisioner: platforms: - name: ubuntu-14.04 driver_config: - image: dliappis/ubuntuhetzner:14.04 + image: dliappis/ubuntu:14.04 privileged: true provision_command: - apt-get update && apt-get install -y software-properties-common && add-apt-repository -y ppa:ansible/ansible @@ -45,7 +45,7 @@ platforms: run_command: "/sbin/init" - name: centos-6 driver_config: - image: dliappis/centoshetzner:6 + image: dliappis/centos:6 privileged: true provision_command: - yum remove -y ansible @@ -54,7 +54,7 @@ platforms: use_sudo: false - name: centos-7 driver_config: - image: dliappis/centoshetzner:7 + image: dliappis/centos:7 provision_command: - yum remove -y ansible - yum -y install gmp-devel python-devel python-pip diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..8c827c2 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,42 @@ +GEM + remote: https://rubygems.org/ + specs: + faraday (0.9.2) + multipart-post (>= 1.2, < 3) + highline (1.7.8) + kitchen-ansible (0.40.1) + librarian-ansible + test-kitchen (~> 1.4) + kitchen-docker (2.1.0) + test-kitchen (>= 1.0.0) + librarian (0.1.2) + highline + thor (~> 0.15) + librarian-ansible (3.0.0) + faraday + librarian (~> 0.1.0) + mixlib-shellout (2.2.6) + multipart-post (2.0.0) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (2.9.4) + safe_yaml (1.0.4) + test-kitchen (1.4.2) + mixlib-shellout (>= 1.2, < 3.0) + net-scp (~> 1.1) + net-ssh (~> 2.7, < 2.10) + safe_yaml (~> 1.0) + thor (~> 0.18) + thor (0.19.1) + +PLATFORMS + ruby + +DEPENDENCIES + kitchen-ansible (= 0.40.1) + kitchen-docker (= 2.1.0) + net-ssh (~> 2.0) + test-kitchen (= 1.4.2) + +BUNDLED WITH + 1.11.2 diff --git a/handlers/main.yml b/handlers/main.yml index 8c6431e..2432ffe 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,4 +1,4 @@ - name: restart elasticsearch service: name={{instance_init_script | basename}} state=restarted enabled=yes - when: es_restart_on_change and es_start_service and (not elasticsearch_started.changed or (plugin_installed is defined and plugin_installed.changed) or elasticsearch_install.changed) + when: es_restart_on_change and es_start_service and not elasticsearch_started.changed and ((plugin_installed is defined and plugin_installed.changed) or elasticsearch_install.changed) From b246a63979d9f887ce67722de45b484bd07a55ea Mon Sep 17 00:00:00 2001 From: Dale McDiarmid Date: Fri, 15 Apr 2016 17:10:00 +0100 Subject: [PATCH 3/4] No need to install ansible as provided by images --- .kitchen.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index f0d6ad1..c5d3279 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -48,18 +48,11 @@ platforms: image: dliappis/centos:6 privileged: true provision_command: - - yum remove -y ansible - - yum -y install gmp-devel python-devel python-pip - - pip install ansible use_sudo: false - name: centos-7 driver_config: image: dliappis/centos:7 provision_command: - - yum remove -y ansible - - yum -y install gmp-devel python-devel python-pip - - yum -y groupinstall "Development Tools" - - pip install ansible - 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 From 50155e79cbd3e75e28ba906191caee5b0fac1cfd Mon Sep 17 00:00:00 2001 From: Dale McDiarmid Date: Fri, 15 Apr 2016 23:17:10 +0100 Subject: [PATCH 4/4] Optimised testing images --- .kitchen.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index c5d3279..a02d9be 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -15,7 +15,7 @@ provisioner: platforms: - name: ubuntu-14.04 driver_config: - image: dliappis/ubuntu:14.04 + image: dliappis/ubuntu-devopsci:14.04 privileged: true provision_command: - apt-get update && apt-get install -y software-properties-common && add-apt-repository -y ppa:ansible/ansible @@ -23,7 +23,7 @@ platforms: use_sudo: false - name: debian-7 driver_config: - image: debian:7 + image: dliappis/debian-devopsci:7 privileged: true provision_command: - apt-get update && apt-get -y install python python-dev python-pip build-essential libyaml-dev python-yaml @@ -32,7 +32,7 @@ platforms: use_sudo: false - name: debian-8 driver_config: - image: debian:8 + image: dliappis/debian-devopsci:8 privileged: true provision_command: - apt-get update && apt-get -y install python python-dev python-pip build-essential libyaml-dev python-yaml curl wget @@ -45,13 +45,13 @@ platforms: run_command: "/sbin/init" - name: centos-6 driver_config: - image: dliappis/centos:6 + image: dliappis/centos-devopsci:6 privileged: true provision_command: use_sudo: false - name: centos-7 driver_config: - image: dliappis/centos:7 + image: dliappis/centos-devopsci:7 provision_command: - sed -ri 's/^#?PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config - sed -ri 's/^#?PasswordAuthentication .*/PasswordAuthentication yes/' /etc/ssh/sshd_config