From e44346975e2d75db5a8465291b920d7b734dedc5 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sun, 2 Oct 2022 15:16:17 +0200 Subject: [PATCH] Pin hugo version --- .../filesystem/valkyrie/etc/apt/preferences.d/hugo.j2 | 3 +++ playbooks/tasks/services/service/03-pod.d/www.yml | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 playbooks/filesystem/valkyrie/etc/apt/preferences.d/hugo.j2 diff --git a/playbooks/filesystem/valkyrie/etc/apt/preferences.d/hugo.j2 b/playbooks/filesystem/valkyrie/etc/apt/preferences.d/hugo.j2 new file mode 100644 index 0000000..4b5ea09 --- /dev/null +++ b/playbooks/filesystem/valkyrie/etc/apt/preferences.d/hugo.j2 @@ -0,0 +1,3 @@ +Package: hugo +Pin: version {{ hugo_version }} +Pin-Priority: 999 diff --git a/playbooks/tasks/services/service/03-pod.d/www.yml b/playbooks/tasks/services/service/03-pod.d/www.yml index a0474f4..cb538eb 100644 --- a/playbooks/tasks/services/service/03-pod.d/www.yml +++ b/playbooks/tasks/services/service/03-pod.d/www.yml @@ -7,10 +7,17 @@ - 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 + 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://gitlab.wojciechkozlowski.eu/wojtek/wojciechkozlowski.eu.git @@ -26,3 +33,5 @@ wojciechkozlowski_eu_git is changed become_user: "{{ service_user_name }}" + vars: + hugo_version: "0.56.0"