Fixing the blender.org blocking Python http lib issue
This commit is contained in:
+26
-10
@@ -1,19 +1,28 @@
|
|||||||
{% from "blender/map.jinja" import blender with context %}
|
{% 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:
|
blender_extract_tarball:
|
||||||
archive.extracted:
|
archive.extracted:
|
||||||
- name: {{ blender.archive_dir }}
|
- name: {{ blender.archive_dir }}
|
||||||
- source: {{ blender.download_url }}
|
- source: /var/tmp/blender-{{ blender.version }}-linux-x64.tar.xz
|
||||||
- skip_verify: True
|
|
||||||
- enforce_ownership_on: {{ blender.archive_dir }}
|
- enforce_ownership_on: {{ blender.archive_dir }}
|
||||||
- options: '--strip-components=1'
|
- options: '--strip-components=1'
|
||||||
- if_missing: {{ blender.archive_dir }}/blender
|
- if_missing: {{ blender.archive_dir }}/blender
|
||||||
# Pass a modern browser User-Agent to bypass CDN bot filters
|
- require:
|
||||||
- http_headers:
|
- file: blender_download_tarball
|
||||||
User-Agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
|
|
||||||
|
|
||||||
# 2. Maintain generic symlink pointing to active version
|
# 3. Maintain generic symlink pointing to active version
|
||||||
blender_opt_symlink:
|
blender_opt_symlink:
|
||||||
file.symlink:
|
file.symlink:
|
||||||
- name: {{ blender.symlink_dir }}
|
- name: {{ blender.symlink_dir }}
|
||||||
@@ -22,7 +31,7 @@ blender_opt_symlink:
|
|||||||
- require:
|
- require:
|
||||||
- archive: blender_extract_tarball
|
- archive: blender_extract_tarball
|
||||||
|
|
||||||
# 3. Create CLI launcher symlink
|
# 4. Create CLI launcher symlink
|
||||||
blender_bin_symlink:
|
blender_bin_symlink:
|
||||||
file.symlink:
|
file.symlink:
|
||||||
- name: {{ blender.bin_dir }}/blender
|
- name: {{ blender.bin_dir }}/blender
|
||||||
@@ -31,7 +40,7 @@ blender_bin_symlink:
|
|||||||
- require:
|
- require:
|
||||||
- file: blender_opt_symlink
|
- file: blender_opt_symlink
|
||||||
|
|
||||||
# 4. Deploy desktop menu shortcut
|
# 5. Deploy desktop menu shortcut
|
||||||
blender_desktop_entry:
|
blender_desktop_entry:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ blender.desktop_dir }}/blender.desktop
|
- name: {{ blender.desktop_dir }}/blender.desktop
|
||||||
@@ -45,4 +54,11 @@ blender_desktop_entry:
|
|||||||
exec_path: "{{ blender.symlink_dir }}/blender %f"
|
exec_path: "{{ blender.symlink_dir }}/blender %f"
|
||||||
icon_path: "{{ blender.symlink_dir }}/blender.svg"
|
icon_path: "{{ blender.symlink_dir }}/blender.svg"
|
||||||
- require:
|
- require:
|
||||||
- file: blender_opt_symlink
|
- 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