From d79af7ae77c1deee13cda2432b699fa658d96c65 Mon Sep 17 00:00:00 2001 From: Chris O'Neil Date: Thu, 5 Dec 2024 17:44:21 +0000 Subject: [PATCH] chore: use new names for telegraf config files This also re-enables the automatic start for Telegraf. --- resources/ansible/nodes.yml | 12 ++------ .../telegraf-configuration/tasks/main.yml | 30 +++++++++---------- .../roles/uploader-metrics/defaults/main.yml | 2 +- .../roles/uploader-metrics/tasks/main.yml | 6 ++-- src/lib.rs | 7 ++--- 5 files changed, 24 insertions(+), 33 deletions(-) diff --git a/resources/ansible/nodes.yml b/resources/ansible/nodes.yml index 028c5ad0..ee4a7a5b 100644 --- a/resources/ansible/nodes.yml +++ b/resources/ansible/nodes.yml @@ -39,15 +39,9 @@ name: systemd-journald state: restarted enabled: yes - # - name: restart telegraf - # become: True - # ansible.builtin.systemd: - # name: telegraf - # state: restarted - # enabled: yes - - name: stop telegraf + - name: restart telegraf become: True ansible.builtin.systemd: name: telegraf - state: stopped - enabled: no + state: restarted + enabled: yes diff --git a/resources/ansible/roles/telegraf-configuration/tasks/main.yml b/resources/ansible/roles/telegraf-configuration/tasks/main.yml index 5b7ecc85..225a9fc4 100644 --- a/resources/ansible/roles/telegraf-configuration/tasks/main.yml +++ b/resources/ansible/roles/telegraf-configuration/tasks/main.yml @@ -41,12 +41,12 @@ lineinfile: path: /etc/sudoers state: present - line: "_telegraf ALL=NOPASSWD: /usr/local/bin/safenode-manager" + line: "_telegraf ALL=NOPASSWD: /usr/local/bin/antctl" validate: "visudo -cf %s" - name: copy telegraf environment file copy: - src: "{{ network_dashboard_repo_path }}/telegraf/EnvironmentFile/safenodes/telegraf" + src: "{{ network_dashboard_repo_path }}/telegraf/EnvironmentFile/antnodes/telegraf" dest: /etc/default/telegraf remote_src: yes @@ -78,14 +78,14 @@ - name: copy telegraf config file copy: - src: "{{ network_dashboard_repo_path }}/telegraf/ConfigurationFile/safenodes/telegraf.conf" + src: "{{ network_dashboard_repo_path }}/telegraf/ConfigurationFile/antnodes/telegraf.conf" dest: /etc/telegraf/telegraf.conf remote_src: yes - name: copy telegraf multi node config file copy: - src: "{{ network_dashboard_repo_path }}/telegraf/ConfigurationFile/safenodes/telegraf_safe_multi_node.conf" - dest: /etc/telegraf/telegraf.d/telegraf_safe_multi_node.conf + src: "{{ network_dashboard_repo_path }}/telegraf/ConfigurationFile/antnodes/telegraf_ant_multi_node.conf" + dest: /etc/telegraf/telegraf.d/telegraf_ant_multi_node.conf remote_src: yes - name: create directory for telegraf configurationfile @@ -95,8 +95,8 @@ - name: copy telegraf elasticsearch config file from network dashboard repo copy: - src: "{{ network_dashboard_repo_path }}/telegraf/ConfigurationFile/safenodes/telegraf_safe_multi_node_elasticsearch.conf" - dest: /etc/telegraf-elasticsearch/telegraf_safe_multi_node_elasticsearch.conf + src: "{{ network_dashboard_repo_path }}/telegraf/ConfigurationFile/antnodes/telegraf_ant_multi_node_elasticsearch.conf" + dest: /etc/telegraf-elasticsearch/telegraf_ant_multi_node_elasticsearch.conf remote_src: yes - name: copy telegraf elasticsearch system service file from network dashboard repo @@ -109,12 +109,12 @@ become: True command: systemctl daemon-reload -# - name: reload the configuration files for systemctl daemon -# become: True -# command: systemctl start telegraf-elasticsearch.service +- name: reload the configuration files for systemctl daemon + become: True + command: systemctl start telegraf-elasticsearch.service -# - name: start telegraf service -# systemd: -# name: telegraf -# enabled: yes -# state: started +- name: start telegraf service + systemd: + name: telegraf + enabled: yes + state: started diff --git a/resources/ansible/roles/uploader-metrics/defaults/main.yml b/resources/ansible/roles/uploader-metrics/defaults/main.yml index 50a41fe8..22f5aa8d 100644 --- a/resources/ansible/roles/uploader-metrics/defaults/main.yml +++ b/resources/ansible/roles/uploader-metrics/defaults/main.yml @@ -1,5 +1,5 @@ --- -network_dashboard_branch: main +network_dashboard_branch: rc-2024.12.1 network_dashboard_github_url: git@github.com:maidsafe/network-dashboard.git network_dashboard_repo_path: /root/network-dashboard network_dashboard_sk_path: /root/.ssh/network-dashboard diff --git a/resources/ansible/roles/uploader-metrics/tasks/main.yml b/resources/ansible/roles/uploader-metrics/tasks/main.yml index 02f8c5aa..d9c2cfff 100644 --- a/resources/ansible/roles/uploader-metrics/tasks/main.yml +++ b/resources/ansible/roles/uploader-metrics/tasks/main.yml @@ -77,14 +77,14 @@ - name: copy telegraf uploader config file copy: - src: "{{ network_dashboard_repo_path }}/telegraf/ConfigurationFile/uploaders/telegraf_safe_uploader_node.conf" - dest: /etc/telegraf/telegraf.d/telegraf_safe_uploader_node.conf + src: "{{ network_dashboard_repo_path }}/telegraf/ConfigurationFile/uploaders/telegraf_ant_uploader_node.conf" + dest: /etc/telegraf/telegraf.d/telegraf_ant_uploader_node.conf remote_src: yes - name: add telegraf user to sudoers for safe command lineinfile: path: /etc/sudoers - line: '_telegraf ALL=(ALL) NOPASSWD: /usr/local/bin/safe' + line: '_telegraf ALL=(ALL) NOPASSWD: /usr/local/bin/ant' validate: '/usr/sbin/visudo -cf %s' state: present diff --git a/src/lib.rs b/src/lib.rs index 59786732..fdd036a4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1394,16 +1394,13 @@ pub async fn notify_slack(inventory: DeploymentInventory) -> Result<()> { } => { message.push_str("*Version Details*\n"); message.push_str(&format!( - "safe version: {}\n", + "ant version: {}\n", safe_version .as_ref() .map_or("None".to_string(), |v| v.to_string()) )); message.push_str(&format!("safenode version: {}\n", safenode_version)); - message.push_str(&format!( - "safenode-manager version: {}\n", - safenode_manager_version - )); + message.push_str(&format!("antctl version: {}\n", safenode_manager_version)); } }