Selaa lähdekoodia

Install postgresql 9.4, 9.3 or 9.1 if available

(on Debian Jessie, Ubuntu Trusty or older distributions such as
Debian Wheezy and Ubuntu Precise).
Sven Neuhaus 10 vuotta sitten
vanhempi
commit
c898aa98d6
2 muutettua tiedostoa jossa 21 lisäystä ja 24 poistoa
  1. 9
    9
      roles/mailserver/tasks/dovecot.yml
  2. 12
    15
      roles/mailserver/tasks/postfix.yml

+ 9
- 9
roles/mailserver/tasks/dovecot.yml Näytä tiedosto

@@ -24,18 +24,18 @@
24 24
     - dovecot-pop3d
25 25
   when: ansible_distribution_release != 'wheezy'
26 26
 
27
-- name: Install Dovecot Postgres dependency for distributions other than Ubuntu Trusty
28
-  apt: pkg={{ item }} state=installed
29
-  with_items:
30
-    - postgresql-9.1
31
-  when: ansible_distribution_release != 'trusty'
27
+- name: Install Postgres 9.1 for Dovecot on older distributions
28
+  apt: pkg=postgresql-9.1 state=present
29
+  when: ansible_distribution_release != 'trusty' and ansible_distribution_release != 'jessie'
32 30
 
33
-- name: Install Dovecot Postgres dependency for Ubuntu trusty
34
-  apt: pkg={{ item }} state=installed
35
-  with_items:
36
-    - postgresql-9.3
31
+- name: Install Postgres 9.3 for Dovecot on Ubuntu Trusty
32
+  apt: pkg=postgresql-9.3 state=present
37 33
   when: ansible_distribution_release == 'trusty'
38 34
 
35
+- name: Install Postgres 9.4 for Dovecot on Debian Jessie
36
+  apt: pkg=postgresql-9.4 state=present
37
+  when: ansible_distribution_release == 'jessie'
38
+
39 39
 - name: Create vmail group
40 40
   group: name=vmail state=present gid=5000
41 41
 

+ 12
- 15
roles/mailserver/tasks/postfix.yml Näytä tiedosto

@@ -1,28 +1,25 @@
1
-- name: Install Postfix 9.1 and related packages for distributions other than Ubuntu Trusty
2
-  apt: pkg={{ item }} state=installed
3
-  with_items:
4
-    - libsasl2-modules
5
-    - postfix
6
-    - postfix-pcre
7
-    - postfix-pgsql
8
-    - postgresql-9.1
9
-    - postgrey
10
-    - python-psycopg2
11
-    - sasl2-bin
12
-  when: ansible_distribution_release != 'trusty'
1
+- name: Install Postgres 9.1 on older distributions
2
+  apt: pkg=postgresql-9.1 state=present
3
+  when: ansible_distribution_release != 'trusty' and ansible_distribution_release != 'jessie'
4
+
5
+- name: Install Postgres 9.3 on Ubuntu Trusty
6
+  apt: pkg=postgresql-9.3 state=present
7
+  when: ansible_distribution_release == 'trusty'
8
+
9
+- name: Install Postgres 9.4 on Debian Jessie
10
+  apt: pkg=postgresql-9.4 state=present
11
+  when: ansible_distribution_release == 'jessie'
13 12
 
14
-- name: Install Postfix 9.3 and related packages for Ubuntu Trusty
13
+- name: Install Postfix and related packages
15 14
   apt: pkg={{ item }} state=installed
16 15
   with_items:
17 16
     - libsasl2-modules
18 17
     - postfix
19 18
     - postfix-pcre
20 19
     - postfix-pgsql
21
-    - postgresql-9.3
22 20
     - postgrey
23 21
     - python-psycopg2
24 22
     - sasl2-bin
25
-  when: ansible_distribution_release == 'trusty'
26 23
 
27 24
 - name: Set postgres password
28 25
   command: sudo -u {{ db_admin_username }} psql -d {{ db_admin_username }} -c "ALTER USER postgres with  password '{{ db_admin_password }}';"

Loading…
Peruuta
Tallenna