From 6f825382cad6ddd8a1ea08f6cf0dfa402d00c5fe Mon Sep 17 00:00:00 2001 From: wangwei Date: Tue, 28 Feb 2017 22:06:15 -0500 Subject: [PATCH] Add sudo command for non-root account to mount osd Generally we specify the user is root when deploying ceph, it is no problem. But if we have the need to use a non-root account, the deployment will fail because the non-root account can't use the mount command. I think it is necessary to add sudo for non-root account, when we can't use the root account to deploy ceph because of security needs, we can use non-root account to deploy ceph. Change-Id: Iea1f30bcf8edbe15dc65909bbae780b55a669067 Closes-Bug: #1668823 --- ansible/roles/ceph/tasks/start_osds.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible/roles/ceph/tasks/start_osds.yml b/ansible/roles/ceph/tasks/start_osds.yml index 643d121b0d..7bd0d4d045 100644 --- a/ansible/roles/ceph/tasks/start_osds.yml +++ b/ansible/roles/ceph/tasks/start_osds.yml @@ -19,6 +19,8 @@ name: "/var/lib/ceph/osd/{{ item['fs_uuid'] }}" opts: "{{ ceph_osd_mount_options }}" with_items: "{{ osds }}" + become: true + become_method: sudo - name: Gathering OSD IDs command: "cat /var/lib/ceph/osd/{{ item['fs_uuid'] }}/whoami"