Browse Source

Added support for Amazon Linux 2 distribution

pull/10/head 0.7
Giovanni Torres 8 years ago
parent
commit
8b01f23b75
  1. 1
      README.md
  2. 12
      kvm-install-vm
  3. 8
      tests/check_distributions.bats

1
README.md

@ -82,6 +82,7 @@ OPTIONS
DISTRIBUTIONS
NAME DESCRIPTION LOGIN
amazon2 Amazon Linux 2 ec2-user
centos7 CentOS 7 centos
centos7-atomic CentOS 7 Atomic Host centos
centos6 CentOS 6 centos

12
kvm-install-vm

@ -61,6 +61,7 @@ function usage_subcommand ()
printf "\n"
printf "DISTRIBUTIONS\n"
printf " NAME DESCRIPTION LOGIN\n"
printf " amazon2 Amazon Linux 2 ec2-user\n"
printf " centos7 CentOS 7 centos\n"
printf " centos7-atomic CentOS 7 Atomic Host centos\n"
printf " centos6 CentOS 6 centos\n"
@ -210,7 +211,14 @@ function fetch_images ()
mkdir -p ${IMAGEDIR}
# Set variables based on $DISTRO
# Use the command "osinfo-query os" to get the list of the accepted OS variants.
case "$DISTRO" in
amazon2)
QCOW=amzn2-kvm-2017.12.0.20171212.2-x86_64.xfs.gpt.qcow2
OS_VARIANT="auto"
IMAGE_URL=https://cdn.amazonlinux.com/os-images/2017.12.0.20171212.2/kvm
LOGIN_USER=ec2-user
;;
centos7)
QCOW=CentOS-7-x86_64-GenericCloud.qcow2
OS_VARIANT="centos7.0"
@ -319,7 +327,7 @@ function storpool_exists ()
function set_sudo_group ()
{
case "${DISTRO}" in
centos?|fedora??|*-atomic )
centos?|fedora??|*-atomic|amazon? )
SUDOGROUP="wheel"
;;
ubuntu*|debian? )
@ -334,7 +342,7 @@ function set_sudo_group ()
function set_cloud_init_remove ()
{
case "${DISTRO}" in
centos? )
centos?|amazon? )
CLOUDINITRM="yum -y remove cloud-init"
;;
fedora?? )

8
tests/check_distributions.bats

@ -16,6 +16,14 @@ function remove_test_vm ()
[ "$status" -eq 0 ]
}
@test "Install VM (Amazon Linux 2) - $VMNAME-amazon2" {
create_test_vm amazon2
}
@test "Delete VM (Amazon Linux 2) - $VMNAME-amazon2" {
remove_test_vm amazon2
}
@test "Install VM (CentOS 7 Atomic) - $VMNAME-centos7-atomic" {
create_test_vm centos7-atomic
}

Loading…
Cancel
Save