38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
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/v{{ hugo_version }}/hugo_extended_{{ hugo_version }}_Linux-64bit.deb
|
|
when:
|
|
not hugo_path.stat.exists
|
|
|
|
- name: Pin hugo version
|
|
become_user: root
|
|
template:
|
|
src: "./filesystem/{{ ansible_hostname }}/etc/apt/preferences.d/hugo.j2"
|
|
dest: "/etc/apt/preferences.d/hugo"
|
|
mode: 0644
|
|
|
|
- name: Clone website repository
|
|
git:
|
|
repo: https://{{ services[service_name].repo_user }}:{{ services[service_name].repo_token }}@git.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 }}"
|
|
vars:
|
|
hugo_version: "0.56.0"
|