torero "Hello, Server" Example

torero supports a Client/Server model where a client can make requests out to a server that handles the actual storage of resources and execution of automations. This example will walk through a quickstart on getting a server up and running and then authenticating to it from a client.

--- title: Single Server/Client --- flowchart LR A(torero client)<-->B(torero server)

torero Server Setup

Steps for torero Server

  1. Install torero bin on server host
  2. Create the torero.conf file. torero will defaultly read it in at ~/.torero.d/torero.conf
[application]
mode = server

[server]
listen_address    = 0.0.0.0
#port             = 50051
#certificate_file =
#private_key_file =
use_tls           = false

Note

TLS where a key/value pair is set on both the server and client is highly encouraged for production usage.

There's a whole slew of options available that can be referred to in the variables list under TORERO_SERVER_* variables in Configuration Variables.

Since this is a single server instance, no etcd database will be configured. That is a more advanced scenario covered in Resilient Design.

(Optional) Validate Server Mode

>_ torero version

version: v1.1.0
commit: bd0290d
executable: /home/ec2-user
mode: server

3. Run torero

>_ torero server

Note

This will run in the foreground, so to not stop the app, the session must be left open. In a real deployment, setting up a start/stop service is recommended.

torero Client Setup

Steps for running the torero Client

  1. Install torero bin on local/client host
  2. Create the torero.conf file (or apply the correct env variables)
[application]
mode         = client

[client]
host              = some.torero-server.domain
#port             = 50051
#certificate_file = /etc/torero/torero.crt
#private_key_file = /etc/torero/torero.key
use_tls           = false

Note

TLS where a key/value pair is set on both the server and client is highly encouraged for production usage.

3. Follow the log in guide to log in to the server.

That's it. Now, any command run on the client is run on the server.