Skip to content

Commit 6bbbca7

Browse files
committed
fix: use stat.pw_name, stat.gr_name instead of owner, group
Cause: The fields `stat.owner` and `stat.group` do not exist. Consequence: The crypttab was always being set to owner/group root. Fix: Use the correct fields `stat.pw_name` and `stat.gr_name`. Result: Owner and group of crypttab are preserved. See https://docs.ansible.com/ansible/2.9/modules/stat_module.html#return-stat/gr_name Signed-off-by: Rich Megginson <rmeggins@redhat.com>
1 parent 12915cb commit 6bbbca7

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

tasks/main-blivet.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@
195195
state: "{{ entry.state }}"
196196
create: true
197197
mode: "{{ __storage_crypttab.stat.mode | d('0600') }}"
198-
owner: "{{ __storage_crypttab.stat.owner | d('root') }}"
199-
group: "{{ __storage_crypttab.stat.group | d('root') }}"
198+
owner: "{{ __storage_crypttab.stat.pw_name | d('root') }}"
199+
group: "{{ __storage_crypttab.stat.gr_name | d('root') }}"
200200
loop: "{{ blivet_output.crypts }}"
201201
loop_control:
202202
loop_var: entry
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
# This file was generated by generate_tests.py
3+
- name: Run test tests_raid_volume_cleanup.yml for nvme
4+
hosts: all
5+
tags:
6+
- tests::nvme
7+
tasks:
8+
- name: Set disk interface for test
9+
set_fact:
10+
storage_test_use_interface: "nvme"
11+
12+
- name: Import playbook
13+
import_playbook: tests_raid_volume_cleanup.yml
14+
tags:
15+
- tests::nvme
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
# This file was generated by generate_tests.py
3+
- name: Run test tests_raid_volume_cleanup.yml for scsi
4+
hosts: all
5+
tags:
6+
- tests::scsi
7+
tasks:
8+
- name: Set disk interface for test
9+
set_fact:
10+
storage_test_use_interface: "scsi"
11+
12+
- name: Import playbook
13+
import_playbook: tests_raid_volume_cleanup.yml
14+
tags:
15+
- tests::scsi

0 commit comments

Comments
 (0)