-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
smoother starts, and use my own init repo
- Loading branch information
Showing
3 changed files
with
107 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
# Do all the stuff that's not the other repos | ||
- name: Ensure firewalld configfile service:factorio | ||
ansible.builtin.copy: | ||
owner: "root" | ||
mode: "644" | ||
dest: /etc/firewalld/services/factorio.xml | ||
content: | | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<service> | ||
<port port="34197" protocol="udp"/> | ||
</service> | ||
register: create_firewalld_factorio_service | ||
|
||
- name: Hard reload firwalld if new service is installed | ||
when: create_firewalld_factorio_service.changed is true | ||
ansible.builtin.command: | ||
cmd: firewall-cmd --reload | ||
|
||
- name: Ensure factorio firewalld allowance (defaultzone) | ||
ansible.posix.firewalld: | ||
state: enabled | ||
service: factorio | ||
permanent: true | ||
immediate: true | ||
|
||
- name: Limit ssh attempts | ||
ansible.posix.firewalld: | ||
state: enabled | ||
rich_rule: rule service name="ssh" audit limit value="5/h" accept | ||
permanent: true | ||
immediate: true | ||
|
||
- name: Install a fail2ban on fedora | ||
ansible.builtin.package: | ||
pkg: fail2ban | ||
state: present | ||
|
||
- name: Config sshd fail2ban on fedora | ||
ansible.builtin.copy: | ||
owner: "root" | ||
mode: "0644" | ||
dest: /etc/fail2ban/jail.d/01-sshd.conf | ||
content: | | ||
[sshd] | ||
enable = true | ||
bantime = 90d | ||
- name: Ensure fail2ban service is started/enabled | ||
ansible.builtin.service: | ||
name: fail2ban | ||
state: started | ||
enabled: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters