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 ¶
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 Packages ¶
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