base: Use with_dict for editing adduser.conf
authornicoo <nicoo@realraum.at>
Wed, 13 Jun 2018 22:29:10 +0000 (00:29 +0200)
committernicoo <nicoo@realraum.at>
Sun, 17 Jun 2018 10:05:34 +0000 (12:05 +0200)
ansible/roles/base/tasks/main.yml

index 92218ba..919b2aa 100644 (file)
     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 }}"