modify the owner so that modify the sudoers locally. 67/7767/1
authorNarinder Gupta <narinder.gupta@canonical.com>
Fri, 22 Jan 2016 14:55:48 +0000 (08:55 -0600)
committerNarinder Gupta <narinder.gupta@canonical.com>
Fri, 22 Jan 2016 19:51:26 +0000 (19:51 +0000)
Change-Id: Ic5a463067171630057ba06708fc423d373d38c26
(cherry picked from commit ae086b4efaf4fdb5964d7b4f5a66c0b075e81dab)

ci/02-maasdeploy.sh

index da0e883..7c6a048 100755 (executable)
@@ -32,6 +32,7 @@ echo "$USER ALL=(ALL) NOPASSWD:ALL" > 90-joid-init
 
 if [ -e /etc/sudoers.d/90-joid-init ]; then
     sudo cp /etc/sudoers.d/90-joid-init 91-joid-init
+    sudo chown $USER:$USER 91-joid-init
     cat 90-joid-init >> 91-joid-init
     sudo chown root:root 91-joid-init
     sudo mv 91-joid-init /etc/sudoers.d/
@@ -49,7 +50,7 @@ fi
 if [ ! -e /var/lib/libvirt/images ]; then
 
     sudo apt-get install libvirt-bin -y
-    sudo adduser ubuntu libvirtd
+    sudo adduser $USER libvirtd
     sudo virsh pool-define-as default --type dir --target /var/lib/libvirt/images/
     sudo virsh pool-start default
     sudo virsh pool-autostart default