My Client.rb file looking like mention below
On Node
cat client.rb
log_level :info
log_location STDOUT
chef_server_url "https://chef.my.com:443"
validation_client_name "mychef-validator"
environment "Rd-Staging"
and environment "Rd-Staging" have mention below information.
On Chef-workstation:
knife environment show Rd-Staging
chef_type: environment
cookbook_versions:
apache-yum: = 0.1.0
default_attributes:
description: Rd-Staging
json_class: Chef::Environment
name: Rd-Staging
override_attributes:
After that whenever I am hitting chef-client form node. Node is not compiling any cookbook while I am hitting the same chef-client from Chef-workstation its compiling same cookbook on same node.
Any how is that possible to assign recipes/roles through client.rb. I am trying to achieve whenever node come up it will enroll under particular environment then run environment dedicated recipes. Please keep that in mind i can not change first-boot.json because at that time in need to create multiple first-boot.json for different projects.