Parameterising node relationships using Chef -
i have group of servers perform specific roles dependencies between them i.e.
web server -> application server -> database server
i have chef cookbooks can build nodes roles. generating each node's hosts file using chef , using hosted chef server. far good. can't quite grips how flexibly represent relationships between nodes different roles.
by flexibly mean in development may have 1 node fulfils 3 roles, whereas in staging , production environments they'd separated out @ least 1 node per role.
it's not clear me how parameterise generation of hosts files accommodate requirement. how other people tackling issue?
thanks in advance.
do have chef-server setup/hosted chef?
chef runs tool called ohai
on each converge collects information node (e.g. ip addresses, interfaces, storage, package data) , writes node
object. when converge finished, chef-client upload node object data chef-server stored , available search other nodes/clients:
manual: http://docs.chef.io/chef_search.html
depending on how have split stages, e.g. using different chef environments, use tags or custom logic, can dynamically build /etc/hosts
file, reconfigure load balancers , firewall rules using search. example: https://serverfault.com/questions/412127/chef-recipe-read-attributes-from-another-node
if not using chef-server based setup, not possible. have manually "describe" infrastructure/topology, e.g. inside data bag or attributes.
Comments
Post a Comment