From 0e65cc345b316412fad4ce9966f99d86c9fa829c Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Sun, 18 Jul 2021 14:40:17 +0100 Subject: [PATCH] feat(config/users): add support for `debian-11` [skip ci] Avoid this failure when installing the package: ``` Setting up prometheus (2.24.1+ds-1+b5) ... adduser: The user `prometheus' already exists, but is not a system user. Exiting. dpkg: error processing package prometheus (--configure): installed prometheus package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: prometheus ``` --- prometheus/config/users.sls | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prometheus/config/users.sls b/prometheus/config/users.sls index 5a61317..14be2ba 100644 --- a/prometheus/config/users.sls +++ b/prometheus/config/users.sls @@ -21,6 +21,9 @@ prometheus-config-users-install-{{ name }}-user-present: - shell: /bin/false {%- if grains.kernel|lower == 'linux' %} - createhome: false + {%- if grains.get('osfinger', '') in ['Debian-11'] %} + - system: true + {%- endif %} {%- elif grains.os_family == 'MacOS' %} - unless: /usr/bin/dscl . list /Users | grep {{ name }} >/dev/null 2>&1 {%- endif %}