Colin Powell пре 3 година
родитељ
комит
833408f285

+ 2 - 1
ansible/playbook.yml

@@ -159,7 +159,7 @@
 - hosts: draw
   roles:
     - role: nginx
-    - role: excalidraw
+    - role: drawio
 
 - hosts: notify
   roles:
@@ -191,6 +191,7 @@
     - role: icecast
     - role: hauk
     - role: excalidraw
+    - role: drawio
     - role: miniflux
     - role: ntfy
     - role: fifteen5

+ 3 - 0
ansible/roles/drawio/files/nginx-location.conf

@@ -0,0 +1,3 @@
+location /drawio {
+    alias /usr/local/www/drawio;
+}

+ 34 - 0
ansible/roles/drawio/tasks/main.yml

@@ -0,0 +1,34 @@
+---
+- name: Dependencies installed
+  community.general.pkgng:
+    name: git-tiny
+    state: latest
+  tags:
+    - build
+
+- name: Source folder exists
+  file: path=/usr/local/src mode=0755 state=directory
+  tags:
+    - build
+
+- name: Drawio source fetched
+  git:
+    repo: "https://github.com/jgraph/drawio.git"
+    dest: /usr/local/src/drawio
+    force: yes
+    accept_hostkey: yes
+    update: yes
+  tags:
+    - build
+
+- name: Drawio build artifacts installed
+  shell:
+    cmd: mkdir -p /usr/local/www/drawio && cp -r /usr/local/src/drawio/src/main/webapp/ /usr/local/www/drawio/
+  tags:
+    - build
+
+- name: Nginx config file installed
+  ansible.builtin.copy:
+    src: nginx-location.conf
+    dest: /usr/local/etc/nginx/locations/
+  notify: Nginx restarted