common

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseTmpl

func ParseTmpl(vars interface{}, tmplStr string, tmplName string, output string, fileMode os.FileMode)

ParseTmpl parse the template to a file vars: the data structure of struct type tmplStr: the template const tmplName: the template name output: the location of output fimeMode: e.g. 0644

Types

type Interfaces

type Interfaces struct {
	InternalNIC     string `json:"InternalNIC"`     // default is eth0
	InternalIP      string `json:"InternalIP"`      // the internal ip address
	InternalMask    string `json:"InternalMask"`    // the netmask for internal ip
	InternalGateway string `json:"InternalGateway"` // the gateway for internal ip
	InternalDNS1    string `json:"InternalDNS1"`    // the dns-nameservers
	InternalDNS2    string `json:"InternalDNS2"`
	ExternalNIC     string `json:"ExternalNIC"` // default is eth1
	Restart         bool   `json:"Restart"`     // restart the system
	Changed         bool   `json:"Changed"`     // changed status
}

Interfaces takes /etc/network/interfaces config file Every filed are needed

func (*Interfaces) InitInterfaces

func (i *Interfaces) InitInterfaces(k, v interface{})

InitInterfaces set the Interfaces struct

func (*Interfaces) PurgeMainConf

func (i *Interfaces) PurgeMainConf()

PurgeMainConf use the interfaces.d dir instead of /etc/network/interfaces

func (*Interfaces) SetExternalNIC

func (i *Interfaces) SetExternalNIC()

SetExternalNIC sets the external nic

func (*Interfaces) SetInternalNIC

func (i *Interfaces) SetInternalNIC()

SetInternalNIC sets the internal nic

type NtpServer

type NtpServer struct {
	Server  string `json:"Server"`
	Changed bool   `json:"Changed"`
}

NtpServer are the module args

func (*NtpServer) InitNtpServer

func (n *NtpServer) InitNtpServer(k, v interface{})

InitNtpServer init the NtpServer struct

func (*NtpServer) InstallChrony

func (n *NtpServer) InstallChrony()

InstallChrony install chrony for ntp server

type Output

type Output struct{}

Output takes json output

type Packages

type Packages struct {
	Version string `json:"Version"`
	Changed bool   `json:"Changed"`
}

Packages struct is the module args

func (*Packages) InitPackages

func (p *Packages) InitPackages(k, v interface{})

InitPackages takes the assignment for Packages struct

func (*Packages) InstallClient

func (p *Packages) InstallClient()

InstallClient install the openstack python client

func (*Packages) InstallRepo

func (p *Packages) InstallRepo()

InstallRepo enable the OpenStack repository

Jump to

Keyboard shortcuts

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