asteris-llc / converge

A powerful and easy-to-use configuration management system.
Apache License 2.0
250 stars 31 forks source link

Add global parameters to tasks #628

Open dmlemos opened 7 years ago

dmlemos commented 7 years ago

Motivation

In my use case I'd like to setup shell flags across all tasks as to avoid specifying the flags in every task. It is a little bit worse when using switch conditionals.

Given the following tasks

task "download" {
  check = "..."
  apply  = <<EOF
    set -e
    ...
EOF
task "extract" {
  check = "..."
  apply  = <<EOF
    set -e
    ...
EOF
task "deploy" {
  check = "..."
  apply  = <<EOF
    set -e
    ...
}

Proposal

Taking the same implementation from terraform:

config {
  interpreter = "/bin/bash"
  flags = ["-e"]
  timeout = "30"
}

Particular useful for timeout. Anything in config would apply globally to all tasks.