Skip to content

Commit

Permalink
add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cbluth committed Aug 16, 2020
1 parent 45da7c1 commit 022b16c
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 2 deletions.
15 changes: 15 additions & 0 deletions docs/Readme.md
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 0 additions & 2 deletions docs/copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
```
1 change: 1 addition & 0 deletions docs/execute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Execute (TODO)
1 change: 1 addition & 0 deletions docs/files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Files (TODO)
1 change: 1 addition & 0 deletions docs/groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Groups (TODO)
50 changes: 50 additions & 0 deletions docs/hosts.md
Original file line number Diff line number Diff line change
@@ -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.<br />
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
```

0 comments on commit 022b16c

Please sign in to comment.