コード例 #1
0
def _update_remote_bvars(stackname, buildvars):
    LOG.info('updating %r with new vars %r', stackname, buildvars)
    encoded = encode_bvars(buildvars)
    fid = core_utils.ymd(fmt='%Y%m%d%H%M%S')
    # make a backup
    remote_sudo(
        'if [ -f /etc/build-vars.json.b64 ]; then cp /etc/build-vars.json.b64 /tmp/build-vars.json.b64.%s; fi;'
        % fid)
    upload(StringIO(encoded), "/etc/build-vars.json.b64", use_sudo=True)
    LOG.info("%r updated. backup written to /tmp/build-vars.json.b64.%s",
             stackname, fid)
コード例 #2
0
ファイル: buildvars.py プロジェクト: swipswaps/builder
def _update_remote_bvars(stackname, buildvars):
    LOG.info('updating %r with new vars %r', stackname, buildvars)
    # not all projects have a 'revision'
    #ensure(core_utils.hasallkeys(buildvars, ['revision']), "buildvars missing key 'revision'")

    encoded = encode_bvars(buildvars)
    fid = core_utils.ymd(fmt='%Y%m%d%H%M%S')
    # make a backup
    remote_sudo('if [ -f /etc/build-vars.json.b64 ]; then cp /etc/build-vars.json.b64 /tmp/build-vars.json.b64.%s; fi;' % fid)
    upload(StringIO(encoded), "/etc/build-vars.json.b64", use_sudo=True)
    LOG.info("%r updated", stackname)
コード例 #3
0
def salt_master_cmd(cmd, module='cmd.run', minions=r'\*'):
    "runs the given command on all aws instances. given command must escape double quotes"
    with stack_conn(core.find_master(utils.find_region())):
        remote_sudo("salt %(minions)s %(module)s %(cmd)s --timeout=30" %
                    locals())
コード例 #4
0
ファイル: master.py プロジェクト: swipswaps/builder
 def workerfn():
     remote_sudo("rm -f /etc/salt/pki/minion/minion_master.pub")
コード例 #5
0
def pillar(stackname):
    "returns the pillar data a minion is using"
    with stack_conn(stackname, username=BOOTSTRAP_USER):
        remote_sudo('salt-call pillar.items')
コード例 #6
0
ファイル: master.py プロジェクト: muzyk10/builder
 def work():
     remote_sudo("rm -f /etc/salt/pki/minion/minion_master.pub"
                 )  # destroy the old master key we have