From 656a7abb4b38c51b434cab77108384d03a23abd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Tue, 12 Apr 2022 16:26:46 +0200 Subject: [PATCH] add neko custom stuff --- host_vars/rabbit.yaml | 2 - host_vars/testhost.yaml | 1 - inventory.yaml | 6 +-- neko.yaml | 7 +++ roles/common/handlers/main.yaml | 5 -- roles/common/tasks/main.yaml | 1 - roles/docker/files/docker-compose-neko.yml | 15 ------ roles/docker/files/docker-compose-test.yml | 1 - roles/docker/tasks/main.yaml | 7 --- roles/neko/tasks/main.yaml | 48 +++++++++++++++++++ roles/netplan/handlers/main.yaml | 5 ++ .../tasks/main.yaml} | 0 .../templates/netplan.yaml | 0 test.yaml | 13 ----- watch2gether.yaml | 7 --- 15 files changed, 62 insertions(+), 56 deletions(-) delete mode 100644 host_vars/rabbit.yaml create mode 100644 neko.yaml delete mode 100644 roles/docker/files/docker-compose-neko.yml delete mode 100644 roles/docker/files/docker-compose-test.yml create mode 100644 roles/neko/tasks/main.yaml create mode 100644 roles/netplan/handlers/main.yaml rename roles/{common/tasks/static-networking.yaml => netplan/tasks/main.yaml} (100%) rename roles/{common => netplan}/templates/netplan.yaml (100%) delete mode 100644 test.yaml delete mode 100644 watch2gether.yaml diff --git a/host_vars/rabbit.yaml b/host_vars/rabbit.yaml deleted file mode 100644 index 0fc763c..0000000 --- a/host_vars/rabbit.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -dockercompose_yml_name: "docker-compose-neko.yml" diff --git a/host_vars/testhost.yaml b/host_vars/testhost.yaml index a168642..e106f56 100644 --- a/host_vars/testhost.yaml +++ b/host_vars/testhost.yaml @@ -1,3 +1,2 @@ --- -dockercompose_yml_name: "docker-compose-test.yml" backupscript_name: "test-backupscript.sh" diff --git a/inventory.yaml b/inventory.yaml index 2d14f62..1527dd5 100644 --- a/inventory.yaml +++ b/inventory.yaml @@ -6,7 +6,5 @@ all: children: woolsey: hosts: - testhost: - ansible_host: 192.168.69.102 - rabbit: - ansible_host: 192.168.69.19 \ No newline at end of file + neko: + ansible_host: 192.168.69.13 diff --git a/neko.yaml b/neko.yaml new file mode 100644 index 0000000..1134d8a --- /dev/null +++ b/neko.yaml @@ -0,0 +1,7 @@ +--- +- name: "Setup neko" + hosts: neko + roles: + - common + - docker + - neko \ No newline at end of file diff --git a/roles/common/handlers/main.yaml b/roles/common/handlers/main.yaml index 20be5df..c90fb14 100644 --- a/roles/common/handlers/main.yaml +++ b/roles/common/handlers/main.yaml @@ -1,8 +1,3 @@ --- - name: run Timedatectl command: timedatectl set-ntp true - -- name: "netplanapply" - command: netplan apply - async: 45 - poll: 0 diff --git a/roles/common/tasks/main.yaml b/roles/common/tasks/main.yaml index 180d1ba..8e8383c 100644 --- a/roles/common/tasks/main.yaml +++ b/roles/common/tasks/main.yaml @@ -1,5 +1,4 @@ --- -- include_tasks: static-networking.yaml - include_tasks: apt.yaml - include_tasks: clean-motd.yaml - include_tasks: remove-snap.yaml diff --git a/roles/docker/files/docker-compose-neko.yml b/roles/docker/files/docker-compose-neko.yml deleted file mode 100644 index 9a32ec5..0000000 --- a/roles/docker/files/docker-compose-neko.yml +++ /dev/null @@ -1,15 +0,0 @@ -version: "3.4" -services: - neko: - image: "m1k1o/neko:firefox" - restart: "unless-stopped" - shm_size: "2gb" - ports: - - "8080:8080" - - "52000-52100:52000-52100/udp" - environment: - NEKO_SCREEN: 1920x1080@30 - NEKO_PASSWORD: neko - NEKO_PASSWORD_ADMIN: admin - NEKO_EPR: 52000-52100 - NEKO_ICELITE: 1 \ No newline at end of file diff --git a/roles/docker/files/docker-compose-test.yml b/roles/docker/files/docker-compose-test.yml deleted file mode 100644 index 73b314f..0000000 --- a/roles/docker/files/docker-compose-test.yml +++ /dev/null @@ -1 +0,0 @@ ---- \ No newline at end of file diff --git a/roles/docker/tasks/main.yaml b/roles/docker/tasks/main.yaml index 018ae1a..878e0c3 100644 --- a/roles/docker/tasks/main.yaml +++ b/roles/docker/tasks/main.yaml @@ -26,10 +26,3 @@ comment: Service user groups: docker append: yes - -- name: Copy docker-compose.yml to target - copy: - src: "{{ dockercompose_yml_name }}" - dest: /home/service-user/docker-compose.yml - mode: 600 - owner: service-user diff --git a/roles/neko/tasks/main.yaml b/roles/neko/tasks/main.yaml new file mode 100644 index 0000000..afd4115 --- /dev/null +++ b/roles/neko/tasks/main.yaml @@ -0,0 +1,48 @@ +--- +- name: "Install haproxy via apt" + apt: + update_cache: yes + state: present + name: + - haproxy + +- name: Reset ufw rules to default + community.general.ufw: + state: reset + +- name: Allow ssh via ufw from localnet + community.general.ufw: + rule: allow + direction: in + port: ssh + from_ip: "192.168.69.0/24" + interface: eth0 + +- name: Allow http via ufw from internet + community.general.ufw: + rule: allow + direction: in + port: http + interface: eth1 + +- name: Allow https via ufw from internet + community.general.ufw: + rule: allow + direction: in + port: https + interface: eth1 + +- name: Allow http via ufw from internet + community.general.ufw: + rule: allow + direction: in + port: http + interface: eth1 + +- name: Allow neko ports via ufw from internet + community.general.ufw: + rule: allow + direction: in + port: 52000:52100 + proto: udp + interface: eth1 diff --git a/roles/netplan/handlers/main.yaml b/roles/netplan/handlers/main.yaml new file mode 100644 index 0000000..6e1c62f --- /dev/null +++ b/roles/netplan/handlers/main.yaml @@ -0,0 +1,5 @@ +--- +- name: "netplanapply" + command: netplan apply + async: 45 + poll: 0 \ No newline at end of file diff --git a/roles/common/tasks/static-networking.yaml b/roles/netplan/tasks/main.yaml similarity index 100% rename from roles/common/tasks/static-networking.yaml rename to roles/netplan/tasks/main.yaml diff --git a/roles/common/templates/netplan.yaml b/roles/netplan/templates/netplan.yaml similarity index 100% rename from roles/common/templates/netplan.yaml rename to roles/netplan/templates/netplan.yaml diff --git a/test.yaml b/test.yaml deleted file mode 100644 index 1f11163..0000000 --- a/test.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: "Test ansbile roles" - hosts: woolsey - roles: - - common - - docker - - mariadb - - postgresql - - backupscript - - internalsmtp - - smtpgateway - - webgateway - - webserver \ No newline at end of file diff --git a/watch2gether.yaml b/watch2gether.yaml deleted file mode 100644 index 80dfc77..0000000 --- a/watch2gether.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: "Setup watch2gether" - hosts: rabbit - roles: - - common - - docker - - webserver \ No newline at end of file