How can I bootstrap the run list of a node in chef server with one of the predefined roles, when the node is created dynamically (not using knife)?
Cloudify installs the node (an ubuntu image with chef client) and starts chef client, which registers with chef server. A new node and client is created in chef server, but the node's run list is empty. I want to populate the run list with mongo role so that MongoDB is installed on the node and configured. If I manually create the node in the chef server with mongo role in run list before running the cloudify process, then mongo is installed and everything is fine. However, this is not an option though because of autoscaling and other requirements. So how can we automate creating a node in chef server with role in run list?
- Chef server is configured with cookbooks and roles. One of these roles is mongo, whose runlist has recipes to install and configure MongoDB.
- Cloudify installs chef client on a ubuntu image. This is the node.
/etc/chef/client.rb file has following:
log_level :debug log_locaiton "/var/log/chef/client.log" ssl_verification_mode :verify_none chef_server_url "htts://chefserver/organizations/orgname" verify_api_cert false node_name SOME_GUID