Tacoscript library provides functionality for provisioning of remote servers and local machines running on any OS. Tacoscript can be installed as a binary. Therefore it doesn't require any additional tools or programs on the host system.
Tacoscript can manage host systems from simple yaml files written in a Salt Project inspired configuration language.
Why do we need another provisioning tool? Unfortunately, the next competitors like Puppet, Ansible, or Salt have limited support for Windows. And they require the installation of additional dependencies, which is not always convenient.
Tacoscript is written in GO, so it is provided as an executable static binary for a big variety of host OS and platforms, and it requires no additional tools to be installed in the host system. You can find the list of supported OS and architectures here.
Jump to our release page and download a binary for your host OS. Don't forget to download a corresponding md5 file as well and compare the checksums.
wget https://github.com/cloudradar-monitoring/tacoscript/releases/download/latest/tacoscript-latest-darwin-amd64.tar.gz
tar xzf tacoscript-latest-darwin-amd64.tar.gz -C /usr/local/bin/ tacoscript
wget https://github.com/cloudradar-monitoring/tacoscript/releases/download/latest/tacoscript-latest-linux-amd64.tar.gz
tar xzf tacoscript-latest-linux-amd64.tar.gz -C /usr/local/bin/ tacoscript
iwr https://github.com/cloudradar-monitoring/tacoscript/releases/download/latest/tacoscript-latest-windows-amd64.zip `
-OutFile tacoscript-latest-windows-amd64.zip
$dest = "C:\Program Files\tacoscript"
mkdir $dest
mkdir "$($dest)\bin"
Expand-Archive -Path $file -DestinationPath $dest -force
mv "$($dest)\tacoscript.exe" "$($dest)\bin"
$ENV:PATH="$ENV:PATH;$($dest)\bin"
[Environment]::SetEnvironmentVariable(
"Path",
[Environment]::GetEnvironmentVariable(
"Path", [EnvironmentVariableTarget]::Machine
) + ";$($dest)\bin",
[EnvironmentVariableTarget]::Machine
)
& tacoscript --version
go get github.com/cloudradar-monitoring/tacoscript
Prepare a script in the yaml format (see the Configuration section below), e.g. tascoscript.yaml
The tacoscript binary expects a script file to be provided in the input:
tacoscript tascoscript.yaml
You can also output the execution details with -v flag:
tacoscript -v tascoscript.yaml
You can use any file extension. Using .taco for example is fine too.
The script file uses the yaml format. The file consists of a list of tasks that define the states of the host system. The desired state can be an installed program or files with pre-defined content.
Here is the minimal possible tacoscript.yaml for Unix:
# unique id of the task, can be any string
create-file:
#task type (function) to be executed
cmd.run:
#Paramter, command to run
- name: touch /tmp/somefile.txtOn Windows, the file can be:
create-tile:
cmd.run:
- name: New-Item -ItemType file C:\Users\Public\Documents\somefile.txt
- shell: powershellWe can read the script as:
Inside a script, we have a task with the id
create-file. It consists of the functioncmd.runwhich executestouch /tmp/somefile.txtor its PowerShell equivalent. The desired result of this script execution would be an empty file at/tmp/somefile.txt.
The tacoscript.yaml file contains a collection of tasks. Each task defines a desired state of the host system. You can add as many tasks as you want. The tacoscript binary will execute tasks from the file sequentially.
Each script contains a collection of tasks. Each task has a unique id, and a function that identifies the kind of operation the task can do. Tasks get a list of parameters under it as input data. In the example above, the function cmd.run receives the parameter -name with value /tmp/somefile.txt and interprets it as a command which should be executed.
- to use shell pipes, redirects or glob expands, please specify a
shellparameter userparameter will require sudo rights for tacoscript, in Windows this parameter is ignored- if you use cmd.run tasks in Windows, you'd better specify the shell parameter as
cmd.exe, otherwise you will get errors like:exec: "xxx": executable file not found in %PATH% - the order of the scripts is not guaranteed. If you don't use the require values, the scripts will be executed in any order.
You can run unit-tests as:
make test
Execute static code analytic tools
-
Install golangci-lint using instructions from this site
-
Run the tool using
make sca
- Compile tacoscript binary for Unix with
make build. - Compile tacoscript binary for Windows with
make build-win
