2020-03-30 19:36:05 +01:00
|
|
|
- name: Install security-related packages
|
2019-03-14 21:34:29 +00:00
|
|
|
aur:
|
|
|
|
name: "{{ item }}"
|
|
|
|
become: true
|
|
|
|
become_user: aur_builder
|
2019-12-09 21:09:00 +00:00
|
|
|
loop:
|
2020-07-16 13:50:14 +01:00
|
|
|
- gnome-keyring
|
2020-06-12 10:19:03 +01:00
|
|
|
- firejail
|
2020-05-14 16:35:24 +01:00
|
|
|
- keepassxc
|
2020-04-15 08:50:11 +01:00
|
|
|
- qomui
|
2020-07-16 13:50:14 +01:00
|
|
|
- seahorse
|
2020-04-15 08:50:11 +01:00
|
|
|
- wireguard-tools
|
2020-05-14 16:44:24 +01:00
|
|
|
- yubikey-personalization-gui
|
2019-03-14 21:34:29 +00:00
|
|
|
|
2020-04-04 21:19:05 +01:00
|
|
|
- name: Create .ssh directory
|
|
|
|
file:
|
|
|
|
state: directory
|
|
|
|
path: "{{ home }}/.ssh"
|
|
|
|
owner: "{{ user }}"
|
|
|
|
mode: 0700
|
|
|
|
directory_mode: 0700
|
|
|
|
|
2019-05-25 16:50:09 +01:00
|
|
|
- name: Install assh config
|
|
|
|
copy:
|
2019-03-14 21:34:29 +00:00
|
|
|
src: ./files/assh.yml
|
2019-05-25 00:21:47 +01:00
|
|
|
dest: "{{ home }}/.ssh/assh.yml"
|
|
|
|
mode: 0644
|
|
|
|
owner: "{{ user }}"
|
2020-06-03 20:32:12 +01:00
|
|
|
|
|
|
|
- name: Install Firewall
|
|
|
|
aur:
|
|
|
|
name: "{{ item }}"
|
|
|
|
become: true
|
|
|
|
become_user: aur_builder
|
|
|
|
loop:
|
|
|
|
- firewalld
|
|
|
|
|
|
|
|
- name: Enable firewalld
|
|
|
|
systemd:
|
|
|
|
name: firewalld
|
|
|
|
enabled: true
|
2020-06-04 09:23:50 +01:00
|
|
|
state: started
|
2020-06-03 20:32:12 +01:00
|
|
|
|
|
|
|
- name: Define firewall ports
|
|
|
|
set_fact:
|
|
|
|
requested_firewall_ports:
|
|
|
|
- 22/tcp # SSH
|
|
|
|
- 80/tcp # Web (crab)
|
|
|
|
|
|
|
|
- name: Get firewall ports
|
|
|
|
shell: firewall-cmd --list-ports
|
|
|
|
become: true
|
|
|
|
register: firewall_ports
|
|
|
|
|
|
|
|
- name: Open firewall ports
|
|
|
|
firewalld:
|
|
|
|
port: "{{ item }}"
|
|
|
|
permanent: true
|
|
|
|
immediate: true
|
|
|
|
state: enabled
|
|
|
|
loop: "{{ requested_firewall_ports }}"
|
|
|
|
|
|
|
|
- name: Close firewall ports
|
|
|
|
firewalld:
|
|
|
|
port: "{{ item }}"
|
|
|
|
permanent: true
|
|
|
|
immediate: true
|
|
|
|
state: disabled
|
2020-06-04 09:23:50 +01:00
|
|
|
when: item and item not in requested_firewall_ports
|
2020-06-03 20:32:12 +01:00
|
|
|
loop: "{{ firewall_ports.stdout.split(' ') }}"
|