Skip to content

Commit

Permalink
start to switch to hcl (#1)
Browse files Browse the repository at this point in the history
* start to switch to hcl

* start to re-implement error

* start to report error

* finish error reporting

* remove rcl
  • Loading branch information
dzhou121 authored Apr 15, 2024
1 parent 714ff1d commit 98589ac
Show file tree
Hide file tree
Showing 31 changed files with 1,831 additions and 1,215 deletions.
110 changes: 99 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ members = [
]

[workspace.dependencies]
hcl-rs = { git = "https://github.com/lapce/hcl-rs", rev = "fb0ac2875760a8219899f5a4d774d0996a5b06dd" }
hcl-edit = { git = "https://github.com/lapce/hcl-rs", rev = "fb0ac2875760a8219899f5a4d774d0996a5b06dd" }
tempfile = "3.10.1"
os_info = "3.7"
itertools = "0.12.1"
Expand All @@ -55,5 +57,3 @@ tiron = { path = "./tiron" }
tiron-tui = { path = "./tiron-tui" }
tiron-node = { path = "./tiron-node" }
tiron-common = { path = "./tiron-common" }
rcl = { git = "https://github.com/lapce/rcl", rev = "78796fe8845a2a129b21093604006501fa5cde24" }
# rcl = { path = "../rcl" }
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
</div>

## Features
* **No YAML:** Tiron uses a new configuration language called [rcl](https://github.com/ruuda/rcl), which is simple to write with some basic code functionalities.
* **No YAML:** Tiron uses [HCL](https://github.com/hashicorp/hcl) as the configuration language.
* **Agentless:** By using SSH, Tiron connects to the remote machines without the need to install an agent first.
* **TUI:** Tiron has a built in terminal user interfaces to display the outputs of the running tasks.
* **Correctness:** Tiron pre validates all the rcl files and will throw errors before the task is started to execute.
* **Correctness:** Tiron pre validates all the runbook files and will throw errors before the task is started to execute.
* **Speed:** On validating all the input, Tiron also pre populates all the data for tasks, and send them to the remote machines in one go to save the roundtrips between the client and remote.

## Quickstart
Expand Down
26 changes: 0 additions & 26 deletions examples/example_tiron_project/jobs/job1/main.rcl

This file was deleted.

18 changes: 18 additions & 0 deletions examples/example_tiron_project/jobs/job1/main.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use "test.tr" {
job "job2" {}
}

job "job1" {
action "copy" {
name = "the first action"
params {
src = "/tmp/test.tr"
dest = "/tmp/test.conf"
}
}
action "job" {
params {
name = "job2"
}
}
}
9 changes: 9 additions & 0 deletions examples/example_tiron_project/jobs/job1/test.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
job "job2" {
action "copy" {
name = "the first action in job2"
params {
src = "/tmp/test.tr"
dest = "/tmp/test.conf"
}
}
}
Empty file.
31 changes: 0 additions & 31 deletions examples/example_tiron_project/main.rcl

This file was deleted.

71 changes: 71 additions & 0 deletions examples/example_tiron_project/main.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
use "jobs/job1/main.tr" {
job "job1" {
}
}

use "tiron.tr" {
group "group2" {}
}

group "production" {
host "localhost" {
apache = "apache2"
}
}

group "gropu3" {
group "group2" {}
}

run "production" {
name = "initial run"
remote_user = "dz"
become = true

action "package" {
params {
name = [apache, "mariadb-connector-c", "${apache}"]
state = "present"
}
}

action "copy" {
params {
src = "/tmp/test.tr"
dest = "/tmp/test.conf"
}
}

action "job" {
name = "run job1"
params {
name = "job1"
}
}
}

run "group2" {
remote_user = "dz"

action "job" {
params {
name = "job1"
}
}
action "copy" {
params {
src = "/tmp/test.tr"
dest = "/tmp/test.conf"
}
}
action "job" {
params {
name = "job1"
}
}
action "job" {
params {
name = "job1"
}
}
}
Loading

0 comments on commit 98589ac

Please sign in to comment.