ip - chef new web node recipe -


i'm chef newbie , working on "new web node" recipe creates server scratch , many things until reaches required state. got part right , far good, need task , here's confused in using chef it. whenever create new web node, need edit php .conf file on server adding new web node's ip address variable string on php conf file.

this how things:

 # knife rackspace server create --server-name chef-node1 --node-name chef-node1 --flavor performance1-2 --image 042395fc-728c-4763-86f9-9b0cacb00701 

once server created add recipe , run chef client on new node

# knife node run_list add chef-node1 recipe[new-web-node::default] # knife ssh -a ipaddress 'name:chef-node1' 'chef-client' 

my question how go editing php .conf file on other server without creating new recipe have manually run on other server? how can done in 1 go?

use search search "the other" node based on role, recipe or attribute. put ip address of other node in template creating php config file.

imagine web node has role web, code on "other" node give ip address of first web node:

web = search(:node, "role:web") ip = web.first[:ipaddress] 

this can parsed template.


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -