From 623301c0f0bb55401340f87e55c5917f1b7669d5 Mon Sep 17 00:00:00 2001 From: Eric Mittelhammer Date: Wed, 30 Jun 2021 20:50:48 +0000 Subject: [PATCH 1/2] - ignore build folder within applications - fix typo in project name --- applications/.gitignore | 3 ++- terraform/playground/variables.tf | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/applications/.gitignore b/applications/.gitignore index 29e319b..4d98746 100644 --- a/applications/.gitignore +++ b/applications/.gitignore @@ -1,3 +1,4 @@ docker-compose.override.yml .gradle -.idea \ No newline at end of file +.idea +build/ \ No newline at end of file diff --git a/terraform/playground/variables.tf b/terraform/playground/variables.tf index a95952d..50df5d5 100644 --- a/terraform/playground/variables.tf +++ b/terraform/playground/variables.tf @@ -13,7 +13,7 @@ variable "new_relic_license_key" { variable "project_name" { type = string - default = "newrelic-kakfa-playground" + default = "newrelic-kafka-playground" } variable "vpc_id" { From 130695a1415342819a54b84fa1e34715988403a2 Mon Sep 17 00:00:00 2001 From: Eric Mittelhammer Date: Thu, 1 Jul 2021 20:32:31 +0000 Subject: [PATCH 2/2] use latest kafka and nr java agent. also dynamically fetch preferred apache download mirror --- .../roles/kafka-distribution/defaults/main.yml | 3 +-- .../roles/kafka-distribution/tasks/main.yml | 16 +++++++++++++++- .../roles/kafka-distribution/vars/main.yml | 4 ++-- applications/consumer/build.gradle | 2 +- applications/producer/build.gradle | 2 +- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ansible-playbooks/roles/kafka-distribution/defaults/main.yml b/ansible-playbooks/roles/kafka-distribution/defaults/main.yml index 21c169a..9bd7ca8 100644 --- a/ansible-playbooks/roles/kafka-distribution/defaults/main.yml +++ b/ansible-playbooks/roles/kafka-distribution/defaults/main.yml @@ -1,6 +1,5 @@ --- kafka_user: kafka -kafka_version: 2.6.0 +kafka_version: 2.8.0 kafka_scala_version: 2.13 -kafka_download_mirror_prefix: "http://mirror.cc.columbia.edu/pub/software/apache/kafka" kafka_install_dir: /opt diff --git a/ansible-playbooks/roles/kafka-distribution/tasks/main.yml b/ansible-playbooks/roles/kafka-distribution/tasks/main.yml index b0a5afd..2f8f790 100644 --- a/ansible-playbooks/roles/kafka-distribution/tasks/main.yml +++ b/ansible-playbooks/roles/kafka-distribution/tasks/main.yml @@ -5,12 +5,26 @@ name: "{{ kafka_user }}" comment: Created by ansible +- name: Get Apache mirrors + uri: + url: "{{ apache_closer_url }}" + method: "GET" + register: apache_mirrors + +- name: Set Download URL + set_fact: + download_url: "{{ apache_mirrors.json.preferred }}{{ apache_mirrors.json.path_info }}" + +- name: Print Download URL + debug: + var: download_url + - name: Download Kafka Distribution become: yes become_user: "{{ kafka_user }}" get_url: dest: "/home/{{ kafka_user }}/{{ kafka_download_filename }}" - url: "{{ kafka_download_url }}" + url: "{{ download_url }}" - name: Uncompress the kafka tar become: yes diff --git a/ansible-playbooks/roles/kafka-distribution/vars/main.yml b/ansible-playbooks/roles/kafka-distribution/vars/main.yml index f778ffa..4091a6e 100644 --- a/ansible-playbooks/roles/kafka-distribution/vars/main.yml +++ b/ansible-playbooks/roles/kafka-distribution/vars/main.yml @@ -1,4 +1,4 @@ +apache_closer_url: "https://www.apache.org/dyn/closer.cgi?path=/kafka/{{ kafka_version }}/kafka_{{ kafka_scala_version }}-{{ kafka_version }}.tgz&as_json=1" kafka_download_filename: "kafka_{{ kafka_scala_version }}-{{ kafka_version }}.tgz" -kafka_download_url: "{{ kafka_download_mirror_prefix }}/{{ kafka_version }}/{{ kafka_download_filename }}" -kafka_versioned_home_dir: "{{ kafka_install_dir }}/{{ kafka_download_filename | regex_replace('(kafka_[\\d\\.]+-[\\d\\.]+).tgz$', '\\1')}}" +kafka_versioned_home_dir: "{{ kafka_install_dir }}/kafka_{{ kafka_scala_version }}-{{ kafka_version }}" kafka_home_dir: "{{ kafka_install_dir }}/kafka" \ No newline at end of file diff --git a/applications/consumer/build.gradle b/applications/consumer/build.gradle index 2860e23..8037688 100644 --- a/applications/consumer/build.gradle +++ b/applications/consumer/build.gradle @@ -6,7 +6,7 @@ repositories { jcenter() } -def newrelicVersion = "6.1.0" +def newrelicVersion = "7.0.1" configurations { newrelicAgent diff --git a/applications/producer/build.gradle b/applications/producer/build.gradle index 51e291d..9497091 100644 --- a/applications/producer/build.gradle +++ b/applications/producer/build.gradle @@ -6,7 +6,7 @@ repositories { jcenter() } -def newrelicVersion = "6.1.0" +def newrelicVersion = "7.0.1" configurations { newrelicAgent