本文整理匯總了Golang中github.com/dynport/urknall.Package類的典型用法代碼示例。如果您正苦於以下問題:Golang Package類的具體用法?Golang Package怎麽用?Golang Package使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Package類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Render
func (m *UbuntuOneHostRemoveTemplate) Render(pkg urknall.Package) {
pkg.AddCommands("onehost",
RemovePackage("opennebula-node"),
RemovePackages(""),
PurgePackages("opennebula-node"),
)
}
示例2: Render
func (m *UbuntuOneHostInstallTemplate) Render(pkg urknall.Package) {
//ip := GetLocalIP()
pkg.AddCommands("repository",
Shell("wget -q -O- http://downloads.opennebula.org/repo/Ubuntu/repo.key | apt-key add -"),
Shell("echo 'deb http://downloads.opennebula.org/repo/4.14/Ubuntu/14.04 stable opennebula' > /etc/apt/sources.list.d/opennebula.list"),
UpdatePackagesOmitError(),
)
pkg.AddCommands("depends",
InstallPackages("build-essential genromfs autoconf libtool qemu-utils libvirt0 bridge-utils lvm2 ssh iproute iputils-arping make"),
)
pkg.AddCommands("node",
InstallPackages("opennebula-node"),
)
pkg.AddCommands("verify",
InstallPackages("qemu-system-x86 qemu-kvm cpu-checker"),
And("kvm=`kvm-ok | grep 'KVM acceleration can be used'`"),
)
pkg.AddCommands("vswitch",
InstallPackages("openvswitch-common openvswitch-switch bridge-utils"),
)
}
示例3: Render
func (m *UbuntuOneRemoveTemplate) Render(pkg urknall.Package) {
pkg.AddCommands("one",
RemovePackage("opennebula opennebula-sunstone"),
RemovePackages(""),
PurgePackages("opennebula opennebula-sunstone"),
)
}
示例4: Render
func (m *UbuntuRabbitRemoveTemplate) Render(pkg urknall.Package) {
pkg.AddCommands("rabbitmq",
RemovePackage("rabbitmq-server"),
RemovePackages(""),
PurgePackages("rabbitmq-server"),
Shell("dpkg --get-selections rabbitmq*"),
)
}
示例5: Render
func (m *UbuntuRiakRemoveTemplate) Render(pkg urknall.Package) {
pkg.AddCommands("riak",
RemovePackage("riak"),
RemovePackages(""),
PurgePackages("riak"),
Shell("dpkg --get-selections riak*"),
)
}
示例6: Render
func (m *UbuntuMegamCommonRemoveTemplate) Render(pkg urknall.Package) {
pkg.AddCommands("megamcommon",
RemovePackage("megamcommon"),
RemovePackages(""),
PurgePackages("megamcommon"),
Shell("dpkg --get-selections megam*"),
)
}
示例7: Render
func (m *UbuntuMegamSnowflakeRemoveTemplate) Render(pkg urknall.Package) {
pkg.AddCommands("megamsnowflake",
Shell("service snowflake stop"),
RemovePackage("megamsnowflake"),
RemovePackages(""),
PurgePackages("megamsnowflake"),
Shell("dpkg --get-selections megam*"),
)
}
示例8: Render
func (m *UbuntuMegamGatewayInstallTemplate) Render(pkg urknall.Package) {
pkg.AddCommands("repository",
Shell("echo 'deb [arch=amd64] "+DefaultMegamRepo+"' > "+ListFilePath),
UpdatePackagesOmitError(),
)
pkg.AddCommands("megamgateway",
InstallPackages("megamgateway"),
)
}
示例9: Render
func (m *UbuntuBridgeTemplate) Render(pkg urknall.Package) {
// ip := GetLocalIP()
pkg.AddCommands("setupbrdige",
Shell(""),
Shell("sudo echo '"+"%"+"oneadmin ALL=(root) NOPASSWD: /usr/bin/ovs-vsctl' >> //etc/sudoers.d/openvswitch"),
Shell("sudo echo '"+"%"+"oneadmin ALL=(root) NOPASSWD: /usr/bin/ovs-ofctl' >> //etc/sudoers.d/openvswitch"),
Shell("export BRIDGE_NAME='one'"),
Shell("export NETWORK_IF='eth0'"),
Shell("sudo ovs-vsctl add-br one"),
Shell("sudo echo 'auto one' >> /etc/network/interfaces"),
Shell("sudo ovs-vsctl add-port one eth0"),
UpdatePackagesOmitError(),
)
}
示例10: Render
func (m *UbuntuOneInstallTemplate) Render(pkg urknall.Package) {
ip := GetLocalIP()
pkg.AddCommands("repository",
Shell("wget -q -O- http://downloads.opennebula.org/repo/Ubuntu/repo.key | apt-key add -"),
Shell("echo 'deb http://downloads.opennebula.org/repo/4.14/Ubuntu/14.04 stable opennebula' > /etc/apt/sources.list.d/opennebula.list"),
UpdatePackagesOmitError(),
)
pkg.AddCommands("one",
InstallPackages("opennebula opennebula-sunstone ntp ruby2.0 ruby2.0-dev ruby-dev"),
)
pkg.AddCommands("repo",
Shell("echo 'oneadmin ALL = (root) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/oneadmin"),
//Shell("sudo apt-get -y install ntp ruby2.0 ruby2.0-dev ruby-dev"),
Shell("rm /usr/bin/ruby"),
Shell("rm /usr/bin/gem"),
Shell("ln -s /usr/bin/ruby2.0 /usr/bin/ruby"),
Shell("ln -s /usr/bin/gem2.0 /usr/bin/gem"),
Shell("sudo chmod 0440 /etc/sudoers.d/oneadmin"),
Shell("sudo rm /usr/share/one/install_gems"),
//Shell("sudo cp ~/install_gems /usr/share/one/install_gems"),
Shell("sudo cp /usr/share/megam/megdc/conf/trusty/opennebula/install_gems /usr/share/one/install_gems"),
Shell("sudo chmod 755 /usr/share/one/install_gems"),
Shell("sudo /usr/share/one/install_gems sunstone"),
Shell("sed -i 's/^[ \t]*:host:.*/:host: "+ip+"/' /etc/one/sunstone-server.conf"),
Shell("sunstone-server start"),
Shell("econe-server start"),
Shell("sudo -H -u oneadmin bash -c 'one restart'"),
Shell("service opennebula restart"),
)
}
示例11: Render
func (m *UbuntuMegamNilavuInstallTemplate) Render(pkg urknall.Package) {
pkg.AddCommands("repository",
Shell("echo 'deb [arch=amd64] "+DefaultMegamRepo+"' > "+ListFilePath),
UpdatePackagesOmitError(),
)
pkg.AddCommands("megamcommon",
And("apt-get -y install megamcommon"),
)
pkg.AddCommands("megamnilavu",
InstallPackages("megamnilavu"),
)
}
示例12: Render
func (tpl *UbuntuMegamdRemove) Render(p urknall.Package) {
p.AddTemplate("megamd", &UbuntuMegamdRemoveTemplate{})
}
示例13: Render
func (tpl *UbuntuRabbitmqInstall) Render(p urknall.Package) {
p.AddTemplate("rabbitmq", &UbuntuRabbitmqInstallTemplate{})
}
示例14: Render
func (tpl *UbuntuCephInstall) Render(p urknall.Package) {
p.AddTemplate("ceph", &UbuntuCephInstallTemplate{})
}
示例15: Render
func (tpl *UbuntuMegamCommonInstall) Render(p urknall.Package) {
p.AddTemplate("common", &UbuntuMegamCommonInstallTemplate{})
}