I have a curl command which is soap request and with headers like basic auth. I need to implement this curl in Chef recipe for automation.So that every time i execute the chef script ,i see this curl being executed too. Please advice me with a syntax for adding curl command in the chef script.
Couldn't you do this using the http_request resource?
Something like:
http_request 'SOAP request' do
url "http://www.example.com/example"
message <xml request>
action :post
end
You can use bash commands in a chef recipe
bash 'install_something' do
user 'root'
cwd '/tmp'
code <<-EOH
wget http://www.example.com/tarball.tar.gz
tar -zxf tarball.tar.gz
cd tarball
./configure
make
make install
EOH
end
Have this example from here: https://docs.chef.io/resource_bash.html. Just call you curl command. Keep in mind that this is not the real Chef way. The bash resource should only be used if there is no other escape.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With