使用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正在获取我正在使用的变量的值,但它无法执行。
1条答案
按热度按时间rhfm7lfc1#
由于空间问题,我正面临着这个问题。现在我解决了它