Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mbovo/yacasc
Yet Another Configurator as Code
https://github.com/mbovo/yacasc
Last synced: 17 days ago
JSON representation
Yet Another Configurator as Code
- Host: GitHub
- URL: https://github.com/mbovo/yacasc
- Owner: mbovo
- License: apache-2.0
- Created: 2020-06-29T16:54:39.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-11T20:41:16.000Z (over 3 years ago)
- Last Synced: 2024-10-20T09:19:46.967Z (2 months ago)
- Language: Go
- Homepage:
- Size: 90.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yet Another Configurator As Code
![Go](https://github.com/mbovo/yacasc/workflows/Go/badge.svg)
A little golang tool that try to implement "as code" approach
```
yacasc v0.0.2.12083d9 - darwin.amd64
Yet Another Configuration as CodeUsage:
yacasc [command]Available Commands:
command Show command usage
help Help about any command
list List available command
print Print internal info
run Run the step file
verify Try to identify changes
version Print version and exitFlags:
-c, --config string Global configuration file
-h, --help help for yacasc
-v, --vars string Variables fileUse "yacasc [command] --help" for more information about a command.
```
## Implemented commands
```
$ yacasc list
yacasc v0.0.2.12083d9 - darwin.amd64
Available Commands:
unzip Extracts zip archives in a given folder
brew Handle homebrew actions
hashfile Calculate SHA256 hash of a file
hash Calculate SHA256 hash of a string
download Download data from remote URI saving it to dest file
echo Print out the give strings
exec Execute a binary with arguments
shell Execute commands using default shell
copy Copy source path to dest
exists Return OK if the path currently exists
link Create a symbolic link like the ln command
mkdir Create a directory
move Rename a path
remove Remove one or more file or directories
which Return the current absolute path of a given executable if in PATH
find Looks for specified patterns in given directory
template Use the given source file as template, resolve variables and output it to dest
setvars Set variables
printvars Print out all recorded vars
```## Example of step file
```yaml
---
- name: StepName
vars:
sayHallo: false
cmds:
- echo:
msg: message in the bottle
- echo:
msg: hallo world
opts:
when: "{{sayHallo}}"
- find:
path: /tmp/
pattern: "file"
opts:
register: fileList
- hashFile:
args: []
fromVar: fileList
opts:
register: myvar
- printvars:
```
The output will be (assuming a `/tmp/file` exists):
```
yacasc v0.0.2.12083d9 - darwin.amd64
Loaded resources/stepv2.yml
Step 1/1: Step1
- echo [OK] message in the bottle\n
- echo [SKIPPED]
- find [OK]
/tmp/file -rw-r--r-- 75
- hashFile [OK]
/tmp/file 8503ff8fcb48ecf19620378aa2027f4a3045674f8a621d8239f681ea0a1b0423
- printvars [OK]
myvar map[/tmp/file:8503ff8fcb48ecf19620378aa2027f4a3045674f8a621d8239f681ea0a1b0423]
sayHallo false
fileList map[/tmp/file:-rw-r--r-- 75]```