通过厨师运行curl命令时出错

问题描述

使用主厨运行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正在获取我正在使用的变量的值,但它无法执行。

解决方法

由于空间问题,我正面临这一问题。现在我解决了