Exemple #1
0
def default(args, config, logger=None):
    if logger is None:
        logger = setup_custom_logger('chef-solo-cup', args)

    sync(args, config, logger=logger)
    command = ' && '.join([
        "cd {0}", "source /etc/profile",
        "`which chef-solo` -c {0}/{1} -j {0}/dna/{2} -l {3}"
    ])
    return sudo_dry(command.format(args['chef_file_dest'], args['config_path'],
                                   'default.json', args['loglevel']),
                    args,
                    logger=logger)
Exemple #2
0
def default(args, config, logger=None):
    if logger is None:
        logger = setup_custom_logger('chef-solo-cup', args)

    sync(args, config, logger=logger)
    command = ' && '.join([
        "cd {0}",
        "source /etc/profile",
        "`which chef-solo` -c {0}/{1} -j {0}/dna/{2} -l {3}"
    ])
    return sudo_dry(command.format(
        args['chef_file_dest'],
        args['config_path'],
        'default.json',
        args['loglevel']
    ), args, logger=logger)
Exemple #3
0
def update(args, config, delete_files=False, logger=None):
    if logger is None:
        logger = setup_custom_logger('chef-solo-cup', args)

    sync(args, config, logger=logger)

    command = ' && '.join([
        "cd {0}", "source /etc/profile",
        "`which chef-solo` -c {0}/{1} -j {0}/{2} -l {3}"
    ])
    if delete_files:
        command += ' && rm -rf {0}'.format(args['chef_file_dest'])

    return sudo_dry(command.format(args['chef_file_dest'], args['config_path'],
                                   config.get('dna_path'), args['loglevel']),
                    args,
                    logger=logger)
Exemple #4
0
def update(args, config, delete_files=False, logger=None):
    if logger is None:
        logger = setup_custom_logger('chef-solo-cup', args)

    sync(args, config, logger=logger)

    command = ' && '.join([
        "cd {0}",
        "source /etc/profile",
        "`which chef-solo` -c {0}/{1} -j {0}/{2} -l {3}"
    ])
    if delete_files:
        command += ' && rm -rf {0}'.format(args['chef_file_dest'])

    return sudo_dry(command.format(
        args['chef_file_dest'],
        args['config_path'],
        config.get('dna_path'),
        args['loglevel']
    ), args, logger=logger)