-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathtests_change_disk_fs.yml
More file actions
68 lines (60 loc) · 2.05 KB
/
tests_change_disk_fs.yml
File metadata and controls
68 lines (60 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
- name: Test change disk fs
hosts: all
become: true
vars:
storage_safe_mode: false
mount_location: '/opt/test'
volume_size: '5g'
fs_type_after: "{{ 'ext3'
if (ansible_facts['distribution'] == 'RedHat' and
ansible_facts['distribution_major_version'] == '6')
else 'ext4' }}"
__storage_min_size: "{{ volume_size }}"
__storage_max_return: 1
tasks:
- name: Prep storage role and discover unused disks
ansible.builtin.include_tasks: tasks/setup.yml
- name: Create a disk device with the default file system type
include_tasks: tasks/run_role_with_clear_facts.yml
vars:
storage_volumes:
- name: test1
type: disk
mount_point: "{{ mount_location }}"
disks: "{{ unused_disks }}"
- name: Verify role results
include_tasks: verify-role-results.yml
- name: Change the disk device file system type to {{ fs_type_after }}
include_tasks: tasks/run_role_with_clear_facts.yml
vars:
storage_volumes:
- name: test1
type: disk
mount_point: "{{ mount_location }}"
fs_type: "{{ fs_type_after }}"
disks: "{{ unused_disks }}"
- name: Verify role results - 2
include_tasks: verify-role-results.yml
- name: Repeat the previous invocation to verify idempotence
include_tasks: tasks/run_role_with_clear_facts.yml
vars:
storage_volumes:
- name: test1
type: disk
mount_point: "{{ mount_location }}"
fs_type: "{{ fs_type_after }}"
disks: "{{ unused_disks }}"
- name: Verify role results - 3
include_tasks: verify-role-results.yml
- name: Clean up
include_tasks: tasks/run_role_with_clear_facts.yml
vars:
storage_volumes:
- name: test1
type: disk
disks: "{{ unused_disks }}"
mount_point: "{{ mount_location }}"
state: absent
- name: Verify role results - 4
include_tasks: verify-role-results.yml