summaryrefslogtreecommitdiff
path: root/docs/serverdocs
diff options
context:
space:
mode:
authorD. Delmar Davis <don@suspectdevices.com>2022-06-28 20:14:05 -0700
committerD. Delmar Davis <don@suspectdevices.com>2022-06-28 20:14:05 -0700
commit2a521477e1da6e6acac5eaac93ae95fe01ac30de (patch)
tree24d927b18ec2f69297802ee652bfdd97b0531084 /docs/serverdocs
parent9249646cc0eec53bdf29182643adf3ccaca16936 (diff)
mygist
Diffstat (limited to 'docs/serverdocs')
-rw-r--r--docs/serverdocs/unifi-install.md67
1 files changed, 67 insertions, 0 deletions
diff --git a/docs/serverdocs/unifi-install.md b/docs/serverdocs/unifi-install.md
new file mode 100644
index 0000000..00d0c69
--- /dev/null
+++ b/docs/serverdocs/unifi-install.md
@@ -0,0 +1,67 @@
+``` yaml
+# ------------------------------------ rules/ubuntu-unifi-server/tasks/main.yml
+- name: download unifi-lastest script
+ ansible.builtin.get_url:
+ url: https://get.glennr.nl/unifi/install/install_latest/unifi-latest.sh
+ dest: /root/unifi-latest.sh
+ mode: '0700'
+
+- name: Run Easy Unifi Script.
+ command: "bash /root/unifi-latest.sh --skip --add-repository"
+
+- name: install nginx
+ apt:
+ state: latest
+ name: nginx
+
+- name: remove default nginx site
+ file:
+ path: /etc/nginx/sites-enabled/default
+ state: absent
+
+- name: Seed nginx configuration
+ copy:
+ src: "../files/nginx.conf"
+ dest: /etc/nginx/nginx.conf
+#
+- name: Restart nginx service
+ service:
+ name: nginx
+ enabled: yes
+ state: restarted
+```
+
+``` json
+# -------------------------- ansible/roles/ubuntu-unifi-server/files/nginx.conf
+# ---- simplest redirection I could figure out
+
+user www-data;
+worker_processes auto;
+pid /run/nginx.pid;
+
+include /etc/nginx/modules-enabled/*.conf;
+
+events {}
+
+stream {
+ upstream unifi {
+ server localhost:8443;
+ }
+ server {
+ listen 443;
+ proxy_pass unifi;
+ }
+}
+http {
+ server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+ server_name _;
+ return 301 https://$host:8443$request_uri;
+ }
+ access_log /var/log/nginx/access.log;
+ error_log /var/log/nginx/error.log;
+ include /etc/nginx/conf.d/*.conf;
+ include /etc/nginx/sites-enabled/*;
+}
+``` \ No newline at end of file