You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
7
-
8
-
Tacoscript can manage host systems from simple yaml files written in a [Salt Project](https://saltproject.io/) inspired configuration language.
9
-
10
-
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.
11
-
12
-
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](https://golang.org/doc/install/source#environment).
13
-
14
-
## Installation
15
-
16
-
### As a compiled binary
3
+
<!-- markdownlint-restore -->
17
4
18
-
Jump to [our release page](https://github.com/cloudradar-monitoring/tacoscript/releases/tag/latest) and download a binary for your host OS. Don't forget to download a corresponding md5 file as well and compare the checksums.
Tacoscript can manage host systems from simple yaml files written in a [Salt Project](https://saltproject.io/) inspired configuration language.
36
12
37
-
$ENV:PATH="$ENV:PATH;$($dest)\bin"
13
+
Why do we need another provisioning tool? All competitors like Puppet, Ansible, or Salt have limited
14
+
support for Windows. And they require the installation of additional dependencies, which is not always convenient.
15
+
Tacoscript is the first tool – written in Go – that is shipped as a static binary. A big variety of host OS and platforms,
16
+
in a convenient way.
38
17
39
-
[Environment]::SetEnvironmentVariable(
40
-
"Path",
41
-
[Environment]::GetEnvironmentVariable(
42
-
"Path", [EnvironmentVariableTarget]::Machine
43
-
) + ";$($dest)\bin",
44
-
[EnvironmentVariableTarget]::Machine
45
-
)
46
-
& tacoscript --version
47
-
48
-
## Install as a go binary:
49
-
50
-
go get github.com/cloudradar-monitoring/tacoscript
18
+
Tacoscript is declarative. You define how the system, a file or a software should look like after tacoscript has run.
19
+
Before each run, Tacoscript compares the desired outcome with the current state. Only the missing steps are preformed.
51
20
52
21
## Program execution
53
22
54
-
Prepare a script in the yaml format (see the _Configuration_ section below), e.g. `tascoscript.yaml`
55
-
The tacoscript binary expects a script file to be provided in the input:
23
+
Prepare a script in the yaml format , e.g. `tascoscript.yaml`, then execute it.
56
24
57
-
tacoscript tascoscript.yaml
25
+
```shell
26
+
tacoscript tascoscript.yaml
27
+
```
58
28
59
29
You can also output the execution details with `-v` flag:
60
30
61
-
tacoscript -v tascoscript.yaml
31
+
```shel
32
+
tacoscript -v tascoscript.yaml
33
+
```
62
34
63
35
_You can use any file extension. Using `.taco` for example is fine too._
36
+
64
37
## Scripting
65
38
66
-
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.
39
+
The script file uses the yaml format. The file consists of a list of tasks that define the states of the host system.
40
+
The desired state can be an installed program or files with pre-defined content.
67
41
68
42
Here is the minimal possible `tacoscript.yaml` for Unix:
> Inside a script, we have a task with the id `create-file`. It consists of the function `cmd.run` which executes `touch /tmp/somefile.txt` or its PowerShell equivalent. The desired result of this script execution would be an empty file at `/tmp/somefile.txt`.
87
-
63
+
> Inside a script, we have a task with the id `create-file`. It consists of the function `cmd.run` which executes
64
+
> `touch /tmp/somefile.txt` or its PowerShell equivalent. The desired result of this script execution would be an empty
65
+
> file at `/tmp/somefile.txt`.
88
66
89
67
### Scripts
90
-
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.
91
68
92
-

69
+
The tacoscript.yaml file contains a collection of tasks. Each task defines a desired state of the host system.
70
+
You can add as many tasks as you want. The tacoscript binary will execute tasks from the file sequentially.
93
71
94
72
### Tasks
95
-
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.
96
73
97
-
### Task types
74
+
Each script contains a collection of tasks. Each task has a unique id, and a function that identifies the kind of
75
+
operation the task can do. Tasks get a list of parameters under it as input data. In the example above, the function
76
+
`cmd.run`receives the parameter `-name` with value `/tmp/somefile.txt` and interprets it as a command which should be
- `cmd.run`Run shell commands and scripts [Read more](https://tacoscript.io/functions/commands/)
82
+
- `file.managed`copy, manipulate, download and manage files [Read More](https://tacoscript.io/functions/file/)
83
+
- `pkg.installed`install packages via package manager [Read More](https://tacoscript.io/functions/packages/#pkginstalled)
84
+
- `pkg.uptodate`update packages via package manager [Read More](https://tacoscript.io/functions/packages/#pkguptodate)
85
+
- `pkg.removed`remove packages via package manager [Read More](https://tacoscript.io/functions/packages/#pkgremoved)
86
+
87
+
[Read full documentation]
104
88
105
89
### Templates
106
-
See [Templates rendering](docs/general/templates/README.md)
90
+
91
+
See [Templates rendering](https://tacoscript.io/get-started/template-engine/)
107
92
108
93
### Known limitations
94
+
109
95
- to use shell pipes, redirects or glob expands, please specify a `shell` parameter
110
96
- `user`parameter will require sudo rights for tacoscript, in Windows this parameter is ignored
111
97
- if you use cmd.run tasks in Windows, you'd better specify the shell parameter as `cmd.exe`, otherwise you will get errors like:
112
98
`exec: "xxx": executable file not found in %PATH%`
113
-
- the order of the scripts is not guaranteed. If you don't use the [require](docs/general/dependencies/require.md) values, the scripts will be executed in any order.
99
+
- the order of the scripts is not guaranteed. If you don't use the [require](https://tacoscript.io/get-started/dependencies/)
100
+
values, the scripts will be executed in any order.
114
101
115
102
## Development instructions
116
103
117
104
### Unit-tests
105
+
118
106
You can run unit-tests as:
119
107
120
-
make test
121
-
108
+
```shell
109
+
make test
110
+
```
111
+
122
112
### Static Code Analyses
113
+
123
114
Execute static code analytic tools
124
115
125
116
1. Install golangci-lint using instructions from [this site](https://golangci-lint.run/usage/install/)
126
117
127
118
1. Run the tool using `make sca`
128
119
129
120
### Compile tacoscript binary for your host OS
121
+
130
122
1. Compile tacoscript binary for Unix with `make build`.
131
123
1. Compile tacoscript binary for Windows with `make build-win`
0 commit comments