From 549df68b121846f60d7110ef4bdb60fc45c89c82 Mon Sep 17 00:00:00 2001 From: citty Date: Fri, 15 Oct 2021 21:15:55 -0400 Subject: [PATCH] How did I already break git history bruh --- autopassword.sh | 5 +++++ roles/database/tasks/main.yml | 8 ++++++++ roles/web/main.yml | 8 ++++++++ 3 files changed, 21 insertions(+) create mode 100644 autopassword.sh create mode 100644 roles/database/tasks/main.yml create mode 100644 roles/web/main.yml diff --git a/autopassword.sh b/autopassword.sh new file mode 100644 index 0000000..2a26aa5 --- /dev/null +++ b/autopassword.sh @@ -0,0 +1,5 @@ +#!/bin/bash +key=hello +name=$1 +hash=$(echo -n "$name$key" | sha256sum | xxd -r -p | base64 | tr -d '+/') +echo "${hash:0:8}-${hash:8:8}" \ No newline at end of file diff --git a/roles/database/tasks/main.yml b/roles/database/tasks/main.yml new file mode 100644 index 0000000..4f94982 --- /dev/null +++ b/roles/database/tasks/main.yml @@ -0,0 +1,8 @@ +--- +- name: Allow MySQL traffic + ufw: rule={{ item.rule }} port={{ item.port }} proto={{ item.proto }} + with_items: + - { rule: 'allow', port: '3306', proto: 'tcp' } + notify: + - restart ufw + become: yes \ No newline at end of file diff --git a/roles/web/main.yml b/roles/web/main.yml new file mode 100644 index 0000000..00e1ea0 --- /dev/null +++ b/roles/web/main.yml @@ -0,0 +1,8 @@ +--- +- name: Allow Web traffic + ufw: rule={{ item.rule }} port={{ item.port }} proto={{ item.proto }} + with_items: + - { rule: 'allow', port: '80', proto: 'tcp' } + notify: + - restart ufw + become: yes \ No newline at end of file