2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

chef-clientのダウングレード

Last updated at Posted at 2017-04-12

前置き

  • Chef-Server11を使っているのだが、最近のOSでデフォルトで入るknifeだとエラーになるようになった
    • amazon linuxやCentOSで
    • Chef-client 13系以上がだめで、12系なら問題なし
    • あるいは、レシピの書き方によってもchef-client を古い目にしたいときがある
FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
ERROR: undefined method `inject' for nil:NilClass
FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

あるいは
Running handlers:
[2018-05-01T07:36:25+00:00] ERROR: Running exception handlers
Running handlers complete
[2018-05-01T07:36:25+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources would have been updated
[2018-05-01T07:36:25+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2018-05-01T07:36:25+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-05-01T07:36:25+00:00] FATAL: NoMethodError: undefined method `supports' for Chef::Resource::User::LinuxUser
など出る

解決

https://downloads.chef.io/
でChef-Client12.Xを選んでダウンロード

# knife -v
Chef: 13.7.16
# yum remove chef
# cd /usr/local/src
適当なディレクトリでよい
# wget https://packages.chef.io/files/stable/chef/12.22.5/el/7/chef-12.22.5-1.el7.x86_64.rpm 
# rpm -ivh chef-12.22.5-1.el7.x86_64.rpm
# knife -v
Chef: 12.22.5

とりあえずよかった

懸念点など

  • Chef-Serverをバージョンアップすればいいのだが、そもそChefやめてAWSの機能や、Ansibleに置き換え中なのでこのような対応になった
    • サーバ使い捨てデプロイを導入していくので、構成管理手法も変えざるを得ない
2
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?