Fixing the blender.org blocking Python http lib issue
This commit is contained in:
+25
-9
@@ -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
|
||||
@@ -46,3 +55,10 @@ blender_desktop_entry:
|
||||
icon_path: "{{ blender.symlink_dir }}/blender.svg"
|
||||
- require:
|
||||
- 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
|
||||
Reference in New Issue
Block a user