From c3dd750fd271fa7d3a200dfd4ccd81147eeedb08 Mon Sep 17 00:00:00 2001 From: nicoo Date: Thu, 14 Jun 2018 00:29:10 +0200 Subject: [PATCH] base: Use with_dict for editing adduser.conf --- ansible/roles/base/tasks/main.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ansible/roles/base/tasks/main.yml b/ansible/roles/base/tasks/main.yml index 92218ba..919b2aa 100644 --- a/ansible/roles/base/tasks/main.yml +++ b/ansible/roles/base/tasks/main.yml @@ -139,10 +139,9 @@ shell: /bin/zsh - name: set default shell for adduser - with_items: - - regexp: "^DSHELL" - line: "DSHELL=/bin/zsh" + with_dict: + DSHELL: /bin/zsh lineinfile: dest: /etc/adduser.conf - regexp: "{{ item.regexp }}" - line: "{{ item.line }}" + regexp: "^#?{{ item.key }}=" + line: "{{ item.key }}={{ item.value }}" -- 1.7.10.4