Browse Source

parametrize lvm filters

Change-Id: I556ab82a1dc0ce711958404165e419275ff5ce19
pull/115/head
Jiri Broulik 7 years ago
parent
commit
b916c8e9e5
3 changed files with 13 additions and 1 deletions
  1. +1
    -1
      linux/files/lvm.conf
  2. +3
    -0
      linux/map.jinja
  3. +9
    -0
      linux/storage/lvm.sls

+ 1
- 1
linux/files/lvm.conf View File

@@ -129,7 +129,7 @@ devices {
# Example
# Accept every block device:

filter = [ "r|/dev/sd.*|","r|/dev/mapper/.*|","r|/dev/.*/by-id/.*|", "r|/dev/.*/by-path/.*|" ]
filter = [ {%- for vgname, vg in storage.lvm.iteritems() %}{%- if vg.get('enabled', True) %}{%- for dev in vg.devices %}"a|{{ dev }}*|"{%- if not loop.last %},{%- endif %}{%- endfor %}{%- endif %}{%- endfor %}, "r|.*|" ]

# filter = [ "a|.*/|" ]
# Reject the cdrom drive:

+ 3
- 0
linux/map.jinja View File

@@ -145,6 +145,7 @@
'mount': {},
'swap': {},
'lvm': {},
'lvm_services': ['lvm2', 'lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
'loopback': {},
'nfs': {
'pkgs': ['nfs-utils']
@@ -159,6 +160,7 @@
'mount': {},
'swap': {},
'lvm': {},
'lvm_services': ['lvm2', 'lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
'loopback': {},
'nfs': {
'pkgs': ['nfs-common']
@@ -174,6 +176,7 @@
'mount': {},
'swap': {},
'lvm': {},
'lvm_services': ['lvm2', 'lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
'loopback': {},
'nfs': {
'pkgs': ['nfs-utils']

+ 9
- 0
linux/storage/lvm.sls View File

@@ -54,4 +54,13 @@ lvm_{{ vg.get('name', vgname) }}_lv_{{ volume.get('name', lvname) }}:
- require:
- pkg: linux_lvm_pkgs

lvm_services:
service.running:
- enable: true
- names: {{ storage.lvm_services }}
- require:
- file: /etc/lvm/lvm.conf
- watch:
- file: /etc/lvm/lvm.conf

{%- endif %}

Loading…
Cancel
Save