Przeglądaj źródła

fix(mail): main_virtual_xx variables usage

mail_virtual_xx list were not use correctly in tasks.

We got error 'unicode object' has no attribute 'name' because:
with_items:
 - "{{ mail_virtual_xx }}
is understood has a list of strings containing information extracted from {{ mail_virtual_xx }} variable

 Now we use:
   with_items: virtual_domain_xx}}"
Bertrand Cachet 11 lat temu
rodzic
commit
812dea232f

+ 2
- 4
roles/mailserver/tasks/dovecot.yml Wyświetl plik

@@ -16,13 +16,11 @@
16 16
 
17 17
 - name: Ensure mail domain directories are in place
18 18
   file: state=directory path=/decrypted/{{ item.name }} owner=vmail group=dovecot mode=770
19
-  with_items:
20
-    - "{{ mail_virtual_domains }}"
19
+  with_items: mail_virtual_domains
21 20
 
22 21
 - name: Ensure mail directories are in place
23 22
   file: state=directory path=/decrypted/{{ item.name }}/{{ item.primary_user }} owner=vmail group=dovecot
24
-  with_items:
25
-    - "{{ mail_virtual_domains }}"
23
+  with_items: mail_virtual_domains
26 24
 
27 25
 - name: Copy dovecot.conf into place
28 26
   copy: src=etc_dovecot_dovecot.conf dest=/etc/dovecot/dovecot.conf

+ 1
- 2
roles/mailserver/tasks/dspam.yml Wyświetl plik

@@ -31,6 +31,5 @@
31 31
 
32 32
 - name: Put sieve rules into each primary user directory
33 33
   copy: src=dot_dovecot.sieve dest=/decrypted/{{ item.name }}/{{ item.primary_user }}/.dovecot.sieve owner=vmail group=dovecot
34
-  with_items:
35
-    - "{{ mail_virtual_domains }}"
34
+  with_items: mail_virtual_domains
36 35
   notify: restart dovecot

+ 2
- 4
roles/mailserver/tasks/opendkim.yml Wyświetl plik

@@ -12,13 +12,11 @@
12 12
 
13 13
 - name: Create OpenDKIM key directories
14 14
   file: state=directory path=/etc/opendkim/keys/{{ item.name }} group=opendkim owner=opendkim
15
-  with_items:
16
-    - "{{ mail_virtual_domains }}"
15
+  with_items: mail_virtual_domains
17 16
 
18 17
 - name: Generate OpenDKIM keys
19 18
   command: opendkim-genkey -r -d {{ item.name }} -D /etc/opendkim/keys/{{ item.name }}/ creates=/etc/opendkim/keys/{{ item.name }}/default.private
20
-  with_items:
21
-    - "{{ mail_virtual_domains }}"
19
+  with_items: mail_virtual_domains
22 20
 
23 21
 - name: Put opendkim.conf into place
24 22
   copy: src=etc_opendkim.conf dest=/etc/opendkim.conf owner=opendkim group=opendkim

Ładowanie…
Anuluj
Zapisz