요리사 노드를 만들기 위해 Vagrant를 사용 중이며 이미지를 회전시킨 다음 초기 chef-client 실행이 실패합니다. 내가 기계에 ssh 때 /etc/chef/client.pem
을 삭제하고 sudo chef-client
를 다시 실행하면 성공하지만 runr_list가 없으면 방랑에서 전달됩니다.요리사 노드에서 잘못된 client.pem을 생성 한 Vagrant (내 생각)
1) Vagrantfile은 상자 포장 :이 내 Vagrantfiles이
$ vagrant up
Bringing machine 'default' up with 'vsphere' provider...
==> default: Calling vSphere CloneVM with the following settings:
==> default: -- Template VM: myOrg/vm/myFolder/vagrantchefnode
==> default: -- Target VM: myOrg/vm/myFolder/test2
==> default: Waiting for SSH to become available...
==> default: New virtual machine successfully cloned and started
==> default: Rsyncing folder: /home/user/.vagrant.d/boxes/test2/ => /vagrant
==> default: Running provisioner: chef_client...
==> default: Creating folder to hold client key...
==> default: Uploading chef client validation key...
Generating chef JSON and uploading...
==> default: Running chef-client...
==> default: stdin: is not a tty
==> default: [2014-10-02T16:11:19-05:00] INFO: Forking chef instance to converge...
==> default: [2014-10-02T16:11:19-05:00] INFO: *** Chef 11.16.2 ***
==> default: [2014-10-02T16:11:19-05:00] INFO: Chef-client pid: 6080
==> default: [2014-10-02T16:11:21-05:00] INFO: HTTP Request Returned 401 Unauthorized: error
==> default: Failed to authenticate to the chef server (http 401).
==> default: Failed to authenticate as 'test2'. Ensure that your node_name and client key are correct.
==> default: chef_server_url "https://server.myorg.com"
==> default: node_name "test2"
==> default: client_key "/etc/chef/client.pem"
:이 같은 실패는 모습입니다
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.provider :vsphere do |vsphere|
vsphere.host = 'vsphereserver.myorg.com'
vsphere.compute_resource_name = 'TestDev'
vsphere.user = 'vagrantadmin'
vsphere.password = 'password'
vsphere.insecure = true
end
config.ssh.username = 'auto'
config.ssh.private_key_path = '~/.vagrant.d/id_rsa'
end
2) 내 집에 Vagrantfile 디렉토리 (~/.vagrant.d) :
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = 'vsphere'
config.vm.provider :vsphere do |vsphere|
vsphere.template_name = 'vagrantchefnode'
end
config.vm.provision "chef_client", id: "chef" do |chef|
chef.provisioning_path = "/etc/chef"
chef.chef_server_url = "https://chefserver.myorg.com"
chef.validation_key_path = "/home/user/.vagrant.d/chef/validation.pem"
# chef.client_key_path = "/etc/chef/client.pem"
chef.validation_client_name = "chef-validator"
chef.custom_config_path = "/home/user/.vagrant.d/Vagrantfile.chef"
chef.delete_node = true
chef.delete_client = true
chef.add_role "base"
end
end
3) Vagrantfile 프로젝트 디렉토리 (~/.vagrant.d/박스/chefnode1)에서 :
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.provider :vsphere do |vsphere|
# vsphere.template_name = 'chefnode'
vsphere.customization_spec_name = 'test2'
vsphere.name = 'test2'
end
config.vm.provision "chef_client", id: "chef" do |chef|
chef.node_name = "test2"
chef.add_role "dev"
end
end
내가 더 효과가 두 번째 Vagrantfile에서 chef.client_key_path을 밖으로 주석을 시도했습니다. 이것은 하나의 Vagrantfile에 모두 들어있을 때 잘 작동하는 것처럼 보였지만 모든 설정을 각 Vagrantfile에 복사하지 않고 여러 컴퓨터를 실행하려고합니다.
아무도 원한다면 --debug 태그가있는 전체 로그가 있습니다. 당신의 기본 이미지가 인증에 실패 장소에 이미 /etc/chef/client.pem
파일을 가지고 같은
빈 실행 목록은 실패했기 때문에 생각했습니다. 그러나 나는 이미베이스 이미지에서 client.pem을 삭제했다는 것을 알았습니다. 내일 인터넷 관리자가 다시 열어서 확인할 수 있도록 기다려야 할 것입니다. – Zook
당신이 옳은 것 같아요, 나는 '부정한 업 - 노 - 프로비저닝'을 실행했고 실제로 컴퓨터에 '클라이언트 .pem'이 있습니다. 내일 해킹 할거야. – Zook