|
| 1 | +# {{ ansible_managed }} |
| 2 | + |
| 3 | +{% set used_lvm_devices = [] %} |
| 4 | +{% if host_lvm_devices_filter_override|length > 0 %} |
| 5 | + {% set used_lvm_devices = host_lvm_devices_filter_override %} |
| 6 | +{% else %} |
| 7 | + {% set lv_devices = lvm_devices.stdout.split('\n') %} |
| 8 | + {% if lv_devices|length > 0 %} |
| 9 | + {% for net in lv_devices %} |
| 10 | + {% if net != '' %} |
| 11 | + {% set lv_device = '"a/' + net + '/"' %} |
| 12 | + {% if used_lvm_devices.append(lv_device) %}{% endif %} |
| 13 | + {% endif %} |
| 14 | + {% endfor %} |
| 15 | + {% endif %} |
| 16 | + |
| 17 | +# Ansible Discovered LVM Devices {{ lv_devices }} |
| 18 | +{% endif %} |
| 19 | + |
| 20 | +{% if used_lvm_devices|length <= 0 %} |
| 21 | + {# If there are no LVM devices present, allow all devices to be scanned #} |
| 22 | + {% if used_lvm_devices.append('"a/.*/"') %}{% endif %} |
| 23 | +{% else %} |
| 24 | + {# Append 'loop.*' to the list to help with AIO deployments. #} |
| 25 | + {% if used_lvm_devices.append('"a/loop.*/"') %}{% endif %} |
| 26 | + {# Disable scanning any other devices than the ones listed. #} |
| 27 | + {% if used_lvm_devices.append('"r/.*/"') %}{% endif %} |
| 28 | +{% endif %} |
| 29 | + |
| 30 | +devices { |
| 31 | + dir = "/dev" |
| 32 | + scan = [ "/dev" ] |
| 33 | + obtain_device_list_from_udev = 1 |
| 34 | + preferred_names = [ ] |
| 35 | + filter = [ {{ used_lvm_devices|join(', ') }} ] |
| 36 | + cache_dir = "/run/lvm" |
| 37 | + cache_file_prefix = "" |
| 38 | + write_cache_state = 1 |
| 39 | + sysfs_scan = 1 |
| 40 | + multipath_component_detection = 1 |
| 41 | + md_component_detection = 1 |
| 42 | + md_chunk_alignment = 1 |
| 43 | + data_alignment_detection = 1 |
| 44 | + data_alignment = 0 |
| 45 | + data_alignment_offset_detection = 1 |
| 46 | + ignore_suspended_devices = 0 |
| 47 | + disable_after_error_count = 0 |
| 48 | + require_restorefile_with_uuid = 1 |
| 49 | + pv_min_size = 2048 |
| 50 | + issue_discards = 1 |
| 51 | +} |
| 52 | +allocation { |
| 53 | + maximise_cling = 1 |
| 54 | + mirror_logs_require_separate_pvs = 0 |
| 55 | + thin_pool_metadata_require_separate_pvs = 0 |
| 56 | +} |
| 57 | +log { |
| 58 | + verbose = 0 |
| 59 | + silent = 0 |
| 60 | + syslog = 1 |
| 61 | + overwrite = 0 |
| 62 | + level = 0 |
| 63 | + indent = 1 |
| 64 | + command_names = 0 |
| 65 | + prefix = " " |
| 66 | +} |
| 67 | +backup { |
| 68 | + backup = 1 |
| 69 | + backup_dir = "/etc/lvm/backup" |
| 70 | + archive = 1 |
| 71 | + archive_dir = "/etc/lvm/archive" |
| 72 | + retain_min = 10 |
| 73 | + retain_days = 30 |
| 74 | +} |
| 75 | +shell { |
| 76 | + history_size = 100 |
| 77 | +} |
| 78 | +global { |
| 79 | + umask = 077 |
| 80 | + test = 0 |
| 81 | + units = "h" |
| 82 | + si_unit_consistency = 1 |
| 83 | + activation = 1 |
| 84 | + proc = "/proc" |
| 85 | + locking_type = 1 |
| 86 | + wait_for_locks = 1 |
| 87 | + fallback_to_clustered_locking = 1 |
| 88 | + fallback_to_local_locking = 1 |
| 89 | + locking_dir = "/run/lock/lvm" |
| 90 | + prioritise_write_locks = 1 |
| 91 | + abort_on_internal_errors = 0 |
| 92 | + detect_internal_vg_cache_corruption = 0 |
| 93 | + metadata_read_only = 0 |
| 94 | + mirror_segtype_default = "mirror" |
| 95 | + use_lvmetad = 0 |
| 96 | + thin_check_executable = "/usr/sbin/thin_check" |
| 97 | + thin_check_options = [ "-q" ] |
| 98 | +} |
| 99 | +activation { |
| 100 | + checks = 0 |
| 101 | + udev_sync = 1 |
| 102 | + udev_rules = 1 |
| 103 | + verify_udev_operations = 0 |
| 104 | + retry_deactivation = 1 |
| 105 | + missing_stripe_filler = "error" |
| 106 | + use_linear_target = 1 |
| 107 | + reserved_stack = 64 |
| 108 | + reserved_memory = 8192 |
| 109 | + process_priority = -18 |
| 110 | + mirror_region_size = 512 |
| 111 | + readahead = "auto" |
| 112 | + raid_fault_policy = "warn" |
| 113 | + mirror_log_fault_policy = "allocate" |
| 114 | + mirror_image_fault_policy = "remove" |
| 115 | + snapshot_autoextend_threshold = 100 |
| 116 | + snapshot_autoextend_percent = 20 |
| 117 | + thin_pool_autoextend_threshold = 100 |
| 118 | + thin_pool_autoextend_percent = 20 |
| 119 | + use_mlockall = 0 |
| 120 | + monitoring = 0 |
| 121 | + polling_interval = 15 |
| 122 | +} |
| 123 | +dmeventd { |
| 124 | + mirror_library = "libdevmapper-event-lvm2mirror.so" |
| 125 | + snapshot_library = "libdevmapper-event-lvm2snapshot.so" |
| 126 | + thin_library = "libdevmapper-event-lvm2thin.so" |
| 127 | +} |
0 commit comments