Class: Pec::Configure::Sample

Inherits:
Object
  • Object
show all
Defined in:
lib/pec/sample.rb

Class Method Summary collapse

Class Method Details

.pec_fileObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/pec/sample.rb', line 5

def pec_file
  {
    "your_sever_name" => {
      "tenant" =>  "your_tenant",
      "image" =>  "centos-7",
      "flavor" =>  "m1.small",
      "allowed_address_pairs" => "nova",
      "networks" => {
        "eth0" => {
          "bootproto" => "static",
          "ip_address" => "10.0.0.0/24",
          "allowed_address_pairs" => ["10.0.0.1"],
          "gateway" =>  "10.0.0.254",
          "dns1" => "10.0.0.10"
        },
        "eth1" => {
          "bootproto" => "static",
          "ip_address" => "20.0.0.11/24",
          "gateway" =>  "20.0.0.254",
          "dns1" => "20.0.0.10"
        }
      },
      "security_group" => [
        "default",
        "www_from_any"
      ],
      "templates" => [
        "web_server.yaml"
      ],
      "user_data" => {
          "hostname" => "pec",
          "fqdn" => "pec.pyama.com"
       }
    }
  }
end

.user_dataObject



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/pec/sample.rb', line 42

def user_data
  {
    "hostname" => "pec",
    "fqdn" => "pec.pyama.com",
    "users" => [
      {
        "name" => "centos",
        "groups" => "sudo",
        "shell" => "/bin/sh"
      }
    ]
  }
end