Browse Source

Skip tripleo_lvmfilter unless enabled or dry_run is set

This is to address the concerns raised in [1]; it skips the role
execution unless the feature is either explicitly enabled or the
caller has set dry_run variable which will make it run up to the
creation of the new lvm.conf file but not actually copy it into
place.

1. https://review.opendev.org/#/c/697990/49/tripleo_ansible/roles/tripleo_lvmfilter/tasks/main.yml

Change-Id: I1c914feda3c4b1bfb6dcfd981244477f82915b75
(cherry picked from commit d1a5769313)
changes/45/759945/1
Giulio Fidente 2 months ago
parent
commit
168e631c57
2 changed files with 4 additions and 1 deletions
  1. +1
    -0
      tripleo_ansible/roles/tripleo_lvmfilter/defaults/main.yml
  2. +3
    -1
      tripleo_ansible/roles/tripleo_lvmfilter/tasks/main.yml

+ 1
- 0
tripleo_ansible/roles/tripleo_lvmfilter/defaults/main.yml View File

@@ -19,5 +19,6 @@

# All variables within this role should have a prefix of "tripleo_tripleo_lvmfilter"
tripleo_tripleo_lvmfilter_enabled: false
tripleo_tripleo_lvmfilter_dry_run: false
tripleo_tripleo_lvmfilter_devices_allowlist: []
tripleo_tripleo_lvmfilter_devices_denylist: []

+ 3
- 1
tripleo_ansible/roles/tripleo_lvmfilter/tasks/main.yml View File

@@ -19,7 +19,9 @@
package_facts:
manager: auto
- name: gather allowed block devices list
when: "'lvm2' in ansible_facts.packages"
when:
- "'lvm2' in ansible_facts.packages"
- tripleo_tripleo_lvmfilter_enabled or tripleo_tripleo_lvmfilter_dry_run
block:
- name: collect in-use lvm2 devices list
become: true


Loading…
Cancel
Save