set

package
v0.7.8-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewPasswordTmpl = template.Must(template.New("NewPasswordTmpl").Parse(dedent.Dedent(`
#!/bin/bash
set -e
echo "{{ .NewPassword }}" | passwd --stdin root
`)))

NewPasswordTmpl 本机互信脚本模板

View Source
var PasswordLessTmpl = template.Must(template.New("PasswordLessTmpl").Parse(dedent.Dedent(`
#!/bin/bash
set -e
mkdir -p ~/.ssh
tee ~/.ssh/id_rsa.pub <<EOF
{{ .PublicKey }}
EOF

tee ~/.ssh/authorized_keys <<EOF
{{ .PublicKey }}
EOF

tee ~/.ssh/id_rsa <<EOF
{{ .PrivateKey }}
EOF

chmod 600 ~/.ssh -R
`)))

PasswordLessTmpl 本机互信脚本模板

Functions

func AddDnsScript

func AddDnsScript(b []byte, tmpl *template.Template) (string, error)

func Config

func Config(b []byte, logger *logrus.Logger, cmd string) error

func Dns

func Dns(b []byte, logger *logrus.Logger) error

func GetResult

func GetResult(b []byte, logger *logrus.Logger, cmd string) ([]runner.ShellResult, error)

func HostResolve

func HostResolve(b []byte, logger *logrus.Logger) error

func IsValid

func IsValid(dnsList []string) (bool, error)

func MakeKeyPairScript

func MakeKeyPairScript(tmpl *template.Template) (string, error)

func NewPassword

func NewPassword(config []byte, logger *logrus.Logger) error

func NewPasswordScript

func NewPasswordScript(b []byte, tmpl *template.Template) (string, error)

func PasswordLess

func PasswordLess(config []byte, logger *logrus.Logger) error

func Timezone

func Timezone(config []byte, logger *logrus.Logger) error

func Ulimit

func Ulimit(b []byte, logger *logrus.Logger) error

Types

type DnsConfig

type DnsConfig struct {
	DnsList []string `yaml:"dns"`
}

func ParseDnsConfig

func ParseDnsConfig(b []byte) (DnsConfig, error)

type IPAddress

type IPAddress []string

IPAddress ip地址

func (IPAddress) Len

func (addresses IPAddress) Len() int

func (IPAddress) Less

func (addresses IPAddress) Less(i, j int) bool

func (IPAddress) Swap

func (addresses IPAddress) Swap(i, j int)

type ParseConfig

type ParseConfig interface {
	Parse(b []byte, debug bool) (error, interface{})
}

type PasswordConfig

type PasswordConfig struct {
	Password string `yaml:"newRootPassword"`
}

func ParseNewPasswordConfig

func ParseNewPasswordConfig(b []byte) (PasswordConfig, error)

type YUM

type YUM struct {
}

func (YUM) Config

func (yum YUM) Config(b []byte, debug bool) error

Jump to

Keyboard shortcuts

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