README.md in kakine-0.4.0 vs README.md in kakine-0.5.0
- old
+ new
@@ -20,12 +20,14 @@
$ gem install kakine
## Usage
-You can define Security Group configuration for OpenStack via YAML format. Like following syntax.
+### Syntax
+You can define Security Group configuration for OpenStack in YAML format as the following example.
+
```yaml
app:
rules:
- direction: ingress
protocol: tcp
@@ -42,18 +44,55 @@
protocol: tcp
port: 3000
remote_ip: 0.0.0.0/0
```
+`port`s and `remote_ip`s may be specified as arrays, in which case the rule is expanded to set of rules with all the combinations of them.
+```yaml
+app:
+ rules:
+ - direction: ingress
+ protocol: tcp
+ port: [80, 443]
+ remote_ip:
+ - 192.0.2.0/24
+ - 198.51.100.0/24
+```
+
+
+Top-level keys whose name both starts and ends with underscores (eg. `_common_`, `_default_`) are considered **meta sections** and do not correspond to security groups.
+These sections are useful to define values that commonly appears throughout the file, used with YAML's anchors and references.
+
+```yaml
+_common_:
+ - &net1 192.0.2.0/24
+ - &net2 198.51.100.0/24
+
+restricted_web:
+ rules:
+ - direction: ingress
+ protocol: tcp
+ port: 80
+ remote_ip: *net1
+ - direction: ingress
+ protocol: tcp
+ port: 80
+ remote_ip: *net2
+ description: Restricted HTTP access
+```
+
+### Authentication configuration
+
You need to put a configuration file to home directory.
```sh
% cat ~/.kakine
auth_url: "http://your-openstack-endpoint/v2.0"
username: "admin"
-tenant: "admin"
password: "admin"
```
+
+### Commands
run following command.
```sh
$ kakine show -t tenant_name # show Security Group of tenant_name