Hi All.
I very recently started using chef. I did my training through Linux Academy.
I am nowhere near an expert but I'm getting a strange error is a simple package resource.
In my recipe
if node['platform'] == "ubuntu" || node['platform_family'] == "rhel"
%w{iptraf vim } .each do |pkg|
package pkg do
action :upgrade
end
end
end
My error when i try bootsstrap with the following command is
sudo knife bootstrap ip -N nodename --ssh-user donovan --sudo -r 'recipe[base::default]'
Recipe: base::default
-
execute[apt-get-update-periodic] action run (skipped due to only_if)
-
execute[apt-get-update-periodic2] action run (skipped due to not_if)
-
apt_package[htop] action upgrade (up to date)
-
apt_package[aptitude] action upgrade (up to date)
-
apt_package[iptraf] action upgrade (up to date)
-
apt_package[vim] action upgrade
================================================================================
Error executing actionupgrade
on resource 'apt_package[vim]'ArgumentError
Malformed version number string 2:7.4.1689-3ubuntu1
Resource Declaration:
In /var/chef/cache/cookbooks/base/recipes/default.rb
57: package pkg do
58: action :upgrade
59: end
60: endCompiled Resource:
Declared in /var/chef/cache/cookbooks/base/recipes/default.rb:57:in `block in from_file'
apt_package("vim") do
package_name "vim"
action [:upgrade]
default_guard_interpreter :default
declared_type :package
cookbook_name "base"
recipe_name "default"
endSystem Info:
chef_version=13.6.0
platform=ubuntu
platform_version=16.04
ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
program_name=chef-client worker: ppid=2095;start=18:47:24;
executable=/opt/chef/bin/chef-client`
If i SSH to the server and run apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libpython3.5 vim-common vim-runtime vim-tiny
Suggested packages:
ctags vim-doc vim-scripts vim-gnome-py2 | vim-gtk-py2 | vim-gtk3-py2 | vim-athena-py2 | vim-nox-py2 indent
The following NEW packages will be installed:
libpython3.5
The following packages will be upgraded:
vim vim-common vim-runtime vim-tiny
4 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 8,108 kB of archives.
After this operation, 4,706 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://za.archive.ubuntu.com/ubuntu xenial-updates/main amd64 vim amd64 2:7.4.1689-3ubuntu1.2 [1,036 kB]
Get:2 http://za.archive.ubuntu.com/ubuntu xenial-updates/main amd64 vim-tiny amd64 2:7.4.1689-3ubuntu1.2 [445 kB]
Any help would be great.
this is not the only package giving me this error.
am i doing something wrong