-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from SoftcatMS/linux
Add linux attachment sub module
- Loading branch information
Showing
5 changed files
with
41 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
# Provision data disks | ||
cd /dev/disk/azure/scsi1/ || exit | ||
|
||
for LUN in * | ||
do | ||
NUM=$(echo "$LUN" | grep -o -E "[0-9]+") | ||
if [ -d "/mnt/data$NUM" ]; then | ||
echo "Disk Exists"; | ||
else | ||
echo "y" | mkfs.ext4 /dev/disk/azure/scsi1/"$LUN"; | ||
mkdir /mnt/data"$NUM"; | ||
echo "/dev/disk/azure/scsi1/$LUN /mnt/data$NUM ext4 defaults,nofail 0 0" >>/etc/fstab; | ||
fi | ||
done | ||
|
||
mount -a | ||
|
||
# Add Softcatadmin user | ||
if id -u "softcatadmin" >/dev/null 2>&1; then | ||
echo "softcatadmin exists"; | ||
else | ||
useradd -md /home/softcatadmin softcatadmin; | ||
usermod -aG sudo softcatadmin; | ||
echo softcatadmin:"${password}" | chpasswd; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Linux | ||
|
||
variable "vm_password" { | ||
description = "Password to connect to VM" | ||
type = string | ||
} | ||
|
||
variable "virtual_machine_id" { | ||
description = "The virtual machine ID disks are attached to" | ||
type = string | ||
} |