def run_rh_playbook(self): """ Method to run ceph-ansible """ args = self.args # get ceph installer remote node ceph_installer = self.ceph_installer # Get ansible path self.ansible_path = os.path.join( ceph_installer.sh("echo $HOME").strip(), "ceph-ansible") log.info("ceph ansible path: {}".format(self.ansible_path)) from tasks.set_repo import GA_BUILDS, set_cdn_repo rhbuild = self.config.get('rhbuild') # skip cdn's for rhel beta tests which will use GA builds from Repo if self.ctx.config.get('redhat').get('skip-subscription-manager', False) is False: if rhbuild in GA_BUILDS: set_cdn_repo(self.ctx, self.config) # install ceph-ansible if ceph_installer.os.package_type == 'rpm': ceph_installer.run( args=['sudo', 'yum', 'install', '-y', 'ceph-ansible']) time.sleep(4) else: ceph_installer.run( args=['sudo', 'apt-get', 'install', '-y', 'ceph-ansible']) time.sleep(4) ceph_installer.run(args=['cp', '-R', '/usr/share/ceph-ansible', '.']) self._copy_and_print_config() self._generate_client_config() self.start_firewalld() str_args = ' '.join(args) ceph_installer.run( args=['cd', 'ceph-ansible', run.Raw(';'), run.Raw(str_args)], timeout=4200, ) # print rgw multi-site sync status, if configured if self.config.get('vars', dict()).get("rgw_multisite"): self.display_multisite_status() self.ready_cluster = self.each_cluster log.info('Ready_cluster {}'.format(self.ready_cluster)) self._create_rbd_pool() self._fix_roles_map() # fix keyring permission for workunits self.fix_keyring_permission() self.create_keyring() if self.legacy: self.change_key_permission() self.wait_for_ceph_health()
def setup_cdn_repo(ctx, config): """ setup repo if set_cdn_repo exists in config redhat: set_cdn_repo: rhbuild: 2.0 or 1.3.2 or 1.3.3 """ # do import of tasks here since the qa task path should be set here if ctx.config.get('redhat').get('set-cdn-repo', None): from tasks.set_repo import set_cdn_repo config = ctx.config.get('redhat').get('set-cdn-repo') set_cdn_repo(ctx, config) yield