Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format samples in readme #105

Merged
merged 1 commit into from
Jul 21, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 25 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ likely to look this this:

```hcl
# install traefik
param "version" { }
param "version" {}

module "yum" "traefik" { }
module "yum" "traefik" {}

module "systemd-unit-enabled" "traefik" {
requires = [ "yum.traefik" ]
requires = ["yum.traefik"]
}

module "systemd-unit-running" "traefik" {
requires = [ "yum.traefik" ]
requires = ["yum.traefik"]
}
```

Expand All @@ -62,7 +62,7 @@ The content of a simple module is below:

```hcl
# start a systemd unit
param "name" { }
param "name" {}

task "start-unit" {
check = "systemctl status {{param `name`}} | tee /dev/stderr | grep -q running"
Expand All @@ -85,14 +85,25 @@ to the filesystem from the module's parameters:

```hcl
# create systemd unit file
param "name" { }
param "execStart" { }
param "user" { default = "root" }
param "group" { default = "root" }
param "description" { default = "{{param `name`}}" }
param "name" {}

param "execStart" {}

param "user" {
default = "root"
}

param "group" {
default = "root"
}

param "description" {
default = "{{param `name`}}"
}

template "unit" {
destination = "/etc/systemd/system/{{param `name`}}.service"

content = <<EOF
[Unit]
Description={{param `description`}}
Expand All @@ -110,9 +121,9 @@ EOF
}

task "reload-daemon" {
check = "systemd-delta --type=overridden {{param `name`}}"
apply = "systemctl daemon-reload"
requires = [ "template.unit" ]
check = "systemd-delta --type=overridden {{param `name`}}"
apply = "systemctl daemon-reload"
requires = ["template.unit"]
}
```

Expand Down Expand Up @@ -153,7 +164,7 @@ Sample:
```hcl
file.mode "test" {
destination = "test.txt"
mode = "0644"
mode = "0644"
}
```

Expand Down