[chef] Re: RE: Re: Chef Role and integration


Chronological Thread 
  • From: Santhosh < >
  • To:
  • Subject: [chef] Re: RE: Re: Chef Role and integration
  • Date: Tue, 01 Jul 2014 08:41:24 +0530

By attribute “roles” do you mean the attributes(override) in your role you mentioned in your previous email.? ([aerohive_webapp][wars_array][hm-webapp.war][..])

If yes, I had a similar case and I used the -j option. (painful).
you can create a .json file and pass it to chef-client (chef-client -j hotfix.json). In the json file you can mention only the roles/recipes  you want to update, as well as the attributes. It's as good as editing your role file, but helps for a quick fix.

let me know

Santhosh
On 6/30/2014 12:29 PM, Mingfei Hua wrote:
" type="cite">

Hi Danjib,

If I use “-o” in chef-client, Not only the run list, but also the attribute “roles” in chef server be overwritten.  The integration which depend on attribute “roles” may broken.

 

Regards,

Mingfei

 

From: Ranjib Dey [ ">mailto: ]
Sent: 2014
629 15:38
To: ">
Subject: [chef] Re: Chef Role and integration

 

if you invoke chef-client with -o , the override option, it should not save the node data back (iirc). you have to check no recipes or other code does not use node.save explicitly ,

 

im curious why you dont want to run the complete run list (all the roles+ extra recipes), is performance (time) a concern ?

regards

ranjib

 

On Sat, Jun 28, 2014 at 11:20 PM, Mingfei Hua < " target="_blank"> > wrote:

 

 

Hello,

 

we have several roles defined for different type of servers, like DB, web, rabbitmq, redis. and the integration is depend on roles, such as how the WEB server find the DB servers. in each role, there are cookbooks or sub roles in 3 layers, there are cookbooks for system, cookbooks for install tomcat/database, cookbooks to install war packages. But in some case, I just need to run the cookbooks for system or just need to deploy the war package, the easiest way is to change the run-list, but it changes the roles attribute in chef server which integration depend on. Any tips on my issue.

 

 

A typical role definition:

{

         "name": "hmweb",

         "chef_type": "role",

         "json_class": "Chef::Role",

         "description": "for web application deployment, include hm-webapp",

         "override_attributes": {

                   "aerohive_webapp": {

                            "wars_array": {

                                     "hm-webapp.war": {

                                               "name": "hm-webapp",

                                               "url": "http://nexus-nms.aerohive.com/service/local/artifact/maven/redirect?r=hive-repository&g=com.aerohive.nms.web&a=hm-webapp&e=war&v=1.0-SNAPSHOT"

                                     },

                                     "sysmgr-regional-webapp.war": {

                                               "name": "sysmgr-regional-webapp",

                                               "url": "http://nexus-nms.aerohive.com/service/local/artifact/maven/redirect?r=hive-repository&g=com.aerohive.nms&a=sysmgr-regional-webapp&e=war&v=1.0-SNAPSHOT"

                                     }

                            },

                            "service_log_enabled": "true"

                   }

         },

         "run_list": [

             "role[_base]",

             "role[_webappbase]",

                   "recipe[aerohive-webapp::deploy]"

         ]

}

 

Sincerely,

Mingfei Hua

 

 





Archive powered by MHonArc 2.6.16.

§