From e84f1428ed0bbaa57a4b86399c1086dca5a91ec4 Mon Sep 17 00:00:00 2001 From: bphinney Date: Fri, 29 Sep 2017 09:48:40 -0400 Subject: [PATCH 01/11] Added a default variable for java_version --- defaults/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/defaults/main.yml b/defaults/main.yml index 34f1417..4734bb2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -21,6 +21,7 @@ kafka_log_cleanup_interval_mins: 1 kafka_heap_opts: "-Xmx1G -Xms1G" kafka_tarball_location: /root kafka_tarball_name: "kafka_2.9.2-{{kafka_version}}.tgz" +java_version: "7" monasca_wait_for_period: 30 monasca_log_level: WARN zookeeper_connection_timeout_ms: 1000000 From 015635e751c2015fb85bffc190fbfd6080de30f5 Mon Sep 17 00:00:00 2001 From: bphinney Date: Fri, 29 Sep 2017 09:49:32 -0400 Subject: [PATCH 02/11] Use variable for java version --- tasks/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/install.yml b/tasks/install.yml index a26d148..ac38067 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,6 +1,6 @@ --- - name: Install OpenJDK - apt: name=openjdk-7-jre-headless state=present + apt: name=openjdk-{{java_version}}-jre-headless state=present - name: Fetch kafka binary package get_url: dest="{{ kafka_tarball_location }}/{{ kafka_tarball_name }}" url="{{apache_mirror}}/kafka/{{kafka_version}}/{{kafka_tarball_name}}" From 05210d84f635156ba660ef1d51fcccaa35d35068 Mon Sep 17 00:00:00 2001 From: bphinney Date: Fri, 29 Sep 2017 09:55:34 -0400 Subject: [PATCH 03/11] Allow java not be installed --- tasks/install.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/install.yml b/tasks/install.yml index ac38067..4d360a9 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,6 +1,7 @@ --- - name: Install OpenJDK apt: name=openjdk-{{java_version}}-jre-headless state=present + when: java_version != 'none' - name: Fetch kafka binary package get_url: dest="{{ kafka_tarball_location }}/{{ kafka_tarball_name }}" url="{{apache_mirror}}/kafka/{{kafka_version}}/{{kafka_tarball_name}}" From f66b21a3db86ec86c65a131725294fccef7930ee Mon Sep 17 00:00:00 2001 From: bphinney Date: Mon, 2 Oct 2017 09:50:47 -0400 Subject: [PATCH 04/11] Changing owner of expanded archive Changing the owner and group of the expanded archive file to the kafka user and kafka group. --- tasks/configure.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index 6ddd88f..b77c0e4 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -6,7 +6,7 @@ user: name={{kafka_user}} system=yes group={{kafka_group}} - name: Uncompress the kafka tar - unarchive: copy=no creates=/opt/kafka_2.9.2-{{kafka_version}} dest=/opt src="{{ kafka_tarball_location }}/{{ kafka_tarball_name }}" + unarchive: copy=no creates=/opt/kafka_2.9.2-{{kafka_version}} owner={{kafka_user}} group={{kafka_group}} dest=/opt src="{{ kafka_tarball_location }}/{{ kafka_tarball_name }}" - name: Link /opt/kafka to the right version file: path=/opt/kafka state=link src=/opt/kafka_2.9.2-{{kafka_version}} From 29a0560e07556634f5ffb63eea55cd7401a2b467 Mon Sep 17 00:00:00 2001 From: Bryan Phinney Date: Mon, 2 Oct 2017 12:39:33 -0400 Subject: [PATCH 05/11] Updated to allow for a branch --- defaults/main.yml | 1 + tasks/configure.yml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 4734bb2..9c6b8a7 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,6 +2,7 @@ apache_mirror: http://apache.mirrors.tds.net kafka_hosts: "{{ansible_fqdn}}:9092" kafka_version: 0.8.1.1 +kafka_branch: 2.9.2 run_mode: Deploy skip_install: False diff --git a/tasks/configure.yml b/tasks/configure.yml index b77c0e4..16815e6 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -6,13 +6,13 @@ user: name={{kafka_user}} system=yes group={{kafka_group}} - name: Uncompress the kafka tar - unarchive: copy=no creates=/opt/kafka_2.9.2-{{kafka_version}} owner={{kafka_user}} group={{kafka_group}} dest=/opt src="{{ kafka_tarball_location }}/{{ kafka_tarball_name }}" + unarchive: copy=no creates=/opt/kafka_{{kafka_branch}}-{{kafka_version}} owner={{kafka_user}} group={{kafka_group}} dest=/opt src="{{ kafka_tarball_location }}/{{ kafka_tarball_name }}" - name: Link /opt/kafka to the right version - file: path=/opt/kafka state=link src=/opt/kafka_2.9.2-{{kafka_version}} + file: path=/opt/kafka state=link src=/opt/kafka_{{kafka_branch}}-{{kafka_version}} - name: Overwrite the start script so the Java Opts can be changed if Kafka 0.8.1.1 - lineinfile: dest=/opt/kafka_2.9.2-{{kafka_version}}/bin/kafka-server-start.sh regexp="^export KAFKA_HEAP_OPTS=" line="export KAFKA_HEAP_OPTS=\"{{ kafka_heap_opts }}\"" + lineinfile: dest=/opt/kafka_{{kafka_branch}}-{{kafka_version}}/bin/kafka-server-start.sh regexp="^export KAFKA_HEAP_OPTS=" line="export KAFKA_HEAP_OPTS=\"{{ kafka_heap_opts }}\"" notify: - restart kafka when: kafka_version == "0.8.1.1" From aacb0e9e7916b905ec6e8a5b886bd5135d56a830 Mon Sep 17 00:00:00 2001 From: bphinney Date: Mon, 2 Oct 2017 14:26:02 -0400 Subject: [PATCH 06/11] Updated to use Kafka_branch in tarball --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 9c6b8a7..b97849e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -21,7 +21,7 @@ kafka_log_segment_bytes: "{{kafka_log_retention_bytes}}" kafka_log_cleanup_interval_mins: 1 kafka_heap_opts: "-Xmx1G -Xms1G" kafka_tarball_location: /root -kafka_tarball_name: "kafka_2.9.2-{{kafka_version}}.tgz" +kafka_tarball_name: "kafka_{{kafka_branch}}-{{kafka_version}}.tgz" java_version: "7" monasca_wait_for_period: 30 monasca_log_level: WARN From 71953e449eb1a05870628d99e4d22343d90289df Mon Sep 17 00:00:00 2001 From: bphinney Date: Fri, 13 Oct 2017 07:14:19 -0400 Subject: [PATCH 07/11] Update main.yml --- defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index b97849e..f768531 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,8 +1,8 @@ --- apache_mirror: http://apache.mirrors.tds.net kafka_hosts: "{{ansible_fqdn}}:9092" -kafka_version: 0.8.1.1 -kafka_branch: 2.9.2 +kafka_version: 0.10.2.0 +kafka_branch: 2.11 run_mode: Deploy skip_install: False From 45b4ef75fd2a4f0cb289be0c2e7e8c078f21337a Mon Sep 17 00:00:00 2001 From: bphinney Date: Wed, 18 Oct 2017 09:28:40 -0400 Subject: [PATCH 08/11] Update to remove java install for openjdk --- tasks/install.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/install.yml b/tasks/install.yml index 4d360a9..6ef7a6e 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,7 +1,7 @@ --- -- name: Install OpenJDK - apt: name=openjdk-{{java_version}}-jre-headless state=present - when: java_version != 'none' +#- name: Install OpenJDK +# apt: name=openjdk-{{java_version}}-jre-headless state=present +# when: java_version != 'none' - name: Fetch kafka binary package get_url: dest="{{ kafka_tarball_location }}/{{ kafka_tarball_name }}" url="{{apache_mirror}}/kafka/{{kafka_version}}/{{kafka_tarball_name}}" From 43706f84a8e11b5c188e7077f60dffced5f004a1 Mon Sep 17 00:00:00 2001 From: bphinney Date: Wed, 18 Oct 2017 18:17:39 -0400 Subject: [PATCH 09/11] Updated to add JMX PORT --- templates/kafka.service.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/kafka.service.j2 b/templates/kafka.service.j2 index 89f6117..24bdf01 100644 --- a/templates/kafka.service.j2 +++ b/templates/kafka.service.j2 @@ -8,7 +8,7 @@ User=kafka Group=kafka LimitNOFILE=32768 Restart=on-failure -Environment="KAFKA_HEAP_OPTS={{ kafka_heap_opts }}" +Environment="KAFKA_HEAP_OPTS={{ kafka_heap_opts }}" "JMX_PORT={{ jmx_port }}" ExecStart=/opt/kafka/bin/kafka-server-start.sh /etc/kafka/server.properties [Install] From 026c9a454e3cd55c7c6727aff93ed537687e3e64 Mon Sep 17 00:00:00 2001 From: bphinney Date: Wed, 18 Oct 2017 18:18:16 -0400 Subject: [PATCH 10/11] Added jmx_port variable --- defaults/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index f768531..7ae4c69 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -27,4 +27,6 @@ monasca_wait_for_period: 30 monasca_log_level: WARN zookeeper_connection_timeout_ms: 1000000 +jmx_port: 9999 + verify: True From d7bb0b88722b6004155dac3afdd400bd8b9900f0 Mon Sep 17 00:00:00 2001 From: Bryan Phinney Date: Tue, 21 Nov 2017 09:17:08 -0500 Subject: [PATCH 11/11] Updated to fix downloads --- defaults/main.yml | 2 ++ tasks/install.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 7ae4c69..902377f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,6 +3,7 @@ apache_mirror: http://apache.mirrors.tds.net kafka_hosts: "{{ansible_fqdn}}:9092" kafka_version: 0.10.2.0 kafka_branch: 2.11 +kafka_url: "https://nexus.ncrsmb.com/repository/momentum-infrastructure/kafka_{{kafka_branch}}/{{kafka_version}}/" run_mode: Deploy skip_install: False @@ -21,6 +22,7 @@ kafka_log_segment_bytes: "{{kafka_log_retention_bytes}}" kafka_log_cleanup_interval_mins: 1 kafka_heap_opts: "-Xmx1G -Xms1G" kafka_tarball_location: /root +kafka_staging_dir: ./tarballs kafka_tarball_name: "kafka_{{kafka_branch}}-{{kafka_version}}.tgz" java_version: "7" monasca_wait_for_period: 30 diff --git a/tasks/install.yml b/tasks/install.yml index 6ef7a6e..f37ca8f 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -4,4 +4,4 @@ # when: java_version != 'none' - name: Fetch kafka binary package - get_url: dest="{{ kafka_tarball_location }}/{{ kafka_tarball_name }}" url="{{apache_mirror}}/kafka/{{kafka_version}}/{{kafka_tarball_name}}" + get_url: dest="{{ kafka_staging_dir }}/{{ kafka_tarball_name }}" url="{{kafka_url}}/{{kafka_tarball_name}}"