78 lines
2.5 KiB
YAML
78 lines
2.5 KiB
YAML
---
|
|
# 2026-09-11 Hyperling
|
|
# Move all Hugo development needs to a specific place.
|
|
|
|
- name: Workstation | Linux | Software | Hugo
|
|
block:
|
|
|
|
- name: Workstation | Linux | Software | Hugo | pacman
|
|
block:
|
|
|
|
- name: Workstation | Linux | Software | Hugo | pacman | Facts
|
|
ansible.builtin.set_fact:
|
|
sass_old: ruby-sass
|
|
sass_current: dart-sass
|
|
|
|
- name: Workstation | Linux | Software | Hugo | pacman | Remove Old
|
|
ansible.builtin.package:
|
|
name:
|
|
- "{{ sass_old }}"
|
|
state: absent
|
|
|
|
- name: Workstation | Linux | Software | Hugo | pacman | Install New
|
|
ansible.builtin.package:
|
|
name:
|
|
- hugo
|
|
- "{{ sass_current }}"
|
|
state: present
|
|
|
|
when: ansible_pkg_mgr == "pacman"
|
|
|
|
# This must exist after nodejs.yml so that NPM is installed.
|
|
- name: Workstation | Linux | Software | Hugo | apt
|
|
block:
|
|
|
|
- name: Workstation | Linux | Software | Hugo | apt | sass | Facts
|
|
ansible.builtin.set_fact:
|
|
sass_old: node-sass
|
|
sass_current: sass
|
|
|
|
- name: Workstation | Linux | Software | Hugo | apt | sass | Gather
|
|
ansible.builtin.shell: npm prefix -g
|
|
register: npm_bin_dir # Provides /usr/local/ on Devuan, /usr/ on Artix.
|
|
changed_when: false
|
|
|
|
- name: Workstation | Linux | Software | Hugo | apt | sass | Remove Old
|
|
ansible.builtin.shell: "npm remove -g {{ sass_old }}"
|
|
args:
|
|
creates: "{{ npm_bin_dir.stdout }}/bin/sass"
|
|
|
|
- name: Workstation | Linux | Software | Hugo | apt | sass | Install New
|
|
ansible.builtin.shell: "npm install -g {{ sass_current }}"
|
|
args:
|
|
creates: "{{ npm_bin_dir.stdout }}/bin/sass"
|
|
|
|
- name: Workstation | Linux | Software | Hugo | apt | hugo | Remove Old
|
|
ansible.builtin.package:
|
|
name:
|
|
- hugo
|
|
state: absent
|
|
|
|
- name: Workstation | Linux | Software | Hugo | apt | hugo | Install Dependencies
|
|
ansible.builtin.package:
|
|
name:
|
|
- golang
|
|
- gcc
|
|
state: present
|
|
|
|
- name: Workstation | Linux | Software | Hugo | apt | hugo | Build
|
|
ansible.builtin.shell: |
|
|
CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest
|
|
ln -s $HOME/go/bin/hugo /usr/local/bin/hugo
|
|
register: shell_check
|
|
changed_when: shell_check.rc == 0
|
|
|
|
when: ansible_pkg_mgr == "apt"
|
|
|
|
when: coding is true
|