Skip to content

Commit

Permalink
Merge pull request VictoriaMetrics#59 from DisasteR/update-role-vmagent
Browse files Browse the repository at this point in the history
handle vmagent tmpDataPath
  • Loading branch information
zekker6 authored Mar 29, 2024
2 parents 31f482d + 5f546bb commit a85989a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion roles/vmagent/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ vmagent_version: "v1.99.0"
vmagent_repo_url: "https://github.com/VictoriaMetrics/VictoriaMetrics"
vmagent_platform: "{% if vmagent_version.replace('v', '') is version('1.79.0', '>=') %}-linux{% endif %}"
vmagent_download_url: "{{ vmagent_repo_url }}/releases/download/{{ vmagent_version }}/vmutils{{ vmagent_platform }}-{{ go_arch }}-{{ vmagent_version }}.tar.gz"

vmagent_system_user: "vic_vm_agent"
vmagent_system_group: "{{ vmagent_system_user }}"

vmagent_config_dir: "/opt/vic-vmagent"
vmagent_sd_config_dir: "{{ vmagent_config_dir }}/file_sd_configs"
vmagent_tmp_data_path: "/tmp/vmagent"

vmagent_remote_write_host: "http://localhost:8428"
vmagent_service_args:
"remoteWrite.url": "{{ vmagent_remote_write_host }}/api/v1/write"
# "remoteWrite.url":
# - "{{ vmagent_remote_write_host_0 }}/api/v1/write"
# - "{{ vmagent_remote_write_host_1 }}/api/v1/write"
"promscrape.config": "{{ vmagent_config_dir }}/config.yml"
"remoteWrite.tmpDataPath": /tmp/vmagent
"remoteWrite.tmpDataPath": "{{ vmagent_tmp_data_path }}"
"remoteWrite.streamAggr.config": "{{ vmagent_config_dir }}/aggregation.yml"

vmagent_scrape_config:
Expand Down
9 changes: 8 additions & 1 deletion roles/vmagent/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
when:
- config_template is changed


- name: Prepare configuration dir
ansible.builtin.file:
state: directory
Expand Down Expand Up @@ -79,3 +78,11 @@
owner: "{{ vmagent_system_user }}"
group: "{{ vmagent_system_group }}"
notify: Restart VMagent service

- name: Prepare tmp data dir
ansible.builtin.file:
state: directory
path: "{{ vmagent_tmp_data_path }}"
mode: 0751
owner: "{{ vmagent_system_user }}"
group: "{{ vmagent_system_group }}"

0 comments on commit a85989a

Please sign in to comment.