代码之家  ›  专栏  ›  技术社区  ›  Stefan R.

在macOS 10.13上设置Chef Push Jobs客户端有什么建议吗?

  •  0
  • Stefan R.  · 技术社区  · 6 年前

    我正在尝试在macOS 10.13节点上设置chef push jobs客户端。

    以下是我目前所做的:

    • 已从安装macOS推送作业客户端 Chef Downloads
    • 创建了名为push jobs client的配置文件。看起来像这样的rb:

      chef_server_url   'https://chef.XXXXX.com/organizations/XXXXX'
      node_name         'default-macos-1013'
      client_key        '/opt/chef/embedded/ssl/cert.pem'
      trusted_certs_dir '/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/spec/data/trusted_certs'
      verify_api_cert   true
      ssl_verify_mode   :verify_peer
      allow_unencrypted true
      log_level         :info
      log_location      STDOUT
      
      whitelist({"chef-client"=>"chef-client"})
      
      Mixlib::Log::Formatter.show_time = false
      
    • 运行此命令:

      /usr/local/bin/pushy-client -c push-jobs-client.rb
      

    错误消息:

    /opt/push-jobs-client/embedded/lib/ruby/gems/2.4.0/gems/opscode-pushy-client-2.4.8/lib/pushy_-client。rb:236:英寸 `get\u config中的rescue:无法下载推送作业配置 (运行时错误)

    日志:

    INFO: [jenkins03] Setting reconfigure deadline to 2018-05-04 12:05:31
    +0200
    INFO: [jenkins03] using config file path: '/opt/push-jobs-client/push-jobs-client.rb'
    INFO: [jenkins03] Using node name: jenkins03 
    INFO: [jenkins03] Using org name: XXXXX 
    INFO: [jenkins03] Using Chef server: https://chef.XXXXX.com/organizations/XXXXX 
    INFO: [jenkins03] Using private key: /opt/chef/embedded/ssl/cert.pem 
    INFO: [jenkins03] Incarnation ID: 633f168d-c8c0-469e-a9c0-8d6658b3b3d5 
    INFO: [jenkins03] Allowing fallback to unencrypted connection: true 
    INFO: [jenkins03] Starting client ... 
    INFO: [jenkins03] Retrieving configuration from https://chef.XXXXX.com/organizations/XXXXX//pushy/config/jenkins03: ... 
    INFO: Could not download push jobs config
    

    因此,连接和身份验证看起来很成功,但由于某些原因,推送作业客户端无法从服务器检索配置。

    我试图直接在节点上的浏览器中手动从日志中转到URL,我在浏览器窗口中看到了这一点:

    {"error":["missing required authentication header(s) 'X-Ops-UserId', 'X-Ops-Timestamp', 'X-Ops-Sign', 'X-Ops-Content-Hash'"]}
    

    所以我想知道我在配置上是否做错了什么?或者它可能是macOS推送作业客户端中的一个bug?

    1 回复  |  直到 6 年前
        1
  •  0
  •   Stefan R.    6 年前

    我发现位于/opt/chef/embedded/ssl/cert.pem的client\u密钥不是由chef服务器签名的cient\u密钥。在/etc/chef/client中找到了正确的客户端密钥。pem公司

    现在一切都正常了,但我会把答案留在这里,以防其他人有类似的问题。