Skip to content

Commit 93f39ed

Browse files
author
Cloud User
committed
[PLAT-17135] Pick correct thirdparty directory when installing clockbound service
Summary: The run template for clockbound had wrong location for thirdparty directory which fetches the clockbound tar zip. Fixed to usee the correct directory. Test Plan: Tested by deploying universe. Reviewers: anijhawan, nsingh, svarshney Reviewed By: nsingh, svarshney Differential Revision: https://phorge.dev.yugabyte.com/D42737
1 parent 15de767 commit 93f39ed

File tree

2 files changed

+17
-9
lines changed
  • managed/node-agent/resources/ynp/modules/provision

2 files changed

+17
-9
lines changed

managed/node-agent/resources/ynp/modules/provision/clockbound/templates/run.j2

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,20 @@ fi
5555
clockbound_gz="clockbound-linux-${arch}.tar.gz"
5656
echo "Using clockbound package ${clockbound_gz}"
5757

58+
if [[ -z "{{ package_path | default('') }}" ]]; then
59+
package_path="{{ ynp_dir }}/../../thirdparty"
60+
else
61+
package_path="{{ package_path }}"
62+
fi
63+
5864
local_path="/usr/local"
5965
local_bin_path="/usr/local/bin"
6066
clockbound_binary="clockbound"
6167
clockbound_check_binary="clockbound-check"
6268

6369
echo "Extracting clockbound and clockbound-check binary"
64-
tar -xvzf {{ package_path }}/"${clockbound_gz}" -C "${local_path}"
70+
echo "Untaring to ${package_path}/${clockbound_gz}"
71+
tar -xvzf "${package_path}/${clockbound_gz}" -C "${local_path}"
6572

6673
echo "Linking clockbound and clockbound-check to ${local_bin_path}"
6774
ln -sf "${local_path}/${clockbound_binary}" "${local_bin_path}/${clockbound_binary}"
@@ -76,7 +83,7 @@ else
7683
echo "chrony user neither chrony nor _chrony, exiting"
7784
exit 1
7885
fi
79-
echo "Making ${chrony_user} owner of ${local_bin_path}/${clockbound_binary}"
86+
echo "Making ${chrony_user} user owner of ${local_bin_path}/${clockbound_binary}"
8087
chown "${chrony_user}":"${chrony_user}" "${local_bin_path}/${clockbound_binary}"
8188

8289
# Add systemd unit file for clockbound

managed/node-agent/resources/ynp/modules/provision/node_exporter/templates/run.j2

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
thirdparty_dir="{{ ynp_dir }}/../../thirdparty"
2-
{% if cloud_type is defined and cloud_type != '' %}
3-
thirdparty_dir="{{ ynp_dir }}/../thirdparty"
4-
{% endif %}
1+
if [[ -z "{{ package_path | default('') }}" ]]; then
2+
package_path="{{ ynp_dir }}/../../thirdparty"
3+
else
4+
package_path="{{ package_path }}"
5+
fi
56

67
# Setup the directories & permissions for prometheus user
78
mkdir -p /opt/prometheus
@@ -26,10 +27,10 @@ else
2627
fi
2728

2829
# Copy the appropriate package if it exists
29-
if [ -f "$thirdparty_dir/$node_exporter_package" ]; then
30-
cp "$thirdparty_dir/$node_exporter_package" /opt/prometheus
30+
if [ -f "$package_path/$node_exporter_package" ]; then
31+
cp "$package_path/$node_exporter_package" /opt/prometheus
3132
else
32-
echo "Error: $node_exporter_package not found in $thirdparty_dir"
33+
echo "Error: $node_exporter_package not found in $package_path"
3334
exit 1
3435
fi
3536

0 commit comments

Comments
 (0)