utils

package
v0.0.0-...-e595aee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CulsterTempl = `` /* 379-byte string literal not displayed */

Functions

func AdminOrchCmd

func AdminOrchCmd(homedir string, caaspdir string, s *CAASPOut, option string, command string) (string, string)

func CheckRebootNeeded

func CheckRebootNeeded(IP string, a *CAASPOut, homedir string, caaspdir string, list map[string]SaltCluster)

func CheckSaltMinions

func CheckSaltMinions(homedir string, caaspdir string)

func CheckVelumUp

func CheckVelumUp(page string) float64

CheckVelumUp returns Velum worm up time in Seconds

func CheckVersions

func CheckVersions()

func CmdRun

func CmdRun(dir, openstackAPIauth, command string) (string, string)

CmdRun takes a directory, openstack api auth, command and runs RunScript

func CreateAcc

func CreateAcc(nodes *CAASPOut)

func Download

func Download(url string) error

Download downloads the kubeconfig file

func FirstSetup

func FirstSetup(nodes *CAASPOut)

func InstallUI

func InstallUI(nodes *CAASPOut, Cluster *CaaSPCluster)

InstallUI handles Velum interactions

func NiceBufRunner

func NiceBufRunner(cmd *exec.Cmd) (string, string)

func RunScript

func RunScript(command string, env EnvOS) (string, string)

RunScript accepts 4 inputs and a runs terraform script

func TfInit

func TfInit(dir string)

TfInit tinitializes the needed terraform modules

func VelumUpdater

func VelumUpdater(homedir string, caaspdir string, nodes *CAASPOut)

Types

type Admin

type Admin struct {
	Value string
}

type CAASPOut

type CAASPOut struct {
	IPAdminExt   *Admin   `json:"ip_admin_external"`
	IPAdminInt   *Admin   `json:"ip_admin_internal"`
	IPMastersExt Machines `json:"ip_masters"`
	IPWorkersExt Machines `json:"ip_workers"`
}

CAASPOut is holding caasp terraform output json variables

func CAASPOutReturner

func CAASPOutReturner(openstack string, homedir string, caaspDir string) *CAASPOut

func (*CAASPOut) SSHCommand

func (s *CAASPOut) SSHCommand(IP string, homedir string, caaspdir string, cmd ...string) *exec.Cmd

type CaaSPCluster

type CaaSPCluster struct {
	ImageName string
	IntNet    string
	ExtNet    string
	AdmSize   string
	MastSize  string
	MastCount int
	WorkSize  string
	WorkCount int
	DnsDomain string
	DnsEntry  int
	StackName string
	Diff      int //----it is to indicate how many more new nodes you add when appending new nodes to the cluster
}
var Cluster CaaSPCluster

func NodesAdder

func NodesAdder(dir string, append string, nodes *CAASPOut, Firsttime bool) *CaaSPCluster

type EnvOS

type EnvOS []string

EnvOS holds as slice with openstack API variables

var ENV EnvOS

func SetOSEnv

func SetOSEnv(file string) (EnvOS, error)

SetOSEnv sets up Openstack environment variables

type Machines

type Machines struct {
	Value []string
}

type OSAPI

type OSAPI struct {
	AuthURL            string
	RegionName         string
	ProjectName        string
	UserDomainName     string
	IdentityAPIVersion string
	Interface          string
	Username           string
	Password           string //[]byte
	ProjectID          string
	Insecure           string
}

OSAPI holds openstack API variables

type PackageData

type PackageData struct {
	Name         string
	Version      string
	Release      string
	Architecture string
}

func RpmOutputParser

func RpmOutputParser(output string) *PackageData

type SESOut

type SESOut struct {
	K8SSC      Machines `json:"k8s_StorageClass_internal_ip"`
	K8SCS      Machines `json:"ceph_secret"`
	IPAdminExt *Admin   `json:"external_ip_admin"`
	IPAdminInt Machines `json:"internal_ip_admin"`
	IPMonsExt  Machines `json:"external_ip_mons"`
	IPMonsInt  Machines `json:"internal_ip_mons"`
	IPOsdsInt  Machines `json:"internal_ip_osds"`
}

SESOut is holding ses terraform output json variables

type SaltCluster

type SaltCluster struct {
	Name         string
	IP           string
	RebootNeeded bool
}

SaltCluster connects hashname of all nodes + hostname and IPs all together

func (*SaltCluster) SSHCmd

func (s *SaltCluster) SSHCmd(IP string, homedir string, caaspdir string, cmd ...string) *exec.Cmd
func (s *CAASPOut) SSHCommand(cmd ...string) *exec.Cmd {
	arg := append(
		[]string{"-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile /dev/null", "-i", "/app/caasp-openstack-terraform/id_caasp",
			fmt.Sprintf("root@%s", s.IPAdminExt.Value),
		},
		cmd...,
	)
	return exec.Command("ssh", arg...)
}

-------------------HERE

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL