Пример #1
0
    def action_post_install(self, *args, **kwargs):
        super().action_post_install(*args, **kwargs)

        #
        # Cache Munin packages and dependencies from EPEL
        #
        os.system(os.path.join(self.install_path, 'bin', "dl.sh"))

        k = KitManager().getKit('munin')

        kit_repo_dir = os.path.join(
            self.config_manager.getReposDir(),
            k.getKitRepoDir()
        )

        #
        # If cache directory exists, copy to 'kitRepoDir' (the default
        # location for kit packages)
        #
        if os.path.isdir('/var/cache/tortuga/pkgs/munin'):
            tortugaSubprocess.executeCommandAndIgnoreFailure(
                'rsync -a {}/ {}'.format(
                    '/var/cache/tortuga/pkgs/munin', kit_repo_dir)
            )
            tortugaSubprocess.executeCommandAndIgnoreFailure(
                'createrepo {}'.format(kit_repo_dir))
Пример #2
0
    def action_post_install(self, *args, **kwargs):
        super().action_post_install(*args, **kwargs)
        #
        # Cache Ganglia packages from EPEL
        #
        os.system(os.path.join(self.install_path, 'bin', "dl.sh"))

        kit = KitManager().getKit('ganglia')
        kit_repo_dir = os.path.join(
            self.config_manager.getReposDir(),
            kit.getKitRepoDir()
        )

        cmd = 'rsync -a {}/ {}'.format('/var/cache/tortuga/pkgs/ganglia',
                                       kit_repo_dir)
        tortugaSubprocess.executeCommandAndIgnoreFailure(cmd)

        cmd = 'cd %s; createrepo .'.format(kit_repo_dir)
        tortugaSubprocess.executeCommandAndIgnoreFailure(cmd)

        #
        # Copy default configuration file into place
        #
        dst_path = os.path.join(self.config_manager.getKitConfigBase(),
                                'ganglia')
        if not os.path.exists(dst_path):
            os.makedirs(dst_path)
        shutil.copyfile(
            os.path.join(self.files_path, 'gmond-component.conf'),
            os.path.join(dst_path, 'gmond-component.conf')
        )