From ba6507e57c88636e52d0a50de1e31c198ed73a6e Mon Sep 17 00:00:00 2001 From: cuqmbr Date: Tue, 24 Jun 2025 13:24:52 +0300 Subject: [PATCH] flatten hugo role settings dict --- ansible/inventories/dev/group_vars/main_page.yml | 9 ++++----- ansible/roles/hugo/defaults/main.yml | 9 ++++----- ansible/roles/hugo/tasks/main.yml | 12 ++++++------ 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/ansible/inventories/dev/group_vars/main_page.yml b/ansible/inventories/dev/group_vars/main_page.yml index 9c59665..85ad149 100644 --- a/ansible/inventories/dev/group_vars/main_page.yml +++ b/ansible/inventories/dev/group_vars/main_page.yml @@ -29,11 +29,10 @@ users: cuqmbr.xyz_gitea-actions" opendoas_settings: "permit nopass gitea-actions" -hugo_settings: - hugo_version: 0.147.9 - homedir: /opt/hugo - git_repo: https://gitea.cuqmbr.xyz/cuqmbr/cuqmbr.xyz.git - git_commit: 5b894854d47b41996b1901fa257f8c2cad9224f9 +hugo_version: 0.147.9 +hugo_homedir: /opt/hugo +hugo_git_repo: https://gitea.cuqmbr.xyz/cuqmbr/cuqmbr.xyz.git +hugo_git_commit: 5b894854d47b41996b1901fa257f8c2cad9224f9 nginx_settings: server_tokens: false diff --git a/ansible/roles/hugo/defaults/main.yml b/ansible/roles/hugo/defaults/main.yml index b0a806a..83182e5 100644 --- a/ansible/roles/hugo/defaults/main.yml +++ b/ansible/roles/hugo/defaults/main.yml @@ -1,7 +1,6 @@ --- -hugo_settings: - hugo_version: 0.147.9 - homedir: /opt/hugo - git_repo: https://gitea.cuqmbr.xyz/cuqmbr/cuqmbr.xyz.git - git_commit: 5b894854d47b41996b1901fa257f8c2cad9224f9 +hugo_version: 0.147.9 +hugo_homedir: /opt/hugo +hugo_git_repo: https://gitea.cuqmbr.xyz/cuqmbr/cuqmbr.xyz.git +hugo_git_commit: 5b894854d47b41996b1901fa257f8c2cad9224f9 diff --git a/ansible/roles/hugo/tasks/main.yml b/ansible/roles/hugo/tasks/main.yml index a54724d..ca03e6c 100644 --- a/ansible/roles/hugo/tasks/main.yml +++ b/ansible/roles/hugo/tasks/main.yml @@ -3,8 +3,8 @@ - name: Install hugo deb package from github. ansible.builtin.apt: deb: "https://github.com/gohugoio/hugo/releases/download\ - /v{{ hugo_settings.hugo_version}}/\ - hugo_{{ hugo_settings.hugo_version }}_linux-amd64.deb" + /v{{ hugo_version}}/\ + hugo_{{ hugo_version }}_linux-amd64.deb" state: present - name: Install dependencies using apt. @@ -14,20 +14,20 @@ - name: Set hugo_source, hugo_compiled and hugo_deploy variables. ansible.builtin.set_fact: - hugo_source: "{{ hugo_settings.homedir }}/src" - hugo_compiled: "{{ hugo_settings.homedir }}/compiled" + hugo_source: "{{ hugo_homedir }}/src" + hugo_compiled: "{{ hugo_homedir }}/compiled" hugo_deploy: /var/www/hugo - name: Clone hugo site git repository. ansible.builtin.git: clone: true - repo: "{{ hugo_settings.git_repo }}" + repo: "{{ hugo_git_repo }}" force: true recursive: true single_branch: true depth: 1 dest: "{{ hugo_source }}" - version: "{{ hugo_settings.git_commit }}" + version: "{{ hugo_git_commit }}" - name: Create hugo site build directory. ansible.builtin.file: