Skip to content

Instantly share code, notes, and snippets.

with_items: "{% for host in groups['app'] %}"
- "{{ host }}"
"{% endfor %}"
@ionrock
ionrock / rspec_failure
Created May 7, 2017 03:29
this makes no sense....
Failure/Error: expect(model).to eq('environment')
expected: "environment"
got: "environemnt"
(compared using ==)
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"os"
"github.com/ionrock/procs"
---
- exec:
cmd: ls -la
- docker:
image: ubuntu
cmd: ls -la
- ssh:
connect: foo.example.com
type CreateCommand func() []string
type CommandExecutor struct {
CmdString string
Command CreateCommand
}
func (ce *CommandExecutor) defaultCommand() []string {
return []string{"/bin/bash", "-c", ce.CmdString}
}
func CreateExecutor(cmdType string, cmdCfg CommandConfig) *CommandExecutor {
ce := &CommandExecutor{}
switch cmdType {
case "docker":
ce.Command = CreateDockerCommand(cmdCfg)
case "ssh":
ce.Command = CreateSSHCommand(cmdCfg)
}
SOURCES=$(shell find . -name '*.go')
myapp: $SOURCES
go build -o myapp ./cmd/myapp
VENV=.venv
$(VENV):
virtualenv $(VENV)
$(VENV)/bin/py.test: $(VENV)
$(VENV)/bin/pip install dev_requirements.txt
test: $(VENV)/bin/py.test
$(VENV)/bin/py.test .
/usr/local/bin/nginx:
apt install nginx