Basically, based on my findings, this problem can occur in two different scenarios:
When you're running the kitchen converge
. This can be solved very easily by adding a piece of code inside the kitchen.yml
as
provisioner:
client_rb:
chef_license: accept
When you're running the knife bootstrap
, this can be a little bit of extra work. This page explains all that needs to be done. Inside the .chef
directory.
> mkdir bootstrap
> cd bootstrap && touch template.erb
> find /opt/chefdk/embedded/lib/ruby -type f -name chef-full.erb -exec cat {} ; > template.erb
Find the line that part that says
cat > /etc/chef/client.rb <<'EOP
<%= config_content %>
EOP
and replace it with
cat > /etc/chef/client.rb <<'EOP'
<%= config_content %>
chef_license "accept"
EOP
Next, run the command knife bootstrap <host> --ssh-user '<username>' -i <my-identity>.pem --sudo --use-sudo-password --node-name <node-name> --boostrap-template "template" --run-list 'recipe[<cookbook-name>::default]'
. That took care of it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…