Files
playbooks/hugo/playbook.yaml
T
2024-12-17 17:52:46 +05:30

39 lines
1.1 KiB
YAML

---
- hosts: all
become: yes
tasks:
- name: Get the latest Hugo release
get_url:
url: https://github.com/gohugoio/hugo/releases/latest/download/hugo_extended_{{ ansible_system }}-64bit.tar.gz
dest: /tmp/hugo.tar.gz
mode: '0755'
- name: Extract Hugo binary
unarchive:
src: /tmp/hugo.tar.gz
dest: /tmp
remote_src: yes
- name: Move Hugo binary to /usr/local/bin
command: mv /tmp/hugo /usr/local/bin/hugo
- name: Check if Hugo project exists
stat:
path: "{{ host_directory }}"
register: hugo_project
- name: Create new Hugo project
command: hugo new site "{{ host_directory }}"
when: not hugo_project.stat.exists
- name: Add Decap CMS with Gitea integration
block:
- name: Clone Decap CMS
git:
repo: 'https://github.com/decapcms/decap.git'
dest: "{{ host_directory }}/themes/decap"
- name: Configure Gitea integration
lineinfile:
path: "{{ host_directory }}/config.toml"
line: 'theme = "decap"'