def pre_config(self): api.info("PRE-config actions.") utils.install("sudo") api.info("<sudo> package installed.") api.info("END of PRE-config actions.")
def pre_validate(self): api.info("PRE-validate actions.") utils.install(self.pre_validate_pkgs) api.info("<%s> installed." % ", ".join(self.pre_validate_pkgs)) api.info("END of PRE-validate actions.")
def add_openstack_distro_repos(release): """Adds the official OpenStack repositories of the distribution. :release: OpenStack release. """ def _get_release(): release_map = { "mitaka": ["9\.0\.[0-9]", "9\.1\.[0-9]", "9\.2\.[0-9]"]} _release = None if release in release_map.keys(): _release = release else: for name, regexp in release_map.items(): for exp in regexp: if re.search(exp, release): return name return _release matched_release = _get_release() if not matched_release: api.fail("Could not match OpenStack release: %s" % release, stop_on_error=True) if system.distname == "ubuntu": utils.enable_repo("cloud-archive:%s" % matched_release) elif system.distname == "centos": utils.install("centos-release-openstack-%s" % matched_release)
def pre_validate(self): voms.client_install() utils.install("glite-ce-cream-cli") if not config.CFG.get("x509_user_proxy", None): # fake proxy config.CFG["x509_user_proxy"] = product_utils.create_fake_proxy() # fake voms server - lsc product_utils.add_fake_lsc()
def pre_validate(self): # voms packages utils.install("globus-gass-copy-progs") voms.client_install() # fake proxy product_utils.create_fake_proxy() # fake voms server - lsc product_utils.add_fake_lsc()
def pre_validate(self): # 1. LDAP utils installation if system.distname in ["redhat", "centos"]: utils.install("openldap-clients") # 2. Decrease BDII_BREATHE_TIMEOUT (for validation tests) utils.runcmd(("sed -i 's/BDII_BREATHE_TIME=.*/BDII_BREATHE_TIME=10/g' " "/etc/bdii/bdii.conf && /etc/init.d/bdii restart"))
def pre_config(self): api.info("PRE-config actions.") utils.install(["sudo", "gridengine", "gridengine-qmaster"]) api.info(("<sudo>, <gridengine> and <gridengine-qmaster> packages " "installed.")) api.info("END of PRE-config actions.")
def __init__(self): self.cfgtool = config.CFG["cfgtool"] self.has_infomodel = config.CFG["has_infomodel"] # NOTE(orviz): within a QCStep? utils.install("glue-validator") if system.distro_version == "redhat5": utils.install("openldap-clients")
def pre_config(self): api.info("PRE-config actions.") utils.install("ntp") api.info("<ntp> installed.") utils.runcmd("mount -o remount,acl,user_xattr /") api.info("Enabled ACLs and Extended Attribute Support in /") api.info("END of PRE-config actions.")
def _run_validator(self, glue_version, logfile): # NOTE(orviz): within a QCStep? utils.install("glue-validator") if system.distro_version == "redhat5": utils.install("openldap-clients") port = config.CFG.get("info_port", "2170") if glue_version == "glue1": # cmd = ("glue-validator -H localhost -p %s -b " # "mds-vo-name=resource,o=grid -g glue1 -s " # "general -v 3" % port) cmd = ("glue-validator -h localhost -p %s -b " "mds-vo-name=resource,o=grid -t glue1" % port) version = "1.3" elif glue_version == "glue2": # cmd = ("glue-validator -H localhost -p %s -b " # "GLUE2GroupID=resource,o=glue -g glue2 -s general -v 3" # % port) cmd = ("glue-validator -h localhost -p %s -b " "GLUE2GroupID=resource,o=glue -t glue2" % port) version = "2.0" time.sleep(self.attempt_sleep) breathe_time_set = False slapd_working = False summary = None for attempt in xrange(self.attempt_no): r = utils.runcmd(cmd, log_to_file=logfile) if not r.failed: summary = {} if r: summary = info_utils.get_gluevalidator_summary(r) slapd_working = True break else: if not breathe_time_set: self._set_breathe_time() breathe_time_set = True time.sleep(self.attempt_sleep) if not slapd_working: api.fail("Could not connect to LDAP service.", stop_on_error=True) if summary: if summary["errors"] != '0': api.fail(("Found %s errors while validating GlueSchema " "v%s support" % (summary["errors"], version)), logfile=r.logfile) elif summary["warnings"] != '0': api.warn(("Found %s warnings while validating GlueSchema " "v%s support" % (summary["warnings"], version))) else: api.ok(("Found no errors or warnings while validating " "GlueSchema v%s support" % version))
def config(self, logfile=None): # Install ansible if it does not exist if utils.runcmd("ansible --help", stop_on_error=False).failed: utils.install("ansible") common.set_umd_params( "umd_ansible.yaml", UMD_VARS_FILE) # Run ansible r = self._run() self.has_run = True return r
def _deploy(self): # Install release package if not (utils.is_pkg_installed("puppetlabs-release") or utils.is_pkg_installed("puppetlabs-release-pc1")): utils.install_remote(config.CFG["puppet_release"]) # Install puppet client r = utils.install("puppet") if r.failed: api.fail("Puppet installation failed", stop_on_error=True) # Set hiera environment - required before pre_config() method if not os.path.exists(self.hiera_data_dir): utils.runcmd("mkdir -p %s" % self.hiera_data_dir)
def pre_validate(self): utils.install("curl")
def pre_validate(self): api.info("PRE-validate actions.") utils.install(["myproxy", "voms-clients", "ca-policy-egi-core"])
def pre_validate(self): utils.install("xrootd-client")
def pre_config(self): utils.install(["fetch-crl", "glite-px-myproxy-yaim"])
def pre_validate(self): if system.distname in ["redhat", "centos"]: utils.install("openldap-clients")
def config(self): self.manifest = os.path.join(config.CFG["puppet_path"], self.manifest) if self.hiera_data: self.hiera_data = os.path.join(config.CFG["puppet_path"], self.hiera_data) utils.install("puppet") # Puppet versions <3 workarounds puppet_version = utils.runcmd("facter -p puppetversion") if puppet_version and (version.StrictVersion(puppet_version) < version.StrictVersion("3.0")): # self._v3_workaround() pkg_url = config.CFG["puppet_release"] pkg_loc = "/tmp/puppet-release.rpm" r = utils.runcmd("wget %s -O %s" % (pkg_url, pkg_loc)) if r.failed: api.fail("Could not fetch Puppet package from '%s'" % pkg_url, stop_on_error=True) else: api.info("Fetched Puppet release package from '%s'." % pkg_url) utils.install(pkg_loc) utils.runcmd(("sed '/enabled=1/a\priority=1' " "/etc/yum.repos.d/puppet*")) # FIXME (orviz) Remove this check when dropping redhat5 support if system.distro_version == "redhat5": pkg = ("ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/" "virt-what-1.11-2.el5.x86_64.rpm") utils.runcmd(("wget %s -O /tmp/virt-what.rpm && yum -y " "install /tmp/virt-what.rpm") % pkg) utils.install("puppet") # Install modules from puppetforge/local for mod in self.module_from_puppetforge: r = utils.runcmd("puppet module install %s --force" % mod) if r.failed: api.fail("Error while installing module '%s'" % mod) self.module_path.append(*["/etc/puppet/modules"]) module_loc = [] for mod in self.module_from_repository: dirname = utils.clone_repo(*mod) if dirname: module_loc.append(dirname) if module_loc: self.module_path.append(*module_loc) # Hiera environment self._set_hiera() logfile = os.path.join(config.CFG["log_path"], "puppet.log") r = utils.runcmd(("puppet apply -l %s --modulepath %s %s " "--detail-exitcodes") % (logfile, ':'.join(self.module_path), self.manifest)) if r.return_code in [0, 2]: api.info("Puppet execution ended successfully.") else: api.fail("Puppet execution failed. More information in logs: %s" % logfile, stop_on_error=True)
def _v3_workaround(self): # Include hiera functions in Puppet environment utils.install("rubygems") utils.runcmd(("gem install hiera-puppet --install-dir " "/etc/puppet/modules")) utils.runcmd("mv /etc/puppet/modules/gems/* /etc/puppet/modules/")
def client_install(): utils.install([ "voms-clients", "myproxy", "voms-clients-cpp" ])
def pre_validate(self): utils.runcmd("useradd -r ees") utils.runcmd("/etc/init.d/ees start") utils.install("nc")