matschaffer / knife-solo

DEPRECATED: Please consider using https://knife-zero.github.io/, ansible, or visit https://www.chef.io/ for other ideas
MIT License
786 stars 213 forks source link

knife solo cook doesnt find chef installed by knife solo prepare #542

Closed aep closed 3 years ago

aep commented 3 years ago

the package installed by solo prepare ( chef/now 16.10.17-1 amd64 ) installs the chef binary to /opt/chef/bin, which is not in PATH.

but even after adding it to PATH using /etc/profile , it won't find it, likely knife isnt using a n interactive shell so i tried adding it to bashrc (dangerous) but that also wont work

the next problem is that the awk is wrong because --version says "Chef Infra Client: 16.10.17" while awk matches "Chef:"

this is Ubuntu 20.10

$ knife solo prepare root@46.4.72__
Bootstrapping Chef...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 23393  100 23393    0     0  25262      0 --:--:-- --:--:-- --:--:-- 25235
ubuntu 20.10 x86_64
Getting information for chef stable 16.10.17 for ubuntu...
downloading https://omnitruck-direct.chef.io/stable/chef/metadata?v=16.10.17&p=ubuntu&pv=20.10&m=x86_64
  to file /tmp/install.sh.7015/metadata.txt
trying wget...
sha1    32516ce8fe7ba09ea96d1e32e7f64087338a3b48
sha256  156057bb0a39b73a9abc2ea940b38210dcf02da4a1b5a461bff3e714a290cc02
url https://packages.chef.io/files/stable/chef/16.10.17/ubuntu/20.04/chef_16.10.17-1_amd64.deb
version 16.10.17
downloaded metadata file looks valid...
downloading https://packages.chef.io/files/stable/chef/16.10.17/ubuntu/20.04/chef_16.10.17-1_amd64.deb
  to file /tmp/install.sh.7015/chef_16.10.17-1_amd64.deb
trying wget...
Comparing checksum with sha256sum...
Installing chef 16.10.17
installing with dpkg...
(Reading database ... 63434 files and directories currently installed.)
Preparing to unpack .../chef_16.10.17-1_amd64.deb ...
removing /opt/chef...
Unpacking chef (16.10.17-1) over (16.10.17-1) ...
Setting up chef (16.10.17-1) ...
Thank you for installing Chef Infra Client! For help getting started visit https://learn.chef.io
ssh  root@46.4._ which chef-solo
/opt/chef/bin//chef-solo
knife solo cook root@46.4.__
Running Chef on 46.4.__...
Checking Chef version...
ERROR: RuntimeError: Couldn't find Chef >=0.10.4 on 46.4.__. Please run `knife solo prepare root@46.4.__` to ensure Chef is installed and up to date.
matschaffer commented 3 years ago

I suspect the version output of chef has changed since 0.10 and the knife solo code doesn’t know how to parse it.

This gem is deprecated so I don’t intend to fix it. If you’re interested in taking over maintenance let me know.

aep commented 3 years ago

yeah that makes sense.

btw switching to ansible was what i really should have done. It uses this workflow out of the box without external hacks

matschaffer commented 3 years ago

Good move 👍