From 162342995b854f4af109dd066bee07cacadd6255 Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Mon, 10 Aug 2026 06:04:55 -0400 Subject: [PATCH] Fixing the blender.org blocking Python http lib issue --- blender/init.sls | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/blender/init.sls b/blender/init.sls index 3111c58..8c27e8d 100644 --- a/blender/init.sls +++ b/blender/init.sls @@ -1,19 +1,28 @@ {% from "blender/map.jinja" import blender with context %} -# 1. Download and extract directly from download.blender.org +# 1. Download tarball to minion's local cache/tmp directory with custom User-Agent +blender_download_tarball: + file.managed: + - name: /var/tmp/blender-{{ blender.version }}-linux-x64.tar.xz + - source: {{ blender.download_url }} + - skip_verify: True + - http_headers: + User-Agent: 'Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0' + - unless: + - test -d {{ blender.archive_dir }} + +# 2. Extract from local file system blender_extract_tarball: archive.extracted: - name: {{ blender.archive_dir }} - - source: {{ blender.download_url }} - - skip_verify: True + - source: /var/tmp/blender-{{ blender.version }}-linux-x64.tar.xz - enforce_ownership_on: {{ blender.archive_dir }} - options: '--strip-components=1' - if_missing: {{ blender.archive_dir }}/blender - # Pass a modern browser User-Agent to bypass CDN bot filters - - http_headers: - User-Agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36' + - require: + - file: blender_download_tarball -# 2. Maintain generic symlink pointing to active version +# 3. Maintain generic symlink pointing to active version blender_opt_symlink: file.symlink: - name: {{ blender.symlink_dir }} @@ -22,7 +31,7 @@ blender_opt_symlink: - require: - archive: blender_extract_tarball -# 3. Create CLI launcher symlink +# 4. Create CLI launcher symlink blender_bin_symlink: file.symlink: - name: {{ blender.bin_dir }}/blender @@ -31,7 +40,7 @@ blender_bin_symlink: - require: - file: blender_opt_symlink -# 4. Deploy desktop menu shortcut +# 5. Deploy desktop menu shortcut blender_desktop_entry: file.managed: - name: {{ blender.desktop_dir }}/blender.desktop @@ -45,4 +54,11 @@ blender_desktop_entry: exec_path: "{{ blender.symlink_dir }}/blender %f" icon_path: "{{ blender.symlink_dir }}/blender.svg" - require: - - file: blender_opt_symlink \ No newline at end of file + - file: blender_opt_symlink + +# 6. Optional: Clean up cached tarball after extraction +blender_cleanup_tarball: + file.absent: + - name: /var/tmp/blender-{{ blender.version }}-linux-x64.tar.xz + - require: + - archive: blender_extract_tarball \ No newline at end of file