Thomas Buck 3 лет назад
Родитель
Сommit
36571bace7
2 измененных файлов: 25 добавлений и 0 удалений
  1. 13
    0
      roles/common/tasks/postgres.yml
  2. 12
    0
      roles/common/tasks/security.yml

+ 13
- 0
roles/common/tasks/postgres.yml Просмотреть файл

@@ -11,6 +11,19 @@
11 11
     - python-psycopg2
12 12
   tags:
13 13
     - dependencies
14
+  when: ansible_distribution_version == '9'
15
+
16
+- name: Install Postgres
17
+  apt:
18
+    name: "{{ packages }}"
19
+    state: present
20
+  vars:
21
+    packages:
22
+    - postgresql
23
+    - python-psycopg2
24
+  tags:
25
+    - dependencies
26
+  when: ansible_distribution_version == '10'
14 27
 
15 28
 - name: Set password for PostgreSQL admin user
16 29
   become: true

+ 12
- 0
roles/common/tasks/security.yml Просмотреть файл

@@ -12,6 +12,9 @@
12 12
 
13 13
 - name: add stretch-backport for fail2ban with IPv6 support
14 14
   apt_repository: repo='deb http://deb.debian.org/debian stretch-backports main' state=present update_cache=yes
15
+  tags:
16
+    - dependencies
17
+  when: ansible_distribution_version == '9'
15 18
 
16 19
 - name: Install newer fail2ban with IPv6 support
17 20
   apt:
@@ -20,6 +23,15 @@
20 23
     default_release: stretch-backports
21 24
   tags:
22 25
     - dependencies
26
+  when: ansible_distribution_version == '9'
27
+
28
+- name: Install fail2ban
29
+  apt:
30
+    name: "fail2ban"
31
+    state: present
32
+  tags:
33
+    - dependencies
34
+  when: ansible_distribution_version == '10'
23 35
 
24 36
 - name: Copy fail2ban configuration into place
25 37
   template: src=etc_fail2ban_jail.local.j2 dest=/etc/fail2ban/jail.local

Загрузка…
Отмена
Сохранить