Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/lvg/tasks/test_active_create.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 - name: Collect vgcreate help
7 command: "vgcreate --help"
8 register: vgcreate_help_result
9
10 - when: "'--setautoactivation' in vgcreate_help_result.stdout"
11 block:
12 - name: Create autoactivated volume group on disk device
13 lvg:
14 state: active
15 vg: vg_autoact_test
16 pvs: "{{ loop_device2 }}"
17
18 - name: Collect vg autoactivation status for vg_autoact_test
19 shell: vgs -oautoactivation --noheadings vg_autoact_test | xargs -n1
20 register: active_vg_autoact_status_result
21
22 - name: Assert vg autoactivation is set for vg_autoact_test
23 assert:
24 that: "'enabled' == active_vg_autoact_status_result.stdout"
25
26 - name: Remove vg_autoact_test for the next test
27 lvg:
28 state: absent
29 vg: vg_autoact_test
30 force: true
31
32 - name: Create auttoactivation disabled volume group on disk device
33 lvg:
34 state: inactive
35 vg: vg_autoact_test
36 pvs: "{{ loop_device2 }}"
37
38 - name: Collect vg autoactivation status for vg_autoact_test
39 shell: vgs -oautoactivation --noheadings vg_autoact_test | xargs -n1
40 register: inactive_vg_autoact_status_result
41
42 - name: Assert vg autoactivation disabled for vg_autoact_test
43 assert:
44 that: "inactive_vg_autoact_status_result.stdout | length == 0"
45
46 - name: Remove vg_autoact_test for the next test
47 lvg:
48 state: absent
49 vg: vg_autoact_test
50 force: true
51
52 - name: Create auttoactivation disabled by option volume group on disk device
53 lvg:
54 state: active
55 vg: vg_autoact_test
56 vg_options: "--setautoactivation n"
57 pvs: "{{ loop_device2 }}"
58
59 - name: Collect vg autoactivation status for vg_autoact_test
60 shell: vgs -oautoactivation --noheadings vg_autoact_test | xargs -n1
61 register: inactive_by_option_vg_autoact_status_result
62
63 - name: Assert vg autoactivation disabled by option for vg_autoact_test
64 assert:
65 that: "inactive_by_option_vg_autoact_status_result.stdout | length == 0"
66 always:
67 - name: Cleanup vg_autoact_test
68 lvg:
69 state: absent
70 vg: vg_autoact_test
71 force: true