Help us understand the problem. What is going on with this article?

DigitaloceanのCLIツール tugboat

More than 3 years have passed since last update.

概要

digitaloceanでのサーバを立ち上げるのに、webサイトを開くのが面倒なんでCLIで操作をできるツールが欲しかった。

vagrant-digitaloceanを使用していたのですが、Linuxディストリビューションを切り替えたいときなどの際に、サイトをみて確認する必要ありが面倒だった。

CLIツール tugboat

tugboat

インストール

gem install tugboat 

rubyは1.9以上

digitaloceanのAPIキー

ここで確認できます。
api_access

環境構築

$ tugboat authorize
Note: You can get this information from digitalocean.com/api_access

Enter your client key:  https://cloud.digitalocean.com/api_accessの取得できるclient ID
Enter your API key: https://cloud.digitalocean.com/api_accessで取得できるAPI Key
Enter your SSH key path (optional, defaults to ~/.ssh/id_rsa): 
Enter your SSH user (optional, defaults to ログインユーザ名): 
Enter your SSH port number (optional, defaults to 22): 

To retrieve region, image, size and key ID's, you can use the corresponding tugboat command, such as `tugboat images`.
Defaults can be changed at any time in your ~/.tugboat configuration file.

Enter your default region ID (optional, defaults to 1 (New York)): 
Enter your default image ID (optional, defaults to 350076 (Ubuntu 13.04 x64)): 
Enter your default size ID (optional, defaults to 66 (512MB)): 
Enter your default ssh key ID (optional, defaults to none): 
Enter your default for private networking (optional, defaults to false): 
Enter your default for enabling backups (optional, defaults to false): 

とりあえずClient IDとAPI Keyを入力する

設定ファイル

$ cat  ~/.tugboat 

authentication:
  client_key: Client ID
  api_key: API Key
ssh:
  ssh_user: 作成するサーバにログインするためのユーザ名
  ssh_key_path: sshキーのパス
  ssh_port: '22'
defaults:
  region: '1' # tugboat regions 表示されたidを書く
  image: '350076' # tugboat images --global 表示されたidを書く
  size: '66' # tugboat sizeで表示されたidを書く 
  ssh_key: ''xxxxx' #tugboat keysで表示されたidを書く
  private_networking: 'false'
  backups_enabled: 'false'

各種コマンドについては
tugboat --helpやtugboat --help コマンド名で確認できます。
またはtugboatで確認できます。

感想

便利

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away