set sudo group earlier to be safe
[automated-distro-installer] / fai / config / distro-install-common / end
index 57b71159f62352228b8f53f28fb0b3ae89e138f8..b248bd31e7759b17a96c77ae1f33bee83db94c81 100755 (executable)
@@ -80,6 +80,10 @@ echo "fs.inotify.max_user_watches = 50000" >> $f
 # applies it. it would be also be applied after a reboot
 $ROOTCMD sysctl --system
 
+if getent group sudo >/dev/null; then
+  usermod -aG sudo iank
+fi
+
 cat >$target/etc/sudoers.d/ianksudoers <<'EOF'
 Defaults timestamp_timeout=1440
 # used in bashrc
@@ -100,6 +104,14 @@ Defaults:root,iank !log_allowed, !pam_session
 Defaults>root env_file=/etc/rootsudoenv
 EOF
 
+case $HOSTNAME in
+  li|bk|je)
+    cat >>$target/etc/sudoers.d/ianksudoers <<'EOF'
+iank  ALL=(ALL)  NOPASSWD: ALL
+EOF
+    ;;
+esac
+
 # remove old config line. can be removed eventually.
 f=$target/etc/sudoers
 line='iank  ALL=(ALL)  NOPASSWD: ALL'