ceph/tasks/chef.py
Douglas Fuller 7b855dea09 RBD: added optional YAML parameters to test xfstests from different repos
These variables are needed because ceph-qa-suite bootstraps ceph-qa-chef via
http download of solo-from/scratch/run. This adds a variable to override the
default script. It also adds variables to the rbd task to override the versions
of run_xfstests_krbd.sh and run_xfstests.sh downloaded by the default task.

variables added
======
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 git upstream branch for ceph-qa-chef
-rbd.xfstests:
  client.0:
   xfstests_branch: # to choose a different git upstream branch for xfstests
   xfstests_url: # override git base URL for run_xfstests{_krbd}.sh

Signed-off-by: Douglas Fuller <dfuller@redhat.com>
2015-04-07 17:45:20 -07:00

52 lines
1.5 KiB
Python

"""
Chef-solo task
"""
import logging
from teuthology.orchestra import run
from teuthology import misc
log = logging.getLogger(__name__)
def task(ctx, config):
"""
Run chef-solo on all nodes.
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
"""
log.info('Running chef-solo...')
if config is None:
config = {}
assert isinstance(config, dict), "chef - need config"
chef_script = config.get('script_url', 'http://ceph.com/git/?p=ceph-qa-chef.git;a=blob_plain;f=solo/solo-from-scratch;hb=HEAD')
chef_repo = config.get('chef_repo', "")
chef_branch = config.get('chef_branch', "")
run.wait(
ctx.cluster.run(
args=[
'wget',
# '-q',
'-O-',
# 'https://raw.github.com/ceph/ceph-qa-chef/master/solo/solo-from-scratch',
chef_script,
run.Raw('|'),
run.Raw('CHEF_REPO={repo}'.format(repo=chef_repo)),
run.Raw('CHEF_BRANCH={branch}'.format(branch=chef_branch)),
'sh',
'-x',
],
wait=False,
)
)
log.info('Reconnecting after ceph-qa-chef run')
misc.reconnect(ctx, 10) #Reconnect for ulimit and other ceph-qa-chef changes