From 7f2c2e4f6595c6ab9228989fe9a4785034a7fb98 Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Mon, 20 Apr 2020 13:20:36 +0000 Subject: [PATCH] Add nginx role for ansible, example playbooks --- ansible/fail2ban.yml | 6 +++ ansible/nginx.yml | 2 +- ansible/roles/nginx/files/.index.html.swp | Bin 0 -> 12288 bytes ansible/roles/nginx/files/nginx/index.html | 25 ++++++++++ ansible/roles/nginx/files/nginx/nginx.conf | 55 +++++++++++++++++++++ 5 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 ansible/fail2ban.yml create mode 100644 ansible/roles/nginx/files/.index.html.swp create mode 100644 ansible/roles/nginx/files/nginx/index.html create mode 100644 ansible/roles/nginx/files/nginx/nginx.conf diff --git a/ansible/fail2ban.yml b/ansible/fail2ban.yml new file mode 100644 index 0000000..193d48f --- /dev/null +++ b/ansible/fail2ban.yml @@ -0,0 +1,6 @@ +--- +- hosts: plumbi + become: yes + roles: + - fail2ban + diff --git a/ansible/nginx.yml b/ansible/nginx.yml index 7b8de16..3cac957 100644 --- a/ansible/nginx.yml +++ b/ansible/nginx.yml @@ -1,5 +1,5 @@ --- -- hosts: nginx-server +- hosts: plumbi become: yes roles: - nginx diff --git a/ansible/roles/nginx/files/.index.html.swp b/ansible/roles/nginx/files/.index.html.swp new file mode 100644 index 0000000000000000000000000000000000000000..1f8438533dfd086206e4358cad0156430ab5d89f GIT binary patch literal 12288 zcmeI2KWh|07{(`d7Ew__w3@_9Np5lmF`ny!MuR~_i%Z19Vs3Z#cF69`Iy0N(5D`Cy zSZHe_Sf=zFSXfz#7IxZM`t0o)MKF>w@D4mT@6MlhpZV=xaojstSYN%vmpTg!?HFSp zzxN-852x6V!;Cp=Lo@upmRJ*P}cu{NpN?&P5? z_D(~yM1TnFmp~n|`K9T##S7i>SN-hl3_o#vZNFJ)JrN)RM1Tko0U|&IhyW2F0tc8t zsHWIc_&+o`!|6#s^;bW+q>cy>0U|&IhyW2F0z`la5CI}U1c(3;IDiCX%GkMS#$H3s z|Np;!|9?Bm*jMNi^bXpA-ayZxXV5L^I&>N8Lg%3~(EB5dy@FmsL+BE868eJtpP?P- zE!5oa1w@Sq5CI}U1c(3;AOb{y2oM1xKm-_z{%9f+O=Wb0akBh21k-&5$su+nR&z;Jy&gLOhJ<(QOcM@BQ*|=SdI1)0(Cahn!WvN`E zWx;)2Rn`TrJ(rtO7ZRo0T!w#Sv~IYY5pkPw;KbPN3jA49Xrp*)le$zU$e^v^(xkih zsR|{%;xMZm50o#zv4qvHV$T5gw^GpwG*Y1TcrykYXskHSDEUOuKc%^vAFv!_{%-p!U M+<$QICU38Q0Hq)$ literal 0 HcmV?d00001 diff --git a/ansible/roles/nginx/files/nginx/index.html b/ansible/roles/nginx/files/nginx/index.html new file mode 100644 index 0000000..b0d878e --- /dev/null +++ b/ansible/roles/nginx/files/nginx/index.html @@ -0,0 +1,25 @@ + + + +Welcome to nginx! + + + +

Klips!

+

If you see this page, the nginx web server is successfully installed and +working. Further configuration is required.

+ +

For online documentation and support please refer to +nginx.org.
+Commercial support is available at +nginx.com.

+ +

Thank you for using nginx.

+ + diff --git a/ansible/roles/nginx/files/nginx/nginx.conf b/ansible/roles/nginx/files/nginx/nginx.conf new file mode 100644 index 0000000..a9c5a2b --- /dev/null +++ b/ansible/roles/nginx/files/nginx/nginx.conf @@ -0,0 +1,55 @@ +user www-data; +worker_processes auto; +pid /run/nginx.pid; + +events { } + +http { + include mime.types; + + # Basic Server Configuration + server { + listen 80; + server_tokens off; + server_name {{ domain_name }}; + + location / { + root {{ nginx_root_dir }}; + index {{ index_files }}; + } + + # Uncomment to pass for SSL + #return 301 https://$host$request_uri; + } +} + + # Terminate SSL and route traffic +# server { +# server_name localhost; +# server_tokens off; +# + # SSL Settings +# listen 443 ssl; +# ssl_certificate /etc/letsencrypt/live/www.domain.com/fullchain.pem; +# ssl_certificate_key /etc/letsencrypt/live/www.domain.com/privkey.pem; +# include /etc/letsencrypt/options-ssl-nginx.conf; +# ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; + +# location / { +# include proxy_params; +# proxy_pass http://0.0.0.0:8080/; +# } +# } + +# Private subdomain for routing custom ssh port +# server { +# server_name sub.domain.com; +# server_tokens off; +# +# location / { +# include proxy_params; +# proxy_pass http://0.0.0.0:3333; +# } +# +#} +