|
62 | 62 | } |
63 | 63 |
|
64 | 64 | if $ensure == 'present' and $createfs { |
65 | | - Logical_volume[$name] -> |
66 | | - Filesystem[$lvm_device_path] -> |
67 | | - Mount[$mount_title] |
68 | | - } elsif $ensure != 'present' and $createfs { |
69 | | - Mount[$mount_title] -> |
70 | | - Filesystem[$lvm_device_path] -> |
71 | 65 | Logical_volume[$name] |
| 66 | + -> Filesystem[$lvm_device_path] |
| 67 | + -> Mount[$mount_title] |
| 68 | + } elsif $ensure != 'present' and $createfs { |
| 69 | + Mount[$mount_title] |
| 70 | + -> Filesystem[$lvm_device_path] |
| 71 | + -> Logical_volume[$name] |
72 | 72 | } |
73 | 73 |
|
74 | 74 | logical_volume { $name: |
|
89 | 89 | mirrorlog => $mirrorlog, |
90 | 90 | no_sync => $no_sync, |
91 | 91 | region_size => $region_size, |
92 | | - alloc => $alloc |
| 92 | + alloc => $alloc, |
93 | 93 | } |
94 | 94 |
|
95 | 95 | if $createfs { |
|
101 | 101 | } |
102 | 102 |
|
103 | 103 | if $createfs or $ensure != 'present' { |
104 | | - if $fs_type == 'swap' { |
105 | | - if $ensure == 'present' { |
106 | | - exec { "swapon for '${mount_title}'": |
107 | | - path => [ '/bin', '/usr/bin', '/sbin' ], |
108 | | - command => "swapon ${lvm_device_path}", |
109 | | - unless => "grep `readlink -f ${lvm_device_path}` /proc/swaps", |
110 | | - subscribe => Mount[$mount_title], |
111 | | - } |
112 | | - } else { |
113 | | - exec { "swapoff for '${mount_title}'": |
114 | | - path => [ '/bin', '/usr/bin', '/sbin' ], |
115 | | - command => "swapoff ${lvm_device_path}", |
116 | | - onlyif => "grep `readlink -f ${lvm_device_path}` /proc/swaps", |
117 | | - notify => Mount[$mount_title], |
118 | | - } |
119 | | - } |
120 | | - } else { |
| 104 | + if $fs_type != 'swap' { |
121 | 105 | exec { "ensure mountpoint '${fixed_mountpath}' exists": |
122 | 106 | path => [ '/bin', '/usr/bin' ], |
123 | 107 | command => "mkdir -p ${fixed_mountpath}", |
124 | 108 | unless => "test -d ${fixed_mountpath}", |
125 | 109 | before => Mount[$mount_title], |
126 | 110 | } |
127 | 111 | } |
| 112 | + |
128 | 113 | mount { $mount_title: |
129 | 114 | ensure => $mount_ensure, |
130 | 115 | name => $fixed_mountpath, |
|
0 commit comments