Browse Source

Jekyll role and playbook

Mariusz Kozakowski 5 years ago
parent
commit
fe81ee7886
3 changed files with 18 additions and 0 deletions
  1. 4 0
      jekyll-update.yml
  2. 4 0
      roles/jekyll/handlers/main.yml
  3. 10 0
      roles/jekyll/tasks/main.yml

+ 4 - 0
jekyll-update.yml

@@ -0,0 +1,4 @@
1
+- name: Update jekyll blog
2
+  hosts: blog
3
+  roles:
4
+   - { role: jekyll, tags: [blog] }

+ 4 - 0
roles/jekyll/handlers/main.yml

@@ -0,0 +1,4 @@
1
+---
2
+- name: build jekyll
3
+  command:
4
+    "{{ blog.jekyll_path }}/jekyll build -s {{ blog.src }} -d {{ blog.path }}"

+ 10 - 0
roles/jekyll/tasks/main.yml

@@ -0,0 +1,10 @@
1
+---
2
+- name: Update files
3
+  git:
4
+    repo:   "{{ blog.repo }}"
5
+    dest:   "{{ blog.src }}"
6
+    update: yes
7
+    accept_hostkey: yes
8
+    key_file: ~/.ssh/id_rsa
9
+  notify:
10
+    - build jekyll