Преглед изворни кода

Make possible to not deploy admins accounts

Emmanuel Bouthenot пре 10 година
родитељ
комит
623d123c52
2 измењених фајлова са 5 додато и 1 уклоњено
  1. 1 1
      roles/common/defaults/main.yml
  2. 4 0
      roles/common/tasks/base.yml

+ 1 - 1
roles/common/defaults/main.yml

@@ -4,7 +4,7 @@
 
 ansible_master: 'root@localhost'
 
-admins:
+admins: Null
 admins_emails:
   - 'root@localhost'
 

+ 4 - 0
roles/common/tasks/base.yml

@@ -92,11 +92,15 @@
 - name: Install unprivileged user
   user: name="{{item.user}}" comment="{{item.fullname}}" groups=adm,operator,sudo append=yes shell=/bin/zsh state=present
   with_items: admins
+  when: admins
 
 - name: Install SSH key for unprivileged user
   authorized_key: user="{{item.user}}" key="{{lookup('file', '../data/users/' + item.user + '/id_rsa.pub')}}" state=present
   with_items: admins
+  when: admins
 
 - name: Install SSH key for root
   authorized_key: user=root key="{{lookup('file', '../data/users/' + item.user + '/id_rsa.pub')}}" state=present
   with_items: admins
+  when: admins
+