https://github.com/orange-cloudfoundry/bosh-commander
Run a set of commands on multiple vms found by deployments, jobs name and bosh directors.
https://github.com/orange-cloudfoundry/bosh-commander
Last synced: 2 months ago
JSON representation
Run a set of commands on multiple vms found by deployments, jobs name and bosh directors.
- Host: GitHub
- URL: https://github.com/orange-cloudfoundry/bosh-commander
- Owner: orange-cloudfoundry
- License: apache-2.0
- Created: 2017-07-10T13:12:36.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-20T09:32:07.000Z (almost 9 years ago)
- Last Synced: 2024-06-20T11:59:30.729Z (about 2 years ago)
- Language: Go
- Size: 788 KB
- Stars: 1
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bosh-commander
Run a set of commands on multiple vms found by deployments, jobs name and bosh directors.
## Why ?
This was primary created to be able to fix `consul` and `etcd` clusters on a cloud foundry
deployment when cluster wasn't shutdown gracefully.
## Installation
### On *nix system
You can install this via the command-line with either `curl` or `wget`.
#### via curl
```bash
$ sh -c "$(curl -fsSL https://raw.github.com/orange-cloudfoundry/bosh-commander/master/bin/install.sh)"
```
#### via wget
```bash
$ sh -c "$(wget https://raw.github.com/orange-cloudfoundry/bosh-commander/master/bin/install.sh -O -)"
```
### On windows
You can install it by downloading the `.exe` corresponding to your cpu from releases page: https://github.com/orange-cloudfoundry/bosh-commander/releases .
Alternatively, if you have terminal interpreting shell you can also use command line script above, it will download file in your current working dir.
### From go command line
Simply run in terminal:
```bash
$ go get github.com/orange-cloudfoundry/bosh-commander
```
## Usage
You will need to set available directors by creating a `.bosh_commander.yml` config file in your home directory:
```yml
log_level: INFO # Can be also ERROR, WARN or DEBUG
bosh_directors:
- name: mybosh
director_url: https://127.0.0.1:25555
username: myboshusername
password: myboshpassword
uaa_url: https://127.0.0.1:8443 # if you use use an uaa url, it will use uaa to authenticate user
ca_cert_file: path/to/pem.pem
client_id: ~ # if you use a special client for uaa you should set it
client_secret: ~ # if you use a special client for uaa you should set it
```
You will now have to create a script file to perform commands on your vm following this schema:
```yml
job_match: myjob # this is the name of your job, it can be a regex
sudo: true # to run your commands in privilegied mode
deployments: # This is optionnal, if set it will looking only deployments which match regex given
- mydeployment.*
script: # It will be the set of command you want to run on your vms, if command fail it will continue to perform the next command
- echo "my super command"
after_all: # this is optionnal, this is a set of commands to run after all commands in script have been ran in all vms
- echo "this is ran after all vms ran scripts commands"
```
You can found useful scripts in [/scripts](/scripts).
You can now run `bosh-commander run -f myscript.yml`.