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