Open NickVolynkin opened 7 years ago
Heh, I've overlooked the problem. I've got bsdtar
, while GNU tar
is required. So, brew install gnu-tar
solved the problem.
Still not sure if this should be handled in the role.
I think that role should be provisioned on clean macOS only with brew installed, but I don't tested it on clean macOS... So you can add brew install gnu-tar
and/or brew install fzf
to role.
It is not working because the unarchive module uses /usr/bin/tar and installing gnu-tar does not replace the symlink of tar from bsdtar to gnu-tar
@gaizeror, just replace symlink yourself.
@popstas I am new to macOS, but I get permissions denied (also with sudo)
@gaizeror, try to become root with sudo -i
I tried, so wierd root cant change symlink
I meet the same problem in my CentOS7, but I have both the /bin/gtar
and /bin/unzip
.
The odd thing was it works in my Debian9, This is both funny and annoying ……
Then I find this.
$ tar xvf /home/cupen/.ansible/tmp/ansible-tmp-1523707936.0375483-68992850281293/source
tar (child): cannot run bzip2: No such file or directory
tar (child): trying lbzip2
tar (child): lbzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
HOLY SHIT ! OK, run yum install bzip2
, then it works.
I installed manually fzf with
brew install fzf
@gaizeror Inability to edit /usr/bin on macOS is the result of SIP. Once it is disabled (requires restart & Recovery partition), you can make changes you need.
Got similar error on Ubuntu 22.04:
"msg": "Failed to find handler for \"/tmp/site.tar.gz\". Make sure the required command to extract the file is installed. Command \"/usr/bin/unzip\" could not handle archive. Command \"/usr/bin/tar\" could not handle archive."
- name: Extract site
ansible.builtin.unarchive:
src: /tmp/site.tar.gz
dest: /var/www/html
owner: root
group: root
mode: '0755'
remote_src: yes
extra_opts: "--no-same-owner --no-same-permissions -xz"
$ ansible --version
ansible 2.10.8
config file = None
configured module search path = ['/var/lib/jenkins/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0]
$ tar --version
tar (GNU tar) 1.34
$ unzip --version
caution: both -n and -o specified; ignoring -o
UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.
@kenorb , is it relative to project ansible-role-zsh?
Is it relative to project ansible-role-zsh?
It is vanilla Ansible, sorry. But the issue could be related.
To aid any future dwellers who like me landed here when looking for an answer to:
Command
/usr/bin/tar
could not handle archive: Unable to list files in the archive:/usr/bin/tar
: You may not specify more than one-Acdtrux
,--delete
or--test-label
option
In my case the cause turned out to be a mere typo in the extra_opts
resulting in a command line option that tar
didn't grok.
Similarly, I suspect that the -xz
that @kenorb included in their extra_opts
could have been the cause for failure if the xz
utility needed for this option wasn't installed.
Role fails on the "Download fzf" step, which uses the
unarchive
module.I have both
tar
andunzip
installed:OSX, zsh already installed, default playbook, run with
ansible-playbook -i 'localhost,' -c local playbook.yml
.I also doubt that
https://github.com/junegunn/fzf-bin/releases/download/0.16.8/fzf-0.16.8-linux_amd64.tgz
is the correct option for OSX, so I've opened #17. Running the playbook with--extra-vars "zsh_fzf_os={{ ansible_os_family }}"
results in using the darwin release, but doesn't fix the problem.Any ideas on how to debug this further?