From 022b16c5e059e0782ea8a285f8ba4d636bf63846 Mon Sep 17 00:00:00 2001 From: Cobin Bluth Date: Sun, 16 Aug 2020 15:58:53 +0200 Subject: [PATCH] add some docs --- docs/Readme.md | 15 +++++++++++++++ docs/copy.md | 2 -- docs/execute.md | 1 + docs/files.md | 1 + docs/groups.md | 1 + docs/hosts.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 68 insertions(+), 2 deletions(-) diff --git a/docs/Readme.md b/docs/Readme.md index b872e77..0fed2c4 100644 --- a/docs/Readme.md +++ b/docs/Readme.md @@ -1,2 +1,17 @@ # gsh Documentation +`gsh` supports some basic CRUD-like operations: put/get/delete. +You can add specifc types of items to your gsh inventory, by using [`make`](make.md): +- [`Hosts`](hosts.md) +- [`Groups`](groups.md) +- [`Scripts`](scripts.md) +- [`Files`](files.md) + +Here is a list of the CRUD-like operations: +- [`make`](make.md) +- [`show`](show.md) +- [`delete`](delete.md) + +You can also execute scripts and copy files on remote hosts: +- [`execute`](execute.md) +- [`copy`](copy.md) diff --git a/docs/copy.md b/docs/copy.md index 7a429dc..3e9c5d3 100644 --- a/docs/copy.md +++ b/docs/copy.md @@ -21,7 +21,6 @@ $ gsh copy file sshrc -n demo1 dst=/etc/sshrc chmod=a+rx ║ File └──────────╮ ╿ Name : Labels └ sshrc : scope=host target=demo1 dst=/etc/sshrc chmod=a+rx -2020/08/10 17:06:42 ``` ```bash $ # copying a file to group @@ -30,5 +29,4 @@ $ gsh copy file nginx.conf -g group1 dst=/etc/nginx/nginx.conf ║ File └──────────╮ ╿ Name : Labels └ nginx.conf : scope=group target=group1 dst=/etc/nginx/nginx.conf -2020/08/10 17:06:42 ``` diff --git a/docs/execute.md b/docs/execute.md index e69de29..05c3b08 100644 --- a/docs/execute.md +++ b/docs/execute.md @@ -0,0 +1 @@ +# Execute (TODO) diff --git a/docs/files.md b/docs/files.md index e69de29..e8cca27 100644 --- a/docs/files.md +++ b/docs/files.md @@ -0,0 +1 @@ +# Files (TODO) diff --git a/docs/groups.md b/docs/groups.md index e69de29..9a0c442 100644 --- a/docs/groups.md +++ b/docs/groups.md @@ -0,0 +1 @@ +# Groups (TODO) diff --git a/docs/hosts.md b/docs/hosts.md index e69de29..1dbf970 100644 --- a/docs/hosts.md +++ b/docs/hosts.md @@ -0,0 +1,50 @@ +# Hosts +A host represents an ssh server running on a host on the network. +[`Groups`](groups.md) can be created to represent groups of hosts. + +Aliases: +- `host` +- `hosts` +- `node` +- `nodes` + +## Making, Updating, Deleting, and Listing Hosts +Your hosts inventory is empty until you have added a host.
+These are the types operations you can do with a host: +- [`make`](make.md) # Make or Update a host in inventory +- [`delete`](delete.md) # Delete a host from inventory +- [`show`](show.md) # Show or List hosts +- [`execute`](execute.md) # Execute scripts on hosts +- [`copy`](copy.md) # Copy files/scripts to hosts + +## Special Labels + +Hosts use special [`labels`](labels.md), please provide an `address` label when adding a host to your inventory. +Supplying an `address` label allows `gsh` to connect to the servers address via ssh. + +## Examples: + +```bash +$ # making a host with labels +$ gsh make host dev0 address=dev0.local develop=true project=foo +╔══════╕ Set! +║ Host └──────────╮ +╿ Name : Labels +└ dev0 : address=dev0.local develop=true project=foo +``` +```bash +$ # updating the same host with different labels +$ gsh make host dev0 address=dev0.local develop=true project=bar +╔══════╕ Set! +║ Host └──────────╮ +╿ Name : Labels +└ dev0 : address=dev0.local develop=true project=bar +``` +```bash +$ # deleting a host +$ gsh del host demo1 +╔══════╕ Deleted! +║ Host └──────────╮ +╿ Name : Labels +└ demo1 : address=demo1.local demo=true +``` \ No newline at end of file