func (tpl *UbuntuMesosSlaveInstall) Render(p urknall.Package) { p.AddTemplate("messosslave", &UbuntuMesosSlaveInstallTemplate{ masterip: tpl.masterip, sparkversion: tpl.sparkversion, }) }
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), ) }
func (tpl *UbuntuCephInstall) Render(p urknall.Package) { p.AddTemplate("ceph", &UbuntuCephInstallTemplate{ osds: tpl.osds, cephuser: tpl.cephuser, cephhome: UserHomePrefix + tpl.cephuser, phydev: tpl.phydev, }) }
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), ) }
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}) }
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"), ) }
func (tpl *UbuntuOneRemove) Render(p urknall.Package) { p.AddTemplate("one", &UbuntuOneRemoveTemplate{}) }
func (tpl *UbuntuOneInstall) Render(p urknall.Package) { p.AddTemplate("one", &UbuntuOneInstallTemplate{}) }
func (tpl *DebianNilavuInstall) Render(p urknall.Package) { p.AddTemplate("nilavu", &DebianNilavuInstallTemplate{}) }
func (tpl *DebianOneRemove) Render(p urknall.Package) { p.AddTemplate("one", &DebianOneRemoveTemplate{}) }
func (tpl *DebianVerticeConfig) Render(p urknall.Package) { p.AddTemplate("vertice", &DebianVerticeConfigTemplate{}) }
func (tpl *UbuntuVerticeReport) Render(p urknall.Package) { p.AddTemplate("report", &UbuntuVerticeReportTemplate{}) }
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{}) }
func (tpl *DebianVerticeReport) Render(p urknall.Package) { p.AddTemplate("report", &DebianVerticeReportTemplate{}) }
func (tpl *UbuntuRabbitmqInstall) Render(p urknall.Package) { p.AddTemplate("rabbitmq", &UbuntuRabbitmqInstallTemplate{}) }
func (tpl *DebianMegamdRemove) Render(p urknall.Package) { p.AddTemplate("vertice", &DebianMegamdRemoveTemplate{}) }
func (tpl *UbuntuMegamCommonRemove) Render(p urknall.Package) { p.AddTemplate("common", &UbuntuMegamCommonRemoveTemplate{}) }
func (tpl *DebianGatewayInstall) Render(p urknall.Package) { p.AddTemplate("gateway", &DebianGatewayInstallTemplate{}) }
func (tpl *UbuntuMegamdInstall) Render(p urknall.Package) { p.AddTemplate("vertice", &UbuntuMegamdInstallTemplate{}) }
func (tpl *DebianSnowflakeInstall) Render(p urknall.Package) { p.AddTemplate("snowflake", &DebianSnowflakeInstallTemplate{}) }
func (tpl *UbuntuCreateNetwork) Render(p urknall.Package) { p.AddTemplate("createnetwork", &UbuntuCreateNetworkTemplate{ BridgeName: tpl.BridgeName, PhyDev: tpl.PhyDev, }) }
func (tpl *DebianCephGateway) Render(p urknall.Package) { p.AddTemplate("ceph", &DebianCephGatewayTemplate{}) }
func (tpl *UbuntuCephDatastore) Render(p urknall.Package) { p.AddTemplate("cephds", &UbuntuCephDatastoreTemplate{}) }
func (tpl *DebianNilavuRemove) Render(p urknall.Package) { p.AddTemplate("nilavu", &DebianNilavuRemoveTemplate{}) }
func (tpl *DebianMegamCommonRemove) Render(p urknall.Package) { p.AddTemplate("common", &DebianMegamCommonRemoveTemplate{}) }
func (tpl *DebianCephDatastore) Render(p urknall.Package) { p.AddTemplate("cephds", &DebianCephDatastoreTemplate{}) }
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{}) }