Create new node json with recipes list

This commit is contained in:
Mike Scherbakov 2012-06-06 16:52:45 +04:00
parent 791d5ca1f5
commit e8be159d3c

View File

@ -40,8 +40,11 @@ def create_chef_config(cluster_id, callback=None):
# Extend solo_json for each node by specifying role
# assignment for this particular node
for n in nodes:
solo_json['run_list'] = \
["role[" + x.name + "]" for x in n.roles.all()]
solo_json['run_list'] = []
for role in n.roles.all():
for rcp in role.recipes.all():
solo_json['run_list'] += ["recipe[%s]" % rcp.recipe]
solo_json['all_roles'] = nodes_per_role
filepath = os.path.join(settings.CHEF_CONF_FOLDER,