29 lines
886 B
YAML
29 lines
886 B
YAML
|
- block:
|
||
|
- name: Check if hugo is installed
|
||
|
stat:
|
||
|
path: "/usr/local/bin/hugo"
|
||
|
register: hugo_path
|
||
|
|
||
|
- name: Install hugo
|
||
|
become_user: root
|
||
|
apt:
|
||
|
deb: https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_extended_0.56.0_Linux-64bit.deb
|
||
|
when:
|
||
|
not hugo_path.stat.exists
|
||
|
|
||
|
- name: Clone website repository
|
||
|
git:
|
||
|
repo: https://gitlab.wojciechkozlowski.eu/wojtek/wojciechkozlowski.eu.git
|
||
|
dest: "{{ service_home }}/.config/{{ service_user_name }}/wojciechkozlowski.eu"
|
||
|
recursive: yes
|
||
|
register: wojciechkozlowski_eu_git
|
||
|
|
||
|
- name: Generate static page using hugo
|
||
|
command:
|
||
|
cmd: hugo
|
||
|
chdir: "{{ service_home }}/.config/{{ service_user_name }}/wojciechkozlowski.eu"
|
||
|
when:
|
||
|
wojciechkozlowski_eu_git is changed
|
||
|
|
||
|
become_user: "{{ service_user_name }}"
|