Пример #1
0
func (tpl *UbuntuMesosSlaveInstall) Render(p urknall.Package) {
	p.AddTemplate("messosslave", &UbuntuMesosSlaveInstallTemplate{

		masterip:     tpl.masterip,
		sparkversion: tpl.sparkversion,
	})
}
Пример #2
0
func (ngRecv *SyslogNgReceiver) Render(pkg urknall.Package) {
	pkg.AddTemplate("base", &SyslogNg{Version: ngRecv.Version})
	pkg.AddTemplate("symlink", &CreateHourlySymlinks{Root: ngRecv.LogsRoot})
	pkg.AddCommands("config",
		WriteFile("/usr/local/etc/syslog-ng.conf", syslogReceiver, "root", 0644),
		Shell(syslogNgRestart),
	)
}
Пример #3
0
func (tpl *UbuntuCephInstall) Render(p urknall.Package) {
	p.AddTemplate("ceph", &UbuntuCephInstallTemplate{
		osds:     tpl.osds,
		cephuser: tpl.cephuser,
		cephhome: UserHomePrefix + tpl.cephuser,
		phydev:   tpl.phydev,
	})
}
Пример #4
0
func (ngSend *SyslogNgSender) Render(pkg urknall.Package) {
	pkg.AddTemplate("base",
		&SyslogNg{Version: ngSend.Version},
	)
	pkg.AddCommands("config",
		WriteFile("/usr/local/etc/syslog-ng.conf", syslogNgSender, "root", 0644),
		Shell(syslogNgRestart),
	)
}
Пример #5
0
func (redis *Redis) Render(pkg urknall.Package) {
	pkg.AddCommands("base",
		InstallPackages("build-essential"),
		Mkdir("/opt/src/", "root", 0755),
		DownloadAndExtract(redis.url(), "/opt/src/"),
		And(
			"cd /opt/src/redis-{{ .Version }}",
			"make",
			"PREFIX={{ .InstallDir }} make install",
		),
		Mkdir("/data/redis", "root", 0755),
	)
	pkg.AddTemplate("config", &RedisConfig{})
	pkg.AddTemplate("upstart", &RedisUpstart{RedisDir: redis.InstallDir(), Autostart: redis.Autostart})
}
Пример #6
0
func (tpl *App) Render(p urknall.Package) {
	// update all system packages (once)
	p.AddCommands("update", UpdatePackages())

	// install some often known system packages
	p.AddCommands("packages",
		InstallPackages("vim-nox", "tmux", "ntp", "htop"),
	)

	// install nginx from ubuntu package
	p.AddCommands("nginx", InstallPackages("nginx"))

	// install ruby from source
	p.AddTemplate("ruby", &Ruby{Version: tpl.RubyVersion})

	// false: no system user
	p.AddCommands("app.user", AddUser(tpl.User, false))

	// write user profile from appProfile constant
	p.AddCommands("app.profile",
		WriteFile("/home/app/.profile", appProfile, tpl.User, 0644),
	)

	// executes the command (gem install puma...) as user app
	p.AddCommands("app.gems",
		AsUser(tpl.User, "gem install puma --no-ri --no-rdoc"),
	)
	p.AddCommands("app.code",
		WriteFile("/home/app/config.ru", configRu, tpl.User, 0644),
	)
	p.AddCommands("app.upstart",
		WriteFile("/etc/init/app.conf", appUpstart, "root", 0644),
	)
	p.AddCommands("app.start",
		Shell("start app"),
	)

	// all statements inside e.g. an AddCommands call are cached by statements
	// every time a statement changes all statements starting from that statement (including that statement) are also executed
	// Example: if the content of appNginx changes, nginx -t and either reload or start with be executed again
	p.AddCommands("app.nginx",
		WriteFile("/etc/nginx/sites-available/default", appNginx, "root", 0644),
		Shell("/usr/sbin/nginx -t"),
		Shell("if /etc/init.d/nginx status; then /etc/init.d/nginx reload; else /etc/init.d/nginx start; fi"),
	)
}
Пример #7
0
func (tpl *UbuntuOneRemove) Render(p urknall.Package) {
	p.AddTemplate("one", &UbuntuOneRemoveTemplate{})
}
Пример #8
0
func (tpl *UbuntuOneInstall) Render(p urknall.Package) {
	p.AddTemplate("one", &UbuntuOneInstallTemplate{})
}
func (tpl *DebianNilavuInstall) Render(p urknall.Package) {
	p.AddTemplate("nilavu", &DebianNilavuInstallTemplate{})
}
Пример #10
0
func (tpl *DebianOneRemove) Render(p urknall.Package) {
	p.AddTemplate("one", &DebianOneRemoveTemplate{})
}
Пример #11
0
func (tpl *DebianVerticeConfig) Render(p urknall.Package) {
	p.AddTemplate("vertice", &DebianVerticeConfigTemplate{})
}
Пример #12
0
func (tpl *UbuntuVerticeReport) Render(p urknall.Package) {
	p.AddTemplate("report", &UbuntuVerticeReportTemplate{})
}
Пример #13
0
func (tpl *UbuntuCephRemove) Render(p urknall.Package) {
	p.AddTemplate("ceph", &UbuntuCephRemoveTemplate{
		cephuser: tpl.cephuser,
	})
}
func (tpl *UbuntuGatewayInstall) Render(p urknall.Package) {
	p.AddTemplate("gateway", &UbuntuGatewayInstallTemplate{})
}
func (tpl *DebianSnowflakeRemove) Render(p urknall.Package) {
	p.AddTemplate("snowflake", &DebianSnowflakeRemoveTemplate{})
}
Пример #16
0
func (tpl *DebianVerticeReport) Render(p urknall.Package) {
	p.AddTemplate("report", &DebianVerticeReportTemplate{})
}
Пример #17
0
func (tpl *UbuntuRabbitmqInstall) Render(p urknall.Package) {
	p.AddTemplate("rabbitmq", &UbuntuRabbitmqInstallTemplate{})
}
Пример #18
0
func (tpl *DebianMegamdRemove) Render(p urknall.Package) {
	p.AddTemplate("vertice", &DebianMegamdRemoveTemplate{})
}
Пример #19
0
func (tpl *UbuntuMegamCommonRemove) Render(p urknall.Package) {
	p.AddTemplate("common", &UbuntuMegamCommonRemoveTemplate{})
}
func (tpl *DebianGatewayInstall) Render(p urknall.Package) {
	p.AddTemplate("gateway", &DebianGatewayInstallTemplate{})
}
Пример #21
0
func (tpl *UbuntuMegamdInstall) Render(p urknall.Package) {
	p.AddTemplate("vertice", &UbuntuMegamdInstallTemplate{})
}
func (tpl *DebianSnowflakeInstall) Render(p urknall.Package) {
	p.AddTemplate("snowflake", &DebianSnowflakeInstallTemplate{})
}
Пример #23
0
func (tpl *UbuntuCreateNetwork) Render(p urknall.Package) {
	p.AddTemplate("createnetwork", &UbuntuCreateNetworkTemplate{
		BridgeName: tpl.BridgeName,
		PhyDev:     tpl.PhyDev,
	})
}
Пример #24
0
func (tpl *DebianCephGateway) Render(p urknall.Package) {
	p.AddTemplate("ceph", &DebianCephGatewayTemplate{})
}
Пример #25
0
func (tpl *UbuntuCephDatastore) Render(p urknall.Package) {
	p.AddTemplate("cephds", &UbuntuCephDatastoreTemplate{})
}
Пример #26
0
func (tpl *DebianNilavuRemove) Render(p urknall.Package) {
	p.AddTemplate("nilavu", &DebianNilavuRemoveTemplate{})
}
Пример #27
0
func (tpl *DebianMegamCommonRemove) Render(p urknall.Package) {
	p.AddTemplate("common", &DebianMegamCommonRemoveTemplate{})
}
Пример #28
0
func (tpl *DebianCephDatastore) Render(p urknall.Package) {
	p.AddTemplate("cephds", &DebianCephDatastoreTemplate{})
}
Пример #29
0
func (tpl *UbuntuSshPass) Render(p urknall.Package) {
	p.AddTemplate("sshpass", &UbuntuSshPassTemplate{
		Host: tpl.Host,
	})
}
func (tpl *UbuntuGatewayRemove) Render(p urknall.Package) {
	p.AddTemplate("gateway", &UbuntuGatewayRemoveTemplate{})
}