Skip to content

Commit

Permalink
chore: use new names for telegraf config files
Browse files Browse the repository at this point in the history
This also re-enables the automatic start for Telegraf.
  • Loading branch information
jacderida authored and RolandSherwin committed Dec 6, 2024
1 parent abc4d2d commit d79af7a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 33 deletions.
12 changes: 3 additions & 9 deletions resources/ansible/nodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 15 additions & 15 deletions resources/ansible/roles/telegraf-configuration/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion resources/ansible/roles/uploader-metrics/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions resources/ansible/roles/uploader-metrics/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 2 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down

0 comments on commit d79af7a

Please sign in to comment.