From d0a17b11b21d3cd670e6dc106cdd02940e17b277 Mon Sep 17 00:00:00 2001 From: yanyx Date: Thu, 27 Jul 2017 11:55:30 +0800 Subject: [PATCH] change the partition's ownership --- .../make-osd-partitions.yml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/infrastructure-playbooks/make-osd-partitions.yml b/infrastructure-playbooks/make-osd-partitions.yml index d348cb380..7dee4cc9a 100644 --- a/infrastructure-playbooks/make-osd-partitions.yml +++ b/infrastructure-playbooks/make-osd-partitions.yml @@ -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 \ No newline at end of file -- 2.39.5