Class: Pec::Configure::Sample

Inherits:
Object
  • Object
show all
Defined in:
lib/pec/configure/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
# File 'lib/pec/configure/sample.rb', line 5

def pec_file
  {
    "sever_name" => {
      "tenant" =>  "your_tenant",
      "image" =>  "centos-7",
      "flavor" =>  "m1.small",
      "networks" => [
        {
          "eth0" => {
            "bootproto" => "static",
            "ip_address" => "10.0.0.0/24",
            "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"
      ],
      "template" => "web_server.yaml",
      "user_data" => {
          "hostname" => "pec",
          "fqdn" => "pec.pyama.com"
       }
    }
  }
end

.user_dataObject



39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/pec/configure/sample.rb', line 39

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