From f9f2c374be4b8894fd6201a237287733c45fc2f2 Mon Sep 17 00:00:00 2001 From: NSSPKrishna Date: Thu, 26 Oct 2023 22:19:47 +0530 Subject: [PATCH] fix(cassandra): Pointing to the right inventory source --- .../infrastructure/ohi/cassandra/debian.yml | 2 +- .../newrelic/infrastructure/ohi/cassandra/rhel.yml | 2 +- test/definitions/ohi/linux/cassandra-debian.json | 2 +- .../install/debian/roles/configure/tasks/main.yml | 14 +++++++++----- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/recipes/newrelic/infrastructure/ohi/cassandra/debian.yml b/recipes/newrelic/infrastructure/ohi/cassandra/debian.yml index 8874d7db4..faf3747e8 100644 --- a/recipes/newrelic/infrastructure/ohi/cassandra/debian.yml +++ b/recipes/newrelic/infrastructure/ohi/cassandra/debian.yml @@ -121,7 +121,7 @@ install: HOSTNAME: {{.NR_CLI_DB_HOSTNAME}} CONFIG_PATH: /etc/cassandra/cassandra.yaml REMOTE_MONITORING: true - inventory_source: config/redis + inventory_source: config/cassandra interval: 60 EOT diff --git a/recipes/newrelic/infrastructure/ohi/cassandra/rhel.yml b/recipes/newrelic/infrastructure/ohi/cassandra/rhel.yml index d6735cd22..fe690c983 100644 --- a/recipes/newrelic/infrastructure/ohi/cassandra/rhel.yml +++ b/recipes/newrelic/infrastructure/ohi/cassandra/rhel.yml @@ -124,7 +124,7 @@ install: HOSTNAME: {{.NR_CLI_DB_HOSTNAME}} CONFIG_PATH: /etc/cassandra/cassandra.yaml REMOTE_MONITORING: true - inventory_source: config/redis + inventory_source: config/cassandra interval: 60 EOT diff --git a/test/definitions/ohi/linux/cassandra-debian.json b/test/definitions/ohi/linux/cassandra-debian.json index d25d92343..0a154c78b 100644 --- a/test/definitions/ohi/linux/cassandra-debian.json +++ b/test/definitions/ohi/linux/cassandra-debian.json @@ -42,4 +42,4 @@ } ] } -} \ No newline at end of file +} diff --git a/test/deploy/linux/cassandra/install/debian/roles/configure/tasks/main.yml b/test/deploy/linux/cassandra/install/debian/roles/configure/tasks/main.yml index 590e9799e..34d5d8df1 100644 --- a/test/deploy/linux/cassandra/install/debian/roles/configure/tasks/main.yml +++ b/test/deploy/linux/cassandra/install/debian/roles/configure/tasks/main.yml @@ -33,15 +33,19 @@ become: yes - name: install java - shell: sudo apt install adoptopenjdk-8-hotspot -y + shell: apt install adoptopenjdk-8-hotspot -y + become: yes + +- name: install curl + shell: apt install curl -y become: yes - name: add cassandra keys - shell: wget -q -O - https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add - + shell: curl https://downloads.apache.org/cassandra/KEYS | sudo apt-key add - become: yes - name: add cassandra repo - shell: sudo sh -c 'echo "deb https://www.apache.org/dist/cassandra/debian 311x main" > /etc/apt/sources.list.d/cassandra.list' + shell: sudo sh -c 'echo "deb https://debian.cassandra.apache.org 30x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list' become: yes - name: update packages @@ -61,7 +65,7 @@ become: yes - name: Ensure Cassandra is ready to accept query - shell: cqlsh localhost 9042 -ucassandra -pcassandra -e "SELECT dateof(now()) FROM system.local ;" + shell: cqlsh localhost 9042 -u cassandra -p cassandra -e "SELECT dateof(now()) FROM system.local ;" register: output retries: 20 delay: 15 @@ -72,7 +76,7 @@ when: output is failed - name: Create newrelic login - shell: cqlsh localhost 9042 -ucassandra -pcassandra -e "CREATE USER newrelic WITH PASSWORD 'Virtuoso4all!';" + shell: cqlsh localhost 9042 -u cassandra -p cassandra -e "CREATE USER newrelic WITH PASSWORD 'Virtuoso4all!';" become: yes when: create_newrelic_user|bool