README.md in infrataster-0.1.8 vs README.md in infrataster-0.1.9

- old
+ new

@@ -61,19 +61,19 @@ ```ruby # spec/spec_helper.rb require 'infrataster/rspec' Infrataster::Server.define( - :proxy, # name - '192.168.33.10', # ip address - vagrant: true # for vagrant VM + :proxy, # name + '192.168.0.0/16', # ip address + vagrant: true # for vagrant VM ) Infrataster::Server.define( - :app, # name - '172.16.33.11', # ip address - vagrant: true, # for vagrant VM - from: :proxy # access to this machine via SSH port forwarding from proxy + :app, # name + '172.16.0.0/16', # ip address + vagrant: true, # for vagrant VM + from: :proxy # access to this machine via SSH port forwarding from proxy ) # Code generated by `rspec --init` is following... ``` @@ -115,21 +115,21 @@ ```ruby Infrataster::Server.define( # Name of the server, this will be used in the spec files. :proxy, # IP address of the server - '192.168.44.10', + '192.168.0.0/16', # If the server is provided by vagrant and this option is true, # SSH configuration to connect to this server is got from `vagrant ssh-config` command automatically. vagrant: true, ) Infrataster::Server.define( # Name of the server, this will be used in the spec files. :app, # IP address of the server - '172.16.44.11', + '172.16.0.0/16', # If the server is provided by vagrant and this option is true, # SSH configuration to connect to this server is got from `vagrant ssh-config` command automatically. vagrant: true, # Which gateway is used to connect to this server by SSH port forwarding? from: :proxy, @@ -143,9 +143,30 @@ ```ruby Infrataster::Server.define( # ... ssh: {host: 'hostname', user: 'testuser', keys: ['/path/to/id_rsa']} ) +``` + +### fuzzy IP address + +Infrataster has "fuzzy IP address" feature. You can pass IP address which has netmask (= CIDR) to `Infrataster::Server#define`. This needs `vagrant` option or `ssh` option which has `host_name` because this fetches all IP address via SSH and find the matching one. + +```ruby +Infrataster::Server.define( + :app, + # find IP address matching 172.16.0.0 ~ 172.16.255.255 + '172.16.0.0/16', +``` + +Of course, you can set fully-specified IP address too. + +```ruby +Infrataster::Server.define( + :app, + '172.16.11.22', + # or + '172.16.11.22/32', ``` ### #ssh_exec You can execute a command on the server like the following: