Browse Source

Use new style of calling apt in ansible

Thomas Buck 5 years ago
parent
commit
c71c6d8559

+ 5
- 2
roles/common/tasks/main.yml View File

10
     - dependencies
10
     - dependencies
11
 
11
 
12
 - name: Install necessities and nice-to-haves
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
     - apache2
18
     - apache2
16
     - apt-transport-https
19
     - apt-transport-https
17
     - apticron
20
     - apticron

+ 5
- 2
roles/common/tasks/postgres.yml View File

2
 # Defines tasks applicable for postgreSQL
2
 # Defines tasks applicable for postgreSQL
3
 
3
 
4
 - name: Install Postgres
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
     - postgresql
10
     - postgresql
8
     - python-psycopg2
11
     - python-psycopg2
9
   tags:
12
   tags:

+ 5
- 2
roles/common/tasks/security.yml View File

1
 - name: Install security-related packages
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
     - fail2ban
7
     - fail2ban
5
     - whois
8
     - whois
6
     - lynis
9
     - lynis

Loading…
Cancel
Save