2013-10-12 08:28:27 +00:00
|
|
|
"""
|
|
|
|
Chef-solo task
|
|
|
|
"""
|
2011-11-18 00:49:47 +00:00
|
|
|
import logging
|
|
|
|
|
2014-08-07 14:24:59 +00:00
|
|
|
from teuthology.orchestra import run
|
|
|
|
from teuthology import misc
|
2011-11-18 00:49:47 +00:00
|
|
|
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
def task(ctx, config):
|
|
|
|
"""
|
|
|
|
Run chef-solo on all nodes.
|
2015-03-31 15:52:52 +00:00
|
|
|
|
|
|
|
Optional parameters:
|
|
|
|
tasks:
|
|
|
|
-chef
|
|
|
|
script_url: # override default location for solo-from-scratch for Chef
|
|
|
|
chef_repo: # override default Chef repo used by solo-from-scratch
|
|
|
|
chef_branch: # to choose a different upstream branch for ceph-qa-chef
|
2011-11-18 00:49:47 +00:00
|
|
|
"""
|
|
|
|
log.info('Running chef-solo...')
|
|
|
|
|
2015-03-31 15:52:52 +00:00
|
|
|
if config is None:
|
|
|
|
config = {}
|
|
|
|
|
|
|
|
assert isinstance(config, dict), "chef - need config"
|
2015-04-16 16:05:30 +00:00
|
|
|
chef_script = config.get('script_url', 'http://git.ceph.com/?p=ceph-qa-chef.git;a=blob_plain;f=solo/solo-from-scratch;hb=HEAD')
|
2015-03-31 15:52:52 +00:00
|
|
|
chef_repo = config.get('chef_repo', "")
|
|
|
|
chef_branch = config.get('chef_branch', "")
|
2011-11-18 00:49:47 +00:00
|
|
|
run.wait(
|
|
|
|
ctx.cluster.run(
|
|
|
|
args=[
|
|
|
|
'wget',
|
2013-04-30 00:11:27 +00:00
|
|
|
# '-q',
|
2011-11-18 00:49:47 +00:00
|
|
|
'-O-',
|
2012-03-02 18:55:19 +00:00
|
|
|
# 'https://raw.github.com/ceph/ceph-qa-chef/master/solo/solo-from-scratch',
|
2015-03-31 15:52:52 +00:00
|
|
|
chef_script,
|
2011-11-18 00:49:47 +00:00
|
|
|
run.Raw('|'),
|
2015-03-31 15:52:52 +00:00
|
|
|
run.Raw('CHEF_REPO={repo}'.format(repo=chef_repo)),
|
|
|
|
run.Raw('CHEF_BRANCH={branch}'.format(branch=chef_branch)),
|
2011-11-18 00:49:47 +00:00
|
|
|
'sh',
|
2013-04-30 20:04:28 +00:00
|
|
|
'-x',
|
2011-11-18 00:49:47 +00:00
|
|
|
],
|
|
|
|
wait=False,
|
|
|
|
)
|
|
|
|
)
|
2013-07-31 00:26:59 +00:00
|
|
|
|
|
|
|
log.info('Reconnecting after ceph-qa-chef run')
|
|
|
|
misc.reconnect(ctx, 10) #Reconnect for ulimit and other ceph-qa-chef changes
|
|
|
|
|