Google gn的主页指定二进制下载链接https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/latest。我尝试使用 Ansibleunarchive
下载、解压和安装这个 zip 存档:
- name: Unpack gn Ninja meta-build for Android and ChromeOS into /usr/bin/
become: yes
unarchive:
src: https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/latest
remote_src: yes
exclude: .cipdpkg
dest: /usr/bin
mode: 0755
Ansible 似乎检测到这是一个 zip 存档,但给出了错误:
An exception occurred during task execution. To see the full traceback, use -vvv.
The error was: ValueError: time data '19800000.000000' does not match format '%Y%m%d.%H%M%S'
fatal: [127.0.0.1]: FAILED! => changed=false
module_stderr: |-
Traceback (most recent call last):
File "/home/johnm/.ansible/tmp/ansible-tmp-1579394036.8322327-49836510689463/AnsiballZ_unarchive.py", line 102, in <module>
_ansiballz_main()
File "/home/johnm/.ansible/tmp/ansible-tmp-1579394036.8322327-49836510689463/AnsiballZ_unarchive.py", line 94, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/johnm/.ansible/tmp/ansible-tmp-1579394036.8322327-49836510689463/AnsiballZ_unarchive.py", line 40, in invoke_module
runpy.run_module(mod_name='ansible.modules.files.unarchive', init_globals=None, run_name='__main__', alter_sys=True)
File "/usr/lib/python3.6/runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmp/ansible_unarchive_payload_3ij5ij4p/ansible_unarchive_payload.zip/ansible/modules/files/unarchive.py", line 913, in <module>
File "/tmp/ansible_unarchive_payload_3ij5ij4p/ansible_unarchive_payload.zip/ansible/modules/files/unarchive.py", line 871, in main
File "/tmp/ansible_unarchive_payload_3ij5ij4p/ansible_unarchive_payload.zip/ansible/modules/files/unarchive.py", line 478, in is_unarchived
File "/usr/lib/python3.6/_strptime.py", line 559, in _strptime_time
tt = _strptime(data_string, format)[0]
File "/usr/lib/python3.6/_strptime.py", line 362, in _strptime
(data_string, format))
ValueError: time data '19800000.000000' does not match format '%Y%m%d.%H%M%S'
module_stdout: ''
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
rc: 1
使用 Python 2.7 也同样失败。
如何下载和安装此 zip 存档?