Przeglądaj źródła

Use new style of calling apt in ansible

Thomas Buck 5 lat temu
rodzic
commit
c71c6d8559

+ 5
- 2
roles/common/tasks/main.yml Wyświetl plik

@@ -10,8 +10,11 @@
10 10
     - dependencies
11 11
 
12 12
 - name: Install necessities and nice-to-haves
13
-  apt: pkg={{ item }} state=present
14
-  with_items:
13
+  apt:
14
+    name: "{{ packages }}"
15
+    state: present
16
+  vars:
17
+    packages:
15 18
     - apache2
16 19
     - apt-transport-https
17 20
     - apticron

+ 5
- 2
roles/common/tasks/postgres.yml Wyświetl plik

@@ -2,8 +2,11 @@
2 2
 # Defines tasks applicable for postgreSQL
3 3
 
4 4
 - name: Install Postgres
5
-  apt: pkg={{ item }} state=present
6
-  with_items:
5
+  apt:
6
+    name: "{{ packages }}"
7
+    state: present
8
+  vars:
9
+    packages:
7 10
     - postgresql
8 11
     - python-psycopg2
9 12
   tags:

+ 5
- 2
roles/common/tasks/security.yml Wyświetl plik

@@ -1,6 +1,9 @@
1 1
 - name: Install security-related packages
2
-  apt: pkg={{ item }} state=present
3
-  with_items:
2
+  apt:
3
+    name: "{{ packages }}"
4
+    state: present
5
+  vars:
6
+    packages:
4 7
     - fail2ban
5 8
     - whois
6 9
     - lynis

Ładowanie…
Anuluj
Zapisz