Преглед на файлове

Improved idempotency and removed ip detection for checkrbl

Luke Cyca преди 11 години
родител
ревизия
7043143f90

+ 1
- 0
roles/common/tasks/encfs.yml Целия файл

@@ -18,6 +18,7 @@
18 18
 - name: Check for existing encfs
19 19
   shell: ls /encrypted/*
20 20
   ignore_errors: True
21
+  changed_when: False  # never report as "changed"
21 22
   register: encfs_check
22 23
 
23 24
 # If it is empty, we need to create the encfs

+ 6
- 1
roles/mailserver/handlers/main.yml Целия файл

@@ -8,4 +8,9 @@
8 8
   service: name=opendkim state=restarted
9 9
 
10 10
 - name: restart solr
11
-  service: name=tomcat6 state=restarted
11
+  service: name=tomcat6 state=restarted
12
+
13
+- name: import mysql postfix
14
+  mysql_db: name={{ mail_mysql_database }} state=import target=/etc/postfix/import.sql
15
+  notify: restart postfix
16
+

+ 1
- 5
roles/mailserver/tasks/checkrbl.yml Целия файл

@@ -1,9 +1,5 @@
1
-- name: What is our IP address?
2
-  command: dig ${mail_server_hostname} +short
3
-  register: dig_command
4
-
5 1
 - name: Download check-rbl
6 2
   get_url: url=https://raw.github.com/lukecyca/check-rbl/f6b222b0ca/check-rbl.pl dest=/opt/check-rbl.pl
7 3
 
8 4
 - name: Install nightly check-rbl cronjob
9
-  cron: name="check-rbl" hour="2" minute="0" job="perl /opt/check-rbl.pl -i ${dig_command.stdout}"
5
+  cron: name="check-rbl" hour="2" minute="0" job="perl /opt/check-rbl.pl -i ${server_ip_address}"

+ 5
- 7
roles/mailserver/tasks/postfix.yml Целия файл

@@ -11,19 +11,17 @@
11 11
 
12 12
 - name: Create database user for mail server
13 13
   mysql_user: user={{ mail_mysql_username }} password={{ mail_mysql_password }} state=present priv="mailserver.*:ALL"
14
+  notify: import mysql postfix
14 15
 
15 16
 - name: Create database for mail server
16 17
   mysql_db: name={{ mail_mysql_database }} state=present
18
+  notify: import mysql postfix
17 19
 
18
-- name: copy over mailserver sql
20
+- name: Copy import.sql
19 21
   template: src=mailserver.sql.j2 dest=/etc/postfix/import.sql owner=root group=root mode=0600
20
-  tags: import_mysql_postfix
22
+  notify: import mysql postfix
21 23
 
22
-- name: import mysql postfix
23
-  mysql_db: name={{ mail_mysql_database }} state=import target=/etc/postfix/import.sql
24
-  tags: import_mysql_postfix
25
-
26
-- name: Copy Postfix config files into place
24
+- name: Copy main.cf
27 25
   template: src=etc_postfix_main.cf.j2 dest=/etc/postfix/main.cf owner=root group=root
28 26
   notify: restart postfix
29 27
 

+ 1
- 3
roles/mailserver/templates/etc_opendkim_TrustedHosts.j2 Целия файл

@@ -1,7 +1,5 @@
1 1
 127.0.0.1
2
-# TODO add your server's IP and DNS hosts, ex:
3
-# ns1.linode.com
4
-# 198.58.112.239 
2
+{{ server_ip_address }}
5 3
 {% for domain in mail_virtual_domains %}
6 4
 {{ domain.name }}
7 5
 {% endfor %}

Loading…
Отказ
Запис