Skip to content

Commit a91b2c4

Browse files
committed
nearly get bootstrap working in configure mode without internet access
1 parent 2838930 commit a91b2c4

File tree

7 files changed

+38
-35
lines changed

7 files changed

+38
-35
lines changed

ansible/bootstrap.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@
185185
become: yes
186186
tasks:
187187
- name: Install and configure tuneD
188-
import_role:
188+
include_role:
189189
name: tuned
190+
tasks_from: "{{ 'configure.yml' if appliances_mode == 'configure' else 'main.yml' }}"
190191

191192
- hosts: freeipa_server
192193
# Done here as it might be providing DNS
@@ -216,31 +217,27 @@
216217
become: yes
217218
tags: firewalld
218219
tasks:
219-
- import_role:
220+
- include_role:
220221
name: firewalld
222+
tasks_from: "{{ 'runtime.yml' if appliances_mode == 'configure' else 'main.yml' }}"
221223

222224
- hosts: fail2ban
223225
gather_facts: false
224226
become: yes
225227
tags: fail2ban
226228
tasks:
227-
- import_role:
229+
- include_role:
228230
name: fail2ban
231+
tasks_from: "{{ 'configure.yml' if appliances_mode == 'configure' else 'main.yml' }}"
229232

230233
- name: Setup podman
231234
gather_facts: false
232235
hosts: podman
233236
tags: podman
234237
tasks:
235-
- import_role:
236-
name: podman
237-
tasks_from: prereqs.yml
238-
tags: prereqs
239-
240-
- import_role:
238+
- include_role:
241239
name: podman
242-
tasks_from: config.yml
243-
tags: config
240+
tasks_from: "{{ 'configure.yml' if appliances_mode == 'configure' else 'main.yml' }}"
244241

245242
- hosts: update
246243
gather_facts: false
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
- name: Create config
3+
template:
4+
dest: /etc/fail2ban/jail.local
5+
src: jail.local.j2
6+
notify: Restart fail2ban
7+
8+
- name: flush handlers
9+
meta: flush_handlers
10+
11+
- name: Ensure fail2ban running even if no config change
12+
service:
13+
name: fail2ban
14+
state: started
15+
enabled: true
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
- name: Install EPEL repo
3+
package:
4+
name: epel-release
5+
6+
- name: Install fail2ban packages
7+
package:
8+
name:
9+
- fail2ban-server
10+
- fail2ban-firewalld
11+
state: present
Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,4 @@
11
---
2-
- name: Install EPEL repo
3-
package:
4-
name: epel-release
52

6-
- name: Install fail2ban packages
7-
package:
8-
name:
9-
- fail2ban-server
10-
- fail2ban-firewalld
11-
state: present
12-
13-
- name: Create config
14-
template:
15-
dest: /etc/fail2ban/jail.local
16-
src: jail.local.j2
17-
notify: Restart fail2ban
18-
19-
- name: flush handlers
20-
meta: flush_handlers
21-
22-
- name: Ensure fail2ban running even if no config change
23-
service:
24-
name: fail2ban
25-
state: started
26-
enabled: true
3+
- import_tasks: install.yml
4+
- import_tasks: configure.yml
File renamed without changes.
File renamed without changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- import_tasks: install.yml
2+
- import_tasks: configure.yml

0 commit comments

Comments
 (0)