From 7a8f9bdee2dfabf605b180a50bd0c62ee9c19edf Mon Sep 17 00:00:00 2001
From: Daniel M <daniel.q.mueller@stud.h-da.de>
Date: Thu, 27 Jan 2022 17:21:23 +0100
Subject: [PATCH] Add mdbook task

---
 README.md                         |  2 ++
 local.yml                         |  1 +
 roles/local-mdbook/tasks/main.yml | 15 +++++++++++++++
 3 files changed, 18 insertions(+)
 create mode 100644 roles/local-mdbook/tasks/main.yml

diff --git a/README.md b/README.md
index 39441e5..c1e1a9e 100644
--- a/README.md
+++ b/README.md
@@ -21,9 +21,11 @@
 - [local.yml](./local.yml): The main playbook file, can be seen as the entry point
   - [roles](./roles): Contains multiple roles (can be seen as small task specific playbooks). The 
     roles are called in the [local.yml](./local.yml)
+    - [git-clone](./roles/git-clone/tasks/main.yml): Clone the [ai-at-the-edge](https://code.fbi.h-da.de/pse-ai-at-the-edge/ai-at-the-edge) repository into the notebooks directory
     - [jupyter-lab](./roles/jupyter-lab/tasks/main.yml): Install jupyter-lab and configure it with a systemd service and autostart
     - [misc-applications](./roles/misc-applications/tasks/main.yml): Install additional extra applications
     - [ml-python-packages](./roles/ml-python-packages/tasks/main.yml): Install the machine learning python packages
+    - [local-mdbook](./roles/local-mdbook/tasks/main.yml): Download the lastest version of the [deployed mdbook](https://pse-ai-at-the-edge.h-da.io/ai-at-the-edge/) documentation
 
 
 # Using the ansible playbook on Raspberry Pi OS
diff --git a/local.yml b/local.yml
index 255bcff..88e77eb 100644
--- a/local.yml
+++ b/local.yml
@@ -33,3 +33,4 @@
     - jupyter-lab
     - ml-python-packages
     - misc-applications
+    - local-mdbook
diff --git a/roles/local-mdbook/tasks/main.yml b/roles/local-mdbook/tasks/main.yml
new file mode 100644
index 0000000..8f3c1cf
--- /dev/null
+++ b/roles/local-mdbook/tasks/main.yml
@@ -0,0 +1,15 @@
+---
+# roles/local-mdbook
+
+- name: Create Documentation dir
+  become: true
+  become_user: "{{ target_user }}"
+  file:
+    path: "/home/{{ target_user }}/Documentation"
+    state: directory
+
+- name: Download and extract mdbook artifacts
+  unarchive:
+    src: "https://code.fbi.h-da.de/pse-ai-at-the-edge/ai-at-the-edge/-/jobs/artifacts/main/download?job=pages"
+    dest: "/home/{{ target_user }}/Documentation"
+    remote_src: true
\ No newline at end of file
-- 
GitLab