change the partition's ownership

pull/1718/head
yanyx 2017-07-27 11:55:30 +08:00
parent fb4254b7e5
commit d0a17b11b2
1 changed files with 21 additions and 0 deletions

View File

@ -62,3 +62,24 @@
with_subelements:
- "{{ devices }}"
- partitions
- set_fact:
owner: 167
group: 167
when:
- ansible_os_family == "RedHat"
- set_fact:
owner: 64045
group: 64045
when:
- ansible_os_family == "Debian"
- name: change partitions ownership
file:
path: "/dev/{{item.0.device_name}}{{item.1.index}}"
owner: "{{ owner | default('root')}}"
group: "{{ group | default('disk')}}"
with_subelements:
- "{{ devices }}"
- partitions