Have you ever wanted orchestrate nodes, roles, data bags, attributes, etc. on a Chef Server? Give this plugin and package a try! Try the official Chef Plugin for vRealize Orchestrator !
See the attached pdf for a workflow listing and documentation of the workflows in this package:
This solution interfaces directly with the Chef Server REST API. Works with all three variations of Chef (Open Source, Private, Hosted).
Workflows that interact with the guest OS for Chef-Client first run use either SSH or VMtools with workflows from: Guest script manager package
The plugin helps with signing the authentication headers as required by the Chef API. The rest of this solution is pure vCO JavaScript.
Dependencies: HTTP-REST Plugin.
To install: The attached zip contains 2 files:
To get running, simply run the Library/Chef/Add Chef Server workflow. This workflow will create the REST Host and store your private key per chefHostname and userid. Use the same chefHostname and userid in any other workflow. The orgName input is optional but required if you are using private or hosted chef.
The chefHostname input is the name of the REST host the workflows will use.
UPDATES:
Brilliant. All working nicely when you know what it's doing! Although, if you ever come to refresh this, I am finding that when registering a new node in Chef using the Register Node workflow, the workflow ends successfully even if the Chef client doesn't actually deploy successfully. The issue I have personally faced that brought this to light is the end-point node can't resolve the chef server hostname in DNS. Obviously, it's an easy fix, but it'd be nice if there was some way of throwing an exception instead of being successful.
That said though, I am new to both Chef and vCO, and to have an incredibly easy way of linking the two and have it all just work out of the box has saved me probably weeks of headaches. Thank you!
Thanks for the feedback! Good test case to check with. I'll check what the expected return codes are for chef-client and make sure they are captured correctly via SSH in vCO.
This is an amazing help to us.
Before this we were shelling out and running knife commands via VCO.
This should allow us to do a lot more.
One bit of feedback.
There is no "Config" section of the workflows.
I did as you said and imported my pem key. Then I ran the "Get Clients" workflow to see how it works.
And the workflow requires an organization.
Since I'm running open source chef that didn't work for me.
Typing in opensource didn't help either.
So, I dug through your presentation tab and realized that the rest-host needs to be flagged with opensource=true
I had no clue how to do that... I finally stumbled across your "Toggle Debug Logging" workflow and saw it needs to be done inside a scriptable task.
So I decided to write a workflow that handles this and wraps a few of your own workflows together.
I named this workflow "Add Chef Server" and it lives in {VCOServer}/Chef Configuration/
Here is a link where you can download the workflow package: http://www.codyhill.co/vco/vco-chef-config.zip
And here is a link to the workflow documentation: http://www.codyhill.co/vco/Add-Chef-Server.2015-02-20.pdf
The workflow does the following:
Imports the SSL cert for your chef-server.
Adds your chef server as a rest-host.
Saves your chef server, chef user, & chef user private key as a configuration element
Asks whether or not to add the debug flag to the chef server.
Asks whether or not to add the open source flag to the chef server.
Asks whether or not a proxy is needed to connect to the chef server, and then configures the proxy if needed.
This is my first public workflow. Please be gentle.
I hope this helps someone else.
Thank you,
Cody Hill
Glad you found this valuable Cody!
The idea behind how I designed this is that is would configure / create the REST hosts on the fly. This might be tricky with opensource hosts now on the latest update as you have found. The first workflow run may fail, but subsequent runs once the REST host is defined should hide the orgName input in the presentation.
I didn't account for proxy usage, so your config workflow is a great idea.
I'm trying to use this plugin + Chef OpenSource 12.2.0-1 and the /clients URL is not working. Can you confirm if the plugin is compatible with that version of Chef OpenSource?
Greets!
Running Get Cookbooks and Get Organizations (the workflows i've tried so far) I keep getting the error "ReferenceError: "ChefAuthUtil" is not defined. (Dynamic Script Module name : executeRequest#52) - chef.example.com"
Turns out i forgot to restart the vRO service after installing the .dar via vRO configuration. Leaving this here in case someone else does the same thing.