8000 use ubuntu for the vagrantbox & terraform update to 0.8 by dominis · Pull Request #7 · dominis/mikado · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 53 additions & 36 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,77 @@
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION = "2"
UBUNTUVERSION = "16.04"
CPUCOUNT = "2"
RAM = "4096"

$script = <<SCRIPT
yum -y install epel-release
sed -i -e "s|#baseurl=|baseurl=|g" /etc/yum.repos.d/epel.repo
sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/epel.repo

yum install deltarpm

yum install -y \
dialog \
python34-devel \
jq \
make \
unzip \
ntpdate \
openssl-devel \
gcc \
python-devel \
python-pip \

# Install terraform and packer
export DEBIAN_PRIORITY=critical
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
APT_OPTS="--assume-yes --no-install-suggests --no-install-recommends -o Dpkg::Options::=\"--force-confdef\" -o Dpkg::Options::=\"--force-confold\""
echo "Upgrading packages ..."
apt-get update ${APT_OPTS} >/dev/null 2>&1
apt-get upgrade ${APT_OPTS} >/dev/null 2>&1
echo "Installing prerequisites ..."
apt-get install ${APT_OPTS} \
build-essential \
curl \
zip \
dialog \
jq \
unzip \
python-pip \
python-setuptools \
8000 python3-pip \
python3-setuptools \
>/dev/null

cd /usr/src
wget --quiet https://releases.hashicorp.com/terraform/0.7.13/terraform_0.7.13_linux_amd64.zip
echo "Downloading terraform and packer ..."
wget --quiet https://releases.hashicorp.com/terraform/0.8.0/terraform_0.8.0_linux_amd64.zip
wget --quiet https://releases.hashicorp.com/packer/0.12.0/packer_0.12.0_linux_amd64.zip
unzip terraform_0.7.13_linux_amd64.zip
unzip packer_0.12.0_linux_amd64.zip
echo "Installing terraform and packer ..."
unzip terraform_0.8.0_linux_amd64.zip >/dev/null
unzip packer_0.12.0_linux_amd64.zip >/dev/null
mv terraform /usr/bin/
mv packer /usr/bin/

# python2 stuff
pip install -U pip
pip install urllib3[secure]
pip install awscli

# python3 stuff
curl https://bootstrap.pypa.io/get-pip.py | python3.4
pip3 install pythondialog
pip3 install pyyaml
echo "Installing python dependencies for the installer ..."
pip install urllib3[secure] awscli >/dev/null 2>&1
pip3 install pythondialog pyyaml >/dev/null 2>&1

# this is a workaround for the dialog bug
echo 'export TERM=xterm' >> /home/vagrant/.bashrc

SCRIPT

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/centos-7.1"
config.vm.box = "bento/ubuntu-#{UBUNTUVERSION}"
config.vm.hostname = "mikado"

config.vm.provision "prepare-shell", type: "shell", inline: "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile", privileged: false
config.vm.provision "initial-setup", type: "shell", inline: $script
config.vm.synced_folder '.', '/home/vagrant/mikado'

config.vm.provider "virtualbox" do |v|
v.memory = 4096
v.cpus = 2
v.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 1000 ]
v.memory = "#{RAM}"
v.cpus = "#{CPUCOUNT}"
end

config.vm.provider "docker" do |v, override|
override.vm.box = "tknerr/baseimage-ubuntu-#{UBUNTUVERSION}"
end

["vmware_fusion", "vmware_workstation"].each do |p|
config.vm.provider p do |v|
v.vmx["memsize"] = "#{RAM}"
v.vmx["numvcpus"] = "#{CPUCOUNT}"
end
end


config.vm.provider "parallels" do |prl|
prl.memory = "#{RAM}"
prl.cpus = "#{CPUCOUNT}"
end
end
6 changes: 3 additions & 3 deletions examples/advanced.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "wp" {
source = "./wp"
domain = "wpexample.com"
domain = "###DOMAIN###"
public_subnets = "${module.vpc.public_subnets}"
private_subnets = "${module.vpc.private_subnets}"
internal_sg = "${module.sg.internal_sg_id}"
Expand All @@ -25,15 +25,15 @@ module "wp" {

module "wp-fastly" {
source = "./wp-fastly"
domain = "wpexample.com"
domain = "###DOMAIN###"
domain_zone_id = "${module.wp.route53_zone_id}"
api_key = "${var.fastly_api_key}"
elb_public_sg_id = "${module.wp.prod-elb_public_sg_id}"
}

module "wp-statuscake" {
source = "./wp-statuscake"
domain = "wpexample.com"
domain = "###DOMAIN###"
username = "${var.statuscake_username}"
apikey = "${var.statuscake_apikey}"
}
4 changes: 2 additions & 2 deletions examples/no-rds.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "wp" {
source = "./wp"
domain = "wpexample.com"
domain = "###DOMAIN###"
public_subnets = "${module.vpc.public_subnets}"
private_subnets = "${module.vpc.private_subnets}"
internal_sg = "${module.sg.internal_sg_id}"
Expand All @@ -14,7 +14,7 @@ module "wp" {

module "wp-fastly" {
source = "./wp-fastly"
domain = "wpexample.com"
domain = "###DOMAIN###"
domain_zone_id = "${module.wp.route53_zone_id}"
api_key = "${var.fastly_api_key}"
elb_public_sg_id = "${module.wp.prod-elb_public_sg_id}"
Expand Down
4 changes: 2 additions & 2 deletions terraform/asg/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ variable "name" {
}

variable "vpc_id" {
tpye = "string"
type = "string"
}

variable "availability_zones" {
Expand All @@ -19,7 +19,7 @@ variable "private_subnets" {
}

variable "ami_id" {
tpye = "string"
type = "string"
}

variable "instance_type" {
Expand Down
3 changes: 2 8000 additions & 1 deletion terraform/wp-fastly/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
variable "api_key" {
type = "string"
type = "string"
default = ""
}

variable "domain" {
Expand Down
6 changes: 4 additions & 2 deletions terraform/wp-statuscake/statuscake.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ variable "domain" {
}

variable "username" {
type = "string"
type = "string"
default = ""
}

variable "apikey" {
type = "string"
type = "string"
default = ""
}

provider "statuscake" {
Expand Down
0