Simple and extensible server orchestration framework based on specinfra.
Concept
- Simple interface and configurations for orchestration various systems
- Push type task pipeline
- Extensible and pluggable design
Installation
$ gem install rundock
Usage
Edit your targetgroup to "targetgroup.yml" like this sample.
# target section
- target: 192.168.1.11
- target: host-alias-01
---
# target information section
host-alias-01:
host: 192.168.1.12
ssh_opts:
port: 2222
user: anyuser
keys: ["~/.ssh/id_rsa_anyuser"]
ssh_config: "/home/anyuser/custom_config"
and execute rundock.
$ rundock ssh -g /path/to/your-dir/targetgroup.yml -c 'your-gread-command'
or
Edit your operation scenario to "scenario.yml" like this sample.
# scenario section
- target: 192.168.1.11
command:
- "sudo hostname new-host-01"
- "sudo sed -i -e 's/HOSTNAME=old-host-01/HOSTNAME=new-host-01/g' /etc/sysconfig/network"
- target: host-alias-01
command:
- "sudo yum -y install ruby"
task:
- update_gem
- install_bundler
---
# target information section
host-alias-01:
host: 192.168.1.12
ssh_opts:
port: 2222
user: anyuser
keys: ["~/.ssh/id_rsa_anyuser"]
---
# task information section
update_gem:
command:
- "sudo gem update --system"
- "sudo gem update"
install_bundler:
command:
- "sudo gem install bundler --no-ri --no-rdoc"
and execute rundock.
$ rundock do /path/to/your-dir/scenario.yml
You can also specify default_ssh_options.yml (Net::SSH options) file contents that you specified "-d" option to the default ssh options.
- use adhoc ssh
$ rundock ssh -g /path/to/your-dir/targetgroup.yml -c 'your-gread-command' -d /path/to/your-dir/default_ssh_options.yml
- use scenario file
$ rundock do /path/to/your-dir/scenario.yml -d /path/to/your-dir/default_ssh_options.yml
You can see from rundock -h
command.
Commands:
rundock do [SCENARIO] [options] # Run rundock from scenario file
rundock help [COMMAND] # Describe available commands or one specific command
rundock ssh [options] # Run rundock ssh with various options
rundock version # Print version
Options:
-l, [--log-level=LOG_LEVEL]
# Default: info
[--color], [--no-color]
# Default: true
[--header], [--no-header]
# Default: true
[--short-header], [--no-short-header]
[--date-header], [--no-date-header]
# Default: true
Documentations
Run tests
Requirements: Docker environments
$ bundle exec rake spec
Contributing
- Fork it ( https://github.com/[my-github-username]/rundock/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request