diff --git a/victoriametrics/_setup.sls b/victoriametrics/_setup.sls index 5605aaaf..12d81554 100644 --- a/victoriametrics/_setup.sls +++ b/victoriametrics/_setup.sls @@ -78,7 +78,13 @@ {%- set vmargslist = [] %} {%- for k, v in vm_data.get("args", {}).items() %} - {%- do vmargslist.append("-" ~ k ~ "=" ~ v) %} + {%- if v is iterable and v is not string and v is not mapping %} + {%- for item in v %} + {%- do vmargslist.append("-" ~ k ~ "=" ~ item) %} + {%- endfor %} + {%- else %} + {%- do vmargslist.append("-" ~ k ~ "=" ~ v) %} + {%- endif %} {%- endfor %} {%- if kind != "vmalert" %} @@ -127,3 +133,4 @@ - file: {{ kind }}_{{ vm_name }}_systemd_unit - cmd: {{ kind }}_{{ vm_name }}_archive_extract {%- endif %} + diff --git a/victoriametrics/pillar.example b/victoriametrics/pillar.example index 34e9e257..ab2a0e27 100644 --- a/victoriametrics/pillar.example +++ b/victoriametrics/pillar.example @@ -80,6 +80,17 @@ vmagent: # https://docs.victoriametrics.com/vmagent/#features remoteWrite.basicAuth.username: user1 remoteWrite.basicAuth.password: password1 promscrape.config: /etc/victoriametrics/promscrape.yaml + # for multiple remoteWrite destinations use lists for args + # that need to be repeated with different values + remoteWrite.url: + - https://vm1.tsdb.example.com/api/v1/write + - https://vm2.tsdb.example.com/api/v1/write + remoteWrite.basicAuth.username: + - user1 + - user2 + remoteWrite.basicAuth.password: + - password1 + - password2 files: managed: promscrape: @@ -157,3 +168,4 @@ vmalert: makedirs: True +