From 7ce18d8c464dc98c5ed0420904f5612972f49c14 Mon Sep 17 00:00:00 2001 From: N Date: Sat, 21 Sep 2019 21:14:36 +0100 Subject: [PATCH] fix(pillardata): clustered=>shared; fix yamllint issues --- lvm/.yamllint => .yamllint | 0 README.rst | 4 +- commitlint.config.js | 3 + lvm/defaults.yaml | 10 +-- lvm/map.jinja | 14 ++-- lvm/oscodename.yaml | 37 ----------- lvm/osfamilymap.yaml | 7 +- lvm/osfingermap.yaml | 4 +- lvm/osmap.yaml | 6 +- pillar.example | 112 ++++++++++++++++---------------- test/salt/pillar/pillar.example | 58 +++++++---------- 11 files changed, 104 insertions(+), 151 deletions(-) rename lvm/.yamllint => .yamllint (100%) create mode 100644 commitlint.config.js delete mode 100644 lvm/oscodename.yaml diff --git a/lvm/.yamllint b/.yamllint similarity index 100% rename from lvm/.yamllint rename to .yamllint diff --git a/README.rst b/README.rst index e920a5e..e932e56 100644 --- a/README.rst +++ b/README.rst @@ -280,7 +280,7 @@ Split volume group(s) into two:: devices: - /dev/sdf options: - clustered: n + shared: n maxphysicalvolumes: 0 maxlogicalvolumes: 0 @@ -313,7 +313,7 @@ Create volume group(s):: - /dev/sdb - /dev/sdc options: - clustered: n + shared: n maxlogicalvolumes: 0 maxphysicalvolumes: 0 physicalextentsize: 1024 diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..2f9d1aa --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], +}; diff --git a/lvm/defaults.yaml b/lvm/defaults.yaml index 60dda6b..717f034 100644 --- a/lvm/defaults.yaml +++ b/lvm/defaults.yaml @@ -1,5 +1,6 @@ # vim: sts=2 ts=2 sw= et ai # +--- lvm: pkgs: - lvm2 @@ -26,11 +27,10 @@ lvm: vendor: kernel format: div: "=" - ucl: False - json: False + ucl: false + json: false vg: - enable_export: False - enable_cfgrestore: False + enable_export: false + enable_cfgrestore: false pv: {} lv: {} - diff --git a/lvm/map.jinja b/lvm/map.jinja index 2dc2bc5..c84acd2 100644 --- a/lvm/map.jinja +++ b/lvm/map.jinja @@ -7,10 +7,8 @@ {%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %} {%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %} {%- import_yaml tplroot ~ "/osmap.yaml" as osmap %} -{%- import_yaml tplroot ~ "/oscodename.yaml" as oscodename %} {%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %} - {#- Retrieve the config dict only once #} {%- set _config = salt['config.get'](tplroot, default={}) %} @@ -24,15 +22,11 @@ osmap, grain='os', merge=salt['grains.filter_by']( - oscodename, - grain='oscodename', + osfingermap, + grain='osfinger', merge=salt['grains.filter_by']( - osfingermap, - grain='osfinger', - merge=salt['grains.filter_by']( - _config, - default='lookup' - ) + _config, + default='lookup' ) ) ) diff --git a/lvm/oscodename.yaml b/lvm/oscodename.yaml deleted file mode 100644 index f920e35..0000000 --- a/lvm/oscodename.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: ft=yaml -# -{% macro debian_codename(name, codename=none) %} -{{ codename|default(name, true) }}: -{% endmacro %} - -{% macro fedora_codename(name, release, codename) %} -{{ codename|default(name, true) }}: -{% endmacro %} - -## Debian GNU/Linux -{{ debian_codename('wheezy') }} -{{ debian_codename('jessie') }} -{{ debian_codename('stretch') }} -{{ debian_codename('buster') }} -{{ debian_codename('bullseye') }} - - ## `oscodename` is longname if `lsb-release` not installed -{{ debian_codename('wheezy', 'Debian GNU/Linux 7 (wheezy)') }} -{{ debian_codename('jessie', 'Debian GNU/Linux 8 (jessie)') }} -{{ debian_codename('stretch', 'Debian GNU/Linux 9 (stretch)') }} -{{ debian_codename('buster', 'Debian GNU/Linux 10 (buster)') }} -{{ debian_codename('bullseye', 'Debian GNU/Linux 11 (bullseye)') }} - -## Ubuntu -{{ debian_codename('trusty', 'trusty') }} -{{ debian_codename('xenial', 'xenial') }} -{{ debian_codename('artful', 'artful') }} -{{ debian_codename('bionic', 'bionic') }} -{{ debian_codename('cosmic', 'cosmic') }} - -## Fedora -# `oscodename` grain has long distro name -{{ fedora_codename('Fedora-29', 29, 'Fedora 29 (Twenty Nine)') }} - -# vim: ft=sls diff --git a/lvm/osfamilymap.yaml b/lvm/osfamilymap.yaml index 9f5af64..c8676cb 100644 --- a/lvm/osfamilymap.yaml +++ b/lvm/osfamilymap.yaml @@ -11,8 +11,8 @@ # osfamilymap: {} --- Debian: - #modules: - # dm_thin_pool + # modules: + # dm_thin_pool pkgs: - lvm2 - thin-provisioning-tools @@ -22,7 +22,6 @@ RedHat: - lvm2 - cryptsetup - device-mapper-persistent-data - - thin-provisioning-tools profiles: default: thin-generic: {} @@ -33,6 +32,7 @@ RedHat: Arch: pkgs: + - lvm2 - thin-provisioning-tools OpenBSD: @@ -40,6 +40,7 @@ OpenBSD: Suse: pkgs: + - lvm2 - thin-provisioning-tools Gentoo: {} diff --git a/lvm/osfingermap.yaml b/lvm/osfingermap.yaml index 0d24c45..cb07b06 100644 --- a/lvm/osfingermap.yaml +++ b/lvm/osfingermap.yaml @@ -17,8 +17,8 @@ CentOS-6: CentOS-7: pkgs: - - device-mapper-persistent-data #aka thin-provisioning-tools + - device-mapper-persistent-data # was thin-provisioning-tools CentOS-8: pkgs: - - device-mapper-persistent-data #aka thin-provisioning-tools + - device-mapper-persistent-data # was thin-provisioning-tools diff --git a/lvm/osmap.yaml b/lvm/osmap.yaml index 0a2664c..3a82214 100644 --- a/lvm/osmap.yaml +++ b/lvm/osmap.yaml @@ -13,9 +13,11 @@ # os_family: RedHat Fedora: pkgs: - - device-mapper-persistent-data #aka thin-provisioning-tools + - lvm2 + - device-mapper-persistent-data # was thin-provisioning-tools # os_family: RedHat Amazon: pkgs: - - device-mapper-persistent-data #aka thin-provisioning-tools + - lvm2 + - device-mapper-persistent-data # was thin-provisioning-tools diff --git a/pillar.example b/pillar.example index 62b53cf..fef644b 100644 --- a/pillar.example +++ b/pillar.example @@ -1,5 +1,6 @@ # vim: sts=2 ts=2 sw= et ai # +--- lvm: config: dir: @@ -16,43 +17,43 @@ lvm: thin_pool_autoextend_percent: 20 files: - #loopbackdir: /tmp/loopdevs #Where to create backing files? + # loopbackdir: /tmp/loopdevs # Where to create backing files? remove: - /tmp/loopdevs/testfile1.img - /tmp/loopdevs/testfile2.img create: - truncate: #Shrink or extend the size of each FILE to the specified size + truncate: # Shrink or extend the size of each FILE to the specified size testfile1.img: options: size: 100M - dd: #copy a file, converting and formatting according to the operands + dd: # copy a file, converting and formatting according to the operands /tmp/loopdevs/testfile2.img: options: if: /dev/urandom bs: 1024 count: 204800 - losetup: #setup loop devices. todo: could be 'list' instead. + losetup: # setup loop devices. todo: could be 'list' instead. /tmp/loopdevs/testfile1.img: {} /tmp/loopdevs/testfile2.img: {} pv: remove: /tmp/loopdevs/loopback1: options: - verbose: True + verbose: true loopback: size: 10G encryption: none /dev/sdb: options: - verbose: True + verbose: true /dev/sdc: options: - debug: True - /dev/sdd: - /dev/sde: - /dev/sdf: + debug: true + /dev/sdd: {} + /dev/sde: {} + /dev/sdf: {} change: - ##Named PV must belong to VG; i.e. PV must be allocatable + # Named PV must belong to VG; i.e. PV must be allocatable /dev/sdd: options: addtag: 'goodpvs' @@ -63,53 +64,53 @@ lvm: options: setphysicalvolumesize: 1G move: - ##(Named LV and) old PV must be in same VG; i.e. PVs must be allocatable + # (Named LV and) old PV must be in same VG; i.e. PVs must be allocatable /dev/sdd: dest: /dev/sde options: - #name: vg00/lv1 - noudevsync: True + # name: vg00/lv1 + noudevsync: true create: - /dev/loop0: #hopefully /tmp/loopdevs/testfile1.img - /dev/loop1: #hopefully /tmp/loopdevs/testfile2.img - /dev/sdb: + /dev/loop0: {} # hopefully /tmp/loopdevs/testfile1.img + /dev/loop1: {} # hopefully /tmp/loopdevs/testfile2.img + /dev/sdb: {} /dev/sdc: options: - verbose: True - /dev/sdd: + verbose: true + /dev/sdd: {} /dev/sde: options: - override: True + override: true dataalignmentoffset: 7s metadatacopies: 1 metadatasize: 40MiB - /dev/sdf: + /dev/sdf: {} vg: cfgbackup: vg00: file: vg00_backup_today options: - quiet: True + quiet: true import: i_do_not_exist: options: - verbose: True + verbose: true remove: vg00: options: - noudevsync: True + noudevsync: true vg_large: options: - noudevsync: True + noudevsync: true change: vg00: options: - available: True - syncronize: False + available: true + syncronize: false addtag: 'goodvgs' deltag: 'badvgs' @@ -118,14 +119,14 @@ lvm: devices: - /dev/sdb options: - removemissing: True + removemissing: true extend: vg00: devices: - /dev/sdd options: - restoremissing: True + restoremissing: true split: vg00: @@ -141,13 +142,13 @@ lvm: vg00: withvg: vg001 options: - debug: True + debug: true rename: vg002: newname: vg2 options: - debug: True + debug: true create: vg00: @@ -168,7 +169,7 @@ lvm: export: vg_tmp: options: - verbose: True + verbose: true commandprofile: command_profile_template cfgrestore: @@ -198,7 +199,7 @@ lvm: my_raid1: vgname: vg_large options: - force: True + force: true change: vg00/lv1: @@ -219,7 +220,7 @@ lvm: extend: vg00/lv1: options: - #extents: +100%PVS + # extents: +100%PVS extents: 2 devices: - /dev/sdf @@ -243,16 +244,16 @@ lvm: extents: 1 stripes: 2 stripesize: 4096 - #following pillars support snapshots: see https://github.com/saltstack/salt/issues/48808 + # snapshots: see https://github.com/saltstack/salt/issues/48808 sparse: vgname: vg00 - snapshot: True + snapshot: true sourcelv: lv1 options: size: 200MiB lv2_snap: vgname: vg00 - snapshot: True + snapshot: true sourcelv: lv2 options: size: '+10%ORIGIN' @@ -267,13 +268,13 @@ lvm: type: raid5 stripes: 3 stripesize: 64 - #lv_raid10_a: - # vgname: vg00 - # options: - # type: raid10 - # size: 5MiB - # stripes: 2 - # mirrors: 1 + # lv_raid10_a: + # vgname: vg00 + # options: + # type: raid10 + # size: 5MiB + # stripes: 2 + # mirrors: 1 # data logical volume for thinLV lv_pool1: @@ -290,7 +291,7 @@ lvm: # thin LV lv_thin1: vgname: lv_thinpool1 - thinvolume: True + thinvolume: true size: 50M options: virtualsize: 1G @@ -301,17 +302,18 @@ lvm: stripes: 2 stripesize: 64 chunksize: 256 - thin: True #thinlogicalvolume + thin: true # thinlogicalvolume thinpool: lv_pool1 virtualsize: 1G - background: True - + background: true + convert: - ##thin pool logical volume + # thin pool logical volume vg_large/lv_thinpool1: options: type: thin-pool - ##data and metadata LVs in a thin pool are best created on separate physical devices + # data & metadata LVs in thin pool are best + # created on separate physical devices poolmetadata: - lv_pool1_meta - lv_pool1 @@ -330,9 +332,9 @@ lvm: splitmirrors: 1 name: lv_split regionsize: 512KB - background: False + background: false interval: 10 - noudevsync: False + noudevsync: false devices: - /dev/sde - /dev/sdf @@ -343,6 +345,6 @@ lvm: options: type: gfs options: '-plock_nolock -j 1' - mount: True - onboot: True - onboot_opts: + mount: true + onboot: true + onboot_opts: {} diff --git a/test/salt/pillar/pillar.example b/test/salt/pillar/pillar.example index 156a061..863a08d 100644 --- a/test/salt/pillar/pillar.example +++ b/test/salt/pillar/pillar.example @@ -1,5 +1,6 @@ # vim: sts=2 ts=2 sw= et ai # +--- lvm: config: dir: @@ -16,74 +17,61 @@ lvm: thin_pool_autoextend_percent: 20 files: - #loopbackdir: /tmp/loopdevs #Where to create backing files? + # loopbackdir: /tmp/loopdevs # for backing files remove: - /tmp/loopdevs/testfile1.img - /tmp/loopdevs/testfile2.img create: - truncate: #Shrink or extend the size of each FILE to the specified size + truncate: # Shrink or extend the size of each FILE to the specified size testfile1.img: options: size: 100M - dd: #copy a file, converting and formatting according to the operands + dd: # copy a file, converting and formatting according to the operands /tmp/loopdevs/testfile2.img: options: if: /dev/urandom bs: 1024 count: 204800 - losetup: #setup loop devices. todo: could be 'list' instead. + losetup: # setup loop devices. todo: could be 'list' instead. /tmp/loopdevs/testfile1.img: {} /tmp/loopdevs/testfile2.img: {} pv: remove: /dev/loop4: options: - verbose: True - loopback: - size: 10G - encryption: none - /dev/loop5: + verbose: true + /dev/loop5: {} + change: - ##Named PV must belong to VG; i.e. PV must be allocatable + # Named PV must belong to VG; i.e. PV must be allocatable /dev/loop4: options: addtag: 'goodpvs' deltag: 'badpvs' debug: 1 - resize: - /dev/loop4: - options: - setphysicalvolumesize: 1G + create: - /dev/loop4: #hopefully /tmp/loopdevs/testfile1.img - /dev/loop5: #hopefully /tmp/loopdevs/testfile2.img + /dev/loop4: {} # hopefully /tmp/loopdevs/testfile1.img + /dev/loop5: # hopefully /tmp/loopdevs/testfile2.img options: - verbose: True + verbose: true vg: cfgbackup: vg00: file: vg00_backup_today options: - quiet: True - - change: - vg00: - options: - available: True - syncronize: False - addtag: 'goodvgs' - deltag: 'badvgs' + quiet: true create: vg00: devices: - /dev/loop4 - /dev/loop5 options: - clustered: n + shared: n maxlogicalvolumes: 0 maxphysicalvolumes: 0 - physicalextentsize: 1024 + # physicalextentsize: 1024 cfgrestore: vg00: @@ -93,17 +81,17 @@ lvm: create: lv1: vgname: vg00 - size: 200MiB + size: 150MiB options: + zero: n addtag: 'Coolvolume' - contiguous: y - monitor: y + filesystems: create: /dev/vg00/lv1: options: - type: gfs + type: xfs options: '-plock_nolock -j 1' - mount: True - onboot: True - onboot_opts: + mount: true + onboot: true + onboot_opts: {}