簡體   English   中英

通過廚師運行 curl 命令時出錯

[英]Getting error while running curl command via chef

使用廚師運行 curl 命令時出錯。 我試圖執行的塊:

bash 'create_aemadmin' do
  code <<-EOF
    curl -u admin:admin -FcreateUser=aemadmin -FauthorizableId=aemadmin -Frep:password=#{node['aem_vm_cookbook']['aem_api_auth']['password']} -Fprofile/familyName=aemadmin http://#{node['aem_vm_cookbook']['host_name']}:8080/libs/granite/security/post/authorizables
  EOF
    not_if { File.exist?('/home/aemadmin/dce/aemadminusercreate') }
  end

我為此得到的錯誤:

/bin/chef-client:162:in `<main>'
[2020-09-09T01:48:24-05:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: bash[create_aemadmin] (aem_vm_cookbook::default line 455) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
---- Begin output of "bash"  "/tmp/chef-script20200909-12267-2dd1ke" ----
STDOUT: 
STDERR: curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
---- End output of "bash"  "/tmp/chef-script20200909-12267-2dd1ke" ----
Ran "bash"  "/tmp/chef-script20200909-12267-2dd1ke" returned 2

使用此塊,我正在嘗試創建一個用戶,我可以看到 curl 正在獲取我正在使用但無法執行的變量的值。

由於空間問題,我正面臨這個問題。 現在我解決了

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM