Skip to content

Commit

Permalink
one final fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Levinson committed Nov 4, 2017
1 parent 2370693 commit e63dda0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 26 deletions.
2 changes: 1 addition & 1 deletion competition/bindata.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion competition/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func DScript(name string, c *Competition, e *Environment, i int, n *Network, h *
var tpl bytes.Buffer

if err := newTmpl.Execute(&tpl, tb); err != nil {
LogError("Error proccessing script: script=" + name + " host=" + hn)
LogError("Error proccessing script: script=" + name + " host=" + hn + " error=" + err.Error())
return "SCRIPT_PARSING_ERROR"
}

Expand Down
53 changes: 30 additions & 23 deletions templates/infra-v2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -960,32 +960,39 @@ resource "aws_instance" "{{ $id }}_{{ $network.Subdomain }}_{{ $hostname }}" {
{{ range $_, $sname := $host.Scripts }}
{{ $scriptPath := DScript $sname $.Competition $.Environment $.PodID $network $host $hostname }}
{{ if ne $scriptPath "SCRIPT_PARSING_ERROR" }}
provisioner "file" {
connection {
host = "${aws_eip.{{ $id }}_{{ $network.Subdomain }}_{{ $hostname }}_eip.public_ip}"
type = "winrm"
user = "Administrator"
timeout = "60m"
password = "{{ $.Competition.RootPassword }}"
{{ if eq $sname "LOCAL_SLEEP_20.ps1" }}
provisioner "local-exec" {
command = "sleep 20"
}

source = "{{ $scriptPath }}"
destination = "C:/laforge/{{ $sname }}"
}

provisioner "remote-exec" {
connection {
host = "${aws_eip.{{ $id }}_{{ $network.Subdomain }}_{{ $hostname }}_eip.public_ip}"
type = "winrm"
user = "Administrator"
timeout = "60m"
password = "{{ $.Competition.RootPassword }}"
{{ else }}
provisioner "file" {
connection {
host = "${aws_eip.{{ $id }}_{{ $network.Subdomain }}_{{ $hostname }}_eip.public_ip}"
type = "winrm"
user = "Administrator"
timeout = "60m"
password = "{{ $.Competition.RootPassword }}"
}

source = "{{ $scriptPath }}"
destination = "C:/laforge/{{ $sname }}"
}

inline = [
"powershell -NoProfile -ExecutionPolicy Bypass C:/laforge/{{ $sname }}",
]
}
provisioner "remote-exec" {
connection {
host = "${aws_eip.{{ $id }}_{{ $network.Subdomain }}_{{ $hostname }}_eip.public_ip}"
type = "winrm"
user = "Administrator"
timeout = "60m"
password = "{{ $.Competition.RootPassword }}"
}

inline = [
"powershell -NoProfile -ExecutionPolicy Bypass C:/laforge/{{ $sname }}",
]
}
{{ end }}

{{ end }}
{{ end }}

Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main

const Name string = "laforge"
const Version string = "2.0.13"
const Version string = "2.0.14"

0 comments on commit e63dda0

Please sign in to comment.