pec 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc3535cbaddf4892db147de807c797e7f43f5058
4
- data.tar.gz: ebfa226eee05a7f65df04bd5a64f3ac279812e33
3
+ metadata.gz: 4e9c85132c3b3c997657d408e5de29e8c41ee89a
4
+ data.tar.gz: 94e297a84db72c730ee36098bebfc55d41262aa7
5
5
  SHA512:
6
- metadata.gz: 60c4b66103aba2fcacd4ea88d9e76282fe99433fce7ad8fdc32860e7642e3a181f5a039daf40a8fd0f728da64b5c6edaff58bba5ac337403d746e5fc7975d14d
7
- data.tar.gz: f32ba3a3a02bbe53cac72f7d4aa47e56be90a507e446e056a7080a2fbbfba3d1209b2adbabe1d5ddcc4f5867c14fb56fa7ba462545c921b845af4586403a507c
6
+ metadata.gz: 9e1eb1c2a62b3af7401f815086c24e37e5cef3de4d8665d181fb6514fae881a04254040a6f60d44803c5738c0a167fc08760c2e2d2b770bb09ea6e7effc6e1af
7
+ data.tar.gz: 6ee13126b25e252fc4079a263d651eef8ab9399888ccb8719ec607b52646377aaf2f7517a61d233cea87a05e27401042d611b01b41d8994467f38b766c9da8d6
@@ -47,7 +47,7 @@ module Pec
47
47
  end
48
48
 
49
49
  def netmask(ports)
50
- ports.find { |p| p.device_name == @name }.netmask
50
+ ports.find { |p| p.device_name == @name }.netmask(@ip_address.split("/").last)
51
51
  end
52
52
 
53
53
  def port_ip_address(ports)
@@ -4,31 +4,29 @@ module Pec
4
4
  class << self
5
5
  def pec_file
6
6
  {
7
- "sever_name" => {
7
+ "your_sever_name" => {
8
8
  "tenant" => "your_tenant",
9
9
  "image" => "centos-7",
10
10
  "flavor" => "m1.small",
11
- "networks" => [
12
- {
13
- "eth0" => {
14
- "bootproto" => "static",
15
- "ip_address" => "10.0.0.0/24",
16
- "gateway" => "10.0.0.254",
17
- "dns1" => "10.0.0.10"
18
- },
19
- "eth1" => {
20
- "bootproto" => "static",
21
- "ip_address" => "20.0.0.11/24",
22
- "gateway" => "20.0.0.254",
23
- "dns1" => "20.0.0.10"
24
- }
11
+ "networks" => {
12
+ "eth0" => {
13
+ "bootproto" => "static",
14
+ "ip_address" => "10.0.0.0/24",
15
+ "gateway" => "10.0.0.254",
16
+ "dns1" => "10.0.0.10"
17
+ },
18
+ "eth1" => {
19
+ "bootproto" => "static",
20
+ "ip_address" => "20.0.0.11/24",
21
+ "gateway" => "20.0.0.254",
22
+ "dns1" => "20.0.0.10"
25
23
  }
26
- ],
24
+ },
27
25
  "security_group" => [
28
26
  "default",
29
27
  "www from any"
30
28
  ],
31
- "template" => "web_server.yaml",
29
+ "templates" => "web_server.yaml",
32
30
  "user_data" => {
33
31
  "hostname" => "pec",
34
32
  "fqdn" => "pec.pyama.com"
@@ -32,8 +32,8 @@ module Pec
32
32
  @port["network_id"]
33
33
  end
34
34
 
35
- def netmask
36
- IP.new(@port["fixed_ips"][0]["ip_address"]).netmask.to_s
35
+ def netmask(cidr)
36
+ IP.new("#{@port["fixed_ips"][0]["ip_address"]}/#{cidr}").netmask.to_s
37
37
  end
38
38
  end
39
39
  end
@@ -1,3 +1,3 @@
1
1
  module Pec
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kazuhiko yamashita