Polish up sudo configs

This commit is contained in:
Salt 2020-12-27 17:25:46 -06:00
parent b4637075bf
commit ef8aa32fd9

View File

@ -122,15 +122,19 @@ arch-chroot-configure() {
# Secondary packages
pacman -S sudo
cat <<-EOF >> "/etc/sudoers"
%wheel ALL=(ALL) ALL
%sudo ALL=(ALL) ALL
ansible ALL=(ALL) NOPASSWD:ALL
EOF
# Create sudo group
if ! grep -e '^sudo:' /etc/group; then
groupadd sudo
fi
# Configure my user
if ! id salt > /dev/null 2>&1; then
useradd salt -m -G wheel -s /bin/bash -u 1000 -U
useradd salt -m -G sudo -s /bin/bash -u 1000 -U
passwd salt
fi
for group in wheel; do
for group in sudo; do
usermod -G "$group" -a salt || warn "Failed to add salt to group: $group"
done
# Configure Ansible user