|
29 | 29 | cwd => '/', |
30 | 30 | } |
31 | 31 |
|
| 32 | + package { 'nfs-server': |
| 33 | + ensure => latest, |
| 34 | + } |
| 35 | + |
| 36 | + file { '/opt/storage/secondary': |
| 37 | + ensure => 'directory', |
| 38 | + group => '0', |
| 39 | + mode => '755', |
| 40 | + owner => '0', |
| 41 | + type => 'directory', |
| 42 | + } |
| 43 | + |
| 44 | + file { '/opt/storage/secondary/template/tmpl/1/1': |
| 45 | + ensure => 'directory', |
| 46 | + group => '0', |
| 47 | + mode => '755', |
| 48 | + owner => '0', |
| 49 | + type => 'directory', |
| 50 | + } |
| 51 | + |
| 52 | + file { '/opt/storage/secondary/template/tmpl/1/5': |
| 53 | + ensure => 'directory', |
| 54 | + group => '0', |
| 55 | + mode => '755', |
| 56 | + owner => '0', |
| 57 | + type => 'directory', |
| 58 | + } |
| 59 | + |
| 60 | + file { '/etc/exports': |
| 61 | + require => Package['nfs-server'], |
| 62 | + ensure => 'file', |
| 63 | + source => 'puppet:///modules/puppet-devcloud/exports', |
| 64 | + mode => '644', |
| 65 | + owner => '0', |
| 66 | + group => '0', |
| 67 | + } |
| 68 | + |
| 69 | + service { 'nfs-kernel-server': |
| 70 | + requires => Package['nfs-server'], |
| 71 | + ensure => 'running', |
| 72 | + enable => 'true', |
| 73 | + } |
| 74 | + |
| 75 | + exec { "wget-default-template-1-vhd": |
| 76 | + command => "/usr/bin/wget --output-document=/opt/storage/secondary/template/tmpl/1/1/dc68eb4c-228c-4a78-84fa-b80ae178fbfd.vhd http://download.cloud.com/templates/devcloud/defaulttemplates/1/dc68eb4c-228c-4a78-84fa-b80ae178fbfd.vhd", |
| 77 | + creates => "/opt/storage/secondary/template/tmpl/1/1/dc68eb4c-228c-4a78-84fa-b80ae178fbfd.vhd", |
| 78 | + requires => File['/opt/storage/secondary/template/tmpl/1/1'], |
| 79 | + cwd => '/', |
| 80 | + } |
| 81 | + |
| 82 | + exec { "wget-default-template-1-props": |
| 83 | + command => "/usr/bin/wget --output-document=/opt/storage/secondary/template/tmpl/1/1/template.properties http://download.cloud.com/templates/devcloud/defaulttemplates/1/template.properties", |
| 84 | + creates => "/opt/storage/secondary/template/tmpl/1/1/template.properties", |
| 85 | + requires => File['/opt/storage/secondary/template/tmpl/1/1'], |
| 86 | + cwd => '/', |
| 87 | + } |
| 88 | + |
| 89 | + exec { "wget-default-template-5-vhd": |
| 90 | + command => "/usr/bin/wget --output-document=/opt/storage/secondary/template/tmpl/1/5/ce5b212e-215a-3461-94fb-814a635b2215.vhd http://download.cloud.com/templates/devcloud/defaulttemplates/5/ce5b212e-215a-3461-94fb-814a635b2215.vhd", |
| 91 | + creates => "/opt/storage/secondary/template/tmpl/1/5/ce5b212e-215a-3461-94fb-814a635b2215.vhd", |
| 92 | + requires => File['/opt/storage/secondary/template/tmpl/1/5'], |
| 93 | + cwd => '/', |
| 94 | + } |
| 95 | + |
| 96 | + exec { "wget-default-template-5-props": |
| 97 | + command => "/usr/bin/wget --output-document=/opt/storage/secondary/template/tmpl/1/5/template.properties http://download.cloud.com/templates/devcloud/defaulttemplates/5/template.properties", |
| 98 | + creates => "/opt/storage/secondary/template/tmpl/1/5/template.properties", |
| 99 | + requires => File['/opt/storage/secondary/template/tmpl/1/5'], |
| 100 | + cwd => '/', |
| 101 | + } |
| 102 | + |
| 103 | + file { '/opt/storage/primary': |
| 104 | + ensure => 'directory', |
| 105 | + group => '0', |
| 106 | + mode => '755', |
| 107 | + owner => '0', |
| 108 | + type => 'directory', |
| 109 | + } |
| 110 | + |
| 111 | + exec { "configlocal": |
| 112 | + requires => File['/opt/storage/primary'], |
| 113 | + unless => 'xe sr-list | grep local-storage', |
| 114 | + command => "hostuuid=`xe host-list |grep uuid|awk '{print $5}'`; xe sr-create host-uuid=$hostuuid name-label=local-storage shared=false type=file device-config:location=/opt/storage/primary", |
| 115 | + cwd => '/', |
| 116 | + } |
| 117 | + |
| 118 | + |
32 | 119 | } |
0 commit comments