diff --git a/states/vector/config.sls b/states/vector/config.sls index b46b7fe..f712d66 100644 --- a/states/vector/config.sls +++ b/states/vector/config.sls @@ -4,16 +4,16 @@ vector-default: file.managed: - name: /etc/default/vector - source: salt://vector/templates/vector.default.j2 - - user: vector - - group: vector + - user: {{ vector.user.name }} + - group: {{ vector.group.name }} - mode: 600 - template: jinja vector-config-dir: file.directory: - name: /etc/vector - - user: vector - - group: vector + - user: {{ vector.user.name }} + - group: {{ vector.group.name }} - mode: 700 - watch_in: - service: vector-service @@ -22,8 +22,8 @@ vector-config-file: file.managed: - name: /etc/vector/vector.yaml - source: salt://vector/templates/vector.yaml.j2 - - user: vector - - group: vector + - user: {{ vector.user.name }} + - group: {{ vector.group.name }} - mode: 600 - template: jinja - watch_in: diff --git a/states/vector/defaults.yaml b/states/vector/defaults.yaml index 9d2dde9..b290a44 100644 --- a/states/vector/defaults.yaml +++ b/states/vector/defaults.yaml @@ -8,8 +8,12 @@ vector: os: linux arch: amd64 variant: gnu - user: vector - group: vector + user: + name: vector + id: 905 + group: + name: vector + id: 905 config: api: enabled: true diff --git a/states/vector/install.sls b/states/vector/install.sls index ffa3576..ac4e0cf 100644 --- a/states/vector/install.sls +++ b/states/vector/install.sls @@ -1,5 +1,17 @@ --- {%- from "vector/map.jinja" import vector with context %} +vector-group: + group.present: + - name: {{ vector.group.name }} + - gid: {{ vector.group.id }} + +vector-user: + user.present: + - name: {{ vector.user.name }} + - uid: {{ vector.user.id }} + - gid: {{ vector.group.id }} + - shell: /bin/nologin + vector-archive-extract: archive.extracted: - name: {{ vector.release_dir }}/vector-{{ vector.version }}