Beispiel #1
0
def operation(ctx, **kwargs):

    if 'runlist' in ctx.properties['chef_config']:
        ctx.logger.info("Using explicitly provided Chef runlist")
        runlist = ctx.properties['chef_config']['runlist']
    else:
        op = _extract_op(ctx)
        if op not in ctx.properties['chef_config']['runlists']:
            ctx.logger.warn("No Chef runlist for operation {0}".format(op))
        ctx.logger.info("Using Chef runlist for operation {0}".format(op))
        runlist = ctx.properties['chef_config']['runlists'].get(op)

    if isinstance(runlist, list):
        runlist = ','.join(runlist)

    ctx.logger.info("Chef runlist: {0}".format(runlist))
    run_chef(ctx, runlist)
def operation(ctx, **kwargs):

    if 'runlist' in ctx.properties['chef_config']:
        ctx.logger.info("Using explicitly provided Chef runlist")
        runlist = ctx.properties['chef_config']['runlist']
    else:
        op = _extract_op(ctx)
        if op not in ctx.properties['chef_config']['runlists']:
            ctx.logger.warn("No Chef runlist for operation {0}".format(op))
        ctx.logger.info("Using Chef runlist for operation {0}".format(op))
        runlist = ctx.properties['chef_config']['runlists'].get(op)

    if isinstance(runlist, list):
        runlist = ','.join(runlist)

    ctx.logger.info("Chef runlist: {0}".format(runlist))
    run_chef(ctx, runlist)
Beispiel #3
0
def operation(ctx, **kwargs):
    if ctx.type == context.NODE_INSTANCE:
        properties = ctx.node.properties
    else:
        properties = ctx.source.node.properties

    if 'runlist' in properties['chef_config']:
        ctx.logger.info("Using explicitly provided Chef runlist")
        runlist = properties['chef_config']['runlist']
    else:
        op = _extract_op(ctx)
        if op not in properties['chef_config']['runlists']:
            ctx.logger.warn("No Chef runlist for operation {0}".format(op))
        ctx.logger.info("Using Chef runlist for operation {0}".format(op))
        runlist = properties['chef_config']['runlists'].get(op)

    if isinstance(runlist, list):
        runlist = ','.join(runlist)

    ctx.logger.info("Chef runlist: {0}".format(runlist))
    run_chef(ctx, runlist)
Beispiel #4
0
def operation(ctx, **kwargs):
    if ctx.type == context.NODE_INSTANCE:
        properties = ctx.node.properties
    else:
        properties = ctx.source.node.properties

    if 'runlist' in properties['chef_config']:
        ctx.logger.info("Using explicitly provided Chef runlist")
        runlist = properties['chef_config']['runlist']
    else:
        op = _extract_op(ctx)
        if op not in properties['chef_config']['runlists']:
            ctx.logger.warn("No Chef runlist for operation {0}".format(op))
        ctx.logger.info("Using Chef runlist for operation {0}".format(op))
        runlist = properties['chef_config']['runlists'].get(op)

    if isinstance(runlist, list):
        runlist = ','.join(runlist)

    ctx.logger.info("Chef runlist: {0}".format(runlist))
    run_chef(ctx, runlist)